Upload checkpoint from checkpoint-351
Browse files- config.json +60 -0
- configuration_deepseek.py +206 -0
- generation_config.json +9 -0
- model-00001-of-00007.safetensors +3 -0
- model-00002-of-00007.safetensors +3 -0
- model-00003-of-00007.safetensors +3 -0
- model-00004-of-00007.safetensors +3 -0
- model-00005-of-00007.safetensors +3 -0
- model-00006-of-00007.safetensors +3 -0
- model-00007-of-00007.safetensors +3 -0
- model.safetensors.index.json +0 -0
- modeling_deepseek.py +2030 -0
- special_tokens_map.json +23 -0
- tokenizer.json +0 -0
- tokenizer_config.json +37 -0
- trainer_state.json +2491 -0
- training_args.bin +3 -0
config.json
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"DeepseekV2ForCausalLM"
|
| 4 |
+
],
|
| 5 |
+
"attention_bias": false,
|
| 6 |
+
"attention_dropout": 0.0,
|
| 7 |
+
"auto_map": {
|
| 8 |
+
"AutoConfig": "configuration_deepseek.DeepseekV2Config",
|
| 9 |
+
"AutoModel": "modeling_deepseek.DeepseekV2ForCausalLM",
|
| 10 |
+
"AutoModelForCausalLM": "autoprogrammer/deepseekv2lite_densemixer--modeling_deepseek.DeepseekV2ForCausalLM"
|
| 11 |
+
},
|
| 12 |
+
"aux_loss_alpha": 0.001,
|
| 13 |
+
"bos_token_id": 100000,
|
| 14 |
+
"eos_token_id": 100001,
|
| 15 |
+
"ep_size": 1,
|
| 16 |
+
"first_k_dense_replace": 1,
|
| 17 |
+
"hidden_act": "silu",
|
| 18 |
+
"hidden_size": 2048,
|
| 19 |
+
"initializer_range": 0.02,
|
| 20 |
+
"intermediate_size": 10944,
|
| 21 |
+
"kv_lora_rank": 512,
|
| 22 |
+
"max_position_embeddings": 163840,
|
| 23 |
+
"model_type": "deepseek_v2",
|
| 24 |
+
"moe_intermediate_size": 1408,
|
| 25 |
+
"moe_layer_freq": 1,
|
| 26 |
+
"n_group": 1,
|
| 27 |
+
"n_routed_experts": 64,
|
| 28 |
+
"n_shared_experts": 2,
|
| 29 |
+
"norm_topk_prob": false,
|
| 30 |
+
"num_attention_heads": 16,
|
| 31 |
+
"num_experts_per_tok": 6,
|
| 32 |
+
"num_hidden_layers": 27,
|
| 33 |
+
"num_key_value_heads": 16,
|
| 34 |
+
"pretraining_tp": 1,
|
| 35 |
+
"q_lora_rank": null,
|
| 36 |
+
"qk_nope_head_dim": 128,
|
| 37 |
+
"qk_rope_head_dim": 64,
|
| 38 |
+
"rms_norm_eps": 1e-06,
|
| 39 |
+
"rope_scaling": {
|
| 40 |
+
"beta_fast": 32,
|
| 41 |
+
"beta_slow": 1,
|
| 42 |
+
"factor": 40,
|
| 43 |
+
"mscale": 0.707,
|
| 44 |
+
"mscale_all_dim": 0.707,
|
| 45 |
+
"original_max_position_embeddings": 4096,
|
| 46 |
+
"type": "yarn"
|
| 47 |
+
},
|
| 48 |
+
"rope_theta": 10000,
|
| 49 |
+
"routed_scaling_factor": 1.0,
|
| 50 |
+
"scoring_func": "softmax",
|
| 51 |
+
"seq_aux": true,
|
| 52 |
+
"tie_word_embeddings": false,
|
| 53 |
+
"topk_group": 1,
|
| 54 |
+
"topk_method": "greedy",
|
| 55 |
+
"torch_dtype": "bfloat16",
|
| 56 |
+
"transformers_version": "4.51.3",
|
| 57 |
+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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from transformers.configuration_utils import PretrainedConfig
|
| 2 |
+
from transformers.utils import logging
|
| 3 |
+
|
| 4 |
+
logger = logging.get_logger(__name__)
|
| 5 |
+
|
| 6 |
+
DEEPSEEK_PRETRAINED_CONFIG_ARCHIVE_MAP = {}
|
| 7 |
+
class DeepseekV2Config(PretrainedConfig):
|
| 8 |
+
r"""
|
| 9 |
+
This is the configuration class to store the configuration of a [`DeepseekV2Model`]. It is used to instantiate an DeepSeek
|
| 10 |
+
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
|
| 11 |
+
defaults will yield a similar configuration to that of the DeepSeek-V2.
|
| 12 |
+
|
| 13 |
+
Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
|
| 14 |
+
documentation from [`PretrainedConfig`] for more information.
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
Args:
|
| 18 |
+
vocab_size (`int`, *optional*, defaults to 102400):
|
| 19 |
+
Vocabulary size of the Deep model. Defines the number of different tokens that can be represented by the
|
| 20 |
+
`inputs_ids` passed when calling [`DeepseekV2Model`]
|
| 21 |
+
hidden_size (`int`, *optional*, defaults to 4096):
|
| 22 |
+
Dimension of the hidden representations.
|
| 23 |
+
intermediate_size (`int`, *optional*, defaults to 11008):
|
| 24 |
+
Dimension of the MLP representations.
|
| 25 |
+
moe_intermediate_size (`int`, *optional*, defaults to 1407):
|
| 26 |
+
Dimension of the MoE representations.
|
| 27 |
+
num_hidden_layers (`int`, *optional*, defaults to 32):
|
| 28 |
+
Number of hidden layers in the Transformer decoder.
|
| 29 |
+
num_attention_heads (`int`, *optional*, defaults to 32):
|
| 30 |
+
Number of attention heads for each attention layer in the Transformer decoder.
|
| 31 |
+
n_shared_experts (`int`, *optional*, defaults to None):
|
| 32 |
+
Number of shared experts, None means dense model.
|
| 33 |
+
n_routed_experts (`int`, *optional*, defaults to None):
|
| 34 |
+
Number of routed experts, None means dense model.
|
| 35 |
+
routed_scaling_factor (`float`, *optional*, defaults to 1.0):
|
| 36 |
+
Scaling factor or routed experts.
|
| 37 |
+
topk_method (`str`, *optional*, defaults to `gready`):
|
| 38 |
+
Topk method used in routed gate.
|
| 39 |
+
n_group (`int`, *optional*, defaults to None):
|
| 40 |
+
Number of groups for routed experts.
|
| 41 |
+
topk_group (`int`, *optional*, defaults to None):
|
| 42 |
+
Number of selected groups for each token(for each token, ensuring the selected experts is only within `topk_group` groups).
|
| 43 |
+
num_experts_per_tok (`int`, *optional*, defaults to None):
|
| 44 |
+
Number of selected experts, None means dense model.
|
| 45 |
+
moe_layer_freq (`int`, *optional*, defaults to 1):
|
| 46 |
+
The frequency of the MoE layer: one expert layer for every `moe_layer_freq - 1` dense layers.
|
| 47 |
+
first_k_dense_replace (`int`, *optional*, defaults to 0):
|
| 48 |
+
Number of dense layers in shallow layers(embed->dense->dense->...->dense->moe->moe...->lm_head).
|
| 49 |
+
\--k dense layers--/
|
| 50 |
+
norm_topk_prob (`bool`, *optional*, defaults to False):
|
| 51 |
+
Whether to normalize the weights of the routed experts.
|
| 52 |
+
scoring_func (`str`, *optional*, defaults to 'softmax'):
|
| 53 |
+
Method of computing expert weights.
|
| 54 |
+
aux_loss_alpha (`float`, *optional*, defaults to 0.001):
|
| 55 |
+
Auxiliary loss weight coefficient.
|
| 56 |
+
seq_aux = (`bool`, *optional*, defaults to True):
|
| 57 |
+
Whether to compute the auxiliary loss for each individual sample.
|
| 58 |
+
num_key_value_heads (`int`, *optional*):
|
| 59 |
+
This is the number of key_value heads that should be used to implement Grouped Query Attention. If
|
| 60 |
+
`num_key_value_heads=num_attention_heads`, the model will use Multi Head Attention (MHA), if
|
| 61 |
+
`num_key_value_heads=1 the model will use Multi Query Attention (MQA) otherwise GQA is used. When
|
| 62 |
+
converting a multi-head checkpoint to a GQA checkpoint, each group key and value head should be constructed
|
| 63 |
+
by meanpooling all the original heads within that group. For more details checkout [this
|
| 64 |
+
paper](https://arxiv.org/pdf/2305.13245.pdf). If it is not specified, will default to
|
| 65 |
+
`num_attention_heads`.
|
| 66 |
+
hidden_act (`str` or `function`, *optional*, defaults to `"silu"`):
|
| 67 |
+
The non-linear activation function (function or string) in the decoder.
|
| 68 |
+
max_position_embeddings (`int`, *optional*, defaults to 2048):
|
| 69 |
+
The maximum sequence length that this model might ever be used with.
|
| 70 |
+
initializer_range (`float`, *optional*, defaults to 0.02):
|
| 71 |
+
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.
|
| 72 |
+
rms_norm_eps (`float`, *optional*, defaults to 1e-06):
|
| 73 |
+
The epsilon used by the rms normalization layers.
|
| 74 |
+
use_cache (`bool`, *optional*, defaults to `True`):
|
| 75 |
+
Whether or not the model should return the last key/values attentions (not used by all models). Only
|
| 76 |
+
relevant if `config.is_decoder=True`.
|
| 77 |
+
pad_token_id (`int`, *optional*):
|
| 78 |
+
Padding token id.
|
| 79 |
+
bos_token_id (`int`, *optional*, defaults to 1):
|
| 80 |
+
Beginning of stream token id.
|
| 81 |
+
eos_token_id (`int`, *optional*, defaults to 2):
|
| 82 |
+
End of stream token id.
|
| 83 |
+
pretraining_tp (`int`, *optional*, defaults to 1):
|
| 84 |
+
Experimental feature. Tensor parallelism rank used during pretraining. Please refer to [this
|
| 85 |
+
document](https://huggingface.co/docs/transformers/parallelism) to understand more about it. This value is
|
| 86 |
+
necessary to ensure exact reproducibility of the pretraining results. Please refer to [this
|
| 87 |
+
issue](https://github.com/pytorch/pytorch/issues/76232).
|
| 88 |
+
tie_word_embeddings (`bool`, *optional*, defaults to `False`):
|
| 89 |
+
Whether to tie weight embeddings
|
| 90 |
+
rope_theta (`float`, *optional*, defaults to 10000.0):
|
| 91 |
+
The base period of the RoPE embeddings.
|
| 92 |
+
rope_scaling (`Dict`, *optional*):
|
| 93 |
+
Dictionary containing the scaling configuration for the RoPE embeddings. Currently supports two scaling
|
| 94 |
+
strategies: linear and dynamic. Their scaling factor must be a float greater than 1. The expected format is
|
| 95 |
+
`{"type": strategy name, "factor": scaling factor}`. When using this flag, don't update
|
| 96 |
+
`max_position_embeddings` to the expected new maximum.
|
| 97 |
+
attention_bias (`bool`, defaults to `False`, *optional*, defaults to `False`):
|
| 98 |
+
Whether to use a bias in the query, key, value and output projection layers during self-attention.
|
| 99 |
+
attention_dropout (`float`, *optional*, defaults to 0.0):
|
| 100 |
+
The dropout ratio for the attention probabilities.
|
| 101 |
+
|
| 102 |
+
```python
|
| 103 |
+
>>> from transformers import DeepseekV2Model, DeepseekV2Config
|
| 104 |
+
|
| 105 |
+
>>> # Initializing a Deepseek-V2 style configuration
|
| 106 |
+
>>> configuration = DeepseekV2Config()
|
| 107 |
+
|
| 108 |
+
>>> # Accessing the model configuration
|
| 109 |
+
>>> configuration = model.config
|
| 110 |
+
```"""
|
| 111 |
+
|
| 112 |
+
model_type = "deepseek_v2"
|
| 113 |
+
keys_to_ignore_at_inference = ["past_key_values"]
|
| 114 |
+
|
| 115 |
+
def __init__(
|
| 116 |
+
self,
|
| 117 |
+
vocab_size=102400,
|
| 118 |
+
hidden_size=4096,
|
| 119 |
+
intermediate_size=11008,
|
| 120 |
+
moe_intermediate_size = 1407,
|
| 121 |
+
num_hidden_layers=30,
|
| 122 |
+
num_attention_heads=32,
|
| 123 |
+
num_key_value_heads=32,
|
| 124 |
+
n_shared_experts = None,
|
| 125 |
+
n_routed_experts = None,
|
| 126 |
+
ep_size = 1,
|
| 127 |
+
routed_scaling_factor = 1.0,
|
| 128 |
+
kv_lora_rank = 512,
|
| 129 |
+
q_lora_rank = 1536,
|
| 130 |
+
qk_rope_head_dim = 64,
|
| 131 |
+
v_head_dim = 128,
|
| 132 |
+
qk_nope_head_dim = 128,
|
| 133 |
+
topk_method = 'gready',
|
| 134 |
+
n_group = None,
|
| 135 |
+
topk_group = None,
|
| 136 |
+
num_experts_per_tok = None,
|
| 137 |
+
moe_layer_freq = 1,
|
| 138 |
+
first_k_dense_replace = 0,
|
| 139 |
+
norm_topk_prob = False,
|
| 140 |
+
scoring_func = 'softmax',
|
| 141 |
+
aux_loss_alpha = 0.001,
|
| 142 |
+
seq_aux = True,
|
| 143 |
+
hidden_act="silu",
|
| 144 |
+
max_position_embeddings=2048,
|
| 145 |
+
initializer_range=0.02,
|
| 146 |
+
rms_norm_eps=1e-6,
|
| 147 |
+
use_cache=True,
|
| 148 |
+
pad_token_id=None,
|
| 149 |
+
bos_token_id=100000,
|
| 150 |
+
eos_token_id=100001,
|
| 151 |
+
pretraining_tp=1,
|
| 152 |
+
tie_word_embeddings=False,
|
| 153 |
+
rope_theta=10000.0,
|
| 154 |
+
rope_scaling=None,
|
| 155 |
+
attention_bias=False,
|
| 156 |
+
attention_dropout=0.0,
|
| 157 |
+
**kwargs,
|
| 158 |
+
):
|
| 159 |
+
self.vocab_size = vocab_size
|
| 160 |
+
self.max_position_embeddings = max_position_embeddings
|
| 161 |
+
self.hidden_size = hidden_size
|
| 162 |
+
self.intermediate_size = intermediate_size
|
| 163 |
+
self.moe_intermediate_size = moe_intermediate_size
|
| 164 |
+
self.num_hidden_layers = num_hidden_layers
|
| 165 |
+
self.num_attention_heads = num_attention_heads
|
| 166 |
+
self.n_shared_experts = n_shared_experts
|
| 167 |
+
self.n_routed_experts = n_routed_experts
|
| 168 |
+
self.ep_size = ep_size
|
| 169 |
+
self.routed_scaling_factor = routed_scaling_factor
|
| 170 |
+
self.kv_lora_rank = kv_lora_rank
|
| 171 |
+
self.q_lora_rank = q_lora_rank
|
| 172 |
+
self.qk_rope_head_dim = qk_rope_head_dim
|
| 173 |
+
self.v_head_dim = v_head_dim
|
| 174 |
+
self.qk_nope_head_dim = qk_nope_head_dim
|
| 175 |
+
self.topk_method = topk_method
|
| 176 |
+
self.n_group = n_group
|
| 177 |
+
self.topk_group = topk_group
|
| 178 |
+
self.num_experts_per_tok = num_experts_per_tok
|
| 179 |
+
self.moe_layer_freq = moe_layer_freq
|
| 180 |
+
self.first_k_dense_replace = first_k_dense_replace
|
| 181 |
+
self.norm_topk_prob = norm_topk_prob
|
| 182 |
+
self.scoring_func = scoring_func
|
| 183 |
+
self.aux_loss_alpha = aux_loss_alpha
|
| 184 |
+
self.seq_aux = seq_aux
|
| 185 |
+
# for backward compatibility
|
| 186 |
+
if num_key_value_heads is None:
|
| 187 |
+
num_key_value_heads = num_attention_heads
|
| 188 |
+
|
| 189 |
+
self.num_key_value_heads = num_key_value_heads
|
| 190 |
+
self.hidden_act = hidden_act
|
| 191 |
+
self.initializer_range = initializer_range
|
| 192 |
+
self.rms_norm_eps = rms_norm_eps
|
| 193 |
+
self.pretraining_tp = pretraining_tp
|
| 194 |
+
self.use_cache = use_cache
|
| 195 |
+
self.rope_theta = rope_theta
|
| 196 |
+
self.rope_scaling = rope_scaling
|
| 197 |
+
self.attention_bias = attention_bias
|
| 198 |
+
self.attention_dropout = attention_dropout
|
| 199 |
+
|
| 200 |
+
super().__init__(
|
| 201 |
+
pad_token_id=pad_token_id,
|
| 202 |
+
bos_token_id=bos_token_id,
|
| 203 |
+
eos_token_id=eos_token_id,
|
| 204 |
+
tie_word_embeddings=tie_word_embeddings,
|
| 205 |
+
**kwargs,
|
| 206 |
+
)
|
generation_config.json
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_from_model_config": true,
|
| 3 |
+
"bos_token_id": 100000,
|
| 4 |
+
"do_sample": true,
|
| 5 |
+
"eos_token_id": 100001,
|
| 6 |
+
"temperature": 0.3,
|
| 7 |
+
"top_p": 0.95,
|
| 8 |
+
"transformers_version": "4.51.3"
|
| 9 |
+
}
|
model-00001-of-00007.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:bf100c546c06d02eb71b2ca2b75f53e153cc971ba8480208c497c350a2c2e34e
|
| 3 |
+
size 4994763632
|
model-00002-of-00007.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:fca0da234c52a13c6c92ef0871cf7b7225194f9807ecaa51a6ba10a3d8bbf3ba
|
| 3 |
+
size 4995044944
|
model-00003-of-00007.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:74e13247732d6e1286a03e4f57c82ab4a7ce9a245b0ba2acdb2c59a88cc8e5b7
|
| 3 |
+
size 4996085000
|
model-00004-of-00007.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:bc32bfae15dda9eebc283d4f862c309ac88f5537f72fd9bfd9d400772553817f
|
| 3 |
+
size 4996085224
|
model-00005-of-00007.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:27b3689e1d8d86ebeb0493e93aaec70b539fb74bc51b7de5c74466fe6939b3b1
|
| 3 |
+
size 4996085224
|
model-00006-of-00007.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:00d593cea64444c5e9ff232946ebcee3e4d09192d6864be0c16653d8060fe0db
|
| 3 |
+
size 4995045792
|
model-00007-of-00007.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c2bb08466a62240c89883d0ce6607403d3743f52b5cd110ebee8b5c0a685e9f3
|
| 3 |
+
size 1440515736
|
model.safetensors.index.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
modeling_deepseek.py
ADDED
|
@@ -0,0 +1,2030 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# coding=utf-8
|
| 2 |
+
# Copyright 2023 DeepSeek-AI and The HuggingFace Inc. team. All rights reserved.
|
| 3 |
+
#
|
| 4 |
+
# This code is based on EleutherAI's GPT-NeoX library and the GPT-NeoX
|
| 5 |
+
# and OPT implementations in this library. It has been modified from its
|
| 6 |
+
# original forms to accommodate minor architectural differences compared
|
| 7 |
+
# to GPT-NeoX and OPT used by the Meta AI team that trained the model.
|
| 8 |
+
#
|
| 9 |
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
| 10 |
+
# you may not use this file except in compliance with the License.
|
| 11 |
+
# You may obtain a copy of the License at
|
| 12 |
+
#
|
| 13 |
+
# http://www.apache.org/licenses/LICENSE-2.0
|
| 14 |
+
#
|
| 15 |
+
# Unless required by applicable law or agreed to in writing, software
|
| 16 |
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
| 17 |
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 18 |
+
# See the License for the specific language governing permissions and
|
| 19 |
+
# limitations under the License.
|
| 20 |
+
""" PyTorch DeepSeek model."""
|
| 21 |
+
import math
|
| 22 |
+
import warnings
|
| 23 |
+
from typing import List, Optional, Tuple, Union
|
| 24 |
+
|
| 25 |
+
import torch
|
| 26 |
+
import torch.nn.functional as F
|
| 27 |
+
import torch.utils.checkpoint
|
| 28 |
+
from torch import nn
|
| 29 |
+
from torch.nn import BCEWithLogitsLoss, CrossEntropyLoss, MSELoss
|
| 30 |
+
|
| 31 |
+
from transformers.activations import ACT2FN
|
| 32 |
+
from transformers.cache_utils import Cache, DynamicCache
|
| 33 |
+
from transformers.modeling_attn_mask_utils import (
|
| 34 |
+
AttentionMaskConverter,
|
| 35 |
+
_prepare_4d_attention_mask,
|
| 36 |
+
_prepare_4d_causal_attention_mask,
|
| 37 |
+
)
|
| 38 |
+
from transformers.modeling_outputs import (
|
| 39 |
+
BaseModelOutputWithPast,
|
| 40 |
+
CausalLMOutputWithPast,
|
| 41 |
+
SequenceClassifierOutputWithPast,
|
| 42 |
+
)
|
| 43 |
+
from transformers.modeling_utils import PreTrainedModel
|
| 44 |
+
from transformers.pytorch_utils import (
|
| 45 |
+
ALL_LAYERNORM_LAYERS,
|
| 46 |
+
is_torch_greater_or_equal_than_1_13,
|
| 47 |
+
)
|
| 48 |
+
from transformers.utils import (
|
| 49 |
+
add_start_docstrings,
|
| 50 |
+
add_start_docstrings_to_model_forward,
|
| 51 |
+
is_flash_attn_2_available,
|
| 52 |
+
is_flash_attn_greater_or_equal_2_10,
|
| 53 |
+
logging,
|
| 54 |
+
replace_return_docstrings,
|
| 55 |
+
)
|
| 56 |
+
from transformers.utils.import_utils import is_torch_fx_available
|
| 57 |
+
from .configuration_deepseek import DeepseekV2Config
|
| 58 |
+
import torch.distributed as dist
|
| 59 |
+
import numpy as np
|
| 60 |
+
|
| 61 |
+
if is_flash_attn_2_available():
|
| 62 |
+
from flash_attn import flash_attn_func, flash_attn_varlen_func
|
| 63 |
+
from flash_attn.bert_padding import index_first_axis, pad_input, unpad_input # noqa
|
| 64 |
+
|
| 65 |
+
|
| 66 |
+
# This makes `_prepare_4d_causal_attention_mask` a leaf function in the FX graph.
|
| 67 |
+
# It means that the function will not be traced through and simply appear as a node in the graph.
|
| 68 |
+
if is_torch_fx_available():
|
| 69 |
+
if not is_torch_greater_or_equal_than_1_13:
|
| 70 |
+
import torch.fx
|
| 71 |
+
|
| 72 |
+
_prepare_4d_causal_attention_mask = torch.fx.wrap(_prepare_4d_causal_attention_mask)
|
| 73 |
+
|
| 74 |
+
|
| 75 |
+
logger = logging.get_logger(__name__)
|
| 76 |
+
|
| 77 |
+
_CONFIG_FOR_DOC = "DeepseekV2Config"
|
| 78 |
+
|
| 79 |
+
|
| 80 |
+
def _get_unpad_data(attention_mask):
|
| 81 |
+
seqlens_in_batch = attention_mask.sum(dim=-1, dtype=torch.int32)
|
| 82 |
+
indices = torch.nonzero(attention_mask.flatten(), as_tuple=False).flatten()
|
| 83 |
+
max_seqlen_in_batch = seqlens_in_batch.max().item()
|
| 84 |
+
cu_seqlens = F.pad(
|
| 85 |
+
torch.cumsum(seqlens_in_batch, dim=0, dtype=torch.torch.int32), (1, 0)
|
| 86 |
+
)
|
| 87 |
+
return (
|
| 88 |
+
indices,
|
| 89 |
+
cu_seqlens,
|
| 90 |
+
max_seqlen_in_batch,
|
| 91 |
+
)
|
| 92 |
+
|
| 93 |
+
|
| 94 |
+
class DeepseekV2RMSNorm(nn.Module):
|
| 95 |
+
def __init__(self, hidden_size, eps=1e-6):
|
| 96 |
+
"""
|
| 97 |
+
DeepseekV2RMSNorm is equivalent to T5LayerNorm
|
| 98 |
+
"""
|
| 99 |
+
super().__init__()
|
| 100 |
+
self.weight = nn.Parameter(torch.ones(hidden_size))
|
| 101 |
+
self.variance_epsilon = eps
|
| 102 |
+
|
| 103 |
+
def forward(self, hidden_states):
|
| 104 |
+
input_dtype = hidden_states.dtype
|
| 105 |
+
hidden_states = hidden_states.to(torch.float32)
|
| 106 |
+
variance = hidden_states.pow(2).mean(-1, keepdim=True)
|
| 107 |
+
hidden_states = hidden_states * torch.rsqrt(variance + self.variance_epsilon)
|
| 108 |
+
return self.weight * hidden_states.to(input_dtype)
|
| 109 |
+
|
| 110 |
+
|
| 111 |
+
ALL_LAYERNORM_LAYERS.append(DeepseekV2RMSNorm)
|
| 112 |
+
|
| 113 |
+
|
| 114 |
+
class DeepseekV2RotaryEmbedding(nn.Module):
|
| 115 |
+
def __init__(self, dim, max_position_embeddings=2048, base=10000, device=None):
|
| 116 |
+
super().__init__()
|
| 117 |
+
|
| 118 |
+
self.dim = dim
|
| 119 |
+
self.max_position_embeddings = max_position_embeddings
|
| 120 |
+
self.base = base
|
| 121 |
+
inv_freq = 1.0 / (
|
| 122 |
+
self.base ** (torch.arange(0, self.dim, 2).float().to(device) / self.dim)
|
| 123 |
+
)
|
| 124 |
+
self.register_buffer("inv_freq", inv_freq, persistent=False)
|
| 125 |
+
|
| 126 |
+
# Build here to make `torch.jit.trace` work.
|
| 127 |
+
self._set_cos_sin_cache(
|
| 128 |
+
seq_len=max_position_embeddings,
|
| 129 |
+
device=self.inv_freq.device,
|
| 130 |
+
dtype=torch.get_default_dtype(),
|
| 131 |
+
)
|
| 132 |
+
self.max_seq_len_cached = None
|
| 133 |
+
|
| 134 |
+
def _set_cos_sin_cache(self, seq_len, device, dtype):
|
| 135 |
+
self.max_seq_len_cached = seq_len
|
| 136 |
+
t = torch.arange(
|
| 137 |
+
self.max_seq_len_cached, device=device, dtype=self.inv_freq.dtype
|
| 138 |
+
)
|
| 139 |
+
|
| 140 |
+
freqs = torch.outer(t, self.inv_freq.to(t.device))
|
| 141 |
+
# Different from paper, but it uses a different permutation in order to obtain the same calculation
|
| 142 |
+
emb = torch.cat((freqs, freqs), dim=-1)
|
| 143 |
+
self.register_buffer("cos_cached", emb.cos().to(dtype), persistent=False)
|
| 144 |
+
self.register_buffer("sin_cached", emb.sin().to(dtype), persistent=False)
|
| 145 |
+
|
| 146 |
+
def forward(self, x, seq_len=None):
|
| 147 |
+
# x: [bs, num_attention_heads, seq_len, head_size]
|
| 148 |
+
if self.max_seq_len_cached is None or seq_len > self.max_seq_len_cached:
|
| 149 |
+
self._set_cos_sin_cache(seq_len=seq_len, device=x.device, dtype=x.dtype)
|
| 150 |
+
|
| 151 |
+
return (
|
| 152 |
+
self.cos_cached[:seq_len].to(dtype=x.dtype),
|
| 153 |
+
self.sin_cached[:seq_len].to(dtype=x.dtype),
|
| 154 |
+
)
|
| 155 |
+
|
| 156 |
+
|
| 157 |
+
# Copied from transformers.models.llama.modeling_llama.LlamaLinearScalingRotaryEmbedding with Llama->DeepseekV2
|
| 158 |
+
class DeepseekV2LinearScalingRotaryEmbedding(DeepseekV2RotaryEmbedding):
|
| 159 |
+
"""DeepseekV2RotaryEmbedding extended with linear scaling. Credits to the Reddit user /u/kaiokendev"""
|
| 160 |
+
|
| 161 |
+
def __init__(
|
| 162 |
+
self,
|
| 163 |
+
dim,
|
| 164 |
+
max_position_embeddings=2048,
|
| 165 |
+
base=10000,
|
| 166 |
+
device=None,
|
| 167 |
+
scaling_factor=1.0,
|
| 168 |
+
):
|
| 169 |
+
self.scaling_factor = scaling_factor
|
| 170 |
+
super().__init__(dim, max_position_embeddings, base, device)
|
| 171 |
+
|
| 172 |
+
def _set_cos_sin_cache(self, seq_len, device, dtype):
|
| 173 |
+
self.max_seq_len_cached = seq_len
|
| 174 |
+
t = torch.arange(
|
| 175 |
+
self.max_seq_len_cached, device=device, dtype=self.inv_freq.dtype
|
| 176 |
+
)
|
| 177 |
+
t = t / self.scaling_factor
|
| 178 |
+
|
| 179 |
+
freqs = torch.outer(t, self.inv_freq)
|
| 180 |
+
# Different from paper, but it uses a different permutation in order to obtain the same calculation
|
| 181 |
+
emb = torch.cat((freqs, freqs), dim=-1)
|
| 182 |
+
self.register_buffer("cos_cached", emb.cos().to(dtype), persistent=False)
|
| 183 |
+
self.register_buffer("sin_cached", emb.sin().to(dtype), persistent=False)
|
| 184 |
+
|
| 185 |
+
|
| 186 |
+
# Copied from transformers.models.llama.modeling_llama.LlamaDynamicNTKScalingRotaryEmbedding with Llama->DeepseekV2
|
| 187 |
+
class DeepseekV2DynamicNTKScalingRotaryEmbedding(DeepseekV2RotaryEmbedding):
|
| 188 |
+
"""DeepseekV2RotaryEmbedding extended with Dynamic NTK scaling. Credits to the Reddit users /u/bloc97 and /u/emozilla"""
|
| 189 |
+
|
| 190 |
+
def __init__(
|
| 191 |
+
self,
|
| 192 |
+
dim,
|
| 193 |
+
max_position_embeddings=2048,
|
| 194 |
+
base=10000,
|
| 195 |
+
device=None,
|
| 196 |
+
scaling_factor=1.0,
|
| 197 |
+
):
|
| 198 |
+
self.scaling_factor = scaling_factor
|
| 199 |
+
super().__init__(dim, max_position_embeddings, base, device)
|
| 200 |
+
|
| 201 |
+
def _set_cos_sin_cache(self, seq_len, device, dtype):
|
| 202 |
+
self.max_seq_len_cached = seq_len
|
| 203 |
+
|
| 204 |
+
if seq_len > self.max_position_embeddings:
|
| 205 |
+
base = self.base * (
|
| 206 |
+
(self.scaling_factor * seq_len / self.max_position_embeddings)
|
| 207 |
+
- (self.scaling_factor - 1)
|
| 208 |
+
) ** (self.dim / (self.dim - 2))
|
| 209 |
+
inv_freq = 1.0 / (
|
| 210 |
+
base ** (torch.arange(0, self.dim, 2).float().to(device) / self.dim)
|
| 211 |
+
)
|
| 212 |
+
self.register_buffer("inv_freq", inv_freq, persistent=False)
|
| 213 |
+
|
| 214 |
+
t = torch.arange(
|
| 215 |
+
self.max_seq_len_cached, device=device, dtype=self.inv_freq.dtype
|
| 216 |
+
)
|
| 217 |
+
|
| 218 |
+
freqs = torch.outer(t, self.inv_freq)
|
| 219 |
+
# Different from paper, but it uses a different permutation in order to obtain the same calculation
|
| 220 |
+
emb = torch.cat((freqs, freqs), dim=-1)
|
| 221 |
+
self.register_buffer("cos_cached", emb.cos().to(dtype), persistent=False)
|
| 222 |
+
self.register_buffer("sin_cached", emb.sin().to(dtype), persistent=False)
|
| 223 |
+
|
| 224 |
+
|
| 225 |
+
# Inverse dim formula to find dim based on number of rotations
|
| 226 |
+
def yarn_find_correction_dim(
|
| 227 |
+
num_rotations, dim, base=10000, max_position_embeddings=2048
|
| 228 |
+
):
|
| 229 |
+
return (dim * math.log(max_position_embeddings / (num_rotations * 2 * math.pi))) / (
|
| 230 |
+
2 * math.log(base)
|
| 231 |
+
)
|
| 232 |
+
|
| 233 |
+
|
| 234 |
+
# Find dim range bounds based on rotations
|
| 235 |
+
def yarn_find_correction_range(
|
| 236 |
+
low_rot, high_rot, dim, base=10000, max_position_embeddings=2048
|
| 237 |
+
):
|
| 238 |
+
low = math.floor(
|
| 239 |
+
yarn_find_correction_dim(low_rot, dim, base, max_position_embeddings)
|
| 240 |
+
)
|
| 241 |
+
high = math.ceil(
|
| 242 |
+
yarn_find_correction_dim(high_rot, dim, base, max_position_embeddings)
|
| 243 |
+
)
|
| 244 |
+
return max(low, 0), min(high, dim - 1) # Clamp values just in case
|
| 245 |
+
|
| 246 |
+
|
| 247 |
+
def yarn_get_mscale(scale=1, mscale=1):
|
| 248 |
+
if scale <= 1:
|
| 249 |
+
return 1.0
|
| 250 |
+
return 0.1 * mscale * math.log(scale) + 1.0
|
| 251 |
+
|
| 252 |
+
|
| 253 |
+
def yarn_linear_ramp_mask(min, max, dim):
|
| 254 |
+
if min == max:
|
| 255 |
+
max += 0.001 # Prevent singularity
|
| 256 |
+
|
| 257 |
+
linear_func = (torch.arange(dim, dtype=torch.float32) - min) / (max - min)
|
| 258 |
+
ramp_func = torch.clamp(linear_func, 0, 1)
|
| 259 |
+
return ramp_func
|
| 260 |
+
|
| 261 |
+
|
| 262 |
+
class DeepseekV2YarnRotaryEmbedding(DeepseekV2RotaryEmbedding):
|
| 263 |
+
|
| 264 |
+
def __init__(
|
| 265 |
+
self,
|
| 266 |
+
dim,
|
| 267 |
+
max_position_embeddings=2048,
|
| 268 |
+
base=10000,
|
| 269 |
+
device=None,
|
| 270 |
+
scaling_factor=1.0,
|
| 271 |
+
original_max_position_embeddings=4096,
|
| 272 |
+
beta_fast=32,
|
| 273 |
+
beta_slow=1,
|
| 274 |
+
mscale=1,
|
| 275 |
+
mscale_all_dim=0,
|
| 276 |
+
):
|
| 277 |
+
self.scaling_factor = scaling_factor
|
| 278 |
+
self.original_max_position_embeddings = original_max_position_embeddings
|
| 279 |
+
self.beta_fast = beta_fast
|
| 280 |
+
self.beta_slow = beta_slow
|
| 281 |
+
self.mscale = mscale
|
| 282 |
+
self.mscale_all_dim = mscale_all_dim
|
| 283 |
+
super().__init__(dim, max_position_embeddings, base, device)
|
| 284 |
+
|
| 285 |
+
def _set_cos_sin_cache(self, seq_len, device, dtype):
|
| 286 |
+
self.max_seq_len_cached = seq_len
|
| 287 |
+
dim = self.dim
|
| 288 |
+
|
| 289 |
+
freq_extra = 1.0 / (
|
| 290 |
+
self.base
|
| 291 |
+
** (torch.arange(0, dim, 2, dtype=torch.float32, device=device) / dim)
|
| 292 |
+
)
|
| 293 |
+
freq_inter = 1.0 / (
|
| 294 |
+
self.scaling_factor
|
| 295 |
+
* self.base
|
| 296 |
+
** (torch.arange(0, dim, 2, dtype=torch.float32, device=device) / dim)
|
| 297 |
+
)
|
| 298 |
+
|
| 299 |
+
low, high = yarn_find_correction_range(
|
| 300 |
+
self.beta_fast,
|
| 301 |
+
self.beta_slow,
|
| 302 |
+
dim,
|
| 303 |
+
self.base,
|
| 304 |
+
self.original_max_position_embeddings,
|
| 305 |
+
)
|
| 306 |
+
inv_freq_mask = 1.0 - yarn_linear_ramp_mask(low, high, dim // 2).to(
|
| 307 |
+
device=device, dtype=torch.float32
|
| 308 |
+
)
|
| 309 |
+
inv_freq = freq_inter * (1 - inv_freq_mask) + freq_extra * inv_freq_mask
|
| 310 |
+
self.register_buffer("inv_freq", inv_freq, persistent=False)
|
| 311 |
+
|
| 312 |
+
t = torch.arange(seq_len, device=device, dtype=torch.float32)
|
| 313 |
+
|
| 314 |
+
freqs = torch.outer(t, inv_freq)
|
| 315 |
+
|
| 316 |
+
_mscale = float(
|
| 317 |
+
yarn_get_mscale(self.scaling_factor, self.mscale)
|
| 318 |
+
/ yarn_get_mscale(self.scaling_factor, self.mscale_all_dim)
|
| 319 |
+
)
|
| 320 |
+
|
| 321 |
+
emb = torch.cat((freqs, freqs), dim=-1)
|
| 322 |
+
self.register_buffer(
|
| 323 |
+
"cos_cached", (emb.cos() * _mscale).to(dtype), persistent=False
|
| 324 |
+
)
|
| 325 |
+
self.register_buffer(
|
| 326 |
+
"sin_cached", (emb.sin() * _mscale).to(dtype), persistent=False
|
| 327 |
+
)
|
| 328 |
+
|
| 329 |
+
|
| 330 |
+
# Copied from transformers.models.llama.modeling_llama.rotate_half
|
| 331 |
+
def rotate_half(x):
|
| 332 |
+
"""Rotates half the hidden dims of the input."""
|
| 333 |
+
x1 = x[..., : x.shape[-1] // 2]
|
| 334 |
+
x2 = x[..., x.shape[-1] // 2 :]
|
| 335 |
+
return torch.cat((-x2, x1), dim=-1)
|
| 336 |
+
|
| 337 |
+
|
| 338 |
+
# Copied from transformers.models.llama.modeling_llama.apply_rotary_pos_emb
|
| 339 |
+
def apply_rotary_pos_emb(q, k, cos, sin, position_ids, unsqueeze_dim=1):
|
| 340 |
+
"""Applies Rotary Position Embedding to the query and key tensors.
|
| 341 |
+
|
| 342 |
+
Args:
|
| 343 |
+
q (`torch.Tensor`): The query tensor.
|
| 344 |
+
k (`torch.Tensor`): The key tensor.
|
| 345 |
+
cos (`torch.Tensor`): The cosine part of the rotary embedding.
|
| 346 |
+
sin (`torch.Tensor`): The sine part of the rotary embedding.
|
| 347 |
+
position_ids (`torch.Tensor`):
|
| 348 |
+
The position indices of the tokens corresponding to the query and key tensors. For example, this can be
|
| 349 |
+
used to pass offsetted position ids when working with a KV-cache.
|
| 350 |
+
unsqueeze_dim (`int`, *optional*, defaults to 1):
|
| 351 |
+
The 'unsqueeze_dim' argument specifies the dimension along which to unsqueeze cos[position_ids] and
|
| 352 |
+
sin[position_ids] so that they can be properly broadcasted to the dimensions of q and k. For example, note
|
| 353 |
+
that cos[position_ids] and sin[position_ids] have the shape [batch_size, seq_len, head_dim]. Then, if q and
|
| 354 |
+
k have the shape [batch_size, heads, seq_len, head_dim], then setting unsqueeze_dim=1 makes
|
| 355 |
+
cos[position_ids] and sin[position_ids] broadcastable to the shapes of q and k. Similarly, if q and k have
|
| 356 |
+
the shape [batch_size, seq_len, heads, head_dim], then set unsqueeze_dim=2.
|
| 357 |
+
Returns:
|
| 358 |
+
`tuple(torch.Tensor)` comprising of the query and key tensors rotated using the Rotary Position Embedding.
|
| 359 |
+
"""
|
| 360 |
+
cos = cos[position_ids].unsqueeze(unsqueeze_dim)
|
| 361 |
+
sin = sin[position_ids].unsqueeze(unsqueeze_dim)
|
| 362 |
+
|
| 363 |
+
b, h, s, d = q.shape
|
| 364 |
+
q = q.view(b, h, s, d // 2, 2).transpose(4, 3).reshape(b, h, s, d)
|
| 365 |
+
|
| 366 |
+
b, h, s, d = k.shape
|
| 367 |
+
k = k.view(b, h, s, d // 2, 2).transpose(4, 3).reshape(b, h, s, d)
|
| 368 |
+
|
| 369 |
+
q_embed = (q * cos) + (rotate_half(q) * sin)
|
| 370 |
+
k_embed = (k * cos) + (rotate_half(k) * sin)
|
| 371 |
+
return q_embed, k_embed
|
| 372 |
+
|
| 373 |
+
|
| 374 |
+
class DeepseekV2MLP(nn.Module):
|
| 375 |
+
def __init__(self, config, hidden_size=None, intermediate_size=None):
|
| 376 |
+
super().__init__()
|
| 377 |
+
self.config = config
|
| 378 |
+
self.hidden_size = config.hidden_size if hidden_size is None else hidden_size
|
| 379 |
+
self.intermediate_size = (
|
| 380 |
+
config.intermediate_size if intermediate_size is None else intermediate_size
|
| 381 |
+
)
|
| 382 |
+
|
| 383 |
+
self.gate_proj = nn.Linear(self.hidden_size, self.intermediate_size, bias=False)
|
| 384 |
+
self.up_proj = nn.Linear(self.hidden_size, self.intermediate_size, bias=False)
|
| 385 |
+
self.down_proj = nn.Linear(self.intermediate_size, self.hidden_size, bias=False)
|
| 386 |
+
self.act_fn = ACT2FN[config.hidden_act]
|
| 387 |
+
|
| 388 |
+
def forward(self, x):
|
| 389 |
+
down_proj = self.down_proj(self.act_fn(self.gate_proj(x)) * self.up_proj(x))
|
| 390 |
+
return down_proj
|
| 391 |
+
|
| 392 |
+
|
| 393 |
+
class MoEGate(nn.Module):
|
| 394 |
+
def __init__(self, config):
|
| 395 |
+
super().__init__()
|
| 396 |
+
self.config = config
|
| 397 |
+
self.top_k = config.num_experts_per_tok
|
| 398 |
+
self.n_routed_experts = config.n_routed_experts
|
| 399 |
+
self.routed_scaling_factor = config.routed_scaling_factor
|
| 400 |
+
self.scoring_func = config.scoring_func
|
| 401 |
+
self.alpha = config.aux_loss_alpha
|
| 402 |
+
self.seq_aux = config.seq_aux
|
| 403 |
+
self.topk_method = config.topk_method
|
| 404 |
+
self.n_group = config.n_group
|
| 405 |
+
self.topk_group = config.topk_group
|
| 406 |
+
|
| 407 |
+
# topk selection algorithm
|
| 408 |
+
self.norm_topk_prob = config.norm_topk_prob
|
| 409 |
+
self.gating_dim = config.hidden_size
|
| 410 |
+
self.weight = nn.Parameter(
|
| 411 |
+
torch.empty((self.n_routed_experts, self.gating_dim))
|
| 412 |
+
)
|
| 413 |
+
self.reset_parameters()
|
| 414 |
+
|
| 415 |
+
def reset_parameters(self) -> None:
|
| 416 |
+
import torch.nn.init as init
|
| 417 |
+
|
| 418 |
+
init.kaiming_uniform_(self.weight, a=math.sqrt(5))
|
| 419 |
+
|
| 420 |
+
def forward(self, hidden_states):
|
| 421 |
+
bsz, seq_len, h = hidden_states.shape
|
| 422 |
+
### compute gating score
|
| 423 |
+
hidden_states = hidden_states.view(-1, h)
|
| 424 |
+
logits = F.linear(
|
| 425 |
+
hidden_states.type(torch.float32), self.weight.type(torch.float32), None
|
| 426 |
+
)
|
| 427 |
+
if self.scoring_func == "softmax":
|
| 428 |
+
scores = logits.softmax(dim=-1, dtype=torch.float32)
|
| 429 |
+
else:
|
| 430 |
+
raise NotImplementedError(
|
| 431 |
+
f"insupportable scoring function for MoE gating: {self.scoring_func}"
|
| 432 |
+
)
|
| 433 |
+
|
| 434 |
+
### select top-k experts
|
| 435 |
+
if self.topk_method == "greedy":
|
| 436 |
+
topk_weight, topk_idx = torch.topk(
|
| 437 |
+
scores, k=self.top_k, dim=-1, sorted=False
|
| 438 |
+
)
|
| 439 |
+
elif self.topk_method == "group_limited_greedy":
|
| 440 |
+
group_scores = (
|
| 441 |
+
scores.view(bsz * seq_len, self.n_group, -1).max(dim=-1).values
|
| 442 |
+
) # [n, n_group]
|
| 443 |
+
group_idx = torch.topk(
|
| 444 |
+
group_scores, k=self.topk_group, dim=-1, sorted=False
|
| 445 |
+
)[
|
| 446 |
+
1
|
| 447 |
+
] # [n, top_k_group]
|
| 448 |
+
group_mask = torch.zeros_like(group_scores) # [n, n_group]
|
| 449 |
+
group_mask.scatter_(1, group_idx, 1) # [n, n_group]
|
| 450 |
+
score_mask = (
|
| 451 |
+
group_mask.unsqueeze(-1)
|
| 452 |
+
.expand(
|
| 453 |
+
bsz * seq_len, self.n_group, self.n_routed_experts // self.n_group
|
| 454 |
+
)
|
| 455 |
+
.reshape(bsz * seq_len, -1)
|
| 456 |
+
) # [n, e]
|
| 457 |
+
tmp_scores = scores.masked_fill(~score_mask.bool(), 0.0) # [n, e]
|
| 458 |
+
topk_weight, topk_idx = torch.topk(
|
| 459 |
+
tmp_scores, k=self.top_k, dim=-1, sorted=False
|
| 460 |
+
)
|
| 461 |
+
|
| 462 |
+
### norm gate to sum 1
|
| 463 |
+
if self.top_k > 1 and self.norm_topk_prob:
|
| 464 |
+
denominator = topk_weight.sum(dim=-1, keepdim=True) + 1e-20
|
| 465 |
+
topk_weight = topk_weight / denominator
|
| 466 |
+
else:
|
| 467 |
+
topk_weight = topk_weight * self.routed_scaling_factor
|
| 468 |
+
### expert-level computation auxiliary loss
|
| 469 |
+
if self.training and self.alpha > 0.0:
|
| 470 |
+
scores_for_aux = scores
|
| 471 |
+
aux_topk = self.top_k
|
| 472 |
+
# always compute aux loss based on the naive greedy topk method
|
| 473 |
+
topk_idx_for_aux_loss = topk_idx.view(bsz, -1)
|
| 474 |
+
if self.seq_aux:
|
| 475 |
+
scores_for_seq_aux = scores_for_aux.view(bsz, seq_len, -1)
|
| 476 |
+
ce = torch.zeros(
|
| 477 |
+
bsz, self.n_routed_experts, device=hidden_states.device
|
| 478 |
+
)
|
| 479 |
+
ce.scatter_add_(
|
| 480 |
+
1,
|
| 481 |
+
topk_idx_for_aux_loss,
|
| 482 |
+
torch.ones(bsz, seq_len * aux_topk, device=hidden_states.device),
|
| 483 |
+
).div_(seq_len * aux_topk / self.n_routed_experts)
|
| 484 |
+
aux_loss = (ce * scores_for_seq_aux.mean(dim=1)).sum(
|
| 485 |
+
dim=1
|
| 486 |
+
).mean() * self.alpha
|
| 487 |
+
else:
|
| 488 |
+
mask_ce = F.one_hot(
|
| 489 |
+
topk_idx_for_aux_loss.view(-1), num_classes=self.n_routed_experts
|
| 490 |
+
)
|
| 491 |
+
ce = mask_ce.float().mean(0)
|
| 492 |
+
Pi = scores_for_aux.mean(0)
|
| 493 |
+
fi = ce * self.n_routed_experts
|
| 494 |
+
aux_loss = (Pi * fi).sum() * self.alpha
|
| 495 |
+
else:
|
| 496 |
+
aux_loss = None
|
| 497 |
+
return topk_idx, topk_weight, aux_loss
|
| 498 |
+
|
| 499 |
+
|
| 500 |
+
class AddAuxiliaryLoss(torch.autograd.Function):
|
| 501 |
+
"""
|
| 502 |
+
The trick function of adding auxiliary (aux) loss,
|
| 503 |
+
which includes the gradient of the aux loss during backpropagation.
|
| 504 |
+
"""
|
| 505 |
+
|
| 506 |
+
@staticmethod
|
| 507 |
+
def forward(ctx, x, loss):
|
| 508 |
+
assert loss.numel() == 1
|
| 509 |
+
ctx.dtype = loss.dtype
|
| 510 |
+
ctx.required_aux_loss = loss.requires_grad
|
| 511 |
+
return x
|
| 512 |
+
|
| 513 |
+
@staticmethod
|
| 514 |
+
def backward(ctx, grad_output):
|
| 515 |
+
grad_loss = None
|
| 516 |
+
if ctx.required_aux_loss:
|
| 517 |
+
grad_loss = torch.ones(1, dtype=ctx.dtype, device=grad_output.device)
|
| 518 |
+
return grad_output, grad_loss
|
| 519 |
+
|
| 520 |
+
|
| 521 |
+
class DeepseekV2MoE(nn.Module):
|
| 522 |
+
"""
|
| 523 |
+
A mixed expert module containing shared experts.
|
| 524 |
+
"""
|
| 525 |
+
|
| 526 |
+
def __init__(self, config):
|
| 527 |
+
super().__init__()
|
| 528 |
+
self.config = config
|
| 529 |
+
self.num_experts_per_tok = config.num_experts_per_tok
|
| 530 |
+
|
| 531 |
+
if hasattr(config, "ep_size") and config.ep_size > 1:
|
| 532 |
+
assert config.ep_size == dist.get_world_size()
|
| 533 |
+
self.ep_size = config.ep_size
|
| 534 |
+
self.experts_per_rank = config.n_routed_experts // config.ep_size
|
| 535 |
+
self.ep_rank = dist.get_rank()
|
| 536 |
+
self.experts = nn.ModuleList(
|
| 537 |
+
[
|
| 538 |
+
(
|
| 539 |
+
DeepseekV2MLP(
|
| 540 |
+
config, intermediate_size=config.moe_intermediate_size
|
| 541 |
+
)
|
| 542 |
+
if i >= self.ep_rank * self.experts_per_rank
|
| 543 |
+
and i < (self.ep_rank + 1) * self.experts_per_rank
|
| 544 |
+
else None
|
| 545 |
+
)
|
| 546 |
+
for i in range(config.n_routed_experts)
|
| 547 |
+
]
|
| 548 |
+
)
|
| 549 |
+
else:
|
| 550 |
+
self.ep_size = 1
|
| 551 |
+
self.experts_per_rank = config.n_routed_experts
|
| 552 |
+
self.ep_rank = 0
|
| 553 |
+
self.experts = nn.ModuleList(
|
| 554 |
+
[
|
| 555 |
+
DeepseekV2MLP(
|
| 556 |
+
config, intermediate_size=config.moe_intermediate_size
|
| 557 |
+
)
|
| 558 |
+
for i in range(config.n_routed_experts)
|
| 559 |
+
]
|
| 560 |
+
)
|
| 561 |
+
self.gate = MoEGate(config)
|
| 562 |
+
if config.n_shared_experts is not None:
|
| 563 |
+
intermediate_size = config.moe_intermediate_size * config.n_shared_experts
|
| 564 |
+
self.shared_experts = DeepseekV2MLP(
|
| 565 |
+
config=config, intermediate_size=intermediate_size
|
| 566 |
+
)
|
| 567 |
+
|
| 568 |
+
def forward_original(self, hidden_states):
|
| 569 |
+
"""Original forward method, kept for comparison and rollback"""
|
| 570 |
+
identity = hidden_states
|
| 571 |
+
orig_shape = hidden_states.shape
|
| 572 |
+
topk_idx, topk_weight, aux_loss = self.gate(hidden_states)
|
| 573 |
+
hidden_states = hidden_states.view(-1, hidden_states.shape[-1])
|
| 574 |
+
flat_topk_idx = topk_idx.view(-1)
|
| 575 |
+
if self.training:
|
| 576 |
+
hidden_states = hidden_states.repeat_interleave(
|
| 577 |
+
self.num_experts_per_tok, dim=0
|
| 578 |
+
)
|
| 579 |
+
y = torch.empty_like(hidden_states)
|
| 580 |
+
for i, expert in enumerate(self.experts):
|
| 581 |
+
y[flat_topk_idx == i] = expert(hidden_states[flat_topk_idx == i])
|
| 582 |
+
y = (y.view(*topk_weight.shape, -1) * topk_weight.unsqueeze(-1)).sum(dim=1)
|
| 583 |
+
y = y.to(hidden_states.dtype).view(*orig_shape)
|
| 584 |
+
y = AddAuxiliaryLoss.apply(y, aux_loss)
|
| 585 |
+
else:
|
| 586 |
+
y = self.moe_infer(hidden_states, topk_idx, topk_weight).view(*orig_shape)
|
| 587 |
+
if self.config.n_shared_experts is not None:
|
| 588 |
+
y = y + self.shared_experts(identity)
|
| 589 |
+
return y
|
| 590 |
+
|
| 591 |
+
def forward(self, hidden_states):
|
| 592 |
+
"""
|
| 593 |
+
Forward pass implementing dense backward functionality:
|
| 594 |
+
Forward output remains the same as official (sparse computation result), but gradients flow back through dense computation during backward pass
|
| 595 |
+
|
| 596 |
+
Dense Backward mechanism explanation:
|
| 597 |
+
1. During forward pass, only top-k experts participate in computation (sparse forward)
|
| 598 |
+
2. During backward pass, all experts receive gradients (dense backward)
|
| 599 |
+
3. Uses straight-through gradient technique: sparse_output.detach() + (dense_output - dense_output.detach())
|
| 600 |
+
4. Uses register_hook to ensure only activated experts actually update parameters
|
| 601 |
+
|
| 602 |
+
Args:
|
| 603 |
+
hidden_states: Input tensor, shape (batch_size, seq_length, hidden_dim)
|
| 604 |
+
|
| 605 |
+
Returns:
|
| 606 |
+
Output tensor, shape (batch_size, seq_length, hidden_dim)
|
| 607 |
+
"""
|
| 608 |
+
batch_size, seq_length, hidden_dim = hidden_states.shape
|
| 609 |
+
dtype = hidden_states.dtype
|
| 610 |
+
device = hidden_states.device
|
| 611 |
+
|
| 612 |
+
identity = hidden_states
|
| 613 |
+
orig_shape = hidden_states.shape
|
| 614 |
+
|
| 615 |
+
# Step 1: Compute routing logic, select top-k experts
|
| 616 |
+
topk_idx, topk_weight, aux_loss = self.gate(hidden_states)
|
| 617 |
+
flat_hidden = hidden_states.view(-1, hidden_dim) # (B*seq_len, hidden_dim)
|
| 618 |
+
N_tokens = flat_hidden.size(0)
|
| 619 |
+
flat_topk_idx = topk_idx.view(-1)
|
| 620 |
+
|
| 621 |
+
# Step 2: Compute complete routing weights (for dense backward)
|
| 622 |
+
# Note: V2 version forces float32 computation
|
| 623 |
+
router_logits = F.linear(
|
| 624 |
+
flat_hidden.type(torch.float32),
|
| 625 |
+
self.gate.weight.type(torch.float32),
|
| 626 |
+
None
|
| 627 |
+
)
|
| 628 |
+
if self.gate.scoring_func == 'softmax':
|
| 629 |
+
routing_weights = F.softmax(router_logits, dim=1, dtype=torch.float32) # (N_tokens, n_routed_experts)
|
| 630 |
+
else:
|
| 631 |
+
raise NotImplementedError(f'Unsupported scoring function: {self.gate.scoring_func}')
|
| 632 |
+
|
| 633 |
+
routing_weights = routing_weights.to(dtype=dtype)
|
| 634 |
+
|
| 635 |
+
# Step 3: Prepare output accumulators
|
| 636 |
+
dense_outputs = torch.zeros((N_tokens, hidden_dim), dtype=dtype, device=device)
|
| 637 |
+
sparse_outputs = torch.zeros((N_tokens, hidden_dim), dtype=dtype, device=device)
|
| 638 |
+
|
| 639 |
+
# Step 4: Compute for each expert
|
| 640 |
+
if self.training:
|
| 641 |
+
# Training mode: implement dense backward
|
| 642 |
+
for expert_idx in range(self.config.n_routed_experts):
|
| 643 |
+
# V2 version experts may be None (in EP mode)
|
| 644 |
+
if self.experts[expert_idx] is None:
|
| 645 |
+
continue
|
| 646 |
+
|
| 647 |
+
expert_layer = self.experts[expert_idx]
|
| 648 |
+
|
| 649 |
+
# Compute current expert output for all tokens (dense computation)
|
| 650 |
+
expert_output = expert_layer(flat_hidden) # (N_tokens, hidden_dim)
|
| 651 |
+
|
| 652 |
+
# Create activation mask: mark which tokens selected this expert
|
| 653 |
+
activation_mask = (topk_idx == expert_idx).any(dim=1).float().unsqueeze(-1).to(dtype)
|
| 654 |
+
|
| 655 |
+
# Register hook: only selected tokens can pass gradients to this expert
|
| 656 |
+
if expert_output.requires_grad:
|
| 657 |
+
expert_output.register_hook(lambda grad, mask=activation_mask: grad * mask)
|
| 658 |
+
|
| 659 |
+
expert_output = expert_output.to(dtype=dtype)
|
| 660 |
+
|
| 661 |
+
# Dense accumulation: use complete routing weights
|
| 662 |
+
weight_full = routing_weights[:, expert_idx].unsqueeze(-1) # (N_tokens, 1)
|
| 663 |
+
dense_outputs = dense_outputs + expert_output * weight_full
|
| 664 |
+
|
| 665 |
+
# Sparse accumulation: only accumulate selected expert outputs
|
| 666 |
+
matches = (topk_idx == expert_idx)
|
| 667 |
+
if matches.any():
|
| 668 |
+
token_indices, k_indices = torch.where(matches)
|
| 669 |
+
weights_topk = topk_weight[token_indices, k_indices].unsqueeze(-1).to(sparse_outputs.dtype) # (num_matches, 1)
|
| 670 |
+
sparse_outputs[token_indices] = sparse_outputs[token_indices] + expert_output[token_indices] * weights_topk
|
| 671 |
+
else:
|
| 672 |
+
# Inference mode: use original sparse computation logic
|
| 673 |
+
sparse_outputs = self.moe_infer(flat_hidden, topk_idx, topk_weight)
|
| 674 |
+
# Dense outputs not needed during inference
|
| 675 |
+
dense_outputs = sparse_outputs
|
| 676 |
+
|
| 677 |
+
# Step 5: Add shared experts (if any)
|
| 678 |
+
if self.config.n_shared_experts is not None:
|
| 679 |
+
shared_expert_output = self.shared_experts(identity)
|
| 680 |
+
sparse_outputs = sparse_outputs.view(*orig_shape) + shared_expert_output
|
| 681 |
+
dense_outputs = dense_outputs.view(*orig_shape) + shared_expert_output
|
| 682 |
+
else:
|
| 683 |
+
sparse_outputs = sparse_outputs.view(*orig_shape)
|
| 684 |
+
dense_outputs = dense_outputs.view(*orig_shape)
|
| 685 |
+
|
| 686 |
+
# Step 6: Use straight-through gradient technique to combine sparse forward and dense backward
|
| 687 |
+
if self.training:
|
| 688 |
+
# Forward uses sparse, backward uses dense
|
| 689 |
+
final_output = sparse_outputs.detach() + (dense_outputs - dense_outputs.detach())
|
| 690 |
+
# Add auxiliary loss
|
| 691 |
+
final_output = AddAuxiliaryLoss.apply(final_output, aux_loss)
|
| 692 |
+
else:
|
| 693 |
+
final_output = sparse_outputs
|
| 694 |
+
|
| 695 |
+
return final_output
|
| 696 |
+
|
| 697 |
+
@torch.no_grad()
|
| 698 |
+
def moe_infer(self, x, topk_ids, topk_weight):
|
| 699 |
+
cnts = topk_ids.new_zeros((topk_ids.shape[0], len(self.experts)))
|
| 700 |
+
cnts.scatter_(1, topk_ids, 1)
|
| 701 |
+
tokens_per_expert = cnts.sum(dim=0)
|
| 702 |
+
idxs = topk_ids.view(-1).argsort()
|
| 703 |
+
sorted_tokens = x[idxs // topk_ids.shape[1]]
|
| 704 |
+
sorted_tokens_shape = sorted_tokens.shape
|
| 705 |
+
if self.ep_size > 1:
|
| 706 |
+
tokens_per_ep_rank = tokens_per_expert.view(self.ep_size, -1).sum(dim=1)
|
| 707 |
+
tokens_per_expert_group = tokens_per_expert.new_empty(
|
| 708 |
+
tokens_per_expert.shape[0]
|
| 709 |
+
)
|
| 710 |
+
dist.all_to_all_single(tokens_per_expert_group, tokens_per_expert)
|
| 711 |
+
output_splits = (
|
| 712 |
+
tokens_per_expert_group.view(self.ep_size, -1)
|
| 713 |
+
.sum(1)
|
| 714 |
+
.cpu()
|
| 715 |
+
.numpy()
|
| 716 |
+
.tolist()
|
| 717 |
+
)
|
| 718 |
+
gathered_tokens = sorted_tokens.new_empty(
|
| 719 |
+
tokens_per_expert_group.sum(dim=0).cpu().item(), sorted_tokens.shape[1]
|
| 720 |
+
)
|
| 721 |
+
input_split_sizes = tokens_per_ep_rank.cpu().numpy().tolist()
|
| 722 |
+
dist.all_to_all(
|
| 723 |
+
list(gathered_tokens.split(output_splits)),
|
| 724 |
+
list(sorted_tokens.split(input_split_sizes)),
|
| 725 |
+
)
|
| 726 |
+
tokens_per_expert_post_gather = tokens_per_expert_group.view(
|
| 727 |
+
self.ep_size, self.experts_per_rank
|
| 728 |
+
).sum(dim=0)
|
| 729 |
+
gatherd_idxs = np.zeros(shape=(gathered_tokens.shape[0],), dtype=np.int32)
|
| 730 |
+
s = 0
|
| 731 |
+
for i, k in enumerate(tokens_per_expert_group.cpu().numpy()):
|
| 732 |
+
gatherd_idxs[s : s + k] = i % self.experts_per_rank
|
| 733 |
+
s += k
|
| 734 |
+
gatherd_idxs = gatherd_idxs.argsort()
|
| 735 |
+
sorted_tokens = gathered_tokens[gatherd_idxs]
|
| 736 |
+
tokens_per_expert = tokens_per_expert_post_gather
|
| 737 |
+
tokens_per_expert = tokens_per_expert.cpu().numpy()
|
| 738 |
+
|
| 739 |
+
outputs = []
|
| 740 |
+
start_idx = 0
|
| 741 |
+
for i, num_tokens in enumerate(tokens_per_expert):
|
| 742 |
+
end_idx = start_idx + num_tokens
|
| 743 |
+
if num_tokens == 0:
|
| 744 |
+
continue
|
| 745 |
+
expert = self.experts[i + self.ep_rank * self.experts_per_rank]
|
| 746 |
+
tokens_for_this_expert = sorted_tokens[start_idx:end_idx]
|
| 747 |
+
expert_out = expert(tokens_for_this_expert)
|
| 748 |
+
outputs.append(expert_out)
|
| 749 |
+
start_idx = end_idx
|
| 750 |
+
|
| 751 |
+
outs = torch.cat(outputs, dim=0) if len(outputs) else sorted_tokens.new_empty(0)
|
| 752 |
+
if self.ep_size > 1:
|
| 753 |
+
new_x = torch.empty_like(outs)
|
| 754 |
+
new_x[gatherd_idxs] = outs
|
| 755 |
+
gathered_tokens = new_x.new_empty(*sorted_tokens_shape)
|
| 756 |
+
dist.all_to_all(
|
| 757 |
+
list(gathered_tokens.split(input_split_sizes)),
|
| 758 |
+
list(new_x.split(output_splits)),
|
| 759 |
+
)
|
| 760 |
+
outs = gathered_tokens
|
| 761 |
+
|
| 762 |
+
new_x = torch.empty_like(outs)
|
| 763 |
+
new_x[idxs] = outs
|
| 764 |
+
final_out = (
|
| 765 |
+
new_x.view(*topk_ids.shape, -1)
|
| 766 |
+
.type(topk_weight.dtype)
|
| 767 |
+
.mul_(topk_weight.unsqueeze(dim=-1))
|
| 768 |
+
.sum(dim=1)
|
| 769 |
+
.type(new_x.dtype)
|
| 770 |
+
)
|
| 771 |
+
return final_out
|
| 772 |
+
|
| 773 |
+
|
| 774 |
+
# Copied from transformers.models.llama.modeling_llama.repeat_kv
|
| 775 |
+
def repeat_kv(hidden_states: torch.Tensor, n_rep: int) -> torch.Tensor:
|
| 776 |
+
"""
|
| 777 |
+
This is the equivalent of torch.repeat_interleave(x, dim=1, repeats=n_rep). The hidden states go from (batch,
|
| 778 |
+
num_key_value_heads, seqlen, head_dim) to (batch, num_attention_heads, seqlen, head_dim)
|
| 779 |
+
"""
|
| 780 |
+
batch, num_key_value_heads, slen, head_dim = hidden_states.shape
|
| 781 |
+
if n_rep == 1:
|
| 782 |
+
return hidden_states
|
| 783 |
+
hidden_states = hidden_states[:, :, None, :, :].expand(
|
| 784 |
+
batch, num_key_value_heads, n_rep, slen, head_dim
|
| 785 |
+
)
|
| 786 |
+
return hidden_states.reshape(batch, num_key_value_heads * n_rep, slen, head_dim)
|
| 787 |
+
|
| 788 |
+
|
| 789 |
+
# Copied from transformers.models.llama.modeling_llama.LlamaAttention with Llama->DeepseekV2
|
| 790 |
+
class DeepseekV2Attention(nn.Module):
|
| 791 |
+
"""Multi-headed attention from 'Attention Is All You Need' paper"""
|
| 792 |
+
|
| 793 |
+
def __init__(self, config: DeepseekV2Config, layer_idx: Optional[int] = None):
|
| 794 |
+
super().__init__()
|
| 795 |
+
self.config = config
|
| 796 |
+
self.layer_idx = layer_idx
|
| 797 |
+
if layer_idx is None:
|
| 798 |
+
logger.warning_once(
|
| 799 |
+
f"Instantiating {self.__class__.__name__} without passing `layer_idx` is not recommended and will "
|
| 800 |
+
"to errors during the forward call, if caching is used. Please make sure to provide a `layer_idx` "
|
| 801 |
+
"when creating this class."
|
| 802 |
+
)
|
| 803 |
+
|
| 804 |
+
self.attention_dropout = config.attention_dropout
|
| 805 |
+
self.hidden_size = config.hidden_size
|
| 806 |
+
self.num_heads = config.num_attention_heads
|
| 807 |
+
|
| 808 |
+
self.max_position_embeddings = config.max_position_embeddings
|
| 809 |
+
self.rope_theta = config.rope_theta
|
| 810 |
+
self.q_lora_rank = config.q_lora_rank
|
| 811 |
+
self.qk_rope_head_dim = config.qk_rope_head_dim
|
| 812 |
+
self.kv_lora_rank = config.kv_lora_rank
|
| 813 |
+
self.v_head_dim = config.v_head_dim
|
| 814 |
+
self.qk_nope_head_dim = config.qk_nope_head_dim
|
| 815 |
+
self.q_head_dim = config.qk_nope_head_dim + config.qk_rope_head_dim
|
| 816 |
+
|
| 817 |
+
self.is_causal = True
|
| 818 |
+
|
| 819 |
+
if self.q_lora_rank is None:
|
| 820 |
+
self.q_proj = nn.Linear(
|
| 821 |
+
self.hidden_size, self.num_heads * self.q_head_dim, bias=False
|
| 822 |
+
)
|
| 823 |
+
else:
|
| 824 |
+
self.q_a_proj = nn.Linear(
|
| 825 |
+
self.hidden_size, config.q_lora_rank, bias=config.attention_bias
|
| 826 |
+
)
|
| 827 |
+
self.q_a_layernorm = DeepseekV2RMSNorm(config.q_lora_rank)
|
| 828 |
+
self.q_b_proj = nn.Linear(
|
| 829 |
+
config.q_lora_rank, self.num_heads * self.q_head_dim, bias=False
|
| 830 |
+
)
|
| 831 |
+
|
| 832 |
+
self.kv_a_proj_with_mqa = nn.Linear(
|
| 833 |
+
self.hidden_size,
|
| 834 |
+
config.kv_lora_rank + config.qk_rope_head_dim,
|
| 835 |
+
bias=config.attention_bias,
|
| 836 |
+
)
|
| 837 |
+
self.kv_a_layernorm = DeepseekV2RMSNorm(config.kv_lora_rank)
|
| 838 |
+
self.kv_b_proj = nn.Linear(
|
| 839 |
+
config.kv_lora_rank,
|
| 840 |
+
self.num_heads
|
| 841 |
+
* (self.q_head_dim - self.qk_rope_head_dim + self.v_head_dim),
|
| 842 |
+
bias=False,
|
| 843 |
+
)
|
| 844 |
+
|
| 845 |
+
self.o_proj = nn.Linear(
|
| 846 |
+
self.num_heads * self.v_head_dim,
|
| 847 |
+
self.hidden_size,
|
| 848 |
+
bias=config.attention_bias,
|
| 849 |
+
)
|
| 850 |
+
self._init_rope()
|
| 851 |
+
|
| 852 |
+
self.softmax_scale = self.q_head_dim ** (-0.5)
|
| 853 |
+
if self.config.rope_scaling is not None:
|
| 854 |
+
mscale_all_dim = self.config.rope_scaling.get("mscale_all_dim", 0)
|
| 855 |
+
scaling_factor = self.config.rope_scaling["factor"]
|
| 856 |
+
if mscale_all_dim:
|
| 857 |
+
mscale = yarn_get_mscale(scaling_factor, mscale_all_dim)
|
| 858 |
+
self.softmax_scale = self.softmax_scale * mscale * mscale
|
| 859 |
+
|
| 860 |
+
def _init_rope(self):
|
| 861 |
+
if self.config.rope_scaling is None:
|
| 862 |
+
self.rotary_emb = DeepseekV2RotaryEmbedding(
|
| 863 |
+
self.qk_rope_head_dim,
|
| 864 |
+
max_position_embeddings=self.max_position_embeddings,
|
| 865 |
+
base=self.rope_theta,
|
| 866 |
+
)
|
| 867 |
+
else:
|
| 868 |
+
scaling_type = self.config.rope_scaling["type"]
|
| 869 |
+
scaling_factor = self.config.rope_scaling["factor"]
|
| 870 |
+
if scaling_type == "linear":
|
| 871 |
+
self.rotary_emb = DeepseekV2LinearScalingRotaryEmbedding(
|
| 872 |
+
self.qk_rope_head_dim,
|
| 873 |
+
max_position_embeddings=self.max_position_embeddings,
|
| 874 |
+
scaling_factor=scaling_factor,
|
| 875 |
+
base=self.rope_theta,
|
| 876 |
+
)
|
| 877 |
+
elif scaling_type == "dynamic":
|
| 878 |
+
self.rotary_emb = DeepseekV2DynamicNTKScalingRotaryEmbedding(
|
| 879 |
+
self.qk_rope_head_dim,
|
| 880 |
+
max_position_embeddings=self.max_position_embeddings,
|
| 881 |
+
scaling_factor=scaling_factor,
|
| 882 |
+
base=self.rope_theta,
|
| 883 |
+
)
|
| 884 |
+
elif scaling_type == "yarn":
|
| 885 |
+
kwargs = {
|
| 886 |
+
key: self.config.rope_scaling[key]
|
| 887 |
+
for key in [
|
| 888 |
+
"original_max_position_embeddings",
|
| 889 |
+
"beta_fast",
|
| 890 |
+
"beta_slow",
|
| 891 |
+
"mscale",
|
| 892 |
+
"mscale_all_dim",
|
| 893 |
+
]
|
| 894 |
+
if key in self.config.rope_scaling
|
| 895 |
+
}
|
| 896 |
+
self.rotary_emb = DeepseekV2YarnRotaryEmbedding(
|
| 897 |
+
self.qk_rope_head_dim,
|
| 898 |
+
max_position_embeddings=self.max_position_embeddings,
|
| 899 |
+
scaling_factor=scaling_factor,
|
| 900 |
+
base=self.rope_theta,
|
| 901 |
+
**kwargs,
|
| 902 |
+
)
|
| 903 |
+
else:
|
| 904 |
+
raise ValueError(f"Unknown RoPE scaling type {scaling_type}")
|
| 905 |
+
|
| 906 |
+
def _shape(self, tensor: torch.Tensor, seq_len: int, bsz: int):
|
| 907 |
+
return (
|
| 908 |
+
tensor.view(bsz, seq_len, self.num_heads, self.v_head_dim)
|
| 909 |
+
.transpose(1, 2)
|
| 910 |
+
.contiguous()
|
| 911 |
+
)
|
| 912 |
+
|
| 913 |
+
def forward(
|
| 914 |
+
self,
|
| 915 |
+
hidden_states: torch.Tensor,
|
| 916 |
+
attention_mask: Optional[torch.Tensor] = None,
|
| 917 |
+
position_ids: Optional[torch.LongTensor] = None,
|
| 918 |
+
past_key_value: Optional[Cache] = None,
|
| 919 |
+
output_attentions: bool = False,
|
| 920 |
+
use_cache: bool = False,
|
| 921 |
+
**kwargs,
|
| 922 |
+
) -> Tuple[torch.Tensor, Optional[torch.Tensor], Optional[Tuple[torch.Tensor]]]:
|
| 923 |
+
if "padding_mask" in kwargs:
|
| 924 |
+
warnings.warn(
|
| 925 |
+
"Passing `padding_mask` is deprecated and will be removed in v4.37. Please make sure use `attention_mask` instead.`"
|
| 926 |
+
)
|
| 927 |
+
bsz, q_len, _ = hidden_states.size()
|
| 928 |
+
|
| 929 |
+
if self.q_lora_rank is None:
|
| 930 |
+
q = self.q_proj(hidden_states)
|
| 931 |
+
else:
|
| 932 |
+
q = self.q_b_proj(self.q_a_layernorm(self.q_a_proj(hidden_states)))
|
| 933 |
+
q = q.view(bsz, q_len, self.num_heads, self.q_head_dim).transpose(1, 2)
|
| 934 |
+
q_nope, q_pe = torch.split(
|
| 935 |
+
q, [self.qk_nope_head_dim, self.qk_rope_head_dim], dim=-1
|
| 936 |
+
)
|
| 937 |
+
|
| 938 |
+
compressed_kv = self.kv_a_proj_with_mqa(hidden_states)
|
| 939 |
+
compressed_kv, k_pe = torch.split(
|
| 940 |
+
compressed_kv, [self.kv_lora_rank, self.qk_rope_head_dim], dim=-1
|
| 941 |
+
)
|
| 942 |
+
k_pe = k_pe.view(bsz, q_len, 1, self.qk_rope_head_dim).transpose(1, 2)
|
| 943 |
+
kv = (
|
| 944 |
+
self.kv_b_proj(self.kv_a_layernorm(compressed_kv))
|
| 945 |
+
.view(bsz, q_len, self.num_heads, self.qk_nope_head_dim + self.v_head_dim)
|
| 946 |
+
.transpose(1, 2)
|
| 947 |
+
)
|
| 948 |
+
|
| 949 |
+
k_nope, value_states = torch.split(
|
| 950 |
+
kv, [self.qk_nope_head_dim, self.v_head_dim], dim=-1
|
| 951 |
+
)
|
| 952 |
+
kv_seq_len = value_states.shape[-2]
|
| 953 |
+
if past_key_value is not None:
|
| 954 |
+
if self.layer_idx is None:
|
| 955 |
+
raise ValueError(
|
| 956 |
+
f"The cache structure has changed since version v4.36. If you are using {self.__class__.__name__} "
|
| 957 |
+
"for auto-regressive decoding with k/v caching, please make sure to initialize the attention class "
|
| 958 |
+
"with a layer index."
|
| 959 |
+
)
|
| 960 |
+
kv_seq_len += past_key_value.get_usable_length(kv_seq_len, self.layer_idx)
|
| 961 |
+
cos, sin = self.rotary_emb(value_states, seq_len=kv_seq_len)
|
| 962 |
+
|
| 963 |
+
q_pe, k_pe = apply_rotary_pos_emb(q_pe, k_pe, cos, sin, position_ids)
|
| 964 |
+
|
| 965 |
+
query_states = k_pe.new_empty(bsz, self.num_heads, q_len, self.q_head_dim)
|
| 966 |
+
query_states[:, :, :, : self.qk_nope_head_dim] = q_nope
|
| 967 |
+
query_states[:, :, :, self.qk_nope_head_dim :] = q_pe
|
| 968 |
+
|
| 969 |
+
key_states = k_pe.new_empty(bsz, self.num_heads, q_len, self.q_head_dim)
|
| 970 |
+
key_states[:, :, :, : self.qk_nope_head_dim] = k_nope
|
| 971 |
+
key_states[:, :, :, self.qk_nope_head_dim :] = k_pe
|
| 972 |
+
if past_key_value is not None:
|
| 973 |
+
cache_kwargs = {"sin": sin, "cos": cos} # Specific to RoPE models
|
| 974 |
+
key_states, value_states = past_key_value.update(
|
| 975 |
+
key_states, value_states, self.layer_idx, cache_kwargs
|
| 976 |
+
)
|
| 977 |
+
|
| 978 |
+
attn_weights = (
|
| 979 |
+
torch.matmul(query_states, key_states.transpose(2, 3)) * self.softmax_scale
|
| 980 |
+
)
|
| 981 |
+
|
| 982 |
+
if attn_weights.size() != (bsz, self.num_heads, q_len, kv_seq_len):
|
| 983 |
+
raise ValueError(
|
| 984 |
+
f"Attention weights should be of size {(bsz, self.num_heads, q_len, kv_seq_len)}, but is"
|
| 985 |
+
f" {attn_weights.size()}"
|
| 986 |
+
)
|
| 987 |
+
assert attention_mask is not None
|
| 988 |
+
if attention_mask is not None:
|
| 989 |
+
if attention_mask.size() != (bsz, 1, q_len, kv_seq_len):
|
| 990 |
+
raise ValueError(
|
| 991 |
+
f"Attention mask should be of size {(bsz, 1, q_len, kv_seq_len)}, but is {attention_mask.size()}"
|
| 992 |
+
)
|
| 993 |
+
attn_weights = attn_weights + attention_mask
|
| 994 |
+
|
| 995 |
+
# upcast attention to fp32
|
| 996 |
+
attn_weights = nn.functional.softmax(
|
| 997 |
+
attn_weights, dim=-1, dtype=torch.float32
|
| 998 |
+
).to(query_states.dtype)
|
| 999 |
+
attn_weights = nn.functional.dropout(
|
| 1000 |
+
attn_weights, p=self.attention_dropout, training=self.training
|
| 1001 |
+
)
|
| 1002 |
+
attn_output = torch.matmul(attn_weights, value_states)
|
| 1003 |
+
|
| 1004 |
+
if attn_output.size() != (bsz, self.num_heads, q_len, self.v_head_dim):
|
| 1005 |
+
raise ValueError(
|
| 1006 |
+
f"`attn_output` should be of size {(bsz, self.num_heads, q_len, self.v_head_dim)}, but is"
|
| 1007 |
+
f" {attn_output.size()}"
|
| 1008 |
+
)
|
| 1009 |
+
|
| 1010 |
+
attn_output = attn_output.transpose(1, 2).contiguous()
|
| 1011 |
+
|
| 1012 |
+
attn_output = attn_output.reshape(bsz, q_len, self.num_heads * self.v_head_dim)
|
| 1013 |
+
|
| 1014 |
+
attn_output = self.o_proj(attn_output)
|
| 1015 |
+
|
| 1016 |
+
if not output_attentions:
|
| 1017 |
+
attn_weights = None
|
| 1018 |
+
|
| 1019 |
+
return attn_output, attn_weights, past_key_value
|
| 1020 |
+
|
| 1021 |
+
|
| 1022 |
+
# Copied from transformers.models.llama.modeling_llama.LlamaFlashAttention2 with Llama->DeepseekV2
|
| 1023 |
+
class DeepseekV2FlashAttention2(DeepseekV2Attention):
|
| 1024 |
+
"""
|
| 1025 |
+
DeepseekV2 flash attention module. This module inherits from `DeepseekV2Attention` as the weights of the module stays
|
| 1026 |
+
untouched. The only required change would be on the forward pass where it needs to correctly call the public API of
|
| 1027 |
+
flash attention and deal with padding tokens in case the input contains any of them.
|
| 1028 |
+
"""
|
| 1029 |
+
|
| 1030 |
+
def __init__(self, *args, **kwargs):
|
| 1031 |
+
super().__init__(*args, **kwargs)
|
| 1032 |
+
|
| 1033 |
+
# TODO: Should be removed once Flash Attention for RoCm is bumped to 2.1.
|
| 1034 |
+
# flash_attn<2.1 generates top-left aligned causal mask, while what is needed here is bottom-right alignement, that was made default for flash_attn>=2.1. This attribute is used to handle this difference. Reference: https://github.com/Dao-AILab/flash-attention/releases/tag/v2.1.0.
|
| 1035 |
+
# Beware that with flash_attn<2.1, using q_seqlen != k_seqlen (except for the case q_seqlen == 1) produces a wrong mask (top-left).
|
| 1036 |
+
self._flash_attn_uses_top_left_mask = not is_flash_attn_greater_or_equal_2_10()
|
| 1037 |
+
|
| 1038 |
+
def forward(
|
| 1039 |
+
self,
|
| 1040 |
+
hidden_states: torch.Tensor,
|
| 1041 |
+
attention_mask: Optional[torch.LongTensor] = None,
|
| 1042 |
+
position_ids: Optional[torch.LongTensor] = None,
|
| 1043 |
+
past_key_value: Optional[Cache] = None,
|
| 1044 |
+
output_attentions: bool = False,
|
| 1045 |
+
use_cache: bool = False,
|
| 1046 |
+
**kwargs,
|
| 1047 |
+
) -> Tuple[torch.Tensor, Optional[torch.Tensor], Optional[Tuple[torch.Tensor]]]:
|
| 1048 |
+
# DeepseekV2FlashAttention2 attention does not support output_attentions
|
| 1049 |
+
if "padding_mask" in kwargs:
|
| 1050 |
+
warnings.warn(
|
| 1051 |
+
"Passing `padding_mask` is deprecated and will be removed in v4.37. Please make sure use `attention_mask` instead.`"
|
| 1052 |
+
)
|
| 1053 |
+
|
| 1054 |
+
# overwrite attention_mask with padding_mask
|
| 1055 |
+
attention_mask = kwargs.pop("padding_mask")
|
| 1056 |
+
|
| 1057 |
+
output_attentions = False
|
| 1058 |
+
|
| 1059 |
+
bsz, q_len, _ = hidden_states.size()
|
| 1060 |
+
|
| 1061 |
+
if self.q_lora_rank is None:
|
| 1062 |
+
q = self.q_proj(hidden_states)
|
| 1063 |
+
else:
|
| 1064 |
+
q = self.q_b_proj(self.q_a_layernorm(self.q_a_proj(hidden_states)))
|
| 1065 |
+
q = q.view(bsz, q_len, self.num_heads, self.q_head_dim).transpose(1, 2)
|
| 1066 |
+
q_nope, q_pe = torch.split(
|
| 1067 |
+
q, [self.qk_nope_head_dim, self.qk_rope_head_dim], dim=-1
|
| 1068 |
+
)
|
| 1069 |
+
|
| 1070 |
+
# Flash attention requires the input to have the shape
|
| 1071 |
+
# batch_size x seq_length x head_dim x hidden_dim
|
| 1072 |
+
# therefore we just need to keep the original shape
|
| 1073 |
+
compressed_kv = self.kv_a_proj_with_mqa(hidden_states)
|
| 1074 |
+
compressed_kv, k_pe = torch.split(
|
| 1075 |
+
compressed_kv, [self.kv_lora_rank, self.qk_rope_head_dim], dim=-1
|
| 1076 |
+
)
|
| 1077 |
+
k_pe = k_pe.view(bsz, q_len, 1, self.qk_rope_head_dim).transpose(1, 2)
|
| 1078 |
+
kv = (
|
| 1079 |
+
self.kv_b_proj(self.kv_a_layernorm(compressed_kv))
|
| 1080 |
+
.view(bsz, q_len, self.num_heads, self.qk_nope_head_dim + self.v_head_dim)
|
| 1081 |
+
.transpose(1, 2)
|
| 1082 |
+
)
|
| 1083 |
+
|
| 1084 |
+
k_nope, value_states = torch.split(
|
| 1085 |
+
kv, [self.qk_nope_head_dim, self.v_head_dim], dim=-1
|
| 1086 |
+
)
|
| 1087 |
+
kv_seq_len = value_states.shape[-2]
|
| 1088 |
+
|
| 1089 |
+
kv_seq_len = value_states.shape[-2]
|
| 1090 |
+
if past_key_value is not None:
|
| 1091 |
+
kv_seq_len += past_key_value.get_usable_length(kv_seq_len, self.layer_idx)
|
| 1092 |
+
|
| 1093 |
+
cos, sin = self.rotary_emb(value_states, seq_len=kv_seq_len)
|
| 1094 |
+
q_pe, k_pe = apply_rotary_pos_emb(q_pe, k_pe, cos, sin, position_ids)
|
| 1095 |
+
|
| 1096 |
+
query_states = k_pe.new_empty(bsz, self.num_heads, q_len, self.q_head_dim)
|
| 1097 |
+
query_states[:, :, :, : self.qk_nope_head_dim] = q_nope
|
| 1098 |
+
query_states[:, :, :, self.qk_nope_head_dim :] = q_pe
|
| 1099 |
+
|
| 1100 |
+
key_states = k_pe.new_empty(bsz, self.num_heads, q_len, self.q_head_dim)
|
| 1101 |
+
key_states[:, :, :, : self.qk_nope_head_dim] = k_nope
|
| 1102 |
+
key_states[:, :, :, self.qk_nope_head_dim :] = k_pe
|
| 1103 |
+
|
| 1104 |
+
if self.q_head_dim != self.v_head_dim:
|
| 1105 |
+
value_states = F.pad(value_states, [0, self.q_head_dim - self.v_head_dim])
|
| 1106 |
+
|
| 1107 |
+
if past_key_value is not None:
|
| 1108 |
+
cache_kwargs = {"sin": sin, "cos": cos} # Specific to RoPE models
|
| 1109 |
+
key_states, value_states = past_key_value.update(
|
| 1110 |
+
key_states, value_states, self.layer_idx, cache_kwargs
|
| 1111 |
+
)
|
| 1112 |
+
|
| 1113 |
+
# TODO: These transpose are quite inefficient but Flash Attention requires the layout [batch_size, sequence_length, num_heads, head_dim]. We would need to refactor the KV cache
|
| 1114 |
+
# to be able to avoid many of these transpose/reshape/view.
|
| 1115 |
+
query_states = query_states.transpose(1, 2)
|
| 1116 |
+
key_states = key_states.transpose(1, 2)
|
| 1117 |
+
value_states = value_states.transpose(1, 2)
|
| 1118 |
+
|
| 1119 |
+
dropout_rate = self.attention_dropout if self.training else 0.0
|
| 1120 |
+
|
| 1121 |
+
# In PEFT, usually we cast the layer norms in float32 for training stability reasons
|
| 1122 |
+
# therefore the input hidden states gets silently casted in float32. Hence, we need
|
| 1123 |
+
# cast them back in the correct dtype just to be sure everything works as expected.
|
| 1124 |
+
# This might slowdown training & inference so it is recommended to not cast the LayerNorms
|
| 1125 |
+
# in fp32. (DeepseekV2RMSNorm handles it correctly)
|
| 1126 |
+
|
| 1127 |
+
input_dtype = query_states.dtype
|
| 1128 |
+
if input_dtype == torch.float32:
|
| 1129 |
+
# Handle the case where the model is quantized
|
| 1130 |
+
if hasattr(self.config, "_pre_quantization_dtype"):
|
| 1131 |
+
target_dtype = self.config._pre_quantization_dtype
|
| 1132 |
+
elif torch.is_autocast_enabled():
|
| 1133 |
+
target_dtype = torch.get_autocast_gpu_dtype()
|
| 1134 |
+
else:
|
| 1135 |
+
target_dtype = (
|
| 1136 |
+
self.q_proj.weight.dtype
|
| 1137 |
+
if self.q_lora_rank is None
|
| 1138 |
+
else self.q_a_proj.weight.dtype
|
| 1139 |
+
)
|
| 1140 |
+
|
| 1141 |
+
logger.warning_once(
|
| 1142 |
+
f"The input hidden states seems to be silently casted in float32, this might be related to"
|
| 1143 |
+
f" the fact you have upcasted embedding or layer norm layers in float32. We will cast back the input in"
|
| 1144 |
+
f" {target_dtype}."
|
| 1145 |
+
)
|
| 1146 |
+
|
| 1147 |
+
query_states = query_states.to(target_dtype)
|
| 1148 |
+
key_states = key_states.to(target_dtype)
|
| 1149 |
+
value_states = value_states.to(target_dtype)
|
| 1150 |
+
|
| 1151 |
+
attn_output = self._flash_attention_forward(
|
| 1152 |
+
query_states,
|
| 1153 |
+
key_states,
|
| 1154 |
+
value_states,
|
| 1155 |
+
attention_mask,
|
| 1156 |
+
q_len,
|
| 1157 |
+
dropout=dropout_rate,
|
| 1158 |
+
softmax_scale=self.softmax_scale,
|
| 1159 |
+
)
|
| 1160 |
+
if self.q_head_dim != self.v_head_dim:
|
| 1161 |
+
attn_output = attn_output[:, :, :, : self.v_head_dim]
|
| 1162 |
+
|
| 1163 |
+
attn_output = attn_output.reshape(
|
| 1164 |
+
bsz, q_len, self.num_heads * self.v_head_dim
|
| 1165 |
+
).contiguous()
|
| 1166 |
+
attn_output = self.o_proj(attn_output)
|
| 1167 |
+
|
| 1168 |
+
if not output_attentions:
|
| 1169 |
+
attn_weights = None
|
| 1170 |
+
|
| 1171 |
+
return attn_output, attn_weights, past_key_value
|
| 1172 |
+
|
| 1173 |
+
def _flash_attention_forward(
|
| 1174 |
+
self,
|
| 1175 |
+
query_states,
|
| 1176 |
+
key_states,
|
| 1177 |
+
value_states,
|
| 1178 |
+
attention_mask,
|
| 1179 |
+
query_length,
|
| 1180 |
+
dropout=0.0,
|
| 1181 |
+
softmax_scale=None,
|
| 1182 |
+
):
|
| 1183 |
+
"""
|
| 1184 |
+
Calls the forward method of Flash Attention - if the input hidden states contain at least one padding token
|
| 1185 |
+
first unpad the input, then computes the attention scores and pad the final attention scores.
|
| 1186 |
+
|
| 1187 |
+
Args:
|
| 1188 |
+
query_states (`torch.Tensor`):
|
| 1189 |
+
Input query states to be passed to Flash Attention API
|
| 1190 |
+
key_states (`torch.Tensor`):
|
| 1191 |
+
Input key states to be passed to Flash Attention API
|
| 1192 |
+
value_states (`torch.Tensor`):
|
| 1193 |
+
Input value states to be passed to Flash Attention API
|
| 1194 |
+
attention_mask (`torch.Tensor`):
|
| 1195 |
+
The padding mask - corresponds to a tensor of size `(batch_size, seq_len)` where 0 stands for the
|
| 1196 |
+
position of padding tokens and 1 for the position of non-padding tokens.
|
| 1197 |
+
dropout (`int`, *optional*):
|
| 1198 |
+
Attention dropout
|
| 1199 |
+
softmax_scale (`float`, *optional*):
|
| 1200 |
+
The scaling of QK^T before applying softmax. Default to 1 / sqrt(head_dim)
|
| 1201 |
+
"""
|
| 1202 |
+
if not self._flash_attn_uses_top_left_mask:
|
| 1203 |
+
causal = self.is_causal
|
| 1204 |
+
else:
|
| 1205 |
+
# TODO: Remove the `query_length != 1` check once Flash Attention for RoCm is bumped to 2.1. For details, please see the comment in DeepseekV2FlashAttention2 __init__.
|
| 1206 |
+
causal = self.is_causal and query_length != 1
|
| 1207 |
+
|
| 1208 |
+
# Contains at least one padding token in the sequence
|
| 1209 |
+
if attention_mask is not None:
|
| 1210 |
+
batch_size = query_states.shape[0]
|
| 1211 |
+
(
|
| 1212 |
+
query_states,
|
| 1213 |
+
key_states,
|
| 1214 |
+
value_states,
|
| 1215 |
+
indices_q,
|
| 1216 |
+
cu_seq_lens,
|
| 1217 |
+
max_seq_lens,
|
| 1218 |
+
) = self._upad_input(
|
| 1219 |
+
query_states, key_states, value_states, attention_mask, query_length
|
| 1220 |
+
)
|
| 1221 |
+
|
| 1222 |
+
cu_seqlens_q, cu_seqlens_k = cu_seq_lens
|
| 1223 |
+
max_seqlen_in_batch_q, max_seqlen_in_batch_k = max_seq_lens
|
| 1224 |
+
|
| 1225 |
+
attn_output_unpad = flash_attn_varlen_func(
|
| 1226 |
+
query_states,
|
| 1227 |
+
key_states,
|
| 1228 |
+
value_states,
|
| 1229 |
+
cu_seqlens_q=cu_seqlens_q,
|
| 1230 |
+
cu_seqlens_k=cu_seqlens_k,
|
| 1231 |
+
max_seqlen_q=max_seqlen_in_batch_q,
|
| 1232 |
+
max_seqlen_k=max_seqlen_in_batch_k,
|
| 1233 |
+
dropout_p=dropout,
|
| 1234 |
+
softmax_scale=softmax_scale,
|
| 1235 |
+
causal=causal,
|
| 1236 |
+
)
|
| 1237 |
+
|
| 1238 |
+
attn_output = pad_input(
|
| 1239 |
+
attn_output_unpad, indices_q, batch_size, query_length
|
| 1240 |
+
)
|
| 1241 |
+
else:
|
| 1242 |
+
attn_output = flash_attn_func(
|
| 1243 |
+
query_states,
|
| 1244 |
+
key_states,
|
| 1245 |
+
value_states,
|
| 1246 |
+
dropout,
|
| 1247 |
+
softmax_scale=softmax_scale,
|
| 1248 |
+
causal=causal,
|
| 1249 |
+
)
|
| 1250 |
+
|
| 1251 |
+
return attn_output
|
| 1252 |
+
|
| 1253 |
+
def _upad_input(
|
| 1254 |
+
self, query_layer, key_layer, value_layer, attention_mask, query_length
|
| 1255 |
+
):
|
| 1256 |
+
indices_k, cu_seqlens_k, max_seqlen_in_batch_k = _get_unpad_data(attention_mask)
|
| 1257 |
+
batch_size, kv_seq_len, num_key_value_heads, head_dim = key_layer.shape
|
| 1258 |
+
|
| 1259 |
+
key_layer = index_first_axis(
|
| 1260 |
+
key_layer.reshape(batch_size * kv_seq_len, num_key_value_heads, head_dim),
|
| 1261 |
+
indices_k,
|
| 1262 |
+
)
|
| 1263 |
+
value_layer = index_first_axis(
|
| 1264 |
+
value_layer.reshape(batch_size * kv_seq_len, num_key_value_heads, head_dim),
|
| 1265 |
+
indices_k,
|
| 1266 |
+
)
|
| 1267 |
+
if query_length == kv_seq_len:
|
| 1268 |
+
query_layer = index_first_axis(
|
| 1269 |
+
query_layer.reshape(batch_size * kv_seq_len, self.num_heads, head_dim),
|
| 1270 |
+
indices_k,
|
| 1271 |
+
)
|
| 1272 |
+
cu_seqlens_q = cu_seqlens_k
|
| 1273 |
+
max_seqlen_in_batch_q = max_seqlen_in_batch_k
|
| 1274 |
+
indices_q = indices_k
|
| 1275 |
+
elif query_length == 1:
|
| 1276 |
+
max_seqlen_in_batch_q = 1
|
| 1277 |
+
cu_seqlens_q = torch.arange(
|
| 1278 |
+
batch_size + 1, dtype=torch.int32, device=query_layer.device
|
| 1279 |
+
) # There is a memcpy here, that is very bad.
|
| 1280 |
+
indices_q = cu_seqlens_q[:-1]
|
| 1281 |
+
query_layer = query_layer.squeeze(1)
|
| 1282 |
+
else:
|
| 1283 |
+
# The -q_len: slice assumes left padding.
|
| 1284 |
+
attention_mask = attention_mask[:, -query_length:]
|
| 1285 |
+
query_layer, indices_q, cu_seqlens_q, max_seqlen_in_batch_q = unpad_input(
|
| 1286 |
+
query_layer, attention_mask
|
| 1287 |
+
)
|
| 1288 |
+
|
| 1289 |
+
return (
|
| 1290 |
+
query_layer,
|
| 1291 |
+
key_layer,
|
| 1292 |
+
value_layer,
|
| 1293 |
+
indices_q,
|
| 1294 |
+
(cu_seqlens_q, cu_seqlens_k),
|
| 1295 |
+
(max_seqlen_in_batch_q, max_seqlen_in_batch_k),
|
| 1296 |
+
)
|
| 1297 |
+
|
| 1298 |
+
|
| 1299 |
+
ATTENTION_CLASSES = {
|
| 1300 |
+
"eager": DeepseekV2Attention,
|
| 1301 |
+
"flash_attention_2": DeepseekV2FlashAttention2,
|
| 1302 |
+
}
|
| 1303 |
+
|
| 1304 |
+
|
| 1305 |
+
class DeepseekV2DecoderLayer(nn.Module):
|
| 1306 |
+
def __init__(self, config: DeepseekV2Config, layer_idx: int):
|
| 1307 |
+
super().__init__()
|
| 1308 |
+
self.hidden_size = config.hidden_size
|
| 1309 |
+
|
| 1310 |
+
self.self_attn = ATTENTION_CLASSES[config._attn_implementation](
|
| 1311 |
+
config=config, layer_idx=layer_idx
|
| 1312 |
+
)
|
| 1313 |
+
|
| 1314 |
+
self.mlp = (
|
| 1315 |
+
DeepseekV2MoE(config)
|
| 1316 |
+
if (
|
| 1317 |
+
config.n_routed_experts is not None
|
| 1318 |
+
and layer_idx >= config.first_k_dense_replace
|
| 1319 |
+
and layer_idx % config.moe_layer_freq == 0
|
| 1320 |
+
)
|
| 1321 |
+
else DeepseekV2MLP(config)
|
| 1322 |
+
)
|
| 1323 |
+
self.input_layernorm = DeepseekV2RMSNorm(
|
| 1324 |
+
config.hidden_size, eps=config.rms_norm_eps
|
| 1325 |
+
)
|
| 1326 |
+
self.post_attention_layernorm = DeepseekV2RMSNorm(
|
| 1327 |
+
config.hidden_size, eps=config.rms_norm_eps
|
| 1328 |
+
)
|
| 1329 |
+
|
| 1330 |
+
def forward(
|
| 1331 |
+
self,
|
| 1332 |
+
hidden_states: torch.Tensor,
|
| 1333 |
+
attention_mask: Optional[torch.Tensor] = None,
|
| 1334 |
+
position_ids: Optional[torch.LongTensor] = None,
|
| 1335 |
+
past_key_value: Optional[Tuple[torch.Tensor]] = None,
|
| 1336 |
+
output_attentions: Optional[bool] = False,
|
| 1337 |
+
use_cache: Optional[bool] = False,
|
| 1338 |
+
**kwargs,
|
| 1339 |
+
) -> Tuple[
|
| 1340 |
+
torch.FloatTensor, Optional[Tuple[torch.FloatTensor, torch.FloatTensor]]
|
| 1341 |
+
]:
|
| 1342 |
+
"""
|
| 1343 |
+
Args:
|
| 1344 |
+
hidden_states (`torch.FloatTensor`): input to the layer of shape `(batch, seq_len, embed_dim)`
|
| 1345 |
+
attention_mask (`torch.FloatTensor`, *optional*):
|
| 1346 |
+
attention mask of size `(batch_size, sequence_length)` if flash attention is used or `(batch_size, 1,
|
| 1347 |
+
query_sequence_length, key_sequence_length)` if default attention is used.
|
| 1348 |
+
output_attentions (`bool`, *optional*):
|
| 1349 |
+
Whether or not to return the attentions tensors of all attention layers. See `attentions` under
|
| 1350 |
+
returned tensors for more detail.
|
| 1351 |
+
use_cache (`bool`, *optional*):
|
| 1352 |
+
If set to `True`, `past_key_values` key value states are returned and can be used to speed up decoding
|
| 1353 |
+
(see `past_key_values`).
|
| 1354 |
+
past_key_value (`Tuple(torch.FloatTensor)`, *optional*): cached past key and value projection states
|
| 1355 |
+
"""
|
| 1356 |
+
if "padding_mask" in kwargs:
|
| 1357 |
+
warnings.warn(
|
| 1358 |
+
"Passing `padding_mask` is deprecated and will be removed in v4.37. Please make sure use `attention_mask` instead.`"
|
| 1359 |
+
)
|
| 1360 |
+
residual = hidden_states
|
| 1361 |
+
|
| 1362 |
+
hidden_states = self.input_layernorm(hidden_states)
|
| 1363 |
+
|
| 1364 |
+
# Self Attention
|
| 1365 |
+
hidden_states, self_attn_weights, present_key_value = self.self_attn(
|
| 1366 |
+
hidden_states=hidden_states,
|
| 1367 |
+
attention_mask=attention_mask,
|
| 1368 |
+
position_ids=position_ids,
|
| 1369 |
+
past_key_value=past_key_value,
|
| 1370 |
+
output_attentions=output_attentions,
|
| 1371 |
+
use_cache=use_cache,
|
| 1372 |
+
**kwargs,
|
| 1373 |
+
)
|
| 1374 |
+
hidden_states = residual + hidden_states
|
| 1375 |
+
|
| 1376 |
+
# Fully Connected
|
| 1377 |
+
residual = hidden_states
|
| 1378 |
+
hidden_states = self.post_attention_layernorm(hidden_states)
|
| 1379 |
+
hidden_states = self.mlp(hidden_states)
|
| 1380 |
+
hidden_states = residual + hidden_states
|
| 1381 |
+
|
| 1382 |
+
outputs = (hidden_states,)
|
| 1383 |
+
|
| 1384 |
+
if output_attentions:
|
| 1385 |
+
outputs += (self_attn_weights,)
|
| 1386 |
+
|
| 1387 |
+
if use_cache:
|
| 1388 |
+
outputs += (present_key_value,)
|
| 1389 |
+
|
| 1390 |
+
return outputs
|
| 1391 |
+
|
| 1392 |
+
|
| 1393 |
+
DeepseekV2_START_DOCSTRING = r"""
|
| 1394 |
+
This model inherits from [`PreTrainedModel`]. Check the superclass documentation for the generic methods the
|
| 1395 |
+
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
|
| 1396 |
+
etc.)
|
| 1397 |
+
|
| 1398 |
+
This model is also a PyTorch [torch.nn.Module](https://pytorch.org/docs/stable/nn.html#torch.nn.Module) subclass.
|
| 1399 |
+
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
|
| 1400 |
+
and behavior.
|
| 1401 |
+
|
| 1402 |
+
Parameters:
|
| 1403 |
+
config ([`DeepseekV2Config`]):
|
| 1404 |
+
Model configuration class with all the parameters of the model. Initializing with a config file does not
|
| 1405 |
+
load the weights associated with the model, only the configuration. Check out the
|
| 1406 |
+
[`~PreTrainedModel.from_pretrained`] method to load the model weights.
|
| 1407 |
+
"""
|
| 1408 |
+
|
| 1409 |
+
|
| 1410 |
+
@add_start_docstrings(
|
| 1411 |
+
"The bare DeepseekV2 Model outputting raw hidden-states without any specific head on top.",
|
| 1412 |
+
DeepseekV2_START_DOCSTRING,
|
| 1413 |
+
)
|
| 1414 |
+
class DeepseekV2PreTrainedModel(PreTrainedModel):
|
| 1415 |
+
config_class = DeepseekV2Config
|
| 1416 |
+
base_model_prefix = "model"
|
| 1417 |
+
supports_gradient_checkpointing = True
|
| 1418 |
+
_no_split_modules = ["DeepseekV2DecoderLayer"]
|
| 1419 |
+
_skip_keys_device_placement = "past_key_values"
|
| 1420 |
+
_supports_flash_attn_2 = True
|
| 1421 |
+
_supports_cache_class = True
|
| 1422 |
+
|
| 1423 |
+
def _init_weights(self, module):
|
| 1424 |
+
std = self.config.initializer_range
|
| 1425 |
+
if isinstance(module, nn.Linear):
|
| 1426 |
+
module.weight.data.normal_(mean=0.0, std=std)
|
| 1427 |
+
if module.bias is not None:
|
| 1428 |
+
module.bias.data.zero_()
|
| 1429 |
+
elif isinstance(module, nn.Embedding):
|
| 1430 |
+
module.weight.data.normal_(mean=0.0, std=std)
|
| 1431 |
+
if module.padding_idx is not None:
|
| 1432 |
+
module.weight.data[module.padding_idx].zero_()
|
| 1433 |
+
|
| 1434 |
+
|
| 1435 |
+
DeepseekV2_INPUTS_DOCSTRING = r"""
|
| 1436 |
+
Args:
|
| 1437 |
+
input_ids (`torch.LongTensor` of shape `(batch_size, sequence_length)`):
|
| 1438 |
+
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
|
| 1439 |
+
it.
|
| 1440 |
+
|
| 1441 |
+
Indices can be obtained using [`AutoTokenizer`]. See [`PreTrainedTokenizer.encode`] and
|
| 1442 |
+
[`PreTrainedTokenizer.__call__`] for details.
|
| 1443 |
+
|
| 1444 |
+
[What are input IDs?](../glossary#input-ids)
|
| 1445 |
+
attention_mask (`torch.Tensor` of shape `(batch_size, sequence_length)`, *optional*):
|
| 1446 |
+
Mask to avoid performing attention on padding token indices. Mask values selected in `[0, 1]`:
|
| 1447 |
+
|
| 1448 |
+
- 1 for tokens that are **not masked**,
|
| 1449 |
+
- 0 for tokens that are **masked**.
|
| 1450 |
+
|
| 1451 |
+
[What are attention masks?](../glossary#attention-mask)
|
| 1452 |
+
|
| 1453 |
+
Indices can be obtained using [`AutoTokenizer`]. See [`PreTrainedTokenizer.encode`] and
|
| 1454 |
+
[`PreTrainedTokenizer.__call__`] for details.
|
| 1455 |
+
|
| 1456 |
+
If `past_key_values` is used, optionally only the last `input_ids` have to be input (see
|
| 1457 |
+
`past_key_values`).
|
| 1458 |
+
|
| 1459 |
+
If you want to change padding behavior, you should read [`modeling_opt._prepare_decoder_attention_mask`]
|
| 1460 |
+
and modify to your needs. See diagram 1 in [the paper](https://arxiv.org/abs/1910.13461) for more
|
| 1461 |
+
information on the default strategy.
|
| 1462 |
+
|
| 1463 |
+
- 1 indicates the head is **not masked**,
|
| 1464 |
+
- 0 indicates the head is **masked**.
|
| 1465 |
+
position_ids (`torch.LongTensor` of shape `(batch_size, sequence_length)`, *optional*):
|
| 1466 |
+
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range `[0,
|
| 1467 |
+
config.n_positions - 1]`.
|
| 1468 |
+
|
| 1469 |
+
[What are position IDs?](../glossary#position-ids)
|
| 1470 |
+
past_key_values (`Cache` or `tuple(tuple(torch.FloatTensor))`, *optional*):
|
| 1471 |
+
Pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
|
| 1472 |
+
blocks) that can be used to speed up sequential decoding. This typically consists in the `past_key_values`
|
| 1473 |
+
returned by the model at a previous stage of decoding, when `use_cache=True` or `config.use_cache=True`.
|
| 1474 |
+
|
| 1475 |
+
Two formats are allowed:
|
| 1476 |
+
- a [`~cache_utils.Cache`] instance;
|
| 1477 |
+
- Tuple of `tuple(torch.FloatTensor)` of length `config.n_layers`, with each tuple having 2 tensors of
|
| 1478 |
+
shape `(batch_size, num_heads, sequence_length, embed_size_per_head)`). This is also known as the legacy
|
| 1479 |
+
cache format.
|
| 1480 |
+
|
| 1481 |
+
The model will output the same cache format that is fed as input. If no `past_key_values` are passed, the
|
| 1482 |
+
legacy cache format will be returned.
|
| 1483 |
+
|
| 1484 |
+
If `past_key_values` are used, the user can optionally input only the last `input_ids` (those that don't
|
| 1485 |
+
have their past key value states given to this model) of shape `(batch_size, 1)` instead of all `input_ids`
|
| 1486 |
+
of shape `(batch_size, sequence_length)`.
|
| 1487 |
+
inputs_embeds (`torch.FloatTensor` of shape `(batch_size, sequence_length, hidden_size)`, *optional*):
|
| 1488 |
+
Optionally, instead of passing `input_ids` you can choose to directly pass an embedded representation. This
|
| 1489 |
+
is useful if you want more control over how to convert `input_ids` indices into associated vectors than the
|
| 1490 |
+
model's internal embedding lookup matrix.
|
| 1491 |
+
use_cache (`bool`, *optional*):
|
| 1492 |
+
If set to `True`, `past_key_values` key value states are returned and can be used to speed up decoding (see
|
| 1493 |
+
`past_key_values`).
|
| 1494 |
+
output_attentions (`bool`, *optional*):
|
| 1495 |
+
Whether or not to return the attentions tensors of all attention layers. See `attentions` under returned
|
| 1496 |
+
tensors for more detail.
|
| 1497 |
+
output_hidden_states (`bool`, *optional*):
|
| 1498 |
+
Whether or not to return the hidden states of all layers. See `hidden_states` under returned tensors for
|
| 1499 |
+
more detail.
|
| 1500 |
+
return_dict (`bool`, *optional*):
|
| 1501 |
+
Whether or not to return a [`~utils.ModelOutput`] instead of a plain tuple.
|
| 1502 |
+
"""
|
| 1503 |
+
|
| 1504 |
+
|
| 1505 |
+
@add_start_docstrings(
|
| 1506 |
+
"The bare DeepseekV2 Model outputting raw hidden-states without any specific head on top.",
|
| 1507 |
+
DeepseekV2_START_DOCSTRING,
|
| 1508 |
+
)
|
| 1509 |
+
class DeepseekV2Model(DeepseekV2PreTrainedModel):
|
| 1510 |
+
"""
|
| 1511 |
+
Transformer decoder consisting of *config.num_hidden_layers* layers. Each layer is a [`DeepseekV2DecoderLayer`]
|
| 1512 |
+
|
| 1513 |
+
Args:
|
| 1514 |
+
config: DeepseekV2Config
|
| 1515 |
+
"""
|
| 1516 |
+
|
| 1517 |
+
def __init__(self, config: DeepseekV2Config):
|
| 1518 |
+
super().__init__(config)
|
| 1519 |
+
print("DeepseekV2Model: using densemixer")
|
| 1520 |
+
self.padding_idx = config.pad_token_id
|
| 1521 |
+
self.vocab_size = config.vocab_size
|
| 1522 |
+
|
| 1523 |
+
self.embed_tokens = nn.Embedding(
|
| 1524 |
+
config.vocab_size, config.hidden_size, self.padding_idx
|
| 1525 |
+
)
|
| 1526 |
+
self.layers = nn.ModuleList(
|
| 1527 |
+
[
|
| 1528 |
+
DeepseekV2DecoderLayer(config, layer_idx)
|
| 1529 |
+
for layer_idx in range(config.num_hidden_layers)
|
| 1530 |
+
]
|
| 1531 |
+
)
|
| 1532 |
+
self._use_flash_attention_2 = config._attn_implementation == "flash_attention_2"
|
| 1533 |
+
self.norm = DeepseekV2RMSNorm(config.hidden_size, eps=config.rms_norm_eps)
|
| 1534 |
+
|
| 1535 |
+
self.gradient_checkpointing = False
|
| 1536 |
+
# Initialize weights and apply final processing
|
| 1537 |
+
self.post_init()
|
| 1538 |
+
|
| 1539 |
+
def get_input_embeddings(self):
|
| 1540 |
+
return self.embed_tokens
|
| 1541 |
+
|
| 1542 |
+
def set_input_embeddings(self, value):
|
| 1543 |
+
self.embed_tokens = value
|
| 1544 |
+
|
| 1545 |
+
@add_start_docstrings_to_model_forward(DeepseekV2_INPUTS_DOCSTRING)
|
| 1546 |
+
def forward(
|
| 1547 |
+
self,
|
| 1548 |
+
input_ids: torch.LongTensor = None,
|
| 1549 |
+
attention_mask: Optional[torch.Tensor] = None,
|
| 1550 |
+
position_ids: Optional[torch.LongTensor] = None,
|
| 1551 |
+
past_key_values: Optional[List[torch.FloatTensor]] = None,
|
| 1552 |
+
inputs_embeds: Optional[torch.FloatTensor] = None,
|
| 1553 |
+
use_cache: Optional[bool] = None,
|
| 1554 |
+
output_attentions: Optional[bool] = None,
|
| 1555 |
+
output_hidden_states: Optional[bool] = None,
|
| 1556 |
+
return_dict: Optional[bool] = None,
|
| 1557 |
+
) -> Union[Tuple, BaseModelOutputWithPast]:
|
| 1558 |
+
output_attentions = (
|
| 1559 |
+
output_attentions
|
| 1560 |
+
if output_attentions is not None
|
| 1561 |
+
else self.config.output_attentions
|
| 1562 |
+
)
|
| 1563 |
+
output_hidden_states = (
|
| 1564 |
+
output_hidden_states
|
| 1565 |
+
if output_hidden_states is not None
|
| 1566 |
+
else self.config.output_hidden_states
|
| 1567 |
+
)
|
| 1568 |
+
use_cache = use_cache if use_cache is not None else self.config.use_cache
|
| 1569 |
+
|
| 1570 |
+
return_dict = (
|
| 1571 |
+
return_dict if return_dict is not None else self.config.use_return_dict
|
| 1572 |
+
)
|
| 1573 |
+
|
| 1574 |
+
# retrieve input_ids and inputs_embeds
|
| 1575 |
+
if input_ids is not None and inputs_embeds is not None:
|
| 1576 |
+
raise ValueError(
|
| 1577 |
+
"You cannot specify both input_ids and inputs_embeds at the same time"
|
| 1578 |
+
)
|
| 1579 |
+
elif input_ids is not None:
|
| 1580 |
+
batch_size, seq_length = input_ids.shape[:2]
|
| 1581 |
+
elif inputs_embeds is not None:
|
| 1582 |
+
batch_size, seq_length = inputs_embeds.shape[:2]
|
| 1583 |
+
else:
|
| 1584 |
+
raise ValueError("You have to specify either input_ids or inputs_embeds")
|
| 1585 |
+
|
| 1586 |
+
if self.gradient_checkpointing and self.training:
|
| 1587 |
+
if use_cache:
|
| 1588 |
+
logger.warning_once(
|
| 1589 |
+
"`use_cache=True` is incompatible with gradient checkpointing. Setting `use_cache=False`transformers."
|
| 1590 |
+
)
|
| 1591 |
+
use_cache = False
|
| 1592 |
+
|
| 1593 |
+
past_key_values_length = 0
|
| 1594 |
+
if use_cache:
|
| 1595 |
+
use_legacy_cache = not isinstance(past_key_values, Cache)
|
| 1596 |
+
if use_legacy_cache:
|
| 1597 |
+
past_key_values = DynamicCache.from_legacy_cache(past_key_values)
|
| 1598 |
+
past_key_values_length = past_key_values.get_usable_length(seq_length)
|
| 1599 |
+
|
| 1600 |
+
if position_ids is None:
|
| 1601 |
+
device = input_ids.device if input_ids is not None else inputs_embeds.device
|
| 1602 |
+
position_ids = torch.arange(
|
| 1603 |
+
past_key_values_length,
|
| 1604 |
+
seq_length + past_key_values_length,
|
| 1605 |
+
dtype=torch.long,
|
| 1606 |
+
device=device,
|
| 1607 |
+
)
|
| 1608 |
+
position_ids = position_ids.unsqueeze(0)
|
| 1609 |
+
|
| 1610 |
+
if inputs_embeds is None:
|
| 1611 |
+
inputs_embeds = self.embed_tokens(input_ids)
|
| 1612 |
+
|
| 1613 |
+
if self._use_flash_attention_2:
|
| 1614 |
+
# 2d mask is passed through the layers
|
| 1615 |
+
attention_mask = (
|
| 1616 |
+
attention_mask
|
| 1617 |
+
if (attention_mask is not None and 0 in attention_mask)
|
| 1618 |
+
else None
|
| 1619 |
+
)
|
| 1620 |
+
else:
|
| 1621 |
+
# 4d mask is passed through the layers
|
| 1622 |
+
attention_mask = _prepare_4d_causal_attention_mask(
|
| 1623 |
+
attention_mask,
|
| 1624 |
+
(batch_size, seq_length),
|
| 1625 |
+
inputs_embeds,
|
| 1626 |
+
past_key_values_length,
|
| 1627 |
+
)
|
| 1628 |
+
|
| 1629 |
+
# embed positions
|
| 1630 |
+
hidden_states = inputs_embeds
|
| 1631 |
+
|
| 1632 |
+
# decoder layers
|
| 1633 |
+
all_hidden_states = () if output_hidden_states else None
|
| 1634 |
+
all_self_attns = () if output_attentions else None
|
| 1635 |
+
next_decoder_cache = None
|
| 1636 |
+
|
| 1637 |
+
for decoder_layer in self.layers:
|
| 1638 |
+
if output_hidden_states:
|
| 1639 |
+
all_hidden_states += (hidden_states,)
|
| 1640 |
+
|
| 1641 |
+
if self.gradient_checkpointing and self.training:
|
| 1642 |
+
layer_outputs = self._gradient_checkpointing_func(
|
| 1643 |
+
decoder_layer.__call__,
|
| 1644 |
+
hidden_states,
|
| 1645 |
+
attention_mask,
|
| 1646 |
+
position_ids,
|
| 1647 |
+
past_key_values,
|
| 1648 |
+
output_attentions,
|
| 1649 |
+
use_cache,
|
| 1650 |
+
)
|
| 1651 |
+
else:
|
| 1652 |
+
layer_outputs = decoder_layer(
|
| 1653 |
+
hidden_states,
|
| 1654 |
+
attention_mask=attention_mask,
|
| 1655 |
+
position_ids=position_ids,
|
| 1656 |
+
past_key_value=past_key_values,
|
| 1657 |
+
output_attentions=output_attentions,
|
| 1658 |
+
use_cache=use_cache,
|
| 1659 |
+
)
|
| 1660 |
+
|
| 1661 |
+
hidden_states = layer_outputs[0]
|
| 1662 |
+
|
| 1663 |
+
if use_cache:
|
| 1664 |
+
next_decoder_cache = layer_outputs[2 if output_attentions else 1]
|
| 1665 |
+
|
| 1666 |
+
if output_attentions:
|
| 1667 |
+
all_self_attns += (layer_outputs[1],)
|
| 1668 |
+
|
| 1669 |
+
hidden_states = self.norm(hidden_states)
|
| 1670 |
+
|
| 1671 |
+
# add hidden states from the last decoder layer
|
| 1672 |
+
if output_hidden_states:
|
| 1673 |
+
all_hidden_states += (hidden_states,)
|
| 1674 |
+
|
| 1675 |
+
next_cache = None
|
| 1676 |
+
if use_cache:
|
| 1677 |
+
next_cache = (
|
| 1678 |
+
next_decoder_cache.to_legacy_cache()
|
| 1679 |
+
if use_legacy_cache
|
| 1680 |
+
else next_decoder_cache
|
| 1681 |
+
)
|
| 1682 |
+
if not return_dict:
|
| 1683 |
+
return tuple(
|
| 1684 |
+
v
|
| 1685 |
+
for v in [hidden_states, next_cache, all_hidden_states, all_self_attns]
|
| 1686 |
+
if v is not None
|
| 1687 |
+
)
|
| 1688 |
+
return BaseModelOutputWithPast(
|
| 1689 |
+
last_hidden_state=hidden_states,
|
| 1690 |
+
past_key_values=next_cache,
|
| 1691 |
+
hidden_states=all_hidden_states,
|
| 1692 |
+
attentions=all_self_attns,
|
| 1693 |
+
)
|
| 1694 |
+
|
| 1695 |
+
|
| 1696 |
+
class DeepseekV2ForCausalLM(DeepseekV2PreTrainedModel):
|
| 1697 |
+
_tied_weights_keys = ["lm_head.weight"]
|
| 1698 |
+
|
| 1699 |
+
def __init__(self, config):
|
| 1700 |
+
super().__init__(config)
|
| 1701 |
+
self.model = DeepseekV2Model(config)
|
| 1702 |
+
self.vocab_size = config.vocab_size
|
| 1703 |
+
self.lm_head = nn.Linear(config.hidden_size, config.vocab_size, bias=False)
|
| 1704 |
+
|
| 1705 |
+
# Initialize weights and apply final processing
|
| 1706 |
+
self.post_init()
|
| 1707 |
+
|
| 1708 |
+
def get_input_embeddings(self):
|
| 1709 |
+
return self.model.embed_tokens
|
| 1710 |
+
|
| 1711 |
+
def set_input_embeddings(self, value):
|
| 1712 |
+
self.model.embed_tokens = value
|
| 1713 |
+
|
| 1714 |
+
def get_output_embeddings(self):
|
| 1715 |
+
return self.lm_head
|
| 1716 |
+
|
| 1717 |
+
def set_output_embeddings(self, new_embeddings):
|
| 1718 |
+
self.lm_head = new_embeddings
|
| 1719 |
+
|
| 1720 |
+
def set_decoder(self, decoder):
|
| 1721 |
+
self.model = decoder
|
| 1722 |
+
|
| 1723 |
+
def get_decoder(self):
|
| 1724 |
+
return self.model
|
| 1725 |
+
|
| 1726 |
+
@add_start_docstrings_to_model_forward(DeepseekV2_INPUTS_DOCSTRING)
|
| 1727 |
+
@replace_return_docstrings(
|
| 1728 |
+
output_type=CausalLMOutputWithPast, config_class=_CONFIG_FOR_DOC
|
| 1729 |
+
)
|
| 1730 |
+
def forward(
|
| 1731 |
+
self,
|
| 1732 |
+
input_ids: torch.LongTensor = None,
|
| 1733 |
+
attention_mask: Optional[torch.Tensor] = None,
|
| 1734 |
+
position_ids: Optional[torch.LongTensor] = None,
|
| 1735 |
+
past_key_values: Optional[List[torch.FloatTensor]] = None,
|
| 1736 |
+
inputs_embeds: Optional[torch.FloatTensor] = None,
|
| 1737 |
+
labels: Optional[torch.LongTensor] = None,
|
| 1738 |
+
use_cache: Optional[bool] = None,
|
| 1739 |
+
output_attentions: Optional[bool] = None,
|
| 1740 |
+
output_hidden_states: Optional[bool] = None,
|
| 1741 |
+
return_dict: Optional[bool] = None,
|
| 1742 |
+
) -> Union[Tuple, CausalLMOutputWithPast]:
|
| 1743 |
+
r"""
|
| 1744 |
+
Args:
|
| 1745 |
+
labels (`torch.LongTensor` of shape `(batch_size, sequence_length)`, *optional*):
|
| 1746 |
+
Labels for computing the masked language modeling loss. Indices should either be in `[0, transformers.,
|
| 1747 |
+
config.vocab_size]` or -100 (see `input_ids` docstring). Tokens with indices set to `-100` are ignored
|
| 1748 |
+
(masked), the loss is only computed for the tokens with labels in `[0, transformers., config.vocab_size]`.
|
| 1749 |
+
|
| 1750 |
+
Returns:
|
| 1751 |
+
|
| 1752 |
+
Example:
|
| 1753 |
+
|
| 1754 |
+
```python
|
| 1755 |
+
>>> from transformers import AutoTokenizer, DeepseekV2ForCausalLM
|
| 1756 |
+
|
| 1757 |
+
>>> model = DeepseekV2ForCausalLM.from_pretrained(PATH_TO_CONVERTED_WEIGHTS)
|
| 1758 |
+
>>> tokenizer = AutoTokenizer.from_pretrained(PATH_TO_CONVERTED_TOKENIZER)
|
| 1759 |
+
|
| 1760 |
+
>>> prompt = "Hey, are you conscious? Can you talk to me?"
|
| 1761 |
+
>>> inputs = tokenizer(prompt, return_tensors="pt")
|
| 1762 |
+
|
| 1763 |
+
>>> # Generate
|
| 1764 |
+
>>> generate_ids = model.generate(inputs.input_ids, max_length=30)
|
| 1765 |
+
>>> tokenizer.batch_decode(generate_ids, skip_special_tokens=True, clean_up_tokenization_spaces=False)[0]
|
| 1766 |
+
"Hey, are you conscious? Can you talk to me?\nI'm not conscious, but I can talk to you."
|
| 1767 |
+
```"""
|
| 1768 |
+
output_attentions = (
|
| 1769 |
+
output_attentions
|
| 1770 |
+
if output_attentions is not None
|
| 1771 |
+
else self.config.output_attentions
|
| 1772 |
+
)
|
| 1773 |
+
output_hidden_states = (
|
| 1774 |
+
output_hidden_states
|
| 1775 |
+
if output_hidden_states is not None
|
| 1776 |
+
else self.config.output_hidden_states
|
| 1777 |
+
)
|
| 1778 |
+
return_dict = (
|
| 1779 |
+
return_dict if return_dict is not None else self.config.use_return_dict
|
| 1780 |
+
)
|
| 1781 |
+
|
| 1782 |
+
# decoder outputs consists of (dec_features, layer_state, dec_hidden, dec_attn)
|
| 1783 |
+
outputs = self.model(
|
| 1784 |
+
input_ids=input_ids,
|
| 1785 |
+
attention_mask=attention_mask,
|
| 1786 |
+
position_ids=position_ids,
|
| 1787 |
+
past_key_values=past_key_values,
|
| 1788 |
+
inputs_embeds=inputs_embeds,
|
| 1789 |
+
use_cache=use_cache,
|
| 1790 |
+
output_attentions=output_attentions,
|
| 1791 |
+
output_hidden_states=output_hidden_states,
|
| 1792 |
+
return_dict=return_dict,
|
| 1793 |
+
)
|
| 1794 |
+
|
| 1795 |
+
hidden_states = outputs[0]
|
| 1796 |
+
logits = self.lm_head(hidden_states)
|
| 1797 |
+
logits = logits.float()
|
| 1798 |
+
|
| 1799 |
+
loss = None
|
| 1800 |
+
if labels is not None:
|
| 1801 |
+
# Shift so that tokens < n predict n
|
| 1802 |
+
shift_logits = logits[..., :-1, :].contiguous()
|
| 1803 |
+
shift_labels = labels[..., 1:].contiguous()
|
| 1804 |
+
# Flatten the tokens
|
| 1805 |
+
loss_fct = CrossEntropyLoss()
|
| 1806 |
+
shift_logits = shift_logits.view(-1, self.config.vocab_size)
|
| 1807 |
+
shift_labels = shift_labels.view(-1)
|
| 1808 |
+
# Enable model parallelism
|
| 1809 |
+
shift_labels = shift_labels.to(shift_logits.device)
|
| 1810 |
+
loss = loss_fct(shift_logits, shift_labels)
|
| 1811 |
+
|
| 1812 |
+
if not return_dict:
|
| 1813 |
+
output = (logits,) + outputs[1:]
|
| 1814 |
+
return (loss,) + output if loss is not None else output
|
| 1815 |
+
|
| 1816 |
+
return CausalLMOutputWithPast(
|
| 1817 |
+
loss=loss,
|
| 1818 |
+
logits=logits,
|
| 1819 |
+
past_key_values=outputs.past_key_values,
|
| 1820 |
+
hidden_states=outputs.hidden_states,
|
| 1821 |
+
attentions=outputs.attentions,
|
| 1822 |
+
)
|
| 1823 |
+
|
| 1824 |
+
def prepare_inputs_for_generation(
|
| 1825 |
+
self,
|
| 1826 |
+
input_ids,
|
| 1827 |
+
past_key_values=None,
|
| 1828 |
+
attention_mask=None,
|
| 1829 |
+
inputs_embeds=None,
|
| 1830 |
+
**kwargs,
|
| 1831 |
+
):
|
| 1832 |
+
if past_key_values is not None:
|
| 1833 |
+
if isinstance(past_key_values, Cache):
|
| 1834 |
+
cache_length = past_key_values.get_seq_length()
|
| 1835 |
+
past_length = past_key_values.seen_tokens
|
| 1836 |
+
max_cache_length = past_key_values.get_max_length()
|
| 1837 |
+
else:
|
| 1838 |
+
cache_length = past_length = past_key_values[0][0].shape[2]
|
| 1839 |
+
max_cache_length = None
|
| 1840 |
+
|
| 1841 |
+
# Keep only the unprocessed tokens:
|
| 1842 |
+
# 1 - If the length of the attention_mask exceeds the length of input_ids, then we are in a setting where
|
| 1843 |
+
# some of the inputs are exclusivelly passed as part of the cache (e.g. when passing input_embeds as
|
| 1844 |
+
# input)
|
| 1845 |
+
if (
|
| 1846 |
+
attention_mask is not None
|
| 1847 |
+
and attention_mask.shape[1] > input_ids.shape[1]
|
| 1848 |
+
):
|
| 1849 |
+
input_ids = input_ids[:, -(attention_mask.shape[1] - past_length) :]
|
| 1850 |
+
# 2 - If the past_length is smaller than input_ids', then input_ids holds all input tokens. We can discard
|
| 1851 |
+
# input_ids based on the past_length.
|
| 1852 |
+
elif past_length < input_ids.shape[1]:
|
| 1853 |
+
input_ids = input_ids[:, past_length:]
|
| 1854 |
+
# 3 - Otherwise (past_length >= input_ids.shape[1]), let's assume input_ids only has unprocessed tokens.
|
| 1855 |
+
|
| 1856 |
+
# If we are about to go beyond the maximum cache length, we need to crop the input attention mask.
|
| 1857 |
+
if (
|
| 1858 |
+
max_cache_length is not None
|
| 1859 |
+
and attention_mask is not None
|
| 1860 |
+
and cache_length + input_ids.shape[1] > max_cache_length
|
| 1861 |
+
):
|
| 1862 |
+
attention_mask = attention_mask[:, -max_cache_length:]
|
| 1863 |
+
|
| 1864 |
+
position_ids = kwargs.get("position_ids", None)
|
| 1865 |
+
if attention_mask is not None and position_ids is None:
|
| 1866 |
+
# create position_ids on the fly for batch generation
|
| 1867 |
+
position_ids = attention_mask.long().cumsum(-1) - 1
|
| 1868 |
+
position_ids.masked_fill_(attention_mask == 0, 1)
|
| 1869 |
+
if past_key_values:
|
| 1870 |
+
position_ids = position_ids[:, -input_ids.shape[1] :]
|
| 1871 |
+
|
| 1872 |
+
# if `inputs_embeds` are passed, we only want to use them in the 1st generation step
|
| 1873 |
+
if inputs_embeds is not None and past_key_values is None:
|
| 1874 |
+
model_inputs = {"inputs_embeds": inputs_embeds}
|
| 1875 |
+
else:
|
| 1876 |
+
model_inputs = {"input_ids": input_ids}
|
| 1877 |
+
|
| 1878 |
+
model_inputs.update(
|
| 1879 |
+
{
|
| 1880 |
+
"position_ids": position_ids,
|
| 1881 |
+
"past_key_values": past_key_values,
|
| 1882 |
+
"use_cache": kwargs.get("use_cache"),
|
| 1883 |
+
"attention_mask": attention_mask,
|
| 1884 |
+
}
|
| 1885 |
+
)
|
| 1886 |
+
return model_inputs
|
| 1887 |
+
|
| 1888 |
+
@staticmethod
|
| 1889 |
+
def _reorder_cache(past_key_values, beam_idx):
|
| 1890 |
+
reordered_past = ()
|
| 1891 |
+
for layer_past in past_key_values:
|
| 1892 |
+
reordered_past += (
|
| 1893 |
+
tuple(
|
| 1894 |
+
past_state.index_select(0, beam_idx.to(past_state.device))
|
| 1895 |
+
for past_state in layer_past
|
| 1896 |
+
),
|
| 1897 |
+
)
|
| 1898 |
+
return reordered_past
|
| 1899 |
+
|
| 1900 |
+
|
| 1901 |
+
@add_start_docstrings(
|
| 1902 |
+
"""
|
| 1903 |
+
The DeepseekV2 Model transformer with a sequence classification head on top (linear layer).
|
| 1904 |
+
|
| 1905 |
+
[`DeepseekV2ForSequenceClassification`] uses the last token in order to do the classification, as other causal models
|
| 1906 |
+
(e.g. GPT-2) do.
|
| 1907 |
+
|
| 1908 |
+
Since it does classification on the last token, it requires to know the position of the last token. If a
|
| 1909 |
+
`pad_token_id` is defined in the configuration, it finds the last token that is not a padding token in each row. If
|
| 1910 |
+
no `pad_token_id` is defined, it simply takes the last value in each row of the batch. Since it cannot guess the
|
| 1911 |
+
padding tokens when `inputs_embeds` are passed instead of `input_ids`, it does the same (take the last value in
|
| 1912 |
+
each row of the batch).
|
| 1913 |
+
""",
|
| 1914 |
+
DeepseekV2_START_DOCSTRING,
|
| 1915 |
+
)
|
| 1916 |
+
class DeepseekV2ForSequenceClassification(DeepseekV2PreTrainedModel):
|
| 1917 |
+
def __init__(self, config):
|
| 1918 |
+
super().__init__(config)
|
| 1919 |
+
self.num_labels = config.num_labels
|
| 1920 |
+
self.model = DeepseekV2Model(config)
|
| 1921 |
+
self.score = nn.Linear(config.hidden_size, self.num_labels, bias=False)
|
| 1922 |
+
|
| 1923 |
+
# Initialize weights and apply final processing
|
| 1924 |
+
self.post_init()
|
| 1925 |
+
|
| 1926 |
+
def get_input_embeddings(self):
|
| 1927 |
+
return self.model.embed_tokens
|
| 1928 |
+
|
| 1929 |
+
def set_input_embeddings(self, value):
|
| 1930 |
+
self.model.embed_tokens = value
|
| 1931 |
+
|
| 1932 |
+
@add_start_docstrings_to_model_forward(DeepseekV2_INPUTS_DOCSTRING)
|
| 1933 |
+
def forward(
|
| 1934 |
+
self,
|
| 1935 |
+
input_ids: torch.LongTensor = None,
|
| 1936 |
+
attention_mask: Optional[torch.Tensor] = None,
|
| 1937 |
+
position_ids: Optional[torch.LongTensor] = None,
|
| 1938 |
+
past_key_values: Optional[List[torch.FloatTensor]] = None,
|
| 1939 |
+
inputs_embeds: Optional[torch.FloatTensor] = None,
|
| 1940 |
+
labels: Optional[torch.LongTensor] = None,
|
| 1941 |
+
use_cache: Optional[bool] = None,
|
| 1942 |
+
output_attentions: Optional[bool] = None,
|
| 1943 |
+
output_hidden_states: Optional[bool] = None,
|
| 1944 |
+
return_dict: Optional[bool] = None,
|
| 1945 |
+
) -> Union[Tuple, SequenceClassifierOutputWithPast]:
|
| 1946 |
+
r"""
|
| 1947 |
+
labels (`torch.LongTensor` of shape `(batch_size,)`, *optional*):
|
| 1948 |
+
Labels for computing the sequence classification/regression loss. Indices should be in `[0, transformers.,
|
| 1949 |
+
config.num_labels - 1]`. If `config.num_labels == 1` a regression loss is computed (Mean-Square loss), If
|
| 1950 |
+
`config.num_labels > 1` a classification loss is computed (Cross-Entropy).
|
| 1951 |
+
"""
|
| 1952 |
+
return_dict = (
|
| 1953 |
+
return_dict if return_dict is not None else self.config.use_return_dict
|
| 1954 |
+
)
|
| 1955 |
+
|
| 1956 |
+
transformer_outputs = self.model(
|
| 1957 |
+
input_ids,
|
| 1958 |
+
attention_mask=attention_mask,
|
| 1959 |
+
position_ids=position_ids,
|
| 1960 |
+
past_key_values=past_key_values,
|
| 1961 |
+
inputs_embeds=inputs_embeds,
|
| 1962 |
+
use_cache=use_cache,
|
| 1963 |
+
output_attentions=output_attentions,
|
| 1964 |
+
output_hidden_states=output_hidden_states,
|
| 1965 |
+
return_dict=return_dict,
|
| 1966 |
+
)
|
| 1967 |
+
hidden_states = transformer_outputs[0]
|
| 1968 |
+
logits = self.score(hidden_states)
|
| 1969 |
+
|
| 1970 |
+
if input_ids is not None:
|
| 1971 |
+
batch_size = input_ids.shape[0]
|
| 1972 |
+
else:
|
| 1973 |
+
batch_size = inputs_embeds.shape[0]
|
| 1974 |
+
|
| 1975 |
+
if self.config.pad_token_id is None and batch_size != 1:
|
| 1976 |
+
raise ValueError(
|
| 1977 |
+
"Cannot handle batch sizes > 1 if no padding token is defined."
|
| 1978 |
+
)
|
| 1979 |
+
if self.config.pad_token_id is None:
|
| 1980 |
+
sequence_lengths = -1
|
| 1981 |
+
else:
|
| 1982 |
+
if input_ids is not None:
|
| 1983 |
+
sequence_lengths = (
|
| 1984 |
+
torch.eq(input_ids, self.config.pad_token_id).int().argmax(-1) - 1
|
| 1985 |
+
).to(logits.device)
|
| 1986 |
+
else:
|
| 1987 |
+
sequence_lengths = -1
|
| 1988 |
+
|
| 1989 |
+
pooled_logits = logits[
|
| 1990 |
+
torch.arange(batch_size, device=logits.device), sequence_lengths
|
| 1991 |
+
]
|
| 1992 |
+
|
| 1993 |
+
loss = None
|
| 1994 |
+
if labels is not None:
|
| 1995 |
+
labels = labels.to(logits.device)
|
| 1996 |
+
if self.config.problem_type is None:
|
| 1997 |
+
if self.num_labels == 1:
|
| 1998 |
+
self.config.problem_type = "regression"
|
| 1999 |
+
elif self.num_labels > 1 and (
|
| 2000 |
+
labels.dtype == torch.long or labels.dtype == torch.int
|
| 2001 |
+
):
|
| 2002 |
+
self.config.problem_type = "single_label_classification"
|
| 2003 |
+
else:
|
| 2004 |
+
self.config.problem_type = "multi_label_classification"
|
| 2005 |
+
|
| 2006 |
+
if self.config.problem_type == "regression":
|
| 2007 |
+
loss_fct = MSELoss()
|
| 2008 |
+
if self.num_labels == 1:
|
| 2009 |
+
loss = loss_fct(pooled_logits.squeeze(), labels.squeeze())
|
| 2010 |
+
else:
|
| 2011 |
+
loss = loss_fct(pooled_logits, labels)
|
| 2012 |
+
elif self.config.problem_type == "single_label_classification":
|
| 2013 |
+
loss_fct = CrossEntropyLoss()
|
| 2014 |
+
loss = loss_fct(
|
| 2015 |
+
pooled_logits.view(-1, self.num_labels), labels.view(-1)
|
| 2016 |
+
)
|
| 2017 |
+
elif self.config.problem_type == "multi_label_classification":
|
| 2018 |
+
loss_fct = BCEWithLogitsLoss()
|
| 2019 |
+
loss = loss_fct(pooled_logits, labels)
|
| 2020 |
+
if not return_dict:
|
| 2021 |
+
output = (pooled_logits,) + transformer_outputs[1:]
|
| 2022 |
+
return ((loss,) + output) if loss is not None else output
|
| 2023 |
+
|
| 2024 |
+
return SequenceClassifierOutputWithPast(
|
| 2025 |
+
loss=loss,
|
| 2026 |
+
logits=pooled_logits,
|
| 2027 |
+
past_key_values=transformer_outputs.past_key_values,
|
| 2028 |
+
hidden_states=transformer_outputs.hidden_states,
|
| 2029 |
+
attentions=transformer_outputs.attentions,
|
| 2030 |
+
)
|
special_tokens_map.json
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"bos_token": {
|
| 3 |
+
"content": "<|begin▁of▁sentence|>",
|
| 4 |
+
"lstrip": false,
|
| 5 |
+
"normalized": true,
|
| 6 |
+
"rstrip": false,
|
| 7 |
+
"single_word": false
|
| 8 |
+
},
|
| 9 |
+
"eos_token": {
|
| 10 |
+
"content": "<|end▁of▁sentence|>",
|
| 11 |
+
"lstrip": false,
|
| 12 |
+
"normalized": true,
|
| 13 |
+
"rstrip": false,
|
| 14 |
+
"single_word": false
|
| 15 |
+
},
|
| 16 |
+
"pad_token": {
|
| 17 |
+
"content": "<|end▁of▁sentence|>",
|
| 18 |
+
"lstrip": false,
|
| 19 |
+
"normalized": true,
|
| 20 |
+
"rstrip": false,
|
| 21 |
+
"single_word": false
|
| 22 |
+
}
|
| 23 |
+
}
|
tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"add_bos_token": true,
|
| 3 |
+
"add_eos_token": false,
|
| 4 |
+
"add_prefix_space": null,
|
| 5 |
+
"added_tokens_decoder": {
|
| 6 |
+
"100000": {
|
| 7 |
+
"content": "<|begin▁of▁sentence|>",
|
| 8 |
+
"lstrip": false,
|
| 9 |
+
"normalized": true,
|
| 10 |
+
"rstrip": false,
|
| 11 |
+
"single_word": false,
|
| 12 |
+
"special": true
|
| 13 |
+
},
|
| 14 |
+
"100001": {
|
| 15 |
+
"content": "<|end▁of▁sentence|>",
|
| 16 |
+
"lstrip": false,
|
| 17 |
+
"normalized": true,
|
| 18 |
+
"rstrip": false,
|
| 19 |
+
"single_word": false,
|
| 20 |
+
"special": true
|
| 21 |
+
}
|
| 22 |
+
},
|
| 23 |
+
"bos_token": "<|begin▁of▁sentence|>",
|
| 24 |
+
"chat_template": "{% if not add_generation_prompt is defined %}{% set add_generation_prompt = false %}{% endif %}{{ bos_token }}{% for message in messages %}{% if message['role'] == 'user' %}{{ 'User: ' + message['content'] + '\n\n' }}{% elif message['role'] == 'assistant' %}{{ 'Assistant: ' + message['content'] + eos_token }}{% elif message['role'] == 'system' %}{{ message['content'] + '\n\n' }}{% endif %}{% endfor %}{% if add_generation_prompt %}{{ 'Assistant:' }}{% endif %}",
|
| 25 |
+
"clean_up_tokenization_spaces": false,
|
| 26 |
+
"eos_token": "<|end▁of▁sentence|>",
|
| 27 |
+
"extra_special_tokens": {},
|
| 28 |
+
"legacy": true,
|
| 29 |
+
"model_max_length": 16384,
|
| 30 |
+
"pad_token": "<|end▁of▁sentence|>",
|
| 31 |
+
"padding_side": "right",
|
| 32 |
+
"sp_model_kwargs": {},
|
| 33 |
+
"split_special_tokens": false,
|
| 34 |
+
"tokenizer_class": "LlamaTokenizerFast",
|
| 35 |
+
"unk_token": null,
|
| 36 |
+
"use_default_system_prompt": false
|
| 37 |
+
}
|
trainer_state.json
ADDED
|
@@ -0,0 +1,2491 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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+
"eval_steps": 500,
|
| 7 |
+
"global_step": 351,
|
| 8 |
+
"is_hyper_param_search": false,
|
| 9 |
+
"is_local_process_zero": true,
|
| 10 |
+
"is_world_process_zero": true,
|
| 11 |
+
"log_history": [
|
| 12 |
+
{
|
| 13 |
+
"epoch": 0.008547008547008548,
|
| 14 |
+
"grad_norm": 5.000201194667757,
|
| 15 |
+
"learning_rate": 0.0,
|
| 16 |
+
"loss": 1.0148,
|
| 17 |
+
"step": 1
|
| 18 |
+
},
|
| 19 |
+
{
|
| 20 |
+
"epoch": 0.017094017094017096,
|
| 21 |
+
"grad_norm": 4.553619244653335,
|
| 22 |
+
"learning_rate": 2.1276595744680852e-07,
|
| 23 |
+
"loss": 0.9335,
|
| 24 |
+
"step": 2
|
| 25 |
+
},
|
| 26 |
+
{
|
| 27 |
+
"epoch": 0.02564102564102564,
|
| 28 |
+
"grad_norm": 5.2025726843321864,
|
| 29 |
+
"learning_rate": 4.2553191489361704e-07,
|
| 30 |
+
"loss": 1.09,
|
| 31 |
+
"step": 3
|
| 32 |
+
},
|
| 33 |
+
{
|
| 34 |
+
"epoch": 0.03418803418803419,
|
| 35 |
+
"grad_norm": 5.547471309289295,
|
| 36 |
+
"learning_rate": 6.382978723404255e-07,
|
| 37 |
+
"loss": 1.118,
|
| 38 |
+
"step": 4
|
| 39 |
+
},
|
| 40 |
+
{
|
| 41 |
+
"epoch": 0.042735042735042736,
|
| 42 |
+
"grad_norm": 5.429011231183887,
|
| 43 |
+
"learning_rate": 8.510638297872341e-07,
|
| 44 |
+
"loss": 1.046,
|
| 45 |
+
"step": 5
|
| 46 |
+
},
|
| 47 |
+
{
|
| 48 |
+
"epoch": 0.05128205128205128,
|
| 49 |
+
"grad_norm": 5.143141788493172,
|
| 50 |
+
"learning_rate": 1.0638297872340427e-06,
|
| 51 |
+
"loss": 0.9892,
|
| 52 |
+
"step": 6
|
| 53 |
+
},
|
| 54 |
+
{
|
| 55 |
+
"epoch": 0.05982905982905983,
|
| 56 |
+
"grad_norm": 5.103143984506411,
|
| 57 |
+
"learning_rate": 1.276595744680851e-06,
|
| 58 |
+
"loss": 0.988,
|
| 59 |
+
"step": 7
|
| 60 |
+
},
|
| 61 |
+
{
|
| 62 |
+
"epoch": 0.06837606837606838,
|
| 63 |
+
"grad_norm": 4.532297415969434,
|
| 64 |
+
"learning_rate": 1.4893617021276596e-06,
|
| 65 |
+
"loss": 0.9533,
|
| 66 |
+
"step": 8
|
| 67 |
+
},
|
| 68 |
+
{
|
| 69 |
+
"epoch": 0.07692307692307693,
|
| 70 |
+
"grad_norm": 4.719461465878973,
|
| 71 |
+
"learning_rate": 1.7021276595744682e-06,
|
| 72 |
+
"loss": 0.9846,
|
| 73 |
+
"step": 9
|
| 74 |
+
},
|
| 75 |
+
{
|
| 76 |
+
"epoch": 0.08547008547008547,
|
| 77 |
+
"grad_norm": 4.886449233552686,
|
| 78 |
+
"learning_rate": 1.9148936170212767e-06,
|
| 79 |
+
"loss": 0.9972,
|
| 80 |
+
"step": 10
|
| 81 |
+
},
|
| 82 |
+
{
|
| 83 |
+
"epoch": 0.09401709401709402,
|
| 84 |
+
"grad_norm": 3.9756063569662836,
|
| 85 |
+
"learning_rate": 2.1276595744680853e-06,
|
| 86 |
+
"loss": 0.9271,
|
| 87 |
+
"step": 11
|
| 88 |
+
},
|
| 89 |
+
{
|
| 90 |
+
"epoch": 0.10256410256410256,
|
| 91 |
+
"grad_norm": 3.6115294528308737,
|
| 92 |
+
"learning_rate": 2.340425531914894e-06,
|
| 93 |
+
"loss": 0.9314,
|
| 94 |
+
"step": 12
|
| 95 |
+
},
|
| 96 |
+
{
|
| 97 |
+
"epoch": 0.1111111111111111,
|
| 98 |
+
"grad_norm": 3.95062221359107,
|
| 99 |
+
"learning_rate": 2.553191489361702e-06,
|
| 100 |
+
"loss": 0.9224,
|
| 101 |
+
"step": 13
|
| 102 |
+
},
|
| 103 |
+
{
|
| 104 |
+
"epoch": 0.11965811965811966,
|
| 105 |
+
"grad_norm": 3.6020474394614355,
|
| 106 |
+
"learning_rate": 2.765957446808511e-06,
|
| 107 |
+
"loss": 0.8217,
|
| 108 |
+
"step": 14
|
| 109 |
+
},
|
| 110 |
+
{
|
| 111 |
+
"epoch": 0.1282051282051282,
|
| 112 |
+
"grad_norm": 3.1675369823021544,
|
| 113 |
+
"learning_rate": 2.978723404255319e-06,
|
| 114 |
+
"loss": 0.7474,
|
| 115 |
+
"step": 15
|
| 116 |
+
},
|
| 117 |
+
{
|
| 118 |
+
"epoch": 0.13675213675213677,
|
| 119 |
+
"grad_norm": 3.4027856540052954,
|
| 120 |
+
"learning_rate": 3.191489361702128e-06,
|
| 121 |
+
"loss": 0.7058,
|
| 122 |
+
"step": 16
|
| 123 |
+
},
|
| 124 |
+
{
|
| 125 |
+
"epoch": 0.1452991452991453,
|
| 126 |
+
"grad_norm": 3.2092110811100807,
|
| 127 |
+
"learning_rate": 3.4042553191489363e-06,
|
| 128 |
+
"loss": 0.7066,
|
| 129 |
+
"step": 17
|
| 130 |
+
},
|
| 131 |
+
{
|
| 132 |
+
"epoch": 0.15384615384615385,
|
| 133 |
+
"grad_norm": 3.3837232484963167,
|
| 134 |
+
"learning_rate": 3.6170212765957453e-06,
|
| 135 |
+
"loss": 0.7442,
|
| 136 |
+
"step": 18
|
| 137 |
+
},
|
| 138 |
+
{
|
| 139 |
+
"epoch": 0.1623931623931624,
|
| 140 |
+
"grad_norm": 3.566285592843641,
|
| 141 |
+
"learning_rate": 3.8297872340425535e-06,
|
| 142 |
+
"loss": 0.6024,
|
| 143 |
+
"step": 19
|
| 144 |
+
},
|
| 145 |
+
{
|
| 146 |
+
"epoch": 0.17094017094017094,
|
| 147 |
+
"grad_norm": 3.8266027576988386,
|
| 148 |
+
"learning_rate": 4.042553191489362e-06,
|
| 149 |
+
"loss": 0.5398,
|
| 150 |
+
"step": 20
|
| 151 |
+
},
|
| 152 |
+
{
|
| 153 |
+
"epoch": 0.1794871794871795,
|
| 154 |
+
"grad_norm": 2.2657952956960936,
|
| 155 |
+
"learning_rate": 4.255319148936171e-06,
|
| 156 |
+
"loss": 0.5643,
|
| 157 |
+
"step": 21
|
| 158 |
+
},
|
| 159 |
+
{
|
| 160 |
+
"epoch": 0.18803418803418803,
|
| 161 |
+
"grad_norm": 1.9644037313787919,
|
| 162 |
+
"learning_rate": 4.468085106382979e-06,
|
| 163 |
+
"loss": 0.5542,
|
| 164 |
+
"step": 22
|
| 165 |
+
},
|
| 166 |
+
{
|
| 167 |
+
"epoch": 0.19658119658119658,
|
| 168 |
+
"grad_norm": 1.9245732015689416,
|
| 169 |
+
"learning_rate": 4.680851063829788e-06,
|
| 170 |
+
"loss": 0.5323,
|
| 171 |
+
"step": 23
|
| 172 |
+
},
|
| 173 |
+
{
|
| 174 |
+
"epoch": 0.20512820512820512,
|
| 175 |
+
"grad_norm": 1.5843848692897562,
|
| 176 |
+
"learning_rate": 4.893617021276596e-06,
|
| 177 |
+
"loss": 0.4884,
|
| 178 |
+
"step": 24
|
| 179 |
+
},
|
| 180 |
+
{
|
| 181 |
+
"epoch": 0.21367521367521367,
|
| 182 |
+
"grad_norm": 1.5705361172860144,
|
| 183 |
+
"learning_rate": 5.106382978723404e-06,
|
| 184 |
+
"loss": 0.5031,
|
| 185 |
+
"step": 25
|
| 186 |
+
},
|
| 187 |
+
{
|
| 188 |
+
"epoch": 0.2222222222222222,
|
| 189 |
+
"grad_norm": 1.408768419889516,
|
| 190 |
+
"learning_rate": 5.319148936170213e-06,
|
| 191 |
+
"loss": 0.509,
|
| 192 |
+
"step": 26
|
| 193 |
+
},
|
| 194 |
+
{
|
| 195 |
+
"epoch": 0.23076923076923078,
|
| 196 |
+
"grad_norm": 1.367146426063194,
|
| 197 |
+
"learning_rate": 5.531914893617022e-06,
|
| 198 |
+
"loss": 0.4943,
|
| 199 |
+
"step": 27
|
| 200 |
+
},
|
| 201 |
+
{
|
| 202 |
+
"epoch": 0.23931623931623933,
|
| 203 |
+
"grad_norm": 1.3938494527960905,
|
| 204 |
+
"learning_rate": 5.744680851063831e-06,
|
| 205 |
+
"loss": 0.4518,
|
| 206 |
+
"step": 28
|
| 207 |
+
},
|
| 208 |
+
{
|
| 209 |
+
"epoch": 0.24786324786324787,
|
| 210 |
+
"grad_norm": 1.5985642734682453,
|
| 211 |
+
"learning_rate": 5.957446808510638e-06,
|
| 212 |
+
"loss": 0.4953,
|
| 213 |
+
"step": 29
|
| 214 |
+
},
|
| 215 |
+
{
|
| 216 |
+
"epoch": 0.2564102564102564,
|
| 217 |
+
"grad_norm": 1.343839505892132,
|
| 218 |
+
"learning_rate": 6.170212765957447e-06,
|
| 219 |
+
"loss": 0.4775,
|
| 220 |
+
"step": 30
|
| 221 |
+
},
|
| 222 |
+
{
|
| 223 |
+
"epoch": 0.26495726495726496,
|
| 224 |
+
"grad_norm": 1.1853048978003005,
|
| 225 |
+
"learning_rate": 6.382978723404256e-06,
|
| 226 |
+
"loss": 0.4606,
|
| 227 |
+
"step": 31
|
| 228 |
+
},
|
| 229 |
+
{
|
| 230 |
+
"epoch": 0.27350427350427353,
|
| 231 |
+
"grad_norm": 1.1985247979159896,
|
| 232 |
+
"learning_rate": 6.595744680851064e-06,
|
| 233 |
+
"loss": 0.4762,
|
| 234 |
+
"step": 32
|
| 235 |
+
},
|
| 236 |
+
{
|
| 237 |
+
"epoch": 0.28205128205128205,
|
| 238 |
+
"grad_norm": 1.237451343485384,
|
| 239 |
+
"learning_rate": 6.808510638297873e-06,
|
| 240 |
+
"loss": 0.4838,
|
| 241 |
+
"step": 33
|
| 242 |
+
},
|
| 243 |
+
{
|
| 244 |
+
"epoch": 0.2905982905982906,
|
| 245 |
+
"grad_norm": 1.121786595500156,
|
| 246 |
+
"learning_rate": 7.021276595744682e-06,
|
| 247 |
+
"loss": 0.4534,
|
| 248 |
+
"step": 34
|
| 249 |
+
},
|
| 250 |
+
{
|
| 251 |
+
"epoch": 0.29914529914529914,
|
| 252 |
+
"grad_norm": 1.1869718474915711,
|
| 253 |
+
"learning_rate": 7.234042553191491e-06,
|
| 254 |
+
"loss": 0.4428,
|
| 255 |
+
"step": 35
|
| 256 |
+
},
|
| 257 |
+
{
|
| 258 |
+
"epoch": 0.3076923076923077,
|
| 259 |
+
"grad_norm": 1.1529254008542718,
|
| 260 |
+
"learning_rate": 7.446808510638298e-06,
|
| 261 |
+
"loss": 0.5016,
|
| 262 |
+
"step": 36
|
| 263 |
+
},
|
| 264 |
+
{
|
| 265 |
+
"epoch": 0.3162393162393162,
|
| 266 |
+
"grad_norm": 1.1702663012816394,
|
| 267 |
+
"learning_rate": 7.659574468085107e-06,
|
| 268 |
+
"loss": 0.4343,
|
| 269 |
+
"step": 37
|
| 270 |
+
},
|
| 271 |
+
{
|
| 272 |
+
"epoch": 0.3247863247863248,
|
| 273 |
+
"grad_norm": 1.1125660212336026,
|
| 274 |
+
"learning_rate": 7.872340425531916e-06,
|
| 275 |
+
"loss": 0.4284,
|
| 276 |
+
"step": 38
|
| 277 |
+
},
|
| 278 |
+
{
|
| 279 |
+
"epoch": 0.3333333333333333,
|
| 280 |
+
"grad_norm": 1.1240752168855772,
|
| 281 |
+
"learning_rate": 8.085106382978723e-06,
|
| 282 |
+
"loss": 0.4182,
|
| 283 |
+
"step": 39
|
| 284 |
+
},
|
| 285 |
+
{
|
| 286 |
+
"epoch": 0.3418803418803419,
|
| 287 |
+
"grad_norm": 1.121419284806237,
|
| 288 |
+
"learning_rate": 8.297872340425532e-06,
|
| 289 |
+
"loss": 0.458,
|
| 290 |
+
"step": 40
|
| 291 |
+
},
|
| 292 |
+
{
|
| 293 |
+
"epoch": 0.3504273504273504,
|
| 294 |
+
"grad_norm": 1.1143819867497298,
|
| 295 |
+
"learning_rate": 8.510638297872341e-06,
|
| 296 |
+
"loss": 0.45,
|
| 297 |
+
"step": 41
|
| 298 |
+
},
|
| 299 |
+
{
|
| 300 |
+
"epoch": 0.358974358974359,
|
| 301 |
+
"grad_norm": 1.1078268588286275,
|
| 302 |
+
"learning_rate": 8.72340425531915e-06,
|
| 303 |
+
"loss": 0.4322,
|
| 304 |
+
"step": 42
|
| 305 |
+
},
|
| 306 |
+
{
|
| 307 |
+
"epoch": 0.36752136752136755,
|
| 308 |
+
"grad_norm": 1.1854005508036922,
|
| 309 |
+
"learning_rate": 8.936170212765958e-06,
|
| 310 |
+
"loss": 0.4323,
|
| 311 |
+
"step": 43
|
| 312 |
+
},
|
| 313 |
+
{
|
| 314 |
+
"epoch": 0.37606837606837606,
|
| 315 |
+
"grad_norm": 1.174625253101526,
|
| 316 |
+
"learning_rate": 9.148936170212767e-06,
|
| 317 |
+
"loss": 0.4517,
|
| 318 |
+
"step": 44
|
| 319 |
+
},
|
| 320 |
+
{
|
| 321 |
+
"epoch": 0.38461538461538464,
|
| 322 |
+
"grad_norm": 1.2148669994783647,
|
| 323 |
+
"learning_rate": 9.361702127659576e-06,
|
| 324 |
+
"loss": 0.4144,
|
| 325 |
+
"step": 45
|
| 326 |
+
},
|
| 327 |
+
{
|
| 328 |
+
"epoch": 0.39316239316239315,
|
| 329 |
+
"grad_norm": 1.0834050202141576,
|
| 330 |
+
"learning_rate": 9.574468085106385e-06,
|
| 331 |
+
"loss": 0.4087,
|
| 332 |
+
"step": 46
|
| 333 |
+
},
|
| 334 |
+
{
|
| 335 |
+
"epoch": 0.4017094017094017,
|
| 336 |
+
"grad_norm": 1.0312981005384125,
|
| 337 |
+
"learning_rate": 9.787234042553192e-06,
|
| 338 |
+
"loss": 0.4014,
|
| 339 |
+
"step": 47
|
| 340 |
+
},
|
| 341 |
+
{
|
| 342 |
+
"epoch": 0.41025641025641024,
|
| 343 |
+
"grad_norm": 1.0991847956199,
|
| 344 |
+
"learning_rate": 1e-05,
|
| 345 |
+
"loss": 0.4231,
|
| 346 |
+
"step": 48
|
| 347 |
+
},
|
| 348 |
+
{
|
| 349 |
+
"epoch": 0.4188034188034188,
|
| 350 |
+
"grad_norm": 1.0497486413956238,
|
| 351 |
+
"learning_rate": 9.999860789001947e-06,
|
| 352 |
+
"loss": 0.4483,
|
| 353 |
+
"step": 49
|
| 354 |
+
},
|
| 355 |
+
{
|
| 356 |
+
"epoch": 0.42735042735042733,
|
| 357 |
+
"grad_norm": 1.191941679054524,
|
| 358 |
+
"learning_rate": 9.999443163759669e-06,
|
| 359 |
+
"loss": 0.4453,
|
| 360 |
+
"step": 50
|
| 361 |
+
},
|
| 362 |
+
{
|
| 363 |
+
"epoch": 0.4358974358974359,
|
| 364 |
+
"grad_norm": 1.138955899116098,
|
| 365 |
+
"learning_rate": 9.998747147528375e-06,
|
| 366 |
+
"loss": 0.4462,
|
| 367 |
+
"step": 51
|
| 368 |
+
},
|
| 369 |
+
{
|
| 370 |
+
"epoch": 0.4444444444444444,
|
| 371 |
+
"grad_norm": 1.0119062091062931,
|
| 372 |
+
"learning_rate": 9.997772779065312e-06,
|
| 373 |
+
"loss": 0.3989,
|
| 374 |
+
"step": 52
|
| 375 |
+
},
|
| 376 |
+
{
|
| 377 |
+
"epoch": 0.452991452991453,
|
| 378 |
+
"grad_norm": 1.0835845087837552,
|
| 379 |
+
"learning_rate": 9.996520112627602e-06,
|
| 380 |
+
"loss": 0.4095,
|
| 381 |
+
"step": 53
|
| 382 |
+
},
|
| 383 |
+
{
|
| 384 |
+
"epoch": 0.46153846153846156,
|
| 385 |
+
"grad_norm": 1.148830281621877,
|
| 386 |
+
"learning_rate": 9.994989217969224e-06,
|
| 387 |
+
"loss": 0.4638,
|
| 388 |
+
"step": 54
|
| 389 |
+
},
|
| 390 |
+
{
|
| 391 |
+
"epoch": 0.4700854700854701,
|
| 392 |
+
"grad_norm": 1.1087544758875711,
|
| 393 |
+
"learning_rate": 9.993180180337126e-06,
|
| 394 |
+
"loss": 0.3991,
|
| 395 |
+
"step": 55
|
| 396 |
+
},
|
| 397 |
+
{
|
| 398 |
+
"epoch": 0.47863247863247865,
|
| 399 |
+
"grad_norm": 1.0719394821426298,
|
| 400 |
+
"learning_rate": 9.991093100466482e-06,
|
| 401 |
+
"loss": 0.4079,
|
| 402 |
+
"step": 56
|
| 403 |
+
},
|
| 404 |
+
{
|
| 405 |
+
"epoch": 0.48717948717948717,
|
| 406 |
+
"grad_norm": 1.1334620383185467,
|
| 407 |
+
"learning_rate": 9.988728094575082e-06,
|
| 408 |
+
"loss": 0.4275,
|
| 409 |
+
"step": 57
|
| 410 |
+
},
|
| 411 |
+
{
|
| 412 |
+
"epoch": 0.49572649572649574,
|
| 413 |
+
"grad_norm": 1.086630981335899,
|
| 414 |
+
"learning_rate": 9.986085294356858e-06,
|
| 415 |
+
"loss": 0.431,
|
| 416 |
+
"step": 58
|
| 417 |
+
},
|
| 418 |
+
{
|
| 419 |
+
"epoch": 0.5042735042735043,
|
| 420 |
+
"grad_norm": 1.0905888189048418,
|
| 421 |
+
"learning_rate": 9.983164846974549e-06,
|
| 422 |
+
"loss": 0.4128,
|
| 423 |
+
"step": 59
|
| 424 |
+
},
|
| 425 |
+
{
|
| 426 |
+
"epoch": 0.5128205128205128,
|
| 427 |
+
"grad_norm": 1.16978894928796,
|
| 428 |
+
"learning_rate": 9.979966915051517e-06,
|
| 429 |
+
"loss": 0.4169,
|
| 430 |
+
"step": 60
|
| 431 |
+
},
|
| 432 |
+
{
|
| 433 |
+
"epoch": 0.5213675213675214,
|
| 434 |
+
"grad_norm": 1.174126314027139,
|
| 435 |
+
"learning_rate": 9.976491676662679e-06,
|
| 436 |
+
"loss": 0.4608,
|
| 437 |
+
"step": 61
|
| 438 |
+
},
|
| 439 |
+
{
|
| 440 |
+
"epoch": 0.5299145299145299,
|
| 441 |
+
"grad_norm": 1.1150440735360172,
|
| 442 |
+
"learning_rate": 9.972739325324596e-06,
|
| 443 |
+
"loss": 0.4399,
|
| 444 |
+
"step": 62
|
| 445 |
+
},
|
| 446 |
+
{
|
| 447 |
+
"epoch": 0.5384615384615384,
|
| 448 |
+
"grad_norm": 1.078427844354108,
|
| 449 |
+
"learning_rate": 9.968710069984699e-06,
|
| 450 |
+
"loss": 0.3941,
|
| 451 |
+
"step": 63
|
| 452 |
+
},
|
| 453 |
+
{
|
| 454 |
+
"epoch": 0.5470085470085471,
|
| 455 |
+
"grad_norm": 1.0461054161947163,
|
| 456 |
+
"learning_rate": 9.964404135009649e-06,
|
| 457 |
+
"loss": 0.4102,
|
| 458 |
+
"step": 64
|
| 459 |
+
},
|
| 460 |
+
{
|
| 461 |
+
"epoch": 0.5555555555555556,
|
| 462 |
+
"grad_norm": 1.095126986939366,
|
| 463 |
+
"learning_rate": 9.959821760172849e-06,
|
| 464 |
+
"loss": 0.3928,
|
| 465 |
+
"step": 65
|
| 466 |
+
},
|
| 467 |
+
{
|
| 468 |
+
"epoch": 0.5641025641025641,
|
| 469 |
+
"grad_norm": 1.0575368605559266,
|
| 470 |
+
"learning_rate": 9.95496320064109e-06,
|
| 471 |
+
"loss": 0.4024,
|
| 472 |
+
"step": 66
|
| 473 |
+
},
|
| 474 |
+
{
|
| 475 |
+
"epoch": 0.5726495726495726,
|
| 476 |
+
"grad_norm": 1.0944807100090737,
|
| 477 |
+
"learning_rate": 9.94982872696034e-06,
|
| 478 |
+
"loss": 0.4213,
|
| 479 |
+
"step": 67
|
| 480 |
+
},
|
| 481 |
+
{
|
| 482 |
+
"epoch": 0.5811965811965812,
|
| 483 |
+
"grad_norm": 1.0040621806899572,
|
| 484 |
+
"learning_rate": 9.94441862504068e-06,
|
| 485 |
+
"loss": 0.4051,
|
| 486 |
+
"step": 68
|
| 487 |
+
},
|
| 488 |
+
{
|
| 489 |
+
"epoch": 0.5897435897435898,
|
| 490 |
+
"grad_norm": 1.1735920693175566,
|
| 491 |
+
"learning_rate": 9.938733196140386e-06,
|
| 492 |
+
"loss": 0.4143,
|
| 493 |
+
"step": 69
|
| 494 |
+
},
|
| 495 |
+
{
|
| 496 |
+
"epoch": 0.5982905982905983,
|
| 497 |
+
"grad_norm": 1.1674632833586573,
|
| 498 |
+
"learning_rate": 9.932772756849152e-06,
|
| 499 |
+
"loss": 0.3902,
|
| 500 |
+
"step": 70
|
| 501 |
+
},
|
| 502 |
+
{
|
| 503 |
+
"epoch": 0.6068376068376068,
|
| 504 |
+
"grad_norm": 1.1627757841084903,
|
| 505 |
+
"learning_rate": 9.926537639070457e-06,
|
| 506 |
+
"loss": 0.4183,
|
| 507 |
+
"step": 71
|
| 508 |
+
},
|
| 509 |
+
{
|
| 510 |
+
"epoch": 0.6153846153846154,
|
| 511 |
+
"grad_norm": 1.01945513131564,
|
| 512 |
+
"learning_rate": 9.92002819000309e-06,
|
| 513 |
+
"loss": 0.3786,
|
| 514 |
+
"step": 72
|
| 515 |
+
},
|
| 516 |
+
{
|
| 517 |
+
"epoch": 0.6239316239316239,
|
| 518 |
+
"grad_norm": 1.0049104542951017,
|
| 519 |
+
"learning_rate": 9.913244772121811e-06,
|
| 520 |
+
"loss": 0.3974,
|
| 521 |
+
"step": 73
|
| 522 |
+
},
|
| 523 |
+
{
|
| 524 |
+
"epoch": 0.6324786324786325,
|
| 525 |
+
"grad_norm": 1.0312700019705312,
|
| 526 |
+
"learning_rate": 9.90618776315717e-06,
|
| 527 |
+
"loss": 0.4154,
|
| 528 |
+
"step": 74
|
| 529 |
+
},
|
| 530 |
+
{
|
| 531 |
+
"epoch": 0.6410256410256411,
|
| 532 |
+
"grad_norm": 1.4096847118584448,
|
| 533 |
+
"learning_rate": 9.898857556074469e-06,
|
| 534 |
+
"loss": 0.3675,
|
| 535 |
+
"step": 75
|
| 536 |
+
},
|
| 537 |
+
{
|
| 538 |
+
"epoch": 0.6495726495726496,
|
| 539 |
+
"grad_norm": 1.0483493517766076,
|
| 540 |
+
"learning_rate": 9.891254559051886e-06,
|
| 541 |
+
"loss": 0.4021,
|
| 542 |
+
"step": 76
|
| 543 |
+
},
|
| 544 |
+
{
|
| 545 |
+
"epoch": 0.6581196581196581,
|
| 546 |
+
"grad_norm": 1.1029965305618874,
|
| 547 |
+
"learning_rate": 9.883379195457747e-06,
|
| 548 |
+
"loss": 0.4236,
|
| 549 |
+
"step": 77
|
| 550 |
+
},
|
| 551 |
+
{
|
| 552 |
+
"epoch": 0.6666666666666666,
|
| 553 |
+
"grad_norm": 1.0646150700268031,
|
| 554 |
+
"learning_rate": 9.875231903826936e-06,
|
| 555 |
+
"loss": 0.4208,
|
| 556 |
+
"step": 78
|
| 557 |
+
},
|
| 558 |
+
{
|
| 559 |
+
"epoch": 0.6752136752136753,
|
| 560 |
+
"grad_norm": 1.0210009444930273,
|
| 561 |
+
"learning_rate": 9.8668131378365e-06,
|
| 562 |
+
"loss": 0.3953,
|
| 563 |
+
"step": 79
|
| 564 |
+
},
|
| 565 |
+
{
|
| 566 |
+
"epoch": 0.6837606837606838,
|
| 567 |
+
"grad_norm": 1.021820246971344,
|
| 568 |
+
"learning_rate": 9.858123366280358e-06,
|
| 569 |
+
"loss": 0.426,
|
| 570 |
+
"step": 80
|
| 571 |
+
},
|
| 572 |
+
{
|
| 573 |
+
"epoch": 0.6923076923076923,
|
| 574 |
+
"grad_norm": 1.0119877252273766,
|
| 575 |
+
"learning_rate": 9.849163073043223e-06,
|
| 576 |
+
"loss": 0.3813,
|
| 577 |
+
"step": 81
|
| 578 |
+
},
|
| 579 |
+
{
|
| 580 |
+
"epoch": 0.7008547008547008,
|
| 581 |
+
"grad_norm": 1.0079125422598045,
|
| 582 |
+
"learning_rate": 9.83993275707364e-06,
|
| 583 |
+
"loss": 0.4026,
|
| 584 |
+
"step": 82
|
| 585 |
+
},
|
| 586 |
+
{
|
| 587 |
+
"epoch": 0.7094017094017094,
|
| 588 |
+
"grad_norm": 1.0880725672936133,
|
| 589 |
+
"learning_rate": 9.830432932356207e-06,
|
| 590 |
+
"loss": 0.3711,
|
| 591 |
+
"step": 83
|
| 592 |
+
},
|
| 593 |
+
{
|
| 594 |
+
"epoch": 0.717948717948718,
|
| 595 |
+
"grad_norm": 0.9867725017004677,
|
| 596 |
+
"learning_rate": 9.820664127882958e-06,
|
| 597 |
+
"loss": 0.4107,
|
| 598 |
+
"step": 84
|
| 599 |
+
},
|
| 600 |
+
{
|
| 601 |
+
"epoch": 0.7264957264957265,
|
| 602 |
+
"grad_norm": 1.0173347037451843,
|
| 603 |
+
"learning_rate": 9.8106268876239e-06,
|
| 604 |
+
"loss": 0.3994,
|
| 605 |
+
"step": 85
|
| 606 |
+
},
|
| 607 |
+
{
|
| 608 |
+
"epoch": 0.7350427350427351,
|
| 609 |
+
"grad_norm": 1.006069526819603,
|
| 610 |
+
"learning_rate": 9.800321770496726e-06,
|
| 611 |
+
"loss": 0.3849,
|
| 612 |
+
"step": 86
|
| 613 |
+
},
|
| 614 |
+
{
|
| 615 |
+
"epoch": 0.7435897435897436,
|
| 616 |
+
"grad_norm": 1.00629856552949,
|
| 617 |
+
"learning_rate": 9.789749350335693e-06,
|
| 618 |
+
"loss": 0.4202,
|
| 619 |
+
"step": 87
|
| 620 |
+
},
|
| 621 |
+
{
|
| 622 |
+
"epoch": 0.7521367521367521,
|
| 623 |
+
"grad_norm": 0.9192152819685229,
|
| 624 |
+
"learning_rate": 9.778910215859666e-06,
|
| 625 |
+
"loss": 0.3625,
|
| 626 |
+
"step": 88
|
| 627 |
+
},
|
| 628 |
+
{
|
| 629 |
+
"epoch": 0.7606837606837606,
|
| 630 |
+
"grad_norm": 1.0300081865237987,
|
| 631 |
+
"learning_rate": 9.767804970639338e-06,
|
| 632 |
+
"loss": 0.3915,
|
| 633 |
+
"step": 89
|
| 634 |
+
},
|
| 635 |
+
{
|
| 636 |
+
"epoch": 0.7692307692307693,
|
| 637 |
+
"grad_norm": 0.8888986185383759,
|
| 638 |
+
"learning_rate": 9.756434233063616e-06,
|
| 639 |
+
"loss": 0.3644,
|
| 640 |
+
"step": 90
|
| 641 |
+
},
|
| 642 |
+
{
|
| 643 |
+
"epoch": 0.7777777777777778,
|
| 644 |
+
"grad_norm": 0.9863916054397147,
|
| 645 |
+
"learning_rate": 9.744798636305189e-06,
|
| 646 |
+
"loss": 0.3876,
|
| 647 |
+
"step": 91
|
| 648 |
+
},
|
| 649 |
+
{
|
| 650 |
+
"epoch": 0.7863247863247863,
|
| 651 |
+
"grad_norm": 0.9456580024202502,
|
| 652 |
+
"learning_rate": 9.732898828285273e-06,
|
| 653 |
+
"loss": 0.3806,
|
| 654 |
+
"step": 92
|
| 655 |
+
},
|
| 656 |
+
{
|
| 657 |
+
"epoch": 0.7948717948717948,
|
| 658 |
+
"grad_norm": 0.9994253554059315,
|
| 659 |
+
"learning_rate": 9.72073547163753e-06,
|
| 660 |
+
"loss": 0.4222,
|
| 661 |
+
"step": 93
|
| 662 |
+
},
|
| 663 |
+
{
|
| 664 |
+
"epoch": 0.8034188034188035,
|
| 665 |
+
"grad_norm": 1.13909860677196,
|
| 666 |
+
"learning_rate": 9.708309243671167e-06,
|
| 667 |
+
"loss": 0.4016,
|
| 668 |
+
"step": 94
|
| 669 |
+
},
|
| 670 |
+
{
|
| 671 |
+
"epoch": 0.811965811965812,
|
| 672 |
+
"grad_norm": 1.0930486357722262,
|
| 673 |
+
"learning_rate": 9.695620836333219e-06,
|
| 674 |
+
"loss": 0.4082,
|
| 675 |
+
"step": 95
|
| 676 |
+
},
|
| 677 |
+
{
|
| 678 |
+
"epoch": 0.8205128205128205,
|
| 679 |
+
"grad_norm": 0.9576110992320139,
|
| 680 |
+
"learning_rate": 9.68267095617003e-06,
|
| 681 |
+
"loss": 0.3872,
|
| 682 |
+
"step": 96
|
| 683 |
+
},
|
| 684 |
+
{
|
| 685 |
+
"epoch": 0.8290598290598291,
|
| 686 |
+
"grad_norm": 1.2947513219359283,
|
| 687 |
+
"learning_rate": 9.669460324287899e-06,
|
| 688 |
+
"loss": 0.4502,
|
| 689 |
+
"step": 97
|
| 690 |
+
},
|
| 691 |
+
{
|
| 692 |
+
"epoch": 0.8376068376068376,
|
| 693 |
+
"grad_norm": 1.0389791981970942,
|
| 694 |
+
"learning_rate": 9.655989676312918e-06,
|
| 695 |
+
"loss": 0.3509,
|
| 696 |
+
"step": 98
|
| 697 |
+
},
|
| 698 |
+
{
|
| 699 |
+
"epoch": 0.8461538461538461,
|
| 700 |
+
"grad_norm": 1.0629554828032584,
|
| 701 |
+
"learning_rate": 9.642259762350034e-06,
|
| 702 |
+
"loss": 0.4139,
|
| 703 |
+
"step": 99
|
| 704 |
+
},
|
| 705 |
+
{
|
| 706 |
+
"epoch": 0.8547008547008547,
|
| 707 |
+
"grad_norm": 1.1762884885720055,
|
| 708 |
+
"learning_rate": 9.628271346941252e-06,
|
| 709 |
+
"loss": 0.3955,
|
| 710 |
+
"step": 100
|
| 711 |
+
},
|
| 712 |
+
{
|
| 713 |
+
"epoch": 0.8632478632478633,
|
| 714 |
+
"grad_norm": 0.9653157874998826,
|
| 715 |
+
"learning_rate": 9.614025209023084e-06,
|
| 716 |
+
"loss": 0.3794,
|
| 717 |
+
"step": 101
|
| 718 |
+
},
|
| 719 |
+
{
|
| 720 |
+
"epoch": 0.8717948717948718,
|
| 721 |
+
"grad_norm": 1.024351198733931,
|
| 722 |
+
"learning_rate": 9.59952214188316e-06,
|
| 723 |
+
"loss": 0.3967,
|
| 724 |
+
"step": 102
|
| 725 |
+
},
|
| 726 |
+
{
|
| 727 |
+
"epoch": 0.8803418803418803,
|
| 728 |
+
"grad_norm": 1.0006816380075654,
|
| 729 |
+
"learning_rate": 9.58476295311606e-06,
|
| 730 |
+
"loss": 0.374,
|
| 731 |
+
"step": 103
|
| 732 |
+
},
|
| 733 |
+
{
|
| 734 |
+
"epoch": 0.8888888888888888,
|
| 735 |
+
"grad_norm": 1.155126565973536,
|
| 736 |
+
"learning_rate": 9.569748464578343e-06,
|
| 737 |
+
"loss": 0.4087,
|
| 738 |
+
"step": 104
|
| 739 |
+
},
|
| 740 |
+
{
|
| 741 |
+
"epoch": 0.8974358974358975,
|
| 742 |
+
"grad_norm": 0.9698857048135491,
|
| 743 |
+
"learning_rate": 9.554479512342785e-06,
|
| 744 |
+
"loss": 0.3853,
|
| 745 |
+
"step": 105
|
| 746 |
+
},
|
| 747 |
+
{
|
| 748 |
+
"epoch": 0.905982905982906,
|
| 749 |
+
"grad_norm": 1.0117208923595893,
|
| 750 |
+
"learning_rate": 9.538956946651816e-06,
|
| 751 |
+
"loss": 0.4131,
|
| 752 |
+
"step": 106
|
| 753 |
+
},
|
| 754 |
+
{
|
| 755 |
+
"epoch": 0.9145299145299145,
|
| 756 |
+
"grad_norm": 0.9931990490031021,
|
| 757 |
+
"learning_rate": 9.52318163187018e-06,
|
| 758 |
+
"loss": 0.3885,
|
| 759 |
+
"step": 107
|
| 760 |
+
},
|
| 761 |
+
{
|
| 762 |
+
"epoch": 0.9230769230769231,
|
| 763 |
+
"grad_norm": 1.0849525275300227,
|
| 764 |
+
"learning_rate": 9.507154446436806e-06,
|
| 765 |
+
"loss": 0.4106,
|
| 766 |
+
"step": 108
|
| 767 |
+
},
|
| 768 |
+
{
|
| 769 |
+
"epoch": 0.9316239316239316,
|
| 770 |
+
"grad_norm": 0.9957238660095532,
|
| 771 |
+
"learning_rate": 9.490876282815884e-06,
|
| 772 |
+
"loss": 0.381,
|
| 773 |
+
"step": 109
|
| 774 |
+
},
|
| 775 |
+
{
|
| 776 |
+
"epoch": 0.9401709401709402,
|
| 777 |
+
"grad_norm": 0.9682321750218811,
|
| 778 |
+
"learning_rate": 9.474348047447177e-06,
|
| 779 |
+
"loss": 0.39,
|
| 780 |
+
"step": 110
|
| 781 |
+
},
|
| 782 |
+
{
|
| 783 |
+
"epoch": 0.9487179487179487,
|
| 784 |
+
"grad_norm": 0.8985303905429384,
|
| 785 |
+
"learning_rate": 9.457570660695542e-06,
|
| 786 |
+
"loss": 0.3875,
|
| 787 |
+
"step": 111
|
| 788 |
+
},
|
| 789 |
+
{
|
| 790 |
+
"epoch": 0.9572649572649573,
|
| 791 |
+
"grad_norm": 0.9866084795766771,
|
| 792 |
+
"learning_rate": 9.440545056799677e-06,
|
| 793 |
+
"loss": 0.3672,
|
| 794 |
+
"step": 112
|
| 795 |
+
},
|
| 796 |
+
{
|
| 797 |
+
"epoch": 0.9658119658119658,
|
| 798 |
+
"grad_norm": 0.9215988731633166,
|
| 799 |
+
"learning_rate": 9.423272183820109e-06,
|
| 800 |
+
"loss": 0.3562,
|
| 801 |
+
"step": 113
|
| 802 |
+
},
|
| 803 |
+
{
|
| 804 |
+
"epoch": 0.9743589743589743,
|
| 805 |
+
"grad_norm": 0.9288674476481529,
|
| 806 |
+
"learning_rate": 9.405753003586396e-06,
|
| 807 |
+
"loss": 0.3652,
|
| 808 |
+
"step": 114
|
| 809 |
+
},
|
| 810 |
+
{
|
| 811 |
+
"epoch": 0.9829059829059829,
|
| 812 |
+
"grad_norm": 1.017966831812477,
|
| 813 |
+
"learning_rate": 9.387988491643558e-06,
|
| 814 |
+
"loss": 0.4042,
|
| 815 |
+
"step": 115
|
| 816 |
+
},
|
| 817 |
+
{
|
| 818 |
+
"epoch": 0.9914529914529915,
|
| 819 |
+
"grad_norm": 1.0281455383446965,
|
| 820 |
+
"learning_rate": 9.369979637197774e-06,
|
| 821 |
+
"loss": 0.3945,
|
| 822 |
+
"step": 116
|
| 823 |
+
},
|
| 824 |
+
{
|
| 825 |
+
"epoch": 1.0,
|
| 826 |
+
"grad_norm": 0.9571454704015322,
|
| 827 |
+
"learning_rate": 9.351727443061284e-06,
|
| 828 |
+
"loss": 0.3852,
|
| 829 |
+
"step": 117
|
| 830 |
+
},
|
| 831 |
+
{
|
| 832 |
+
"epoch": 1.0085470085470085,
|
| 833 |
+
"grad_norm": 0.9266871031690506,
|
| 834 |
+
"learning_rate": 9.33323292559655e-06,
|
| 835 |
+
"loss": 0.3153,
|
| 836 |
+
"step": 118
|
| 837 |
+
},
|
| 838 |
+
{
|
| 839 |
+
"epoch": 1.017094017094017,
|
| 840 |
+
"grad_norm": 0.8745036746915139,
|
| 841 |
+
"learning_rate": 9.31449711465967e-06,
|
| 842 |
+
"loss": 0.3117,
|
| 843 |
+
"step": 119
|
| 844 |
+
},
|
| 845 |
+
{
|
| 846 |
+
"epoch": 1.0256410256410255,
|
| 847 |
+
"grad_norm": 0.8482296667448963,
|
| 848 |
+
"learning_rate": 9.29552105354302e-06,
|
| 849 |
+
"loss": 0.3079,
|
| 850 |
+
"step": 120
|
| 851 |
+
},
|
| 852 |
+
{
|
| 853 |
+
"epoch": 1.0341880341880343,
|
| 854 |
+
"grad_norm": 0.8411994115333025,
|
| 855 |
+
"learning_rate": 9.27630579891716e-06,
|
| 856 |
+
"loss": 0.2959,
|
| 857 |
+
"step": 121
|
| 858 |
+
},
|
| 859 |
+
{
|
| 860 |
+
"epoch": 1.0427350427350428,
|
| 861 |
+
"grad_norm": 0.8391738206365779,
|
| 862 |
+
"learning_rate": 9.256852420771999e-06,
|
| 863 |
+
"loss": 0.2837,
|
| 864 |
+
"step": 122
|
| 865 |
+
},
|
| 866 |
+
{
|
| 867 |
+
"epoch": 1.0512820512820513,
|
| 868 |
+
"grad_norm": 0.8815879789228052,
|
| 869 |
+
"learning_rate": 9.237162002357214e-06,
|
| 870 |
+
"loss": 0.28,
|
| 871 |
+
"step": 123
|
| 872 |
+
},
|
| 873 |
+
{
|
| 874 |
+
"epoch": 1.0598290598290598,
|
| 875 |
+
"grad_norm": 1.0350428789005957,
|
| 876 |
+
"learning_rate": 9.217235640121927e-06,
|
| 877 |
+
"loss": 0.2994,
|
| 878 |
+
"step": 124
|
| 879 |
+
},
|
| 880 |
+
{
|
| 881 |
+
"epoch": 1.0683760683760684,
|
| 882 |
+
"grad_norm": 1.0854352704500956,
|
| 883 |
+
"learning_rate": 9.197074443653643e-06,
|
| 884 |
+
"loss": 0.3179,
|
| 885 |
+
"step": 125
|
| 886 |
+
},
|
| 887 |
+
{
|
| 888 |
+
"epoch": 1.0769230769230769,
|
| 889 |
+
"grad_norm": 1.0028480692303414,
|
| 890 |
+
"learning_rate": 9.176679535616477e-06,
|
| 891 |
+
"loss": 0.316,
|
| 892 |
+
"step": 126
|
| 893 |
+
},
|
| 894 |
+
{
|
| 895 |
+
"epoch": 1.0854700854700854,
|
| 896 |
+
"grad_norm": 1.0303844180092128,
|
| 897 |
+
"learning_rate": 9.156052051688633e-06,
|
| 898 |
+
"loss": 0.2885,
|
| 899 |
+
"step": 127
|
| 900 |
+
},
|
| 901 |
+
{
|
| 902 |
+
"epoch": 1.0940170940170941,
|
| 903 |
+
"grad_norm": 1.0216951652794686,
|
| 904 |
+
"learning_rate": 9.135193140499155e-06,
|
| 905 |
+
"loss": 0.3144,
|
| 906 |
+
"step": 128
|
| 907 |
+
},
|
| 908 |
+
{
|
| 909 |
+
"epoch": 1.1025641025641026,
|
| 910 |
+
"grad_norm": 0.8725973849729337,
|
| 911 |
+
"learning_rate": 9.114103963563986e-06,
|
| 912 |
+
"loss": 0.274,
|
| 913 |
+
"step": 129
|
| 914 |
+
},
|
| 915 |
+
{
|
| 916 |
+
"epoch": 1.1111111111111112,
|
| 917 |
+
"grad_norm": 0.9873615101301011,
|
| 918 |
+
"learning_rate": 9.092785695221271e-06,
|
| 919 |
+
"loss": 0.308,
|
| 920 |
+
"step": 130
|
| 921 |
+
},
|
| 922 |
+
{
|
| 923 |
+
"epoch": 1.1196581196581197,
|
| 924 |
+
"grad_norm": 0.9999161033044182,
|
| 925 |
+
"learning_rate": 9.071239522565978e-06,
|
| 926 |
+
"loss": 0.3129,
|
| 927 |
+
"step": 131
|
| 928 |
+
},
|
| 929 |
+
{
|
| 930 |
+
"epoch": 1.1282051282051282,
|
| 931 |
+
"grad_norm": 0.9386573931483712,
|
| 932 |
+
"learning_rate": 9.049466645383785e-06,
|
| 933 |
+
"loss": 0.2693,
|
| 934 |
+
"step": 132
|
| 935 |
+
},
|
| 936 |
+
{
|
| 937 |
+
"epoch": 1.1367521367521367,
|
| 938 |
+
"grad_norm": 0.9980094788357861,
|
| 939 |
+
"learning_rate": 9.027468276084274e-06,
|
| 940 |
+
"loss": 0.3186,
|
| 941 |
+
"step": 133
|
| 942 |
+
},
|
| 943 |
+
{
|
| 944 |
+
"epoch": 1.1452991452991452,
|
| 945 |
+
"grad_norm": 0.9390751988491651,
|
| 946 |
+
"learning_rate": 9.00524563963343e-06,
|
| 947 |
+
"loss": 0.2985,
|
| 948 |
+
"step": 134
|
| 949 |
+
},
|
| 950 |
+
{
|
| 951 |
+
"epoch": 1.1538461538461537,
|
| 952 |
+
"grad_norm": 1.03545783987269,
|
| 953 |
+
"learning_rate": 8.982799973485407e-06,
|
| 954 |
+
"loss": 0.2833,
|
| 955 |
+
"step": 135
|
| 956 |
+
},
|
| 957 |
+
{
|
| 958 |
+
"epoch": 1.1623931623931625,
|
| 959 |
+
"grad_norm": 1.024107461540865,
|
| 960 |
+
"learning_rate": 8.960132527513642e-06,
|
| 961 |
+
"loss": 0.2453,
|
| 962 |
+
"step": 136
|
| 963 |
+
},
|
| 964 |
+
{
|
| 965 |
+
"epoch": 1.170940170940171,
|
| 966 |
+
"grad_norm": 1.3444850160966515,
|
| 967 |
+
"learning_rate": 8.937244563941248e-06,
|
| 968 |
+
"loss": 0.2503,
|
| 969 |
+
"step": 137
|
| 970 |
+
},
|
| 971 |
+
{
|
| 972 |
+
"epoch": 1.1794871794871795,
|
| 973 |
+
"grad_norm": 1.0282281707799192,
|
| 974 |
+
"learning_rate": 8.914137357270723e-06,
|
| 975 |
+
"loss": 0.2597,
|
| 976 |
+
"step": 138
|
| 977 |
+
},
|
| 978 |
+
{
|
| 979 |
+
"epoch": 1.188034188034188,
|
| 980 |
+
"grad_norm": 1.0791593285230392,
|
| 981 |
+
"learning_rate": 8.890812194212987e-06,
|
| 982 |
+
"loss": 0.2876,
|
| 983 |
+
"step": 139
|
| 984 |
+
},
|
| 985 |
+
{
|
| 986 |
+
"epoch": 1.1965811965811965,
|
| 987 |
+
"grad_norm": 1.1587216473989226,
|
| 988 |
+
"learning_rate": 8.867270373615735e-06,
|
| 989 |
+
"loss": 0.314,
|
| 990 |
+
"step": 140
|
| 991 |
+
},
|
| 992 |
+
{
|
| 993 |
+
"epoch": 1.205128205128205,
|
| 994 |
+
"grad_norm": 1.1302687975127939,
|
| 995 |
+
"learning_rate": 8.8435132063911e-06,
|
| 996 |
+
"loss": 0.2714,
|
| 997 |
+
"step": 141
|
| 998 |
+
},
|
| 999 |
+
{
|
| 1000 |
+
"epoch": 1.2136752136752136,
|
| 1001 |
+
"grad_norm": 1.0317148046622857,
|
| 1002 |
+
"learning_rate": 8.81954201544267e-06,
|
| 1003 |
+
"loss": 0.2756,
|
| 1004 |
+
"step": 142
|
| 1005 |
+
},
|
| 1006 |
+
{
|
| 1007 |
+
"epoch": 1.2222222222222223,
|
| 1008 |
+
"grad_norm": 1.1000105834749634,
|
| 1009 |
+
"learning_rate": 8.79535813559181e-06,
|
| 1010 |
+
"loss": 0.3188,
|
| 1011 |
+
"step": 143
|
| 1012 |
+
},
|
| 1013 |
+
{
|
| 1014 |
+
"epoch": 1.2307692307692308,
|
| 1015 |
+
"grad_norm": 1.036205595694295,
|
| 1016 |
+
"learning_rate": 8.77096291350334e-06,
|
| 1017 |
+
"loss": 0.2936,
|
| 1018 |
+
"step": 144
|
| 1019 |
+
},
|
| 1020 |
+
{
|
| 1021 |
+
"epoch": 1.2393162393162394,
|
| 1022 |
+
"grad_norm": 1.006551880177312,
|
| 1023 |
+
"learning_rate": 8.746357707610544e-06,
|
| 1024 |
+
"loss": 0.302,
|
| 1025 |
+
"step": 145
|
| 1026 |
+
},
|
| 1027 |
+
{
|
| 1028 |
+
"epoch": 1.2478632478632479,
|
| 1029 |
+
"grad_norm": 1.169116918594509,
|
| 1030 |
+
"learning_rate": 8.721543888039534e-06,
|
| 1031 |
+
"loss": 0.2895,
|
| 1032 |
+
"step": 146
|
| 1033 |
+
},
|
| 1034 |
+
{
|
| 1035 |
+
"epoch": 1.2564102564102564,
|
| 1036 |
+
"grad_norm": 1.0864182825636342,
|
| 1037 |
+
"learning_rate": 8.69652283653294e-06,
|
| 1038 |
+
"loss": 0.3077,
|
| 1039 |
+
"step": 147
|
| 1040 |
+
},
|
| 1041 |
+
{
|
| 1042 |
+
"epoch": 1.264957264957265,
|
| 1043 |
+
"grad_norm": 0.9457510205128588,
|
| 1044 |
+
"learning_rate": 8.671295946372989e-06,
|
| 1045 |
+
"loss": 0.3046,
|
| 1046 |
+
"step": 148
|
| 1047 |
+
},
|
| 1048 |
+
{
|
| 1049 |
+
"epoch": 1.2735042735042734,
|
| 1050 |
+
"grad_norm": 0.9421346142612829,
|
| 1051 |
+
"learning_rate": 8.6458646223039e-06,
|
| 1052 |
+
"loss": 0.2545,
|
| 1053 |
+
"step": 149
|
| 1054 |
+
},
|
| 1055 |
+
{
|
| 1056 |
+
"epoch": 1.282051282051282,
|
| 1057 |
+
"grad_norm": 1.020294862762954,
|
| 1058 |
+
"learning_rate": 8.620230280453672e-06,
|
| 1059 |
+
"loss": 0.2773,
|
| 1060 |
+
"step": 150
|
| 1061 |
+
},
|
| 1062 |
+
{
|
| 1063 |
+
"epoch": 1.2905982905982907,
|
| 1064 |
+
"grad_norm": 0.9909459877705835,
|
| 1065 |
+
"learning_rate": 8.594394348255239e-06,
|
| 1066 |
+
"loss": 0.2741,
|
| 1067 |
+
"step": 151
|
| 1068 |
+
},
|
| 1069 |
+
{
|
| 1070 |
+
"epoch": 1.2991452991452992,
|
| 1071 |
+
"grad_norm": 0.9494309377838384,
|
| 1072 |
+
"learning_rate": 8.568358264366958e-06,
|
| 1073 |
+
"loss": 0.2467,
|
| 1074 |
+
"step": 152
|
| 1075 |
+
},
|
| 1076 |
+
{
|
| 1077 |
+
"epoch": 1.3076923076923077,
|
| 1078 |
+
"grad_norm": 1.0161704485065284,
|
| 1079 |
+
"learning_rate": 8.542123478592518e-06,
|
| 1080 |
+
"loss": 0.287,
|
| 1081 |
+
"step": 153
|
| 1082 |
+
},
|
| 1083 |
+
{
|
| 1084 |
+
"epoch": 1.3162393162393162,
|
| 1085 |
+
"grad_norm": 1.0207054242080966,
|
| 1086 |
+
"learning_rate": 8.515691451800206e-06,
|
| 1087 |
+
"loss": 0.2905,
|
| 1088 |
+
"step": 154
|
| 1089 |
+
},
|
| 1090 |
+
{
|
| 1091 |
+
"epoch": 1.3247863247863247,
|
| 1092 |
+
"grad_norm": 1.022131931414966,
|
| 1093 |
+
"learning_rate": 8.489063655841552e-06,
|
| 1094 |
+
"loss": 0.2728,
|
| 1095 |
+
"step": 155
|
| 1096 |
+
},
|
| 1097 |
+
{
|
| 1098 |
+
"epoch": 1.3333333333333333,
|
| 1099 |
+
"grad_norm": 1.0725266744704032,
|
| 1100 |
+
"learning_rate": 8.462241573469378e-06,
|
| 1101 |
+
"loss": 0.289,
|
| 1102 |
+
"step": 156
|
| 1103 |
+
},
|
| 1104 |
+
{
|
| 1105 |
+
"epoch": 1.341880341880342,
|
| 1106 |
+
"grad_norm": 1.0458013617797695,
|
| 1107 |
+
"learning_rate": 8.435226698255228e-06,
|
| 1108 |
+
"loss": 0.2929,
|
| 1109 |
+
"step": 157
|
| 1110 |
+
},
|
| 1111 |
+
{
|
| 1112 |
+
"epoch": 1.3504273504273505,
|
| 1113 |
+
"grad_norm": 0.9861514317089332,
|
| 1114 |
+
"learning_rate": 8.408020534506195e-06,
|
| 1115 |
+
"loss": 0.2572,
|
| 1116 |
+
"step": 158
|
| 1117 |
+
},
|
| 1118 |
+
{
|
| 1119 |
+
"epoch": 1.358974358974359,
|
| 1120 |
+
"grad_norm": 1.1010237190802399,
|
| 1121 |
+
"learning_rate": 8.380624597181165e-06,
|
| 1122 |
+
"loss": 0.3027,
|
| 1123 |
+
"step": 159
|
| 1124 |
+
},
|
| 1125 |
+
{
|
| 1126 |
+
"epoch": 1.3675213675213675,
|
| 1127 |
+
"grad_norm": 1.0258156162843595,
|
| 1128 |
+
"learning_rate": 8.353040411806449e-06,
|
| 1129 |
+
"loss": 0.2633,
|
| 1130 |
+
"step": 160
|
| 1131 |
+
},
|
| 1132 |
+
{
|
| 1133 |
+
"epoch": 1.376068376068376,
|
| 1134 |
+
"grad_norm": 1.01005527335511,
|
| 1135 |
+
"learning_rate": 8.325269514390835e-06,
|
| 1136 |
+
"loss": 0.2983,
|
| 1137 |
+
"step": 161
|
| 1138 |
+
},
|
| 1139 |
+
{
|
| 1140 |
+
"epoch": 1.3846153846153846,
|
| 1141 |
+
"grad_norm": 1.2204776934624333,
|
| 1142 |
+
"learning_rate": 8.297313451340064e-06,
|
| 1143 |
+
"loss": 0.2861,
|
| 1144 |
+
"step": 162
|
| 1145 |
+
},
|
| 1146 |
+
{
|
| 1147 |
+
"epoch": 1.393162393162393,
|
| 1148 |
+
"grad_norm": 0.8734578653516611,
|
| 1149 |
+
"learning_rate": 8.269173779370712e-06,
|
| 1150 |
+
"loss": 0.2292,
|
| 1151 |
+
"step": 163
|
| 1152 |
+
},
|
| 1153 |
+
{
|
| 1154 |
+
"epoch": 1.4017094017094016,
|
| 1155 |
+
"grad_norm": 0.9861868131334284,
|
| 1156 |
+
"learning_rate": 8.240852065423507e-06,
|
| 1157 |
+
"loss": 0.2777,
|
| 1158 |
+
"step": 164
|
| 1159 |
+
},
|
| 1160 |
+
{
|
| 1161 |
+
"epoch": 1.4102564102564101,
|
| 1162 |
+
"grad_norm": 1.0383132702636761,
|
| 1163 |
+
"learning_rate": 8.21234988657607e-06,
|
| 1164 |
+
"loss": 0.2914,
|
| 1165 |
+
"step": 165
|
| 1166 |
+
},
|
| 1167 |
+
{
|
| 1168 |
+
"epoch": 1.4188034188034189,
|
| 1169 |
+
"grad_norm": 1.0002371661495773,
|
| 1170 |
+
"learning_rate": 8.183668829955111e-06,
|
| 1171 |
+
"loss": 0.2978,
|
| 1172 |
+
"step": 166
|
| 1173 |
+
},
|
| 1174 |
+
{
|
| 1175 |
+
"epoch": 1.4273504273504274,
|
| 1176 |
+
"grad_norm": 0.92226966003497,
|
| 1177 |
+
"learning_rate": 8.154810492648038e-06,
|
| 1178 |
+
"loss": 0.2509,
|
| 1179 |
+
"step": 167
|
| 1180 |
+
},
|
| 1181 |
+
{
|
| 1182 |
+
"epoch": 1.435897435897436,
|
| 1183 |
+
"grad_norm": 0.9162109513490585,
|
| 1184 |
+
"learning_rate": 8.125776481614025e-06,
|
| 1185 |
+
"loss": 0.2571,
|
| 1186 |
+
"step": 168
|
| 1187 |
+
},
|
| 1188 |
+
{
|
| 1189 |
+
"epoch": 1.4444444444444444,
|
| 1190 |
+
"grad_norm": 1.0277779346011928,
|
| 1191 |
+
"learning_rate": 8.096568413594533e-06,
|
| 1192 |
+
"loss": 0.2785,
|
| 1193 |
+
"step": 169
|
| 1194 |
+
},
|
| 1195 |
+
{
|
| 1196 |
+
"epoch": 1.452991452991453,
|
| 1197 |
+
"grad_norm": 0.9850257001130588,
|
| 1198 |
+
"learning_rate": 8.067187915023283e-06,
|
| 1199 |
+
"loss": 0.2539,
|
| 1200 |
+
"step": 170
|
| 1201 |
+
},
|
| 1202 |
+
{
|
| 1203 |
+
"epoch": 1.4615384615384617,
|
| 1204 |
+
"grad_norm": 1.0438356899162438,
|
| 1205 |
+
"learning_rate": 8.037636621935686e-06,
|
| 1206 |
+
"loss": 0.2766,
|
| 1207 |
+
"step": 171
|
| 1208 |
+
},
|
| 1209 |
+
{
|
| 1210 |
+
"epoch": 1.4700854700854702,
|
| 1211 |
+
"grad_norm": 1.1044905378606227,
|
| 1212 |
+
"learning_rate": 8.007916179877742e-06,
|
| 1213 |
+
"loss": 0.3066,
|
| 1214 |
+
"step": 172
|
| 1215 |
+
},
|
| 1216 |
+
{
|
| 1217 |
+
"epoch": 1.4786324786324787,
|
| 1218 |
+
"grad_norm": 1.1986894818242533,
|
| 1219 |
+
"learning_rate": 7.978028243814416e-06,
|
| 1220 |
+
"loss": 0.2934,
|
| 1221 |
+
"step": 173
|
| 1222 |
+
},
|
| 1223 |
+
{
|
| 1224 |
+
"epoch": 1.4871794871794872,
|
| 1225 |
+
"grad_norm": 0.9261423596893972,
|
| 1226 |
+
"learning_rate": 7.947974478037468e-06,
|
| 1227 |
+
"loss": 0.267,
|
| 1228 |
+
"step": 174
|
| 1229 |
+
},
|
| 1230 |
+
{
|
| 1231 |
+
"epoch": 1.4957264957264957,
|
| 1232 |
+
"grad_norm": 1.0443413434899798,
|
| 1233 |
+
"learning_rate": 7.917756556072792e-06,
|
| 1234 |
+
"loss": 0.2976,
|
| 1235 |
+
"step": 175
|
| 1236 |
+
},
|
| 1237 |
+
{
|
| 1238 |
+
"epoch": 1.5042735042735043,
|
| 1239 |
+
"grad_norm": 1.0384861014624558,
|
| 1240 |
+
"learning_rate": 7.887376160587214e-06,
|
| 1241 |
+
"loss": 0.2864,
|
| 1242 |
+
"step": 176
|
| 1243 |
+
},
|
| 1244 |
+
{
|
| 1245 |
+
"epoch": 1.5128205128205128,
|
| 1246 |
+
"grad_norm": 1.0318547123175033,
|
| 1247 |
+
"learning_rate": 7.85683498329481e-06,
|
| 1248 |
+
"loss": 0.2777,
|
| 1249 |
+
"step": 177
|
| 1250 |
+
},
|
| 1251 |
+
{
|
| 1252 |
+
"epoch": 1.5213675213675213,
|
| 1253 |
+
"grad_norm": 0.9592453443113762,
|
| 1254 |
+
"learning_rate": 7.826134724862687e-06,
|
| 1255 |
+
"loss": 0.2653,
|
| 1256 |
+
"step": 178
|
| 1257 |
+
},
|
| 1258 |
+
{
|
| 1259 |
+
"epoch": 1.5299145299145298,
|
| 1260 |
+
"grad_norm": 0.9570337836331478,
|
| 1261 |
+
"learning_rate": 7.795277094816292e-06,
|
| 1262 |
+
"loss": 0.2454,
|
| 1263 |
+
"step": 179
|
| 1264 |
+
},
|
| 1265 |
+
{
|
| 1266 |
+
"epoch": 1.5384615384615383,
|
| 1267 |
+
"grad_norm": 1.0457133463401027,
|
| 1268 |
+
"learning_rate": 7.764263811444214e-06,
|
| 1269 |
+
"loss": 0.2712,
|
| 1270 |
+
"step": 180
|
| 1271 |
+
},
|
| 1272 |
+
{
|
| 1273 |
+
"epoch": 1.547008547008547,
|
| 1274 |
+
"grad_norm": 1.0207456095370218,
|
| 1275 |
+
"learning_rate": 7.733096601702508e-06,
|
| 1276 |
+
"loss": 0.2732,
|
| 1277 |
+
"step": 181
|
| 1278 |
+
},
|
| 1279 |
+
{
|
| 1280 |
+
"epoch": 1.5555555555555556,
|
| 1281 |
+
"grad_norm": 1.0244190668219126,
|
| 1282 |
+
"learning_rate": 7.70177720111852e-06,
|
| 1283 |
+
"loss": 0.2934,
|
| 1284 |
+
"step": 182
|
| 1285 |
+
},
|
| 1286 |
+
{
|
| 1287 |
+
"epoch": 1.564102564102564,
|
| 1288 |
+
"grad_norm": 0.9954405580380525,
|
| 1289 |
+
"learning_rate": 7.67030735369426e-06,
|
| 1290 |
+
"loss": 0.2925,
|
| 1291 |
+
"step": 183
|
| 1292 |
+
},
|
| 1293 |
+
{
|
| 1294 |
+
"epoch": 1.5726495726495726,
|
| 1295 |
+
"grad_norm": 0.9322832104494698,
|
| 1296 |
+
"learning_rate": 7.638688811809274e-06,
|
| 1297 |
+
"loss": 0.2472,
|
| 1298 |
+
"step": 184
|
| 1299 |
+
},
|
| 1300 |
+
{
|
| 1301 |
+
"epoch": 1.5811965811965814,
|
| 1302 |
+
"grad_norm": 1.0600233137539596,
|
| 1303 |
+
"learning_rate": 7.6069233361230696e-06,
|
| 1304 |
+
"loss": 0.3104,
|
| 1305 |
+
"step": 185
|
| 1306 |
+
},
|
| 1307 |
+
{
|
| 1308 |
+
"epoch": 1.5897435897435899,
|
| 1309 |
+
"grad_norm": 1.0083319379085491,
|
| 1310 |
+
"learning_rate": 7.575012695477076e-06,
|
| 1311 |
+
"loss": 0.2847,
|
| 1312 |
+
"step": 186
|
| 1313 |
+
},
|
| 1314 |
+
{
|
| 1315 |
+
"epoch": 1.5982905982905984,
|
| 1316 |
+
"grad_norm": 1.041305415335912,
|
| 1317 |
+
"learning_rate": 7.542958666796149e-06,
|
| 1318 |
+
"loss": 0.2706,
|
| 1319 |
+
"step": 187
|
| 1320 |
+
},
|
| 1321 |
+
{
|
| 1322 |
+
"epoch": 1.606837606837607,
|
| 1323 |
+
"grad_norm": 1.1329161208604377,
|
| 1324 |
+
"learning_rate": 7.510763034989616e-06,
|
| 1325 |
+
"loss": 0.2914,
|
| 1326 |
+
"step": 188
|
| 1327 |
+
},
|
| 1328 |
+
{
|
| 1329 |
+
"epoch": 1.6153846153846154,
|
| 1330 |
+
"grad_norm": 1.0916420589362317,
|
| 1331 |
+
"learning_rate": 7.478427592851894e-06,
|
| 1332 |
+
"loss": 0.2786,
|
| 1333 |
+
"step": 189
|
| 1334 |
+
},
|
| 1335 |
+
{
|
| 1336 |
+
"epoch": 1.623931623931624,
|
| 1337 |
+
"grad_norm": 1.0581617052700192,
|
| 1338 |
+
"learning_rate": 7.44595414096265e-06,
|
| 1339 |
+
"loss": 0.2628,
|
| 1340 |
+
"step": 190
|
| 1341 |
+
},
|
| 1342 |
+
{
|
| 1343 |
+
"epoch": 1.6324786324786325,
|
| 1344 |
+
"grad_norm": 0.9898228571273449,
|
| 1345 |
+
"learning_rate": 7.413344487586542e-06,
|
| 1346 |
+
"loss": 0.284,
|
| 1347 |
+
"step": 191
|
| 1348 |
+
},
|
| 1349 |
+
{
|
| 1350 |
+
"epoch": 1.641025641025641,
|
| 1351 |
+
"grad_norm": 0.9867082418046837,
|
| 1352 |
+
"learning_rate": 7.380600448572532e-06,
|
| 1353 |
+
"loss": 0.2893,
|
| 1354 |
+
"step": 192
|
| 1355 |
+
},
|
| 1356 |
+
{
|
| 1357 |
+
"epoch": 1.6495726495726495,
|
| 1358 |
+
"grad_norm": 0.9672882314435588,
|
| 1359 |
+
"learning_rate": 7.347723847252756e-06,
|
| 1360 |
+
"loss": 0.2797,
|
| 1361 |
+
"step": 193
|
| 1362 |
+
},
|
| 1363 |
+
{
|
| 1364 |
+
"epoch": 1.658119658119658,
|
| 1365 |
+
"grad_norm": 1.0401540523766375,
|
| 1366 |
+
"learning_rate": 7.314716514341007e-06,
|
| 1367 |
+
"loss": 0.246,
|
| 1368 |
+
"step": 194
|
| 1369 |
+
},
|
| 1370 |
+
{
|
| 1371 |
+
"epoch": 1.6666666666666665,
|
| 1372 |
+
"grad_norm": 0.9689645676758608,
|
| 1373 |
+
"learning_rate": 7.28158028783079e-06,
|
| 1374 |
+
"loss": 0.2923,
|
| 1375 |
+
"step": 195
|
| 1376 |
+
},
|
| 1377 |
+
{
|
| 1378 |
+
"epoch": 1.6752136752136753,
|
| 1379 |
+
"grad_norm": 0.935601541197187,
|
| 1380 |
+
"learning_rate": 7.248317012892969e-06,
|
| 1381 |
+
"loss": 0.2572,
|
| 1382 |
+
"step": 196
|
| 1383 |
+
},
|
| 1384 |
+
{
|
| 1385 |
+
"epoch": 1.6837606837606838,
|
| 1386 |
+
"grad_norm": 1.10318785764845,
|
| 1387 |
+
"learning_rate": 7.214928541773027e-06,
|
| 1388 |
+
"loss": 0.2795,
|
| 1389 |
+
"step": 197
|
| 1390 |
+
},
|
| 1391 |
+
{
|
| 1392 |
+
"epoch": 1.6923076923076923,
|
| 1393 |
+
"grad_norm": 0.9868329475934362,
|
| 1394 |
+
"learning_rate": 7.1814167336879195e-06,
|
| 1395 |
+
"loss": 0.284,
|
| 1396 |
+
"step": 198
|
| 1397 |
+
},
|
| 1398 |
+
{
|
| 1399 |
+
"epoch": 1.7008547008547008,
|
| 1400 |
+
"grad_norm": 1.044608088122816,
|
| 1401 |
+
"learning_rate": 7.147783454722545e-06,
|
| 1402 |
+
"loss": 0.3048,
|
| 1403 |
+
"step": 199
|
| 1404 |
+
},
|
| 1405 |
+
{
|
| 1406 |
+
"epoch": 1.7094017094017095,
|
| 1407 |
+
"grad_norm": 1.0799645803249942,
|
| 1408 |
+
"learning_rate": 7.1140305777258355e-06,
|
| 1409 |
+
"loss": 0.2863,
|
| 1410 |
+
"step": 200
|
| 1411 |
+
},
|
| 1412 |
+
{
|
| 1413 |
+
"epoch": 1.717948717948718,
|
| 1414 |
+
"grad_norm": 1.0517923573554782,
|
| 1415 |
+
"learning_rate": 7.080159982206471e-06,
|
| 1416 |
+
"loss": 0.3145,
|
| 1417 |
+
"step": 201
|
| 1418 |
+
},
|
| 1419 |
+
{
|
| 1420 |
+
"epoch": 1.7264957264957266,
|
| 1421 |
+
"grad_norm": 0.9968670693310975,
|
| 1422 |
+
"learning_rate": 7.046173554228213e-06,
|
| 1423 |
+
"loss": 0.254,
|
| 1424 |
+
"step": 202
|
| 1425 |
+
},
|
| 1426 |
+
{
|
| 1427 |
+
"epoch": 1.735042735042735,
|
| 1428 |
+
"grad_norm": 0.964749838672855,
|
| 1429 |
+
"learning_rate": 7.012073186304885e-06,
|
| 1430 |
+
"loss": 0.2758,
|
| 1431 |
+
"step": 203
|
| 1432 |
+
},
|
| 1433 |
+
{
|
| 1434 |
+
"epoch": 1.7435897435897436,
|
| 1435 |
+
"grad_norm": 1.0047621299766185,
|
| 1436 |
+
"learning_rate": 6.9778607772949894e-06,
|
| 1437 |
+
"loss": 0.2464,
|
| 1438 |
+
"step": 204
|
| 1439 |
+
},
|
| 1440 |
+
{
|
| 1441 |
+
"epoch": 1.7521367521367521,
|
| 1442 |
+
"grad_norm": 1.0086773804431133,
|
| 1443 |
+
"learning_rate": 6.943538232295965e-06,
|
| 1444 |
+
"loss": 0.2825,
|
| 1445 |
+
"step": 205
|
| 1446 |
+
},
|
| 1447 |
+
{
|
| 1448 |
+
"epoch": 1.7606837606837606,
|
| 1449 |
+
"grad_norm": 1.0353438135920368,
|
| 1450 |
+
"learning_rate": 6.909107462538113e-06,
|
| 1451 |
+
"loss": 0.2653,
|
| 1452 |
+
"step": 206
|
| 1453 |
+
},
|
| 1454 |
+
{
|
| 1455 |
+
"epoch": 1.7692307692307692,
|
| 1456 |
+
"grad_norm": 1.075416890479264,
|
| 1457 |
+
"learning_rate": 6.874570385278161e-06,
|
| 1458 |
+
"loss": 0.2708,
|
| 1459 |
+
"step": 207
|
| 1460 |
+
},
|
| 1461 |
+
{
|
| 1462 |
+
"epoch": 1.7777777777777777,
|
| 1463 |
+
"grad_norm": 1.0717559406017942,
|
| 1464 |
+
"learning_rate": 6.839928923692505e-06,
|
| 1465 |
+
"loss": 0.2816,
|
| 1466 |
+
"step": 208
|
| 1467 |
+
},
|
| 1468 |
+
{
|
| 1469 |
+
"epoch": 1.7863247863247862,
|
| 1470 |
+
"grad_norm": 0.9699589020057593,
|
| 1471 |
+
"learning_rate": 6.805185006770125e-06,
|
| 1472 |
+
"loss": 0.2907,
|
| 1473 |
+
"step": 209
|
| 1474 |
+
},
|
| 1475 |
+
{
|
| 1476 |
+
"epoch": 1.7948717948717947,
|
| 1477 |
+
"grad_norm": 1.037057337578332,
|
| 1478 |
+
"learning_rate": 6.7703405692051585e-06,
|
| 1479 |
+
"loss": 0.2938,
|
| 1480 |
+
"step": 210
|
| 1481 |
+
},
|
| 1482 |
+
{
|
| 1483 |
+
"epoch": 1.8034188034188035,
|
| 1484 |
+
"grad_norm": 1.044362011849155,
|
| 1485 |
+
"learning_rate": 6.735397551289179e-06,
|
| 1486 |
+
"loss": 0.2687,
|
| 1487 |
+
"step": 211
|
| 1488 |
+
},
|
| 1489 |
+
{
|
| 1490 |
+
"epoch": 1.811965811965812,
|
| 1491 |
+
"grad_norm": 1.033400330455886,
|
| 1492 |
+
"learning_rate": 6.700357898803146e-06,
|
| 1493 |
+
"loss": 0.2532,
|
| 1494 |
+
"step": 212
|
| 1495 |
+
},
|
| 1496 |
+
{
|
| 1497 |
+
"epoch": 1.8205128205128205,
|
| 1498 |
+
"grad_norm": 0.9636160334145306,
|
| 1499 |
+
"learning_rate": 6.665223562909058e-06,
|
| 1500 |
+
"loss": 0.2592,
|
| 1501 |
+
"step": 213
|
| 1502 |
+
},
|
| 1503 |
+
{
|
| 1504 |
+
"epoch": 1.8290598290598292,
|
| 1505 |
+
"grad_norm": 1.0596242484536975,
|
| 1506 |
+
"learning_rate": 6.629996500041299e-06,
|
| 1507 |
+
"loss": 0.2884,
|
| 1508 |
+
"step": 214
|
| 1509 |
+
},
|
| 1510 |
+
{
|
| 1511 |
+
"epoch": 1.8376068376068377,
|
| 1512 |
+
"grad_norm": 1.153168789304082,
|
| 1513 |
+
"learning_rate": 6.5946786717977026e-06,
|
| 1514 |
+
"loss": 0.2597,
|
| 1515 |
+
"step": 215
|
| 1516 |
+
},
|
| 1517 |
+
{
|
| 1518 |
+
"epoch": 1.8461538461538463,
|
| 1519 |
+
"grad_norm": 1.0937153973454066,
|
| 1520 |
+
"learning_rate": 6.5592720448303174e-06,
|
| 1521 |
+
"loss": 0.2828,
|
| 1522 |
+
"step": 216
|
| 1523 |
+
},
|
| 1524 |
+
{
|
| 1525 |
+
"epoch": 1.8547008547008548,
|
| 1526 |
+
"grad_norm": 1.0435570626624995,
|
| 1527 |
+
"learning_rate": 6.523778590735892e-06,
|
| 1528 |
+
"loss": 0.264,
|
| 1529 |
+
"step": 217
|
| 1530 |
+
},
|
| 1531 |
+
{
|
| 1532 |
+
"epoch": 1.8632478632478633,
|
| 1533 |
+
"grad_norm": 1.0159218667337082,
|
| 1534 |
+
"learning_rate": 6.488200285946094e-06,
|
| 1535 |
+
"loss": 0.2852,
|
| 1536 |
+
"step": 218
|
| 1537 |
+
},
|
| 1538 |
+
{
|
| 1539 |
+
"epoch": 1.8717948717948718,
|
| 1540 |
+
"grad_norm": 1.04164062658954,
|
| 1541 |
+
"learning_rate": 6.452539111617454e-06,
|
| 1542 |
+
"loss": 0.29,
|
| 1543 |
+
"step": 219
|
| 1544 |
+
},
|
| 1545 |
+
{
|
| 1546 |
+
"epoch": 1.8803418803418803,
|
| 1547 |
+
"grad_norm": 0.9410186884244581,
|
| 1548 |
+
"learning_rate": 6.416797053521039e-06,
|
| 1549 |
+
"loss": 0.2794,
|
| 1550 |
+
"step": 220
|
| 1551 |
+
},
|
| 1552 |
+
{
|
| 1553 |
+
"epoch": 1.8888888888888888,
|
| 1554 |
+
"grad_norm": 1.1049755203106681,
|
| 1555 |
+
"learning_rate": 6.380976101931879e-06,
|
| 1556 |
+
"loss": 0.2781,
|
| 1557 |
+
"step": 221
|
| 1558 |
+
},
|
| 1559 |
+
{
|
| 1560 |
+
"epoch": 1.8974358974358974,
|
| 1561 |
+
"grad_norm": 1.060999044968166,
|
| 1562 |
+
"learning_rate": 6.345078251518144e-06,
|
| 1563 |
+
"loss": 0.2954,
|
| 1564 |
+
"step": 222
|
| 1565 |
+
},
|
| 1566 |
+
{
|
| 1567 |
+
"epoch": 1.9059829059829059,
|
| 1568 |
+
"grad_norm": 0.97766743042665,
|
| 1569 |
+
"learning_rate": 6.3091055012300675e-06,
|
| 1570 |
+
"loss": 0.2625,
|
| 1571 |
+
"step": 223
|
| 1572 |
+
},
|
| 1573 |
+
{
|
| 1574 |
+
"epoch": 1.9145299145299144,
|
| 1575 |
+
"grad_norm": 0.9506649490274797,
|
| 1576 |
+
"learning_rate": 6.273059854188636e-06,
|
| 1577 |
+
"loss": 0.2661,
|
| 1578 |
+
"step": 224
|
| 1579 |
+
},
|
| 1580 |
+
{
|
| 1581 |
+
"epoch": 1.9230769230769231,
|
| 1582 |
+
"grad_norm": 1.1043737999592356,
|
| 1583 |
+
"learning_rate": 6.236943317574054e-06,
|
| 1584 |
+
"loss": 0.3124,
|
| 1585 |
+
"step": 225
|
| 1586 |
+
},
|
| 1587 |
+
{
|
| 1588 |
+
"epoch": 1.9316239316239316,
|
| 1589 |
+
"grad_norm": 0.9154283261070125,
|
| 1590 |
+
"learning_rate": 6.200757902513962e-06,
|
| 1591 |
+
"loss": 0.2478,
|
| 1592 |
+
"step": 226
|
| 1593 |
+
},
|
| 1594 |
+
{
|
| 1595 |
+
"epoch": 1.9401709401709402,
|
| 1596 |
+
"grad_norm": 1.0837031286372636,
|
| 1597 |
+
"learning_rate": 6.164505623971458e-06,
|
| 1598 |
+
"loss": 0.2795,
|
| 1599 |
+
"step": 227
|
| 1600 |
+
},
|
| 1601 |
+
{
|
| 1602 |
+
"epoch": 1.9487179487179487,
|
| 1603 |
+
"grad_norm": 1.1060980919238643,
|
| 1604 |
+
"learning_rate": 6.128188500632892e-06,
|
| 1605 |
+
"loss": 0.3015,
|
| 1606 |
+
"step": 228
|
| 1607 |
+
},
|
| 1608 |
+
{
|
| 1609 |
+
"epoch": 1.9572649572649574,
|
| 1610 |
+
"grad_norm": 0.995226395302528,
|
| 1611 |
+
"learning_rate": 6.091808554795462e-06,
|
| 1612 |
+
"loss": 0.2527,
|
| 1613 |
+
"step": 229
|
| 1614 |
+
},
|
| 1615 |
+
{
|
| 1616 |
+
"epoch": 1.965811965811966,
|
| 1617 |
+
"grad_norm": 1.0160669700353187,
|
| 1618 |
+
"learning_rate": 6.055367812254592e-06,
|
| 1619 |
+
"loss": 0.2596,
|
| 1620 |
+
"step": 230
|
| 1621 |
+
},
|
| 1622 |
+
{
|
| 1623 |
+
"epoch": 1.9743589743589745,
|
| 1624 |
+
"grad_norm": 1.0168740840680386,
|
| 1625 |
+
"learning_rate": 6.0188683021911394e-06,
|
| 1626 |
+
"loss": 0.2526,
|
| 1627 |
+
"step": 231
|
| 1628 |
+
},
|
| 1629 |
+
{
|
| 1630 |
+
"epoch": 1.982905982905983,
|
| 1631 |
+
"grad_norm": 1.0487534405210723,
|
| 1632 |
+
"learning_rate": 5.982312057058392e-06,
|
| 1633 |
+
"loss": 0.2754,
|
| 1634 |
+
"step": 232
|
| 1635 |
+
},
|
| 1636 |
+
{
|
| 1637 |
+
"epoch": 1.9914529914529915,
|
| 1638 |
+
"grad_norm": 1.1701390273236945,
|
| 1639 |
+
"learning_rate": 5.9457011124689025e-06,
|
| 1640 |
+
"loss": 0.2923,
|
| 1641 |
+
"step": 233
|
| 1642 |
+
},
|
| 1643 |
+
{
|
| 1644 |
+
"epoch": 2.0,
|
| 1645 |
+
"grad_norm": 1.1642958300030686,
|
| 1646 |
+
"learning_rate": 5.9090375070811215e-06,
|
| 1647 |
+
"loss": 0.2803,
|
| 1648 |
+
"step": 234
|
| 1649 |
+
},
|
| 1650 |
+
{
|
| 1651 |
+
"epoch": 2.0085470085470085,
|
| 1652 |
+
"grad_norm": 1.069653544642503,
|
| 1653 |
+
"learning_rate": 5.872323282485889e-06,
|
| 1654 |
+
"loss": 0.1446,
|
| 1655 |
+
"step": 235
|
| 1656 |
+
},
|
| 1657 |
+
{
|
| 1658 |
+
"epoch": 2.017094017094017,
|
| 1659 |
+
"grad_norm": 1.503292464135147,
|
| 1660 |
+
"learning_rate": 5.835560483092743e-06,
|
| 1661 |
+
"loss": 0.1597,
|
| 1662 |
+
"step": 236
|
| 1663 |
+
},
|
| 1664 |
+
{
|
| 1665 |
+
"epoch": 2.0256410256410255,
|
| 1666 |
+
"grad_norm": 1.261233995216377,
|
| 1667 |
+
"learning_rate": 5.798751156016085e-06,
|
| 1668 |
+
"loss": 0.1642,
|
| 1669 |
+
"step": 237
|
| 1670 |
+
},
|
| 1671 |
+
{
|
| 1672 |
+
"epoch": 2.034188034188034,
|
| 1673 |
+
"grad_norm": 1.2079697622320351,
|
| 1674 |
+
"learning_rate": 5.7618973509611755e-06,
|
| 1675 |
+
"loss": 0.1526,
|
| 1676 |
+
"step": 238
|
| 1677 |
+
},
|
| 1678 |
+
{
|
| 1679 |
+
"epoch": 2.0427350427350426,
|
| 1680 |
+
"grad_norm": 1.149288621503201,
|
| 1681 |
+
"learning_rate": 5.72500112011001e-06,
|
| 1682 |
+
"loss": 0.1592,
|
| 1683 |
+
"step": 239
|
| 1684 |
+
},
|
| 1685 |
+
{
|
| 1686 |
+
"epoch": 2.051282051282051,
|
| 1687 |
+
"grad_norm": 1.4762296190724578,
|
| 1688 |
+
"learning_rate": 5.688064518007036e-06,
|
| 1689 |
+
"loss": 0.1421,
|
| 1690 |
+
"step": 240
|
| 1691 |
+
},
|
| 1692 |
+
{
|
| 1693 |
+
"epoch": 2.0598290598290596,
|
| 1694 |
+
"grad_norm": 2.003647719764341,
|
| 1695 |
+
"learning_rate": 5.651089601444752e-06,
|
| 1696 |
+
"loss": 0.1474,
|
| 1697 |
+
"step": 241
|
| 1698 |
+
},
|
| 1699 |
+
{
|
| 1700 |
+
"epoch": 2.0683760683760686,
|
| 1701 |
+
"grad_norm": 1.7668906081339444,
|
| 1702 |
+
"learning_rate": 5.614078429349172e-06,
|
| 1703 |
+
"loss": 0.1366,
|
| 1704 |
+
"step": 242
|
| 1705 |
+
},
|
| 1706 |
+
{
|
| 1707 |
+
"epoch": 2.076923076923077,
|
| 1708 |
+
"grad_norm": 2.3921788956538186,
|
| 1709 |
+
"learning_rate": 5.577033062665179e-06,
|
| 1710 |
+
"loss": 0.1582,
|
| 1711 |
+
"step": 243
|
| 1712 |
+
},
|
| 1713 |
+
{
|
| 1714 |
+
"epoch": 2.0854700854700856,
|
| 1715 |
+
"grad_norm": 1.6101269928361035,
|
| 1716 |
+
"learning_rate": 5.53995556424176e-06,
|
| 1717 |
+
"loss": 0.1515,
|
| 1718 |
+
"step": 244
|
| 1719 |
+
},
|
| 1720 |
+
{
|
| 1721 |
+
"epoch": 2.094017094017094,
|
| 1722 |
+
"grad_norm": 1.1559072830659123,
|
| 1723 |
+
"learning_rate": 5.50284799871714e-06,
|
| 1724 |
+
"loss": 0.1158,
|
| 1725 |
+
"step": 245
|
| 1726 |
+
},
|
| 1727 |
+
{
|
| 1728 |
+
"epoch": 2.1025641025641026,
|
| 1729 |
+
"grad_norm": 1.2340271146467505,
|
| 1730 |
+
"learning_rate": 5.465712432403812e-06,
|
| 1731 |
+
"loss": 0.1349,
|
| 1732 |
+
"step": 246
|
| 1733 |
+
},
|
| 1734 |
+
{
|
| 1735 |
+
"epoch": 2.111111111111111,
|
| 1736 |
+
"grad_norm": 1.2407989391392402,
|
| 1737 |
+
"learning_rate": 5.428550933173476e-06,
|
| 1738 |
+
"loss": 0.1353,
|
| 1739 |
+
"step": 247
|
| 1740 |
+
},
|
| 1741 |
+
{
|
| 1742 |
+
"epoch": 2.1196581196581197,
|
| 1743 |
+
"grad_norm": 1.301482212210664,
|
| 1744 |
+
"learning_rate": 5.391365570341893e-06,
|
| 1745 |
+
"loss": 0.1552,
|
| 1746 |
+
"step": 248
|
| 1747 |
+
},
|
| 1748 |
+
{
|
| 1749 |
+
"epoch": 2.128205128205128,
|
| 1750 |
+
"grad_norm": 1.2580505721084358,
|
| 1751 |
+
"learning_rate": 5.3541584145536475e-06,
|
| 1752 |
+
"loss": 0.1461,
|
| 1753 |
+
"step": 249
|
| 1754 |
+
},
|
| 1755 |
+
{
|
| 1756 |
+
"epoch": 2.1367521367521367,
|
| 1757 |
+
"grad_norm": 1.4720652877475484,
|
| 1758 |
+
"learning_rate": 5.3169315376668566e-06,
|
| 1759 |
+
"loss": 0.1385,
|
| 1760 |
+
"step": 250
|
| 1761 |
+
},
|
| 1762 |
+
{
|
| 1763 |
+
"epoch": 2.1452991452991452,
|
| 1764 |
+
"grad_norm": 1.1729142443934197,
|
| 1765 |
+
"learning_rate": 5.279687012637798e-06,
|
| 1766 |
+
"loss": 0.1293,
|
| 1767 |
+
"step": 251
|
| 1768 |
+
},
|
| 1769 |
+
{
|
| 1770 |
+
"epoch": 2.1538461538461537,
|
| 1771 |
+
"grad_norm": 1.15630597157973,
|
| 1772 |
+
"learning_rate": 5.242426913405471e-06,
|
| 1773 |
+
"loss": 0.1152,
|
| 1774 |
+
"step": 252
|
| 1775 |
+
},
|
| 1776 |
+
{
|
| 1777 |
+
"epoch": 2.1623931623931623,
|
| 1778 |
+
"grad_norm": 1.3236950867612902,
|
| 1779 |
+
"learning_rate": 5.2051533147761155e-06,
|
| 1780 |
+
"loss": 0.1405,
|
| 1781 |
+
"step": 253
|
| 1782 |
+
},
|
| 1783 |
+
{
|
| 1784 |
+
"epoch": 2.1709401709401708,
|
| 1785 |
+
"grad_norm": 1.5274593351451313,
|
| 1786 |
+
"learning_rate": 5.167868292307679e-06,
|
| 1787 |
+
"loss": 0.1429,
|
| 1788 |
+
"step": 254
|
| 1789 |
+
},
|
| 1790 |
+
{
|
| 1791 |
+
"epoch": 2.1794871794871793,
|
| 1792 |
+
"grad_norm": 1.1425761952751792,
|
| 1793 |
+
"learning_rate": 5.130573922194236e-06,
|
| 1794 |
+
"loss": 0.1309,
|
| 1795 |
+
"step": 255
|
| 1796 |
+
},
|
| 1797 |
+
{
|
| 1798 |
+
"epoch": 2.1880341880341883,
|
| 1799 |
+
"grad_norm": 1.622095836566193,
|
| 1800 |
+
"learning_rate": 5.093272281150383e-06,
|
| 1801 |
+
"loss": 0.1422,
|
| 1802 |
+
"step": 256
|
| 1803 |
+
},
|
| 1804 |
+
{
|
| 1805 |
+
"epoch": 2.1965811965811968,
|
| 1806 |
+
"grad_norm": 1.50224547669942,
|
| 1807 |
+
"learning_rate": 5.05596544629559e-06,
|
| 1808 |
+
"loss": 0.1526,
|
| 1809 |
+
"step": 257
|
| 1810 |
+
},
|
| 1811 |
+
{
|
| 1812 |
+
"epoch": 2.2051282051282053,
|
| 1813 |
+
"grad_norm": 1.4032519853329708,
|
| 1814 |
+
"learning_rate": 5.018655495038542e-06,
|
| 1815 |
+
"loss": 0.1386,
|
| 1816 |
+
"step": 258
|
| 1817 |
+
},
|
| 1818 |
+
{
|
| 1819 |
+
"epoch": 2.213675213675214,
|
| 1820 |
+
"grad_norm": 1.2766988294028478,
|
| 1821 |
+
"learning_rate": 4.981344504961459e-06,
|
| 1822 |
+
"loss": 0.1399,
|
| 1823 |
+
"step": 259
|
| 1824 |
+
},
|
| 1825 |
+
{
|
| 1826 |
+
"epoch": 2.2222222222222223,
|
| 1827 |
+
"grad_norm": 1.3462278929217413,
|
| 1828 |
+
"learning_rate": 4.944034553704412e-06,
|
| 1829 |
+
"loss": 0.132,
|
| 1830 |
+
"step": 260
|
| 1831 |
+
},
|
| 1832 |
+
{
|
| 1833 |
+
"epoch": 2.230769230769231,
|
| 1834 |
+
"grad_norm": 1.3348753763267436,
|
| 1835 |
+
"learning_rate": 4.906727718849619e-06,
|
| 1836 |
+
"loss": 0.1353,
|
| 1837 |
+
"step": 261
|
| 1838 |
+
},
|
| 1839 |
+
{
|
| 1840 |
+
"epoch": 2.2393162393162394,
|
| 1841 |
+
"grad_norm": 1.4997085467156723,
|
| 1842 |
+
"learning_rate": 4.8694260778057655e-06,
|
| 1843 |
+
"loss": 0.146,
|
| 1844 |
+
"step": 262
|
| 1845 |
+
},
|
| 1846 |
+
{
|
| 1847 |
+
"epoch": 2.247863247863248,
|
| 1848 |
+
"grad_norm": 1.326521062937016,
|
| 1849 |
+
"learning_rate": 4.832131707692322e-06,
|
| 1850 |
+
"loss": 0.1281,
|
| 1851 |
+
"step": 263
|
| 1852 |
+
},
|
| 1853 |
+
{
|
| 1854 |
+
"epoch": 2.2564102564102564,
|
| 1855 |
+
"grad_norm": 1.1798260881739706,
|
| 1856 |
+
"learning_rate": 4.7948466852238844e-06,
|
| 1857 |
+
"loss": 0.1438,
|
| 1858 |
+
"step": 264
|
| 1859 |
+
},
|
| 1860 |
+
{
|
| 1861 |
+
"epoch": 2.264957264957265,
|
| 1862 |
+
"grad_norm": 1.1727975205202528,
|
| 1863 |
+
"learning_rate": 4.757573086594529e-06,
|
| 1864 |
+
"loss": 0.116,
|
| 1865 |
+
"step": 265
|
| 1866 |
+
},
|
| 1867 |
+
{
|
| 1868 |
+
"epoch": 2.2735042735042734,
|
| 1869 |
+
"grad_norm": 1.3822252924380758,
|
| 1870 |
+
"learning_rate": 4.720312987362204e-06,
|
| 1871 |
+
"loss": 0.1113,
|
| 1872 |
+
"step": 266
|
| 1873 |
+
},
|
| 1874 |
+
{
|
| 1875 |
+
"epoch": 2.282051282051282,
|
| 1876 |
+
"grad_norm": 1.231698294599555,
|
| 1877 |
+
"learning_rate": 4.683068462333144e-06,
|
| 1878 |
+
"loss": 0.138,
|
| 1879 |
+
"step": 267
|
| 1880 |
+
},
|
| 1881 |
+
{
|
| 1882 |
+
"epoch": 2.2905982905982905,
|
| 1883 |
+
"grad_norm": 1.4446379845008153,
|
| 1884 |
+
"learning_rate": 4.645841585446356e-06,
|
| 1885 |
+
"loss": 0.1324,
|
| 1886 |
+
"step": 268
|
| 1887 |
+
},
|
| 1888 |
+
{
|
| 1889 |
+
"epoch": 2.299145299145299,
|
| 1890 |
+
"grad_norm": 1.2330401624249168,
|
| 1891 |
+
"learning_rate": 4.6086344296581095e-06,
|
| 1892 |
+
"loss": 0.1301,
|
| 1893 |
+
"step": 269
|
| 1894 |
+
},
|
| 1895 |
+
{
|
| 1896 |
+
"epoch": 2.3076923076923075,
|
| 1897 |
+
"grad_norm": 1.2926146242762988,
|
| 1898 |
+
"learning_rate": 4.5714490668265245e-06,
|
| 1899 |
+
"loss": 0.1348,
|
| 1900 |
+
"step": 270
|
| 1901 |
+
},
|
| 1902 |
+
{
|
| 1903 |
+
"epoch": 2.316239316239316,
|
| 1904 |
+
"grad_norm": 1.2530821975910227,
|
| 1905 |
+
"learning_rate": 4.534287567596189e-06,
|
| 1906 |
+
"loss": 0.1383,
|
| 1907 |
+
"step": 271
|
| 1908 |
+
},
|
| 1909 |
+
{
|
| 1910 |
+
"epoch": 2.324786324786325,
|
| 1911 |
+
"grad_norm": 1.192627395626684,
|
| 1912 |
+
"learning_rate": 4.497152001282861e-06,
|
| 1913 |
+
"loss": 0.1316,
|
| 1914 |
+
"step": 272
|
| 1915 |
+
},
|
| 1916 |
+
{
|
| 1917 |
+
"epoch": 2.3333333333333335,
|
| 1918 |
+
"grad_norm": 1.2535231135970228,
|
| 1919 |
+
"learning_rate": 4.460044435758241e-06,
|
| 1920 |
+
"loss": 0.1444,
|
| 1921 |
+
"step": 273
|
| 1922 |
+
},
|
| 1923 |
+
{
|
| 1924 |
+
"epoch": 2.341880341880342,
|
| 1925 |
+
"grad_norm": 1.1274733333105196,
|
| 1926 |
+
"learning_rate": 4.4229669373348225e-06,
|
| 1927 |
+
"loss": 0.1477,
|
| 1928 |
+
"step": 274
|
| 1929 |
+
},
|
| 1930 |
+
{
|
| 1931 |
+
"epoch": 2.3504273504273505,
|
| 1932 |
+
"grad_norm": 1.2274434991234653,
|
| 1933 |
+
"learning_rate": 4.3859215706508295e-06,
|
| 1934 |
+
"loss": 0.131,
|
| 1935 |
+
"step": 275
|
| 1936 |
+
},
|
| 1937 |
+
{
|
| 1938 |
+
"epoch": 2.358974358974359,
|
| 1939 |
+
"grad_norm": 1.1890612042985977,
|
| 1940 |
+
"learning_rate": 4.348910398555249e-06,
|
| 1941 |
+
"loss": 0.1459,
|
| 1942 |
+
"step": 276
|
| 1943 |
+
},
|
| 1944 |
+
{
|
| 1945 |
+
"epoch": 2.3675213675213675,
|
| 1946 |
+
"grad_norm": 1.2651976119409816,
|
| 1947 |
+
"learning_rate": 4.311935481992965e-06,
|
| 1948 |
+
"loss": 0.153,
|
| 1949 |
+
"step": 277
|
| 1950 |
+
},
|
| 1951 |
+
{
|
| 1952 |
+
"epoch": 2.376068376068376,
|
| 1953 |
+
"grad_norm": 1.2073049155472424,
|
| 1954 |
+
"learning_rate": 4.274998879889991e-06,
|
| 1955 |
+
"loss": 0.1308,
|
| 1956 |
+
"step": 278
|
| 1957 |
+
},
|
| 1958 |
+
{
|
| 1959 |
+
"epoch": 2.3846153846153846,
|
| 1960 |
+
"grad_norm": 1.2001752708922162,
|
| 1961 |
+
"learning_rate": 4.238102649038825e-06,
|
| 1962 |
+
"loss": 0.1401,
|
| 1963 |
+
"step": 279
|
| 1964 |
+
},
|
| 1965 |
+
{
|
| 1966 |
+
"epoch": 2.393162393162393,
|
| 1967 |
+
"grad_norm": 1.1597559886153073,
|
| 1968 |
+
"learning_rate": 4.2012488439839185e-06,
|
| 1969 |
+
"loss": 0.1339,
|
| 1970 |
+
"step": 280
|
| 1971 |
+
},
|
| 1972 |
+
{
|
| 1973 |
+
"epoch": 2.4017094017094016,
|
| 1974 |
+
"grad_norm": 1.2129337472313142,
|
| 1975 |
+
"learning_rate": 4.164439516907258e-06,
|
| 1976 |
+
"loss": 0.1235,
|
| 1977 |
+
"step": 281
|
| 1978 |
+
},
|
| 1979 |
+
{
|
| 1980 |
+
"epoch": 2.41025641025641,
|
| 1981 |
+
"grad_norm": 1.164487908603764,
|
| 1982 |
+
"learning_rate": 4.127676717514114e-06,
|
| 1983 |
+
"loss": 0.1165,
|
| 1984 |
+
"step": 282
|
| 1985 |
+
},
|
| 1986 |
+
{
|
| 1987 |
+
"epoch": 2.4188034188034186,
|
| 1988 |
+
"grad_norm": 1.5630221178287673,
|
| 1989 |
+
"learning_rate": 4.090962492918881e-06,
|
| 1990 |
+
"loss": 0.1283,
|
| 1991 |
+
"step": 283
|
| 1992 |
+
},
|
| 1993 |
+
{
|
| 1994 |
+
"epoch": 2.427350427350427,
|
| 1995 |
+
"grad_norm": 1.4467081408521456,
|
| 1996 |
+
"learning_rate": 4.054298887531099e-06,
|
| 1997 |
+
"loss": 0.1427,
|
| 1998 |
+
"step": 284
|
| 1999 |
+
},
|
| 2000 |
+
{
|
| 2001 |
+
"epoch": 2.435897435897436,
|
| 2002 |
+
"grad_norm": 1.3351337981128666,
|
| 2003 |
+
"learning_rate": 4.017687942941609e-06,
|
| 2004 |
+
"loss": 0.1266,
|
| 2005 |
+
"step": 285
|
| 2006 |
+
},
|
| 2007 |
+
{
|
| 2008 |
+
"epoch": 2.4444444444444446,
|
| 2009 |
+
"grad_norm": 1.3739930621375298,
|
| 2010 |
+
"learning_rate": 3.981131697808862e-06,
|
| 2011 |
+
"loss": 0.127,
|
| 2012 |
+
"step": 286
|
| 2013 |
+
},
|
| 2014 |
+
{
|
| 2015 |
+
"epoch": 2.452991452991453,
|
| 2016 |
+
"grad_norm": 1.3250657966359611,
|
| 2017 |
+
"learning_rate": 3.94463218774541e-06,
|
| 2018 |
+
"loss": 0.1317,
|
| 2019 |
+
"step": 287
|
| 2020 |
+
},
|
| 2021 |
+
{
|
| 2022 |
+
"epoch": 2.4615384615384617,
|
| 2023 |
+
"grad_norm": 1.3839053620631172,
|
| 2024 |
+
"learning_rate": 3.90819144520454e-06,
|
| 2025 |
+
"loss": 0.1486,
|
| 2026 |
+
"step": 288
|
| 2027 |
+
},
|
| 2028 |
+
{
|
| 2029 |
+
"epoch": 2.47008547008547,
|
| 2030 |
+
"grad_norm": 1.2541791548934644,
|
| 2031 |
+
"learning_rate": 3.8718114993671086e-06,
|
| 2032 |
+
"loss": 0.1411,
|
| 2033 |
+
"step": 289
|
| 2034 |
+
},
|
| 2035 |
+
{
|
| 2036 |
+
"epoch": 2.4786324786324787,
|
| 2037 |
+
"grad_norm": 1.2797919636646522,
|
| 2038 |
+
"learning_rate": 3.835494376028544e-06,
|
| 2039 |
+
"loss": 0.1329,
|
| 2040 |
+
"step": 290
|
| 2041 |
+
},
|
| 2042 |
+
{
|
| 2043 |
+
"epoch": 2.4871794871794872,
|
| 2044 |
+
"grad_norm": 1.19445175435913,
|
| 2045 |
+
"learning_rate": 3.799242097486038e-06,
|
| 2046 |
+
"loss": 0.1127,
|
| 2047 |
+
"step": 291
|
| 2048 |
+
},
|
| 2049 |
+
{
|
| 2050 |
+
"epoch": 2.4957264957264957,
|
| 2051 |
+
"grad_norm": 1.263873181736575,
|
| 2052 |
+
"learning_rate": 3.7630566824259456e-06,
|
| 2053 |
+
"loss": 0.1229,
|
| 2054 |
+
"step": 292
|
| 2055 |
+
},
|
| 2056 |
+
{
|
| 2057 |
+
"epoch": 2.5042735042735043,
|
| 2058 |
+
"grad_norm": 1.2758237081061692,
|
| 2059 |
+
"learning_rate": 3.726940145811363e-06,
|
| 2060 |
+
"loss": 0.1276,
|
| 2061 |
+
"step": 293
|
| 2062 |
+
},
|
| 2063 |
+
{
|
| 2064 |
+
"epoch": 2.5128205128205128,
|
| 2065 |
+
"grad_norm": 1.304674554826579,
|
| 2066 |
+
"learning_rate": 3.6908944987699346e-06,
|
| 2067 |
+
"loss": 0.1151,
|
| 2068 |
+
"step": 294
|
| 2069 |
+
},
|
| 2070 |
+
{
|
| 2071 |
+
"epoch": 2.5213675213675213,
|
| 2072 |
+
"grad_norm": 1.1714341440974179,
|
| 2073 |
+
"learning_rate": 3.6549217484818576e-06,
|
| 2074 |
+
"loss": 0.1395,
|
| 2075 |
+
"step": 295
|
| 2076 |
+
},
|
| 2077 |
+
{
|
| 2078 |
+
"epoch": 2.52991452991453,
|
| 2079 |
+
"grad_norm": 1.3058811514063335,
|
| 2080 |
+
"learning_rate": 3.6190238980681235e-06,
|
| 2081 |
+
"loss": 0.1436,
|
| 2082 |
+
"step": 296
|
| 2083 |
+
},
|
| 2084 |
+
{
|
| 2085 |
+
"epoch": 2.5384615384615383,
|
| 2086 |
+
"grad_norm": 1.2967742087987242,
|
| 2087 |
+
"learning_rate": 3.583202946478963e-06,
|
| 2088 |
+
"loss": 0.1258,
|
| 2089 |
+
"step": 297
|
| 2090 |
+
},
|
| 2091 |
+
{
|
| 2092 |
+
"epoch": 2.547008547008547,
|
| 2093 |
+
"grad_norm": 1.1913612474105706,
|
| 2094 |
+
"learning_rate": 3.5474608883825475e-06,
|
| 2095 |
+
"loss": 0.1346,
|
| 2096 |
+
"step": 298
|
| 2097 |
+
},
|
| 2098 |
+
{
|
| 2099 |
+
"epoch": 2.5555555555555554,
|
| 2100 |
+
"grad_norm": 1.1886275741984524,
|
| 2101 |
+
"learning_rate": 3.5117997140539073e-06,
|
| 2102 |
+
"loss": 0.1295,
|
| 2103 |
+
"step": 299
|
| 2104 |
+
},
|
| 2105 |
+
{
|
| 2106 |
+
"epoch": 2.564102564102564,
|
| 2107 |
+
"grad_norm": 1.122495545975888,
|
| 2108 |
+
"learning_rate": 3.47622140926411e-06,
|
| 2109 |
+
"loss": 0.1225,
|
| 2110 |
+
"step": 300
|
| 2111 |
+
},
|
| 2112 |
+
{
|
| 2113 |
+
"epoch": 2.5726495726495724,
|
| 2114 |
+
"grad_norm": 1.318932172034003,
|
| 2115 |
+
"learning_rate": 3.4407279551696846e-06,
|
| 2116 |
+
"loss": 0.1393,
|
| 2117 |
+
"step": 301
|
| 2118 |
+
},
|
| 2119 |
+
{
|
| 2120 |
+
"epoch": 2.5811965811965814,
|
| 2121 |
+
"grad_norm": 1.2535465593212531,
|
| 2122 |
+
"learning_rate": 3.4053213282022983e-06,
|
| 2123 |
+
"loss": 0.1245,
|
| 2124 |
+
"step": 302
|
| 2125 |
+
},
|
| 2126 |
+
{
|
| 2127 |
+
"epoch": 2.58974358974359,
|
| 2128 |
+
"grad_norm": 1.3994513320015718,
|
| 2129 |
+
"learning_rate": 3.370003499958703e-06,
|
| 2130 |
+
"loss": 0.1393,
|
| 2131 |
+
"step": 303
|
| 2132 |
+
},
|
| 2133 |
+
{
|
| 2134 |
+
"epoch": 2.5982905982905984,
|
| 2135 |
+
"grad_norm": 1.3295335537122033,
|
| 2136 |
+
"learning_rate": 3.334776437090944e-06,
|
| 2137 |
+
"loss": 0.1303,
|
| 2138 |
+
"step": 304
|
| 2139 |
+
},
|
| 2140 |
+
{
|
| 2141 |
+
"epoch": 2.606837606837607,
|
| 2142 |
+
"grad_norm": 1.2677029897614571,
|
| 2143 |
+
"learning_rate": 3.2996421011968546e-06,
|
| 2144 |
+
"loss": 0.1367,
|
| 2145 |
+
"step": 305
|
| 2146 |
+
},
|
| 2147 |
+
{
|
| 2148 |
+
"epoch": 2.6153846153846154,
|
| 2149 |
+
"grad_norm": 1.2546238705761343,
|
| 2150 |
+
"learning_rate": 3.264602448710822e-06,
|
| 2151 |
+
"loss": 0.1312,
|
| 2152 |
+
"step": 306
|
| 2153 |
+
},
|
| 2154 |
+
{
|
| 2155 |
+
"epoch": 2.623931623931624,
|
| 2156 |
+
"grad_norm": 1.3121100205006806,
|
| 2157 |
+
"learning_rate": 3.2296594307948428e-06,
|
| 2158 |
+
"loss": 0.1313,
|
| 2159 |
+
"step": 307
|
| 2160 |
+
},
|
| 2161 |
+
{
|
| 2162 |
+
"epoch": 2.6324786324786325,
|
| 2163 |
+
"grad_norm": 1.3584184422228247,
|
| 2164 |
+
"learning_rate": 3.194814993229878e-06,
|
| 2165 |
+
"loss": 0.1328,
|
| 2166 |
+
"step": 308
|
| 2167 |
+
},
|
| 2168 |
+
{
|
| 2169 |
+
"epoch": 2.641025641025641,
|
| 2170 |
+
"grad_norm": 1.253399856498852,
|
| 2171 |
+
"learning_rate": 3.1600710763074972e-06,
|
| 2172 |
+
"loss": 0.136,
|
| 2173 |
+
"step": 309
|
| 2174 |
+
},
|
| 2175 |
+
{
|
| 2176 |
+
"epoch": 2.6495726495726495,
|
| 2177 |
+
"grad_norm": 1.2109051722868416,
|
| 2178 |
+
"learning_rate": 3.125429614721842e-06,
|
| 2179 |
+
"loss": 0.1272,
|
| 2180 |
+
"step": 310
|
| 2181 |
+
},
|
| 2182 |
+
{
|
| 2183 |
+
"epoch": 2.658119658119658,
|
| 2184 |
+
"grad_norm": 1.3473576434309786,
|
| 2185 |
+
"learning_rate": 3.090892537461889e-06,
|
| 2186 |
+
"loss": 0.1459,
|
| 2187 |
+
"step": 311
|
| 2188 |
+
},
|
| 2189 |
+
{
|
| 2190 |
+
"epoch": 2.6666666666666665,
|
| 2191 |
+
"grad_norm": 1.2233293824600466,
|
| 2192 |
+
"learning_rate": 3.056461767704037e-06,
|
| 2193 |
+
"loss": 0.1103,
|
| 2194 |
+
"step": 312
|
| 2195 |
+
},
|
| 2196 |
+
{
|
| 2197 |
+
"epoch": 2.6752136752136755,
|
| 2198 |
+
"grad_norm": 1.7294644676940956,
|
| 2199 |
+
"learning_rate": 3.0221392227050126e-06,
|
| 2200 |
+
"loss": 0.1226,
|
| 2201 |
+
"step": 313
|
| 2202 |
+
},
|
| 2203 |
+
{
|
| 2204 |
+
"epoch": 2.683760683760684,
|
| 2205 |
+
"grad_norm": 1.2909828604259357,
|
| 2206 |
+
"learning_rate": 2.9879268136951163e-06,
|
| 2207 |
+
"loss": 0.1195,
|
| 2208 |
+
"step": 314
|
| 2209 |
+
},
|
| 2210 |
+
{
|
| 2211 |
+
"epoch": 2.6923076923076925,
|
| 2212 |
+
"grad_norm": 1.272394384043866,
|
| 2213 |
+
"learning_rate": 2.953826445771788e-06,
|
| 2214 |
+
"loss": 0.1253,
|
| 2215 |
+
"step": 315
|
| 2216 |
+
},
|
| 2217 |
+
{
|
| 2218 |
+
"epoch": 2.700854700854701,
|
| 2219 |
+
"grad_norm": 1.3100049119552946,
|
| 2220 |
+
"learning_rate": 2.9198400177935303e-06,
|
| 2221 |
+
"loss": 0.1315,
|
| 2222 |
+
"step": 316
|
| 2223 |
+
},
|
| 2224 |
+
{
|
| 2225 |
+
"epoch": 2.7094017094017095,
|
| 2226 |
+
"grad_norm": 1.4563737233249137,
|
| 2227 |
+
"learning_rate": 2.8859694222741653e-06,
|
| 2228 |
+
"loss": 0.1515,
|
| 2229 |
+
"step": 317
|
| 2230 |
+
},
|
| 2231 |
+
{
|
| 2232 |
+
"epoch": 2.717948717948718,
|
| 2233 |
+
"grad_norm": 1.3661596293666407,
|
| 2234 |
+
"learning_rate": 2.852216545277456e-06,
|
| 2235 |
+
"loss": 0.1375,
|
| 2236 |
+
"step": 318
|
| 2237 |
+
},
|
| 2238 |
+
{
|
| 2239 |
+
"epoch": 2.7264957264957266,
|
| 2240 |
+
"grad_norm": 1.3215922683830597,
|
| 2241 |
+
"learning_rate": 2.8185832663120817e-06,
|
| 2242 |
+
"loss": 0.1326,
|
| 2243 |
+
"step": 319
|
| 2244 |
+
},
|
| 2245 |
+
{
|
| 2246 |
+
"epoch": 2.735042735042735,
|
| 2247 |
+
"grad_norm": 1.2997204668749665,
|
| 2248 |
+
"learning_rate": 2.785071458226972e-06,
|
| 2249 |
+
"loss": 0.1309,
|
| 2250 |
+
"step": 320
|
| 2251 |
+
},
|
| 2252 |
+
{
|
| 2253 |
+
"epoch": 2.7435897435897436,
|
| 2254 |
+
"grad_norm": 1.38301882052004,
|
| 2255 |
+
"learning_rate": 2.7516829871070295e-06,
|
| 2256 |
+
"loss": 0.1373,
|
| 2257 |
+
"step": 321
|
| 2258 |
+
},
|
| 2259 |
+
{
|
| 2260 |
+
"epoch": 2.752136752136752,
|
| 2261 |
+
"grad_norm": 1.203414342919684,
|
| 2262 |
+
"learning_rate": 2.718419712169213e-06,
|
| 2263 |
+
"loss": 0.1177,
|
| 2264 |
+
"step": 322
|
| 2265 |
+
},
|
| 2266 |
+
{
|
| 2267 |
+
"epoch": 2.7606837606837606,
|
| 2268 |
+
"grad_norm": 1.1997353822311783,
|
| 2269 |
+
"learning_rate": 2.685283485658995e-06,
|
| 2270 |
+
"loss": 0.1287,
|
| 2271 |
+
"step": 323
|
| 2272 |
+
},
|
| 2273 |
+
{
|
| 2274 |
+
"epoch": 2.769230769230769,
|
| 2275 |
+
"grad_norm": 1.2830714772919205,
|
| 2276 |
+
"learning_rate": 2.6522761527472464e-06,
|
| 2277 |
+
"loss": 0.1371,
|
| 2278 |
+
"step": 324
|
| 2279 |
+
},
|
| 2280 |
+
{
|
| 2281 |
+
"epoch": 2.7777777777777777,
|
| 2282 |
+
"grad_norm": 1.2065889197198314,
|
| 2283 |
+
"learning_rate": 2.6193995514274705e-06,
|
| 2284 |
+
"loss": 0.1173,
|
| 2285 |
+
"step": 325
|
| 2286 |
+
},
|
| 2287 |
+
{
|
| 2288 |
+
"epoch": 2.786324786324786,
|
| 2289 |
+
"grad_norm": 1.3541924537020815,
|
| 2290 |
+
"learning_rate": 2.586655512413458e-06,
|
| 2291 |
+
"loss": 0.1376,
|
| 2292 |
+
"step": 326
|
| 2293 |
+
},
|
| 2294 |
+
{
|
| 2295 |
+
"epoch": 2.7948717948717947,
|
| 2296 |
+
"grad_norm": 1.3635242391799476,
|
| 2297 |
+
"learning_rate": 2.554045859037353e-06,
|
| 2298 |
+
"loss": 0.1479,
|
| 2299 |
+
"step": 327
|
| 2300 |
+
},
|
| 2301 |
+
{
|
| 2302 |
+
"epoch": 2.8034188034188032,
|
| 2303 |
+
"grad_norm": 1.3506673316004048,
|
| 2304 |
+
"learning_rate": 2.521572407148107e-06,
|
| 2305 |
+
"loss": 0.1329,
|
| 2306 |
+
"step": 328
|
| 2307 |
+
},
|
| 2308 |
+
{
|
| 2309 |
+
"epoch": 2.8119658119658117,
|
| 2310 |
+
"grad_norm": 1.7369024705223575,
|
| 2311 |
+
"learning_rate": 2.4892369650103837e-06,
|
| 2312 |
+
"loss": 0.1238,
|
| 2313 |
+
"step": 329
|
| 2314 |
+
},
|
| 2315 |
+
{
|
| 2316 |
+
"epoch": 2.8205128205128203,
|
| 2317 |
+
"grad_norm": 1.2081751490349724,
|
| 2318 |
+
"learning_rate": 2.4570413332038523e-06,
|
| 2319 |
+
"loss": 0.1125,
|
| 2320 |
+
"step": 330
|
| 2321 |
+
},
|
| 2322 |
+
{
|
| 2323 |
+
"epoch": 2.8290598290598292,
|
| 2324 |
+
"grad_norm": 1.2584213577853094,
|
| 2325 |
+
"learning_rate": 2.4249873045229244e-06,
|
| 2326 |
+
"loss": 0.1233,
|
| 2327 |
+
"step": 331
|
| 2328 |
+
},
|
| 2329 |
+
{
|
| 2330 |
+
"epoch": 2.8376068376068377,
|
| 2331 |
+
"grad_norm": 1.246458599126342,
|
| 2332 |
+
"learning_rate": 2.3930766638769325e-06,
|
| 2333 |
+
"loss": 0.1289,
|
| 2334 |
+
"step": 332
|
| 2335 |
+
},
|
| 2336 |
+
{
|
| 2337 |
+
"epoch": 2.8461538461538463,
|
| 2338 |
+
"grad_norm": 1.2067937513427751,
|
| 2339 |
+
"learning_rate": 2.3613111881907273e-06,
|
| 2340 |
+
"loss": 0.1375,
|
| 2341 |
+
"step": 333
|
| 2342 |
+
},
|
| 2343 |
+
{
|
| 2344 |
+
"epoch": 2.8547008547008548,
|
| 2345 |
+
"grad_norm": 1.2530306295643197,
|
| 2346 |
+
"learning_rate": 2.3296926463057396e-06,
|
| 2347 |
+
"loss": 0.1279,
|
| 2348 |
+
"step": 334
|
| 2349 |
+
},
|
| 2350 |
+
{
|
| 2351 |
+
"epoch": 2.8632478632478633,
|
| 2352 |
+
"grad_norm": 1.3298170862444603,
|
| 2353 |
+
"learning_rate": 2.29822279888148e-06,
|
| 2354 |
+
"loss": 0.154,
|
| 2355 |
+
"step": 335
|
| 2356 |
+
},
|
| 2357 |
+
{
|
| 2358 |
+
"epoch": 2.871794871794872,
|
| 2359 |
+
"grad_norm": 1.2644393627660502,
|
| 2360 |
+
"learning_rate": 2.2669033982974946e-06,
|
| 2361 |
+
"loss": 0.1174,
|
| 2362 |
+
"step": 336
|
| 2363 |
+
},
|
| 2364 |
+
{
|
| 2365 |
+
"epoch": 2.8803418803418803,
|
| 2366 |
+
"grad_norm": 1.262782045642597,
|
| 2367 |
+
"learning_rate": 2.235736188555787e-06,
|
| 2368 |
+
"loss": 0.1426,
|
| 2369 |
+
"step": 337
|
| 2370 |
+
},
|
| 2371 |
+
{
|
| 2372 |
+
"epoch": 2.888888888888889,
|
| 2373 |
+
"grad_norm": 1.2952351378601683,
|
| 2374 |
+
"learning_rate": 2.2047229051837107e-06,
|
| 2375 |
+
"loss": 0.1235,
|
| 2376 |
+
"step": 338
|
| 2377 |
+
},
|
| 2378 |
+
{
|
| 2379 |
+
"epoch": 2.8974358974358974,
|
| 2380 |
+
"grad_norm": 1.269259170523244,
|
| 2381 |
+
"learning_rate": 2.173865275137314e-06,
|
| 2382 |
+
"loss": 0.1237,
|
| 2383 |
+
"step": 339
|
| 2384 |
+
},
|
| 2385 |
+
{
|
| 2386 |
+
"epoch": 2.905982905982906,
|
| 2387 |
+
"grad_norm": 1.2210835736635746,
|
| 2388 |
+
"learning_rate": 2.143165016705192e-06,
|
| 2389 |
+
"loss": 0.1172,
|
| 2390 |
+
"step": 340
|
| 2391 |
+
},
|
| 2392 |
+
{
|
| 2393 |
+
"epoch": 2.9145299145299144,
|
| 2394 |
+
"grad_norm": 1.3169756003561237,
|
| 2395 |
+
"learning_rate": 2.1126238394127868e-06,
|
| 2396 |
+
"loss": 0.1245,
|
| 2397 |
+
"step": 341
|
| 2398 |
+
},
|
| 2399 |
+
{
|
| 2400 |
+
"epoch": 2.9230769230769234,
|
| 2401 |
+
"grad_norm": 1.3863664568544543,
|
| 2402 |
+
"learning_rate": 2.082243443927212e-06,
|
| 2403 |
+
"loss": 0.131,
|
| 2404 |
+
"step": 342
|
| 2405 |
+
},
|
| 2406 |
+
{
|
| 2407 |
+
"epoch": 2.931623931623932,
|
| 2408 |
+
"grad_norm": 1.3478658336934703,
|
| 2409 |
+
"learning_rate": 2.052025521962534e-06,
|
| 2410 |
+
"loss": 0.1084,
|
| 2411 |
+
"step": 343
|
| 2412 |
+
},
|
| 2413 |
+
{
|
| 2414 |
+
"epoch": 2.9401709401709404,
|
| 2415 |
+
"grad_norm": 1.3228994525587703,
|
| 2416 |
+
"learning_rate": 2.0219717561855857e-06,
|
| 2417 |
+
"loss": 0.13,
|
| 2418 |
+
"step": 344
|
| 2419 |
+
},
|
| 2420 |
+
{
|
| 2421 |
+
"epoch": 2.948717948717949,
|
| 2422 |
+
"grad_norm": 1.2682637394344838,
|
| 2423 |
+
"learning_rate": 1.992083820122259e-06,
|
| 2424 |
+
"loss": 0.1262,
|
| 2425 |
+
"step": 345
|
| 2426 |
+
},
|
| 2427 |
+
{
|
| 2428 |
+
"epoch": 2.9572649572649574,
|
| 2429 |
+
"grad_norm": 1.3907553886466266,
|
| 2430 |
+
"learning_rate": 1.962363378064316e-06,
|
| 2431 |
+
"loss": 0.1196,
|
| 2432 |
+
"step": 346
|
| 2433 |
+
},
|
| 2434 |
+
{
|
| 2435 |
+
"epoch": 2.965811965811966,
|
| 2436 |
+
"grad_norm": 1.417152488429629,
|
| 2437 |
+
"learning_rate": 1.9328120849767198e-06,
|
| 2438 |
+
"loss": 0.1304,
|
| 2439 |
+
"step": 347
|
| 2440 |
+
},
|
| 2441 |
+
{
|
| 2442 |
+
"epoch": 2.9743589743589745,
|
| 2443 |
+
"grad_norm": 1.2447437410179203,
|
| 2444 |
+
"learning_rate": 1.9034315864054682e-06,
|
| 2445 |
+
"loss": 0.1088,
|
| 2446 |
+
"step": 348
|
| 2447 |
+
},
|
| 2448 |
+
{
|
| 2449 |
+
"epoch": 2.982905982905983,
|
| 2450 |
+
"grad_norm": 1.0906420828574008,
|
| 2451 |
+
"learning_rate": 1.8742235183859747e-06,
|
| 2452 |
+
"loss": 0.098,
|
| 2453 |
+
"step": 349
|
| 2454 |
+
},
|
| 2455 |
+
{
|
| 2456 |
+
"epoch": 2.9914529914529915,
|
| 2457 |
+
"grad_norm": 1.247352449950185,
|
| 2458 |
+
"learning_rate": 1.8451895073519643e-06,
|
| 2459 |
+
"loss": 0.1312,
|
| 2460 |
+
"step": 350
|
| 2461 |
+
},
|
| 2462 |
+
{
|
| 2463 |
+
"epoch": 3.0,
|
| 2464 |
+
"grad_norm": 1.078500122533204,
|
| 2465 |
+
"learning_rate": 1.8163311700448899e-06,
|
| 2466 |
+
"loss": 0.1081,
|
| 2467 |
+
"step": 351
|
| 2468 |
+
}
|
| 2469 |
+
],
|
| 2470 |
+
"logging_steps": 1,
|
| 2471 |
+
"max_steps": 468,
|
| 2472 |
+
"num_input_tokens_seen": 0,
|
| 2473 |
+
"num_train_epochs": 4,
|
| 2474 |
+
"save_steps": 500,
|
| 2475 |
+
"stateful_callbacks": {
|
| 2476 |
+
"TrainerControl": {
|
| 2477 |
+
"args": {
|
| 2478 |
+
"should_epoch_stop": false,
|
| 2479 |
+
"should_evaluate": false,
|
| 2480 |
+
"should_log": false,
|
| 2481 |
+
"should_save": true,
|
| 2482 |
+
"should_training_stop": false
|
| 2483 |
+
},
|
| 2484 |
+
"attributes": {}
|
| 2485 |
+
}
|
| 2486 |
+
},
|
| 2487 |
+
"total_flos": 5914678788096.0,
|
| 2488 |
+
"train_batch_size": 16,
|
| 2489 |
+
"trial_name": null,
|
| 2490 |
+
"trial_params": null
|
| 2491 |
+
}
|
training_args.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c1711fb022d56b7d3ae350a140d0ad942052bbfc3b35700cf77dbd45fa031ee2
|
| 3 |
+
size 8081
|