tkhangg0910 commited on
Commit
8560113
·
verified ·
1 Parent(s): 8a86e03

Upload folder using huggingface_hub

Browse files
README.md ADDED
@@ -0,0 +1,207 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: tkhangg0910/Merged-Dual-Explain-stage_full
3
+ library_name: peft
4
+ pipeline_tag: text-generation
5
+ tags:
6
+ - base_model:adapter:tkhangg0910/Merged-Dual-Explain-stage_full
7
+ - lora
8
+ - transformers
9
+ ---
10
+
11
+ # Model Card for Model ID
12
+
13
+ <!-- Provide a quick summary of what the model is/does. -->
14
+
15
+
16
+
17
+ ## Model Details
18
+
19
+ ### Model Description
20
+
21
+ <!-- Provide a longer summary of what this model is. -->
22
+
23
+
24
+
25
+ - **Developed by:** [More Information Needed]
26
+ - **Funded by [optional]:** [More Information Needed]
27
+ - **Shared by [optional]:** [More Information Needed]
28
+ - **Model type:** [More Information Needed]
29
+ - **Language(s) (NLP):** [More Information Needed]
30
+ - **License:** [More Information Needed]
31
+ - **Finetuned from model [optional]:** [More Information Needed]
32
+
33
+ ### Model Sources [optional]
34
+
35
+ <!-- Provide the basic links for the model. -->
36
+
37
+ - **Repository:** [More Information Needed]
38
+ - **Paper [optional]:** [More Information Needed]
39
+ - **Demo [optional]:** [More Information Needed]
40
+
41
+ ## Uses
42
+
43
+ <!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
44
+
45
+ ### Direct Use
46
+
47
+ <!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
48
+
49
+ [More Information Needed]
50
+
51
+ ### Downstream Use [optional]
52
+
53
+ <!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
54
+
55
+ [More Information Needed]
56
+
57
+ ### Out-of-Scope Use
58
+
59
+ <!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
60
+
61
+ [More Information Needed]
62
+
63
+ ## Bias, Risks, and Limitations
64
+
65
+ <!-- This section is meant to convey both technical and sociotechnical limitations. -->
66
+
67
+ [More Information Needed]
68
+
69
+ ### Recommendations
70
+
71
+ <!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
72
+
73
+ Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
74
+
75
+ ## How to Get Started with the Model
76
+
77
+ Use the code below to get started with the model.
78
+
79
+ [More Information Needed]
80
+
81
+ ## Training Details
82
+
83
+ ### Training Data
84
+
85
+ <!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
86
+
87
+ [More Information Needed]
88
+
89
+ ### Training Procedure
90
+
91
+ <!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
92
+
93
+ #### Preprocessing [optional]
94
+
95
+ [More Information Needed]
96
+
97
+
98
+ #### Training Hyperparameters
99
+
100
+ - **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
101
+
102
+ #### Speeds, Sizes, Times [optional]
103
+
104
+ <!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
105
+
106
+ [More Information Needed]
107
+
108
+ ## Evaluation
109
+
110
+ <!-- This section describes the evaluation protocols and provides the results. -->
111
+
112
+ ### Testing Data, Factors & Metrics
113
+
114
+ #### Testing Data
115
+
116
+ <!-- This should link to a Dataset Card if possible. -->
117
+
118
+ [More Information Needed]
119
+
120
+ #### Factors
121
+
122
+ <!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
123
+
124
+ [More Information Needed]
125
+
126
+ #### Metrics
127
+
128
+ <!-- These are the evaluation metrics being used, ideally with a description of why. -->
129
+
130
+ [More Information Needed]
131
+
132
+ ### Results
133
+
134
+ [More Information Needed]
135
+
136
+ #### Summary
137
+
138
+
139
+
140
+ ## Model Examination [optional]
141
+
142
+ <!-- Relevant interpretability work for the model goes here -->
143
+
144
+ [More Information Needed]
145
+
146
+ ## Environmental Impact
147
+
148
+ <!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
149
+
150
+ Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
151
+
152
+ - **Hardware Type:** [More Information Needed]
153
+ - **Hours used:** [More Information Needed]
154
+ - **Cloud Provider:** [More Information Needed]
155
+ - **Compute Region:** [More Information Needed]
156
+ - **Carbon Emitted:** [More Information Needed]
157
+
158
+ ## Technical Specifications [optional]
159
+
160
+ ### Model Architecture and Objective
161
+
162
+ [More Information Needed]
163
+
164
+ ### Compute Infrastructure
165
+
166
+ [More Information Needed]
167
+
168
+ #### Hardware
169
+
170
+ [More Information Needed]
171
+
172
+ #### Software
173
+
174
+ [More Information Needed]
175
+
176
+ ## Citation [optional]
177
+
178
+ <!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
179
+
180
+ **BibTeX:**
181
+
182
+ [More Information Needed]
183
+
184
+ **APA:**
185
+
186
+ [More Information Needed]
187
+
188
+ ## Glossary [optional]
189
+
190
+ <!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
191
+
192
+ [More Information Needed]
193
+
194
+ ## More Information [optional]
195
+
196
+ [More Information Needed]
197
+
198
+ ## Model Card Authors [optional]
199
+
200
+ [More Information Needed]
201
+
202
+ ## Model Card Contact
203
+
204
+ [More Information Needed]
205
+ ### Framework versions
206
+
207
+ - PEFT 0.18.1
adapter_config.json ADDED
@@ -0,0 +1,149 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "alora_invocation_tokens": null,
3
+ "alpha_pattern": {},
4
+ "arrow_config": null,
5
+ "auto_mapping": null,
6
+ "base_model_name_or_path": "tkhangg0910/Merged-Dual-Explain-stage_full",
7
+ "bias": "none",
8
+ "corda_config": null,
9
+ "ensure_weight_tying": false,
10
+ "eva_config": null,
11
+ "exclude_modules": null,
12
+ "fan_in_fan_out": false,
13
+ "inference_mode": true,
14
+ "init_lora_weights": true,
15
+ "layer_replication": null,
16
+ "layers_pattern": null,
17
+ "layers_to_transform": null,
18
+ "loftq_config": {},
19
+ "lora_alpha": 32,
20
+ "lora_bias": false,
21
+ "lora_dropout": 0.1,
22
+ "megatron_config": null,
23
+ "megatron_core": "megatron.core",
24
+ "modules_to_save": [
25
+ "lm_head",
26
+ "embed_tokens",
27
+ "box_decoder",
28
+ "box_encoder",
29
+ "visual_projector",
30
+ "mask_decoder",
31
+ "prompt_encoder",
32
+ "text_prompt_proj",
33
+ "mask_encoder"
34
+ ],
35
+ "peft_type": "LORA",
36
+ "peft_version": "0.18.1",
37
+ "qalora_group_size": 16,
38
+ "r": 24,
39
+ "rank_pattern": {},
40
+ "revision": null,
41
+ "target_modules": [
42
+ "model.layers.21.self_attn.v_proj",
43
+ "model.layers.20.self_attn.k_proj",
44
+ "model.layers.4.self_attn.v_proj",
45
+ "model.layers.16.self_attn.q_proj",
46
+ "model.layers.12.self_attn.q_proj",
47
+ "o_proj",
48
+ "model.layers.23.self_attn.v_proj",
49
+ "model.layers.2.self_attn.k_proj",
50
+ "27.self_attn.v_proj",
51
+ "model.layers.2.self_attn.v_proj",
52
+ "model.layers.14.self_attn.v_proj",
53
+ "24.self_attn.k_proj",
54
+ "model.layers.0.self_attn.q_proj",
55
+ "24.self_attn.q_proj",
56
+ "model.layers.9.self_attn.v_proj",
57
+ "model.layers.9.self_attn.q_proj",
58
+ "model.layers.15.self_attn.q_proj",
59
+ "model.layers.11.self_attn.k_proj",
60
+ "model.layers.18.self_attn.k_proj",
61
+ "31.self_attn.v_proj",
62
+ "model.layers.0.self_attn.k_proj",
63
+ "28.self_attn.q_proj",
64
+ "model.layers.6.self_attn.k_proj",
65
+ "30.self_attn.k_proj",
66
+ "model.layers.6.self_attn.v_proj",
67
+ "model.layers.0.self_attn.v_proj",
68
+ "model.layers.3.self_attn.v_proj",
69
+ "model.layers.7.self_attn.v_proj",
70
+ "model.layers.8.self_attn.v_proj",
71
+ "model.layers.19.self_attn.v_proj",
72
+ "model.layers.22.self_attn.k_proj",
73
+ "model.layers.10.self_attn.v_proj",
74
+ "model.layers.8.self_attn.q_proj",
75
+ "24.self_attn.v_proj",
76
+ "26.self_attn.k_proj",
77
+ "model.layers.19.self_attn.k_proj",
78
+ "model.layers.15.self_attn.k_proj",
79
+ "model.layers.17.self_attn.q_proj",
80
+ "model.layers.4.self_attn.q_proj",
81
+ "model.layers.5.self_attn.v_proj",
82
+ "model.layers.10.self_attn.k_proj",
83
+ "model.layers.12.self_attn.k_proj",
84
+ "model.layers.19.self_attn.q_proj",
85
+ "29.self_attn.q_proj",
86
+ "model.layers.3.self_attn.k_proj",
87
+ "model.layers.18.self_attn.v_proj",
88
+ "gate_proj",
89
+ "model.layers.22.self_attn.v_proj",
90
+ "29.self_attn.k_proj",
91
+ "model.layers.7.self_attn.q_proj",
92
+ "model.layers.22.self_attn.q_proj",
93
+ "down_proj",
94
+ "model.layers.6.self_attn.q_proj",
95
+ "model.layers.1.self_attn.v_proj",
96
+ "model.layers.12.self_attn.v_proj",
97
+ "model.layers.23.self_attn.k_proj",
98
+ "model.layers.21.self_attn.q_proj",
99
+ "model.layers.23.self_attn.q_proj",
100
+ "model.layers.13.self_attn.v_proj",
101
+ "model.layers.11.self_attn.v_proj",
102
+ "26.self_attn.q_proj",
103
+ "30.self_attn.v_proj",
104
+ "model.layers.4.self_attn.k_proj",
105
+ "27.self_attn.q_proj",
106
+ "up_proj",
107
+ "model.layers.8.self_attn.k_proj",
108
+ "31.self_attn.q_proj",
109
+ "model.layers.20.self_attn.v_proj",
110
+ "model.layers.13.self_attn.q_proj",
111
+ "model.layers.2.self_attn.q_proj",
112
+ "model.layers.21.self_attn.k_proj",
113
+ "model.layers.9.self_attn.k_proj",
114
+ "29.self_attn.v_proj",
115
+ "31.self_attn.k_proj",
116
+ "model.layers.16.self_attn.v_proj",
117
+ "model.layers.16.self_attn.k_proj",
118
+ "model.layers.1.self_attn.q_proj",
119
+ "model.layers.3.self_attn.q_proj",
120
+ "model.layers.5.self_attn.q_proj",
121
+ "25.self_attn.q_proj",
122
+ "model.layers.20.self_attn.q_proj",
123
+ "27.self_attn.k_proj",
124
+ "model.layers.13.self_attn.k_proj",
125
+ "model.layers.7.self_attn.k_proj",
126
+ "model.layers.15.self_attn.v_proj",
127
+ "28.self_attn.v_proj",
128
+ "model.layers.10.self_attn.q_proj",
129
+ "30.self_attn.q_proj",
130
+ "model.layers.17.self_attn.k_proj",
131
+ "26.self_attn.v_proj",
132
+ "model.layers.1.self_attn.k_proj",
133
+ "model.layers.18.self_attn.q_proj",
134
+ "model.layers.14.self_attn.q_proj",
135
+ "model.layers.14.self_attn.k_proj",
136
+ "25.self_attn.k_proj",
137
+ "28.self_attn.k_proj",
138
+ "model.layers.5.self_attn.k_proj",
139
+ "model.layers.11.self_attn.q_proj",
140
+ "model.layers.17.self_attn.v_proj",
141
+ "25.self_attn.v_proj"
142
+ ],
143
+ "target_parameters": null,
144
+ "task_type": "CAUSAL_LM",
145
+ "trainable_token_indices": null,
146
+ "use_dora": false,
147
+ "use_qalora": false,
148
+ "use_rslora": false
149
+ }
adapter_model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:eecd61d5483dc04e5578b7e95cc6a1fbb674aa3f9ef24d4a02a94434189f7482
3
+ size 1986408208
added_tokens.json ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ {
2
+ "<bboxes>": 32000,
3
+ "<image>": 32002,
4
+ "<mask>": 32003,
5
+ "<obj>": 32001
6
+ }
chat_template.jinja ADDED
@@ -0,0 +1 @@
 
 
1
+ {{ bos_token }}{% for message in messages %}{% if (message['role'] == 'user') != (loop.index0 % 2 == 0) %}{{ raise_exception('Conversation roles must alternate user/assistant/user/assistant/...') }}{% endif %}{% if message['role'] == 'user' %}{{ '[INST] ' + message['content'] + ' [/INST]' }}{% elif message['role'] == 'assistant' %}{{ message['content'] + eos_token}}{% else %}{{ raise_exception('Only user and assistant roles are supported!') }}{% endif %}{% endfor %}
custom_modules.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:48674a334e4edee32344af870393e6de968f3ece32541ed6b62a605132b8ba62
3
+ size 1082976550
custom_modules_info.json ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "custom_modules": [
3
+ "box_decoder",
4
+ "model",
5
+ "text_prompt_proj",
6
+ "box_encoder",
7
+ "lm_head"
8
+ ],
9
+ "total_params": 1504,
10
+ "saved_at_step": 1011
11
+ }
global_step1011/bf16_zero_pp_rank_0_mp_rank_00_optim_states.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7c4c12680dfb20a8468a3d7df43766433f9aae7cdf36a0f122ed9e9366848ea5
3
+ size 2409126160
global_step1011/bf16_zero_pp_rank_1_mp_rank_00_optim_states.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5795d933c00c9e40f89e0dc997821ddcf0760d60730a626cd0a81b4d8fc07904
3
+ size 2409144016
global_step1011/mp_rank_00_model_states.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0692cbd02b131d8978890aa66e3e3526392edbbeddabdff4b280178f430e036f
3
+ size 1061904486
latest ADDED
@@ -0,0 +1 @@
 
 
1
+ global_step1011
rng_state_0.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:575d9572b94cd02755719c1576eb09330c44a0ed9891c69099d7009833d03908
3
+ size 14512
rng_state_1.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3fd61f5b2150717e0d4be7b72021ed1f1166b6126040eef00d135169bb3e9fb6
3
+ size 14512
special_tokens_map.json ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "additional_special_tokens": [
3
+ {
4
+ "content": "<obj>",
5
+ "lstrip": false,
6
+ "normalized": false,
7
+ "rstrip": false,
8
+ "single_word": false
9
+ }
10
+ ],
11
+ "bos_token": {
12
+ "content": "<s>",
13
+ "lstrip": false,
14
+ "normalized": false,
15
+ "rstrip": false,
16
+ "single_word": false
17
+ },
18
+ "eos_token": {
19
+ "content": "</s>",
20
+ "lstrip": false,
21
+ "normalized": false,
22
+ "rstrip": false,
23
+ "single_word": false
24
+ },
25
+ "pad_token": {
26
+ "content": "<unk>",
27
+ "lstrip": false,
28
+ "normalized": false,
29
+ "rstrip": false,
30
+ "single_word": false
31
+ },
32
+ "unk_token": {
33
+ "content": "<unk>",
34
+ "lstrip": false,
35
+ "normalized": false,
36
+ "rstrip": false,
37
+ "single_word": false
38
+ }
39
+ }
tokenizer.model ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:dadfd56d766715c61d2ef780a525ab43b8e6da4de6865bda3d95fdef5e134055
3
+ size 493443
tokenizer_config.json ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_bos_token": true,
3
+ "add_eos_token": false,
4
+ "add_prefix_space": true,
5
+ "added_tokens_decoder": {
6
+ "0": {
7
+ "content": "<unk>",
8
+ "lstrip": false,
9
+ "normalized": false,
10
+ "rstrip": false,
11
+ "single_word": false,
12
+ "special": true
13
+ },
14
+ "1": {
15
+ "content": "<s>",
16
+ "lstrip": false,
17
+ "normalized": false,
18
+ "rstrip": false,
19
+ "single_word": false,
20
+ "special": true
21
+ },
22
+ "2": {
23
+ "content": "</s>",
24
+ "lstrip": false,
25
+ "normalized": false,
26
+ "rstrip": false,
27
+ "single_word": false,
28
+ "special": true
29
+ },
30
+ "32000": {
31
+ "content": "<bboxes>",
32
+ "lstrip": false,
33
+ "normalized": false,
34
+ "rstrip": false,
35
+ "single_word": false,
36
+ "special": true
37
+ },
38
+ "32001": {
39
+ "content": "<obj>",
40
+ "lstrip": false,
41
+ "normalized": false,
42
+ "rstrip": false,
43
+ "single_word": false,
44
+ "special": true
45
+ },
46
+ "32002": {
47
+ "content": "<image>",
48
+ "lstrip": false,
49
+ "normalized": false,
50
+ "rstrip": false,
51
+ "single_word": false,
52
+ "special": true
53
+ },
54
+ "32003": {
55
+ "content": "<mask>",
56
+ "lstrip": false,
57
+ "normalized": false,
58
+ "rstrip": false,
59
+ "single_word": false,
60
+ "special": true
61
+ }
62
+ },
63
+ "additional_special_tokens": [
64
+ "<obj>"
65
+ ],
66
+ "bos_token": "<s>",
67
+ "clean_up_tokenization_spaces": false,
68
+ "eos_token": "</s>",
69
+ "extra_special_tokens": {},
70
+ "legacy": true,
71
+ "model_max_length": 2048,
72
+ "pad_token": "<unk>",
73
+ "padding_side": "right",
74
+ "sp_model_kwargs": {},
75
+ "spaces_between_special_tokens": false,
76
+ "tokenizer_class": "LlamaTokenizer",
77
+ "unk_token": "<unk>",
78
+ "use_default_system_prompt": false
79
+ }
trainer_state.json ADDED
@@ -0,0 +1,2433 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "best_global_step": null,
3
+ "best_metric": 0.6839648485183716,
4
+ "best_model_checkpoint": null,
5
+ "epoch": 3.0,
6
+ "eval_steps": 500,
7
+ "global_step": 1011,
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.002967359050445104,
14
+ "grad_norm": 15.052371978759766,
15
+ "learning_rate": 0.0,
16
+ "loss": 0.3511,
17
+ "step": 1
18
+ },
19
+ {
20
+ "epoch": 0.008902077151335312,
21
+ "grad_norm": 11.145326614379883,
22
+ "learning_rate": 3.2123800577354604e-06,
23
+ "loss": 0.3486,
24
+ "step": 3
25
+ },
26
+ {
27
+ "epoch": 0.017804154302670624,
28
+ "grad_norm": 7.514125823974609,
29
+ "learning_rate": 5.239166215940359e-06,
30
+ "loss": 0.3444,
31
+ "step": 6
32
+ },
33
+ {
34
+ "epoch": 0.026706231454005934,
35
+ "grad_norm": 8.797248840332031,
36
+ "learning_rate": 6.424760115470921e-06,
37
+ "loss": 0.3284,
38
+ "step": 9
39
+ },
40
+ {
41
+ "epoch": 0.03560830860534125,
42
+ "grad_norm": 3.7588727474212646,
43
+ "learning_rate": 7.265952374145257e-06,
44
+ "loss": 0.3375,
45
+ "step": 12
46
+ },
47
+ {
48
+ "epoch": 0.04451038575667656,
49
+ "grad_norm": 7.172510623931885,
50
+ "learning_rate": 7.918431780800236e-06,
51
+ "loss": 0.3271,
52
+ "step": 15
53
+ },
54
+ {
55
+ "epoch": 0.05341246290801187,
56
+ "grad_norm": 3.615478992462158,
57
+ "learning_rate": 8.451546273675818e-06,
58
+ "loss": 0.3277,
59
+ "step": 18
60
+ },
61
+ {
62
+ "epoch": 0.06231454005934718,
63
+ "grad_norm": 6.7531232833862305,
64
+ "learning_rate": 8.902288154930203e-06,
65
+ "loss": 0.3343,
66
+ "step": 21
67
+ },
68
+ {
69
+ "epoch": 0.0712166172106825,
70
+ "grad_norm": 6.248157501220703,
71
+ "learning_rate": 9.292738532350157e-06,
72
+ "loss": 0.3294,
73
+ "step": 24
74
+ },
75
+ {
76
+ "epoch": 0.08011869436201781,
77
+ "grad_norm": 6.436707019805908,
78
+ "learning_rate": 9.637140173206382e-06,
79
+ "loss": 0.3358,
80
+ "step": 27
81
+ },
82
+ {
83
+ "epoch": 0.08902077151335312,
84
+ "grad_norm": 9.06855583190918,
85
+ "learning_rate": 9.945217939005136e-06,
86
+ "loss": 0.3293,
87
+ "step": 30
88
+ },
89
+ {
90
+ "epoch": 0.09792284866468842,
91
+ "grad_norm": 7.107985973358154,
92
+ "learning_rate": 1.0223908177645902e-05,
93
+ "loss": 0.3111,
94
+ "step": 33
95
+ },
96
+ {
97
+ "epoch": 0.10682492581602374,
98
+ "grad_norm": 6.3856520652771,
99
+ "learning_rate": 1.0478332431880717e-05,
100
+ "loss": 0.3251,
101
+ "step": 36
102
+ },
103
+ {
104
+ "epoch": 0.11572700296735905,
105
+ "grad_norm": 4.95862340927124,
106
+ "learning_rate": 1.0712380057735461e-05,
107
+ "loss": 0.3211,
108
+ "step": 39
109
+ },
110
+ {
111
+ "epoch": 0.12462908011869436,
112
+ "grad_norm": 4.809103012084961,
113
+ "learning_rate": 1.0929074313135101e-05,
114
+ "loss": 0.3244,
115
+ "step": 42
116
+ },
117
+ {
118
+ "epoch": 0.13353115727002968,
119
+ "grad_norm": 6.697277069091797,
120
+ "learning_rate": 1.1130811838535696e-05,
121
+ "loss": 0.3179,
122
+ "step": 45
123
+ },
124
+ {
125
+ "epoch": 0.142433234421365,
126
+ "grad_norm": 12.093936920166016,
127
+ "learning_rate": 1.1319524690555053e-05,
128
+ "loss": 0.3339,
129
+ "step": 48
130
+ },
131
+ {
132
+ "epoch": 0.1513353115727003,
133
+ "grad_norm": 8.427734375,
134
+ "learning_rate": 1.1496793166558515e-05,
135
+ "loss": 0.329,
136
+ "step": 51
137
+ },
138
+ {
139
+ "epoch": 0.16023738872403562,
140
+ "grad_norm": 11.345624923706055,
141
+ "learning_rate": 1.1663926331411281e-05,
142
+ "loss": 0.3212,
143
+ "step": 54
144
+ },
145
+ {
146
+ "epoch": 0.16913946587537093,
147
+ "grad_norm": 7.70440149307251,
148
+ "learning_rate": 1.1822020743040672e-05,
149
+ "loss": 0.3119,
150
+ "step": 57
151
+ },
152
+ {
153
+ "epoch": 0.17804154302670624,
154
+ "grad_norm": 4.138779163360596,
155
+ "learning_rate": 1.1972004097210032e-05,
156
+ "loss": 0.3186,
157
+ "step": 60
158
+ },
159
+ {
160
+ "epoch": 0.18694362017804153,
161
+ "grad_norm": 9.505159378051758,
162
+ "learning_rate": 1.2114668212665663e-05,
163
+ "loss": 0.3125,
164
+ "step": 63
165
+ },
166
+ {
167
+ "epoch": 0.19584569732937684,
168
+ "grad_norm": 5.866057395935059,
169
+ "learning_rate": 1.2250694335850798e-05,
170
+ "loss": 0.3217,
171
+ "step": 66
172
+ },
173
+ {
174
+ "epoch": 0.20474777448071216,
175
+ "grad_norm": 9.940937995910645,
176
+ "learning_rate": 1.238067281605409e-05,
177
+ "loss": 0.3295,
178
+ "step": 69
179
+ },
180
+ {
181
+ "epoch": 0.21364985163204747,
182
+ "grad_norm": 8.819473266601562,
183
+ "learning_rate": 1.2505118590085615e-05,
184
+ "loss": 0.3351,
185
+ "step": 72
186
+ },
187
+ {
188
+ "epoch": 0.22255192878338279,
189
+ "grad_norm": 9.78069019317627,
190
+ "learning_rate": 1.262448350386501e-05,
191
+ "loss": 0.3383,
192
+ "step": 75
193
+ },
194
+ {
195
+ "epoch": 0.2314540059347181,
196
+ "grad_norm": 5.660183429718018,
197
+ "learning_rate": 1.2739166215940359e-05,
198
+ "loss": 0.3252,
199
+ "step": 78
200
+ },
201
+ {
202
+ "epoch": 0.2403560830860534,
203
+ "grad_norm": 7.043887615203857,
204
+ "learning_rate": 1.2849520230941842e-05,
205
+ "loss": 0.3249,
206
+ "step": 81
207
+ },
208
+ {
209
+ "epoch": 0.24925816023738873,
210
+ "grad_norm": 7.998411178588867,
211
+ "learning_rate": 1.295586047134e-05,
212
+ "loss": 0.3359,
213
+ "step": 84
214
+ },
215
+ {
216
+ "epoch": 0.258160237388724,
217
+ "grad_norm": 11.106488227844238,
218
+ "learning_rate": 1.3058468695482481e-05,
219
+ "loss": 0.3211,
220
+ "step": 87
221
+ },
222
+ {
223
+ "epoch": 0.26706231454005935,
224
+ "grad_norm": 5.680809497833252,
225
+ "learning_rate": 1.3157597996740594e-05,
226
+ "loss": 0.3152,
227
+ "step": 90
228
+ },
229
+ {
230
+ "epoch": 0.27596439169139464,
231
+ "grad_norm": 6.006475925445557,
232
+ "learning_rate": 1.3253476564657357e-05,
233
+ "loss": 0.3171,
234
+ "step": 93
235
+ },
236
+ {
237
+ "epoch": 0.28486646884273,
238
+ "grad_norm": 4.647056579589844,
239
+ "learning_rate": 1.3346310848759951e-05,
240
+ "loss": 0.31,
241
+ "step": 96
242
+ },
243
+ {
244
+ "epoch": 0.29376854599406527,
245
+ "grad_norm": 4.605801582336426,
246
+ "learning_rate": 1.343628823538136e-05,
247
+ "loss": 0.3185,
248
+ "step": 99
249
+ },
250
+ {
251
+ "epoch": 0.3026706231454006,
252
+ "grad_norm": 17.812042236328125,
253
+ "learning_rate": 1.3523579324763411e-05,
254
+ "loss": 0.3161,
255
+ "step": 102
256
+ },
257
+ {
258
+ "epoch": 0.3115727002967359,
259
+ "grad_norm": 12.627123832702637,
260
+ "learning_rate": 1.3608339877994978e-05,
261
+ "loss": 0.329,
262
+ "step": 105
263
+ },
264
+ {
265
+ "epoch": 0.32047477744807124,
266
+ "grad_norm": 7.308374404907227,
267
+ "learning_rate": 1.3690712489616179e-05,
268
+ "loss": 0.3179,
269
+ "step": 108
270
+ },
271
+ {
272
+ "epoch": 0.3293768545994065,
273
+ "grad_norm": 5.522846698760986,
274
+ "learning_rate": 1.3770828031006136e-05,
275
+ "loss": 0.3245,
276
+ "step": 111
277
+ },
278
+ {
279
+ "epoch": 0.33827893175074186,
280
+ "grad_norm": 8.475018501281738,
281
+ "learning_rate": 1.384880690124557e-05,
282
+ "loss": 0.3105,
283
+ "step": 114
284
+ },
285
+ {
286
+ "epoch": 0.34718100890207715,
287
+ "grad_norm": 8.174044609069824,
288
+ "learning_rate": 1.3924760115470921e-05,
289
+ "loss": 0.3057,
290
+ "step": 117
291
+ },
292
+ {
293
+ "epoch": 0.3560830860534125,
294
+ "grad_norm": 6.196917533874512,
295
+ "learning_rate": 1.399879025541493e-05,
296
+ "loss": 0.336,
297
+ "step": 120
298
+ },
299
+ {
300
+ "epoch": 0.3649851632047478,
301
+ "grad_norm": 9.92663860321045,
302
+ "learning_rate": 1.4070992302558296e-05,
303
+ "loss": 0.3253,
304
+ "step": 123
305
+ },
306
+ {
307
+ "epoch": 0.37388724035608306,
308
+ "grad_norm": 7.014742374420166,
309
+ "learning_rate": 1.4141454370870561e-05,
310
+ "loss": 0.3129,
311
+ "step": 126
312
+ },
313
+ {
314
+ "epoch": 0.3827893175074184,
315
+ "grad_norm": 8.182991027832031,
316
+ "learning_rate": 1.421025835332077e-05,
317
+ "loss": 0.3329,
318
+ "step": 129
319
+ },
320
+ {
321
+ "epoch": 0.3916913946587537,
322
+ "grad_norm": 7.044063091278076,
323
+ "learning_rate": 1.4277480494055697e-05,
324
+ "loss": 0.3265,
325
+ "step": 132
326
+ },
327
+ {
328
+ "epoch": 0.40059347181008903,
329
+ "grad_norm": 7.129275321960449,
330
+ "learning_rate": 1.4343191896271158e-05,
331
+ "loss": 0.3259,
332
+ "step": 135
333
+ },
334
+ {
335
+ "epoch": 0.4094955489614243,
336
+ "grad_norm": 6.028862476348877,
337
+ "learning_rate": 1.4407458974258987e-05,
338
+ "loss": 0.326,
339
+ "step": 138
340
+ },
341
+ {
342
+ "epoch": 0.41839762611275966,
343
+ "grad_norm": 9.75017261505127,
344
+ "learning_rate": 1.4470343856834936e-05,
345
+ "loss": 0.3242,
346
+ "step": 141
347
+ },
348
+ {
349
+ "epoch": 0.42729970326409494,
350
+ "grad_norm": 8.225783348083496,
351
+ "learning_rate": 1.4531904748290513e-05,
352
+ "loss": 0.3061,
353
+ "step": 144
354
+ },
355
+ {
356
+ "epoch": 0.4362017804154303,
357
+ "grad_norm": 7.090129852294922,
358
+ "learning_rate": 1.4592196252124945e-05,
359
+ "loss": 0.3152,
360
+ "step": 147
361
+ },
362
+ {
363
+ "epoch": 0.44510385756676557,
364
+ "grad_norm": 11.792762756347656,
365
+ "learning_rate": 1.465126966206991e-05,
366
+ "loss": 0.3258,
367
+ "step": 150
368
+ },
369
+ {
370
+ "epoch": 0.4540059347181009,
371
+ "grad_norm": 8.907958984375,
372
+ "learning_rate": 1.4709173224293973e-05,
373
+ "loss": 0.3203,
374
+ "step": 153
375
+ },
376
+ {
377
+ "epoch": 0.4629080118694362,
378
+ "grad_norm": 4.160986423492432,
379
+ "learning_rate": 1.4765952374145259e-05,
380
+ "loss": 0.3156,
381
+ "step": 156
382
+ },
383
+ {
384
+ "epoch": 0.47181008902077154,
385
+ "grad_norm": 4.767416954040527,
386
+ "learning_rate": 1.482164995034286e-05,
387
+ "loss": 0.3238,
388
+ "step": 159
389
+ },
390
+ {
391
+ "epoch": 0.4807121661721068,
392
+ "grad_norm": 6.091423511505127,
393
+ "learning_rate": 1.4876306389146738e-05,
394
+ "loss": 0.3186,
395
+ "step": 162
396
+ },
397
+ {
398
+ "epoch": 0.4896142433234421,
399
+ "grad_norm": 9.760332107543945,
400
+ "learning_rate": 1.4929959900710676e-05,
401
+ "loss": 0.3111,
402
+ "step": 165
403
+ },
404
+ {
405
+ "epoch": 0.49851632047477745,
406
+ "grad_norm": 7.750044822692871,
407
+ "learning_rate": 1.4982646629544899e-05,
408
+ "loss": 0.3209,
409
+ "step": 168
410
+ },
411
+ {
412
+ "epoch": 0.5074183976261127,
413
+ "grad_norm": 10.224579811096191,
414
+ "learning_rate": 1.5e-05,
415
+ "loss": 0.3262,
416
+ "step": 171
417
+ },
418
+ {
419
+ "epoch": 0.516320474777448,
420
+ "grad_norm": 8.861902236938477,
421
+ "learning_rate": 1.5e-05,
422
+ "loss": 0.3121,
423
+ "step": 174
424
+ },
425
+ {
426
+ "epoch": 0.5252225519287834,
427
+ "grad_norm": 4.321209907531738,
428
+ "learning_rate": 1.5e-05,
429
+ "loss": 0.3133,
430
+ "step": 177
431
+ },
432
+ {
433
+ "epoch": 0.5341246290801187,
434
+ "grad_norm": 4.978445529937744,
435
+ "learning_rate": 1.5e-05,
436
+ "loss": 0.3071,
437
+ "step": 180
438
+ },
439
+ {
440
+ "epoch": 0.543026706231454,
441
+ "grad_norm": 10.364422798156738,
442
+ "learning_rate": 1.5e-05,
443
+ "loss": 0.3178,
444
+ "step": 183
445
+ },
446
+ {
447
+ "epoch": 0.5519287833827893,
448
+ "grad_norm": 8.970362663269043,
449
+ "learning_rate": 1.5e-05,
450
+ "loss": 0.3212,
451
+ "step": 186
452
+ },
453
+ {
454
+ "epoch": 0.5608308605341247,
455
+ "grad_norm": 6.0015645027160645,
456
+ "learning_rate": 1.5e-05,
457
+ "loss": 0.3184,
458
+ "step": 189
459
+ },
460
+ {
461
+ "epoch": 0.56973293768546,
462
+ "grad_norm": 5.832813739776611,
463
+ "learning_rate": 1.5e-05,
464
+ "loss": 0.3211,
465
+ "step": 192
466
+ },
467
+ {
468
+ "epoch": 0.5786350148367952,
469
+ "grad_norm": 7.478390693664551,
470
+ "learning_rate": 1.5e-05,
471
+ "loss": 0.3432,
472
+ "step": 195
473
+ },
474
+ {
475
+ "epoch": 0.5875370919881305,
476
+ "grad_norm": 5.908259868621826,
477
+ "learning_rate": 1.5e-05,
478
+ "loss": 0.3287,
479
+ "step": 198
480
+ },
481
+ {
482
+ "epoch": 0.5964391691394659,
483
+ "grad_norm": 8.518238067626953,
484
+ "learning_rate": 1.5e-05,
485
+ "loss": 0.313,
486
+ "step": 201
487
+ },
488
+ {
489
+ "epoch": 0.6053412462908012,
490
+ "grad_norm": 6.046856880187988,
491
+ "learning_rate": 1.5e-05,
492
+ "loss": 0.3197,
493
+ "step": 204
494
+ },
495
+ {
496
+ "epoch": 0.6142433234421365,
497
+ "grad_norm": 9.07325553894043,
498
+ "learning_rate": 1.5e-05,
499
+ "loss": 0.3105,
500
+ "step": 207
501
+ },
502
+ {
503
+ "epoch": 0.6231454005934718,
504
+ "grad_norm": 7.418500900268555,
505
+ "learning_rate": 1.5e-05,
506
+ "loss": 0.3178,
507
+ "step": 210
508
+ },
509
+ {
510
+ "epoch": 0.6320474777448071,
511
+ "grad_norm": 10.935755729675293,
512
+ "learning_rate": 1.5e-05,
513
+ "loss": 0.3192,
514
+ "step": 213
515
+ },
516
+ {
517
+ "epoch": 0.6409495548961425,
518
+ "grad_norm": 8.953109741210938,
519
+ "learning_rate": 1.5e-05,
520
+ "loss": 0.336,
521
+ "step": 216
522
+ },
523
+ {
524
+ "epoch": 0.6498516320474778,
525
+ "grad_norm": 10.9089937210083,
526
+ "learning_rate": 1.5e-05,
527
+ "loss": 0.3362,
528
+ "step": 219
529
+ },
530
+ {
531
+ "epoch": 0.658753709198813,
532
+ "grad_norm": 7.62611198425293,
533
+ "learning_rate": 1.5e-05,
534
+ "loss": 0.3219,
535
+ "step": 222
536
+ },
537
+ {
538
+ "epoch": 0.6676557863501483,
539
+ "grad_norm": 8.877312660217285,
540
+ "learning_rate": 1.5e-05,
541
+ "loss": 0.3242,
542
+ "step": 225
543
+ },
544
+ {
545
+ "epoch": 0.6765578635014837,
546
+ "grad_norm": 11.891584396362305,
547
+ "learning_rate": 1.5e-05,
548
+ "loss": 0.3193,
549
+ "step": 228
550
+ },
551
+ {
552
+ "epoch": 0.685459940652819,
553
+ "grad_norm": 6.047501564025879,
554
+ "learning_rate": 1.5e-05,
555
+ "loss": 0.3145,
556
+ "step": 231
557
+ },
558
+ {
559
+ "epoch": 0.6943620178041543,
560
+ "grad_norm": 11.06523609161377,
561
+ "learning_rate": 1.5e-05,
562
+ "loss": 0.3205,
563
+ "step": 234
564
+ },
565
+ {
566
+ "epoch": 0.7032640949554896,
567
+ "grad_norm": 14.651629447937012,
568
+ "learning_rate": 1.5e-05,
569
+ "loss": 0.3181,
570
+ "step": 237
571
+ },
572
+ {
573
+ "epoch": 0.712166172106825,
574
+ "grad_norm": 4.986928462982178,
575
+ "learning_rate": 1.5e-05,
576
+ "loss": 0.3188,
577
+ "step": 240
578
+ },
579
+ {
580
+ "epoch": 0.7210682492581603,
581
+ "grad_norm": 5.383213520050049,
582
+ "learning_rate": 1.5e-05,
583
+ "loss": 0.3322,
584
+ "step": 243
585
+ },
586
+ {
587
+ "epoch": 0.7299703264094956,
588
+ "grad_norm": 7.467197418212891,
589
+ "learning_rate": 1.5e-05,
590
+ "loss": 0.3231,
591
+ "step": 246
592
+ },
593
+ {
594
+ "epoch": 0.7388724035608308,
595
+ "grad_norm": 8.040964126586914,
596
+ "learning_rate": 1.5e-05,
597
+ "loss": 0.3194,
598
+ "step": 249
599
+ },
600
+ {
601
+ "epoch": 0.7477744807121661,
602
+ "grad_norm": 9.442214012145996,
603
+ "learning_rate": 1.5e-05,
604
+ "loss": 0.3045,
605
+ "step": 252
606
+ },
607
+ {
608
+ "epoch": 0.7566765578635015,
609
+ "grad_norm": 5.0572919845581055,
610
+ "learning_rate": 1.5e-05,
611
+ "loss": 0.3198,
612
+ "step": 255
613
+ },
614
+ {
615
+ "epoch": 0.7655786350148368,
616
+ "grad_norm": 9.763797760009766,
617
+ "learning_rate": 1.5e-05,
618
+ "loss": 0.3038,
619
+ "step": 258
620
+ },
621
+ {
622
+ "epoch": 0.7744807121661721,
623
+ "grad_norm": 4.699306488037109,
624
+ "learning_rate": 1.5e-05,
625
+ "loss": 0.3071,
626
+ "step": 261
627
+ },
628
+ {
629
+ "epoch": 0.7833827893175074,
630
+ "grad_norm": 6.758116245269775,
631
+ "learning_rate": 1.5e-05,
632
+ "loss": 0.3079,
633
+ "step": 264
634
+ },
635
+ {
636
+ "epoch": 0.7922848664688428,
637
+ "grad_norm": 9.004244804382324,
638
+ "learning_rate": 1.5e-05,
639
+ "loss": 0.3114,
640
+ "step": 267
641
+ },
642
+ {
643
+ "epoch": 0.8011869436201781,
644
+ "grad_norm": 10.923787117004395,
645
+ "learning_rate": 1.5e-05,
646
+ "loss": 0.3214,
647
+ "step": 270
648
+ },
649
+ {
650
+ "epoch": 0.8100890207715133,
651
+ "grad_norm": 4.750248432159424,
652
+ "learning_rate": 1.5e-05,
653
+ "loss": 0.3213,
654
+ "step": 273
655
+ },
656
+ {
657
+ "epoch": 0.8189910979228486,
658
+ "grad_norm": 6.5013346672058105,
659
+ "learning_rate": 1.5e-05,
660
+ "loss": 0.3213,
661
+ "step": 276
662
+ },
663
+ {
664
+ "epoch": 0.827893175074184,
665
+ "grad_norm": 14.487788200378418,
666
+ "learning_rate": 1.5e-05,
667
+ "loss": 0.3117,
668
+ "step": 279
669
+ },
670
+ {
671
+ "epoch": 0.8367952522255193,
672
+ "grad_norm": 4.58863639831543,
673
+ "learning_rate": 1.5e-05,
674
+ "loss": 0.325,
675
+ "step": 282
676
+ },
677
+ {
678
+ "epoch": 0.8456973293768546,
679
+ "grad_norm": 5.803460597991943,
680
+ "learning_rate": 1.5e-05,
681
+ "loss": 0.3095,
682
+ "step": 285
683
+ },
684
+ {
685
+ "epoch": 0.8545994065281899,
686
+ "grad_norm": 6.8022871017456055,
687
+ "learning_rate": 1.5e-05,
688
+ "loss": 0.3279,
689
+ "step": 288
690
+ },
691
+ {
692
+ "epoch": 0.8635014836795252,
693
+ "grad_norm": 11.592184066772461,
694
+ "learning_rate": 1.5e-05,
695
+ "loss": 0.3211,
696
+ "step": 291
697
+ },
698
+ {
699
+ "epoch": 0.8724035608308606,
700
+ "grad_norm": 4.380642890930176,
701
+ "learning_rate": 1.5e-05,
702
+ "loss": 0.3121,
703
+ "step": 294
704
+ },
705
+ {
706
+ "epoch": 0.8813056379821959,
707
+ "grad_norm": 10.14802360534668,
708
+ "learning_rate": 1.5e-05,
709
+ "loss": 0.3147,
710
+ "step": 297
711
+ },
712
+ {
713
+ "epoch": 0.8902077151335311,
714
+ "grad_norm": 6.102616786956787,
715
+ "learning_rate": 1.5e-05,
716
+ "loss": 0.327,
717
+ "step": 300
718
+ },
719
+ {
720
+ "epoch": 0.8991097922848664,
721
+ "grad_norm": 6.485515117645264,
722
+ "learning_rate": 1.5e-05,
723
+ "loss": 0.3165,
724
+ "step": 303
725
+ },
726
+ {
727
+ "epoch": 0.9080118694362018,
728
+ "grad_norm": 3.8234357833862305,
729
+ "learning_rate": 1.5e-05,
730
+ "loss": 0.316,
731
+ "step": 306
732
+ },
733
+ {
734
+ "epoch": 0.9169139465875371,
735
+ "grad_norm": 9.781375885009766,
736
+ "learning_rate": 1.5e-05,
737
+ "loss": 0.3147,
738
+ "step": 309
739
+ },
740
+ {
741
+ "epoch": 0.9258160237388724,
742
+ "grad_norm": 8.865571975708008,
743
+ "learning_rate": 1.5e-05,
744
+ "loss": 0.3178,
745
+ "step": 312
746
+ },
747
+ {
748
+ "epoch": 0.9347181008902077,
749
+ "grad_norm": 6.27769660949707,
750
+ "learning_rate": 1.5e-05,
751
+ "loss": 0.3152,
752
+ "step": 315
753
+ },
754
+ {
755
+ "epoch": 0.9436201780415431,
756
+ "grad_norm": 5.6717143058776855,
757
+ "learning_rate": 1.5e-05,
758
+ "loss": 0.3062,
759
+ "step": 318
760
+ },
761
+ {
762
+ "epoch": 0.9525222551928784,
763
+ "grad_norm": 14.846003532409668,
764
+ "learning_rate": 1.5e-05,
765
+ "loss": 0.3204,
766
+ "step": 321
767
+ },
768
+ {
769
+ "epoch": 0.9614243323442137,
770
+ "grad_norm": 7.501077651977539,
771
+ "learning_rate": 1.5e-05,
772
+ "loss": 0.307,
773
+ "step": 324
774
+ },
775
+ {
776
+ "epoch": 0.9703264094955489,
777
+ "grad_norm": 7.450833320617676,
778
+ "learning_rate": 1.5e-05,
779
+ "loss": 0.313,
780
+ "step": 327
781
+ },
782
+ {
783
+ "epoch": 0.9792284866468842,
784
+ "grad_norm": 4.422346591949463,
785
+ "learning_rate": 1.5e-05,
786
+ "loss": 0.3067,
787
+ "step": 330
788
+ },
789
+ {
790
+ "epoch": 0.9881305637982196,
791
+ "grad_norm": 5.954162120819092,
792
+ "learning_rate": 1.5e-05,
793
+ "loss": 0.3215,
794
+ "step": 333
795
+ },
796
+ {
797
+ "epoch": 0.9970326409495549,
798
+ "grad_norm": 4.766922950744629,
799
+ "learning_rate": 1.5e-05,
800
+ "loss": 0.3139,
801
+ "step": 336
802
+ },
803
+ {
804
+ "epoch": 1.0,
805
+ "eval_loss": 0.6956011056900024,
806
+ "eval_runtime": 297.7711,
807
+ "eval_samples_per_second": 5.178,
808
+ "eval_steps_per_second": 0.648,
809
+ "step": 337
810
+ },
811
+ {
812
+ "epoch": 1.0059347181008902,
813
+ "grad_norm": 7.0965895652771,
814
+ "learning_rate": 1.5e-05,
815
+ "loss": 0.3104,
816
+ "step": 339
817
+ },
818
+ {
819
+ "epoch": 1.0148367952522255,
820
+ "grad_norm": 7.9634599685668945,
821
+ "learning_rate": 1.5e-05,
822
+ "loss": 0.3082,
823
+ "step": 342
824
+ },
825
+ {
826
+ "epoch": 1.0237388724035608,
827
+ "grad_norm": 8.5128755569458,
828
+ "learning_rate": 1.5e-05,
829
+ "loss": 0.3211,
830
+ "step": 345
831
+ },
832
+ {
833
+ "epoch": 1.032640949554896,
834
+ "grad_norm": 5.733129501342773,
835
+ "learning_rate": 1.5e-05,
836
+ "loss": 0.3236,
837
+ "step": 348
838
+ },
839
+ {
840
+ "epoch": 1.0415430267062316,
841
+ "grad_norm": 8.197546005249023,
842
+ "learning_rate": 1.5e-05,
843
+ "loss": 0.3136,
844
+ "step": 351
845
+ },
846
+ {
847
+ "epoch": 1.0504451038575668,
848
+ "grad_norm": 11.312963485717773,
849
+ "learning_rate": 1.5e-05,
850
+ "loss": 0.3274,
851
+ "step": 354
852
+ },
853
+ {
854
+ "epoch": 1.0593471810089021,
855
+ "grad_norm": 4.885214328765869,
856
+ "learning_rate": 1.5e-05,
857
+ "loss": 0.3268,
858
+ "step": 357
859
+ },
860
+ {
861
+ "epoch": 1.0682492581602374,
862
+ "grad_norm": 7.366455078125,
863
+ "learning_rate": 1.5e-05,
864
+ "loss": 0.3214,
865
+ "step": 360
866
+ },
867
+ {
868
+ "epoch": 1.0771513353115727,
869
+ "grad_norm": 7.0693559646606445,
870
+ "learning_rate": 1.5e-05,
871
+ "loss": 0.3262,
872
+ "step": 363
873
+ },
874
+ {
875
+ "epoch": 1.086053412462908,
876
+ "grad_norm": 12.16964054107666,
877
+ "learning_rate": 1.5e-05,
878
+ "loss": 0.3232,
879
+ "step": 366
880
+ },
881
+ {
882
+ "epoch": 1.0949554896142433,
883
+ "grad_norm": 6.702571868896484,
884
+ "learning_rate": 1.5e-05,
885
+ "loss": 0.3049,
886
+ "step": 369
887
+ },
888
+ {
889
+ "epoch": 1.1038575667655786,
890
+ "grad_norm": 8.25865650177002,
891
+ "learning_rate": 1.5e-05,
892
+ "loss": 0.3086,
893
+ "step": 372
894
+ },
895
+ {
896
+ "epoch": 1.1127596439169138,
897
+ "grad_norm": 10.963550567626953,
898
+ "learning_rate": 1.5e-05,
899
+ "loss": 0.3187,
900
+ "step": 375
901
+ },
902
+ {
903
+ "epoch": 1.1216617210682494,
904
+ "grad_norm": 10.957636833190918,
905
+ "learning_rate": 1.5e-05,
906
+ "loss": 0.3119,
907
+ "step": 378
908
+ },
909
+ {
910
+ "epoch": 1.1305637982195846,
911
+ "grad_norm": 4.481369495391846,
912
+ "learning_rate": 1.5e-05,
913
+ "loss": 0.3153,
914
+ "step": 381
915
+ },
916
+ {
917
+ "epoch": 1.13946587537092,
918
+ "grad_norm": 7.9678120613098145,
919
+ "learning_rate": 1.5e-05,
920
+ "loss": 0.3143,
921
+ "step": 384
922
+ },
923
+ {
924
+ "epoch": 1.1483679525222552,
925
+ "grad_norm": 10.013398170471191,
926
+ "learning_rate": 1.5e-05,
927
+ "loss": 0.3146,
928
+ "step": 387
929
+ },
930
+ {
931
+ "epoch": 1.1572700296735905,
932
+ "grad_norm": 9.361319541931152,
933
+ "learning_rate": 1.5e-05,
934
+ "loss": 0.3069,
935
+ "step": 390
936
+ },
937
+ {
938
+ "epoch": 1.1661721068249258,
939
+ "grad_norm": 7.185680866241455,
940
+ "learning_rate": 1.5e-05,
941
+ "loss": 0.3198,
942
+ "step": 393
943
+ },
944
+ {
945
+ "epoch": 1.175074183976261,
946
+ "grad_norm": 9.780238151550293,
947
+ "learning_rate": 1.5e-05,
948
+ "loss": 0.3173,
949
+ "step": 396
950
+ },
951
+ {
952
+ "epoch": 1.1839762611275964,
953
+ "grad_norm": 6.236032009124756,
954
+ "learning_rate": 1.5e-05,
955
+ "loss": 0.3096,
956
+ "step": 399
957
+ },
958
+ {
959
+ "epoch": 1.1928783382789319,
960
+ "grad_norm": 6.732054710388184,
961
+ "learning_rate": 1.5e-05,
962
+ "loss": 0.3086,
963
+ "step": 402
964
+ },
965
+ {
966
+ "epoch": 1.2017804154302671,
967
+ "grad_norm": 8.902305603027344,
968
+ "learning_rate": 1.5e-05,
969
+ "loss": 0.3074,
970
+ "step": 405
971
+ },
972
+ {
973
+ "epoch": 1.2106824925816024,
974
+ "grad_norm": 8.529496192932129,
975
+ "learning_rate": 1.5e-05,
976
+ "loss": 0.3208,
977
+ "step": 408
978
+ },
979
+ {
980
+ "epoch": 1.2195845697329377,
981
+ "grad_norm": 10.779397964477539,
982
+ "learning_rate": 1.5e-05,
983
+ "loss": 0.2997,
984
+ "step": 411
985
+ },
986
+ {
987
+ "epoch": 1.228486646884273,
988
+ "grad_norm": 5.797762393951416,
989
+ "learning_rate": 1.5e-05,
990
+ "loss": 0.2977,
991
+ "step": 414
992
+ },
993
+ {
994
+ "epoch": 1.2373887240356083,
995
+ "grad_norm": 10.339754104614258,
996
+ "learning_rate": 1.5e-05,
997
+ "loss": 0.3099,
998
+ "step": 417
999
+ },
1000
+ {
1001
+ "epoch": 1.2462908011869436,
1002
+ "grad_norm": 6.894352436065674,
1003
+ "learning_rate": 1.5e-05,
1004
+ "loss": 0.3027,
1005
+ "step": 420
1006
+ },
1007
+ {
1008
+ "epoch": 1.2551928783382789,
1009
+ "grad_norm": 10.406209945678711,
1010
+ "learning_rate": 1.5e-05,
1011
+ "loss": 0.318,
1012
+ "step": 423
1013
+ },
1014
+ {
1015
+ "epoch": 1.2640949554896141,
1016
+ "grad_norm": 4.105279922485352,
1017
+ "learning_rate": 1.5e-05,
1018
+ "loss": 0.3271,
1019
+ "step": 426
1020
+ },
1021
+ {
1022
+ "epoch": 1.2729970326409497,
1023
+ "grad_norm": 9.26810073852539,
1024
+ "learning_rate": 1.5e-05,
1025
+ "loss": 0.3052,
1026
+ "step": 429
1027
+ },
1028
+ {
1029
+ "epoch": 1.281899109792285,
1030
+ "grad_norm": 11.131587028503418,
1031
+ "learning_rate": 1.5e-05,
1032
+ "loss": 0.315,
1033
+ "step": 432
1034
+ },
1035
+ {
1036
+ "epoch": 1.2908011869436202,
1037
+ "grad_norm": 7.997912883758545,
1038
+ "learning_rate": 1.5e-05,
1039
+ "loss": 0.3037,
1040
+ "step": 435
1041
+ },
1042
+ {
1043
+ "epoch": 1.2997032640949555,
1044
+ "grad_norm": 4.264193058013916,
1045
+ "learning_rate": 1.5e-05,
1046
+ "loss": 0.2967,
1047
+ "step": 438
1048
+ },
1049
+ {
1050
+ "epoch": 1.3086053412462908,
1051
+ "grad_norm": 6.291212558746338,
1052
+ "learning_rate": 1.5e-05,
1053
+ "loss": 0.3078,
1054
+ "step": 441
1055
+ },
1056
+ {
1057
+ "epoch": 1.317507418397626,
1058
+ "grad_norm": 10.159900665283203,
1059
+ "learning_rate": 1.5e-05,
1060
+ "loss": 0.2994,
1061
+ "step": 444
1062
+ },
1063
+ {
1064
+ "epoch": 1.3264094955489614,
1065
+ "grad_norm": 10.216263771057129,
1066
+ "learning_rate": 1.5e-05,
1067
+ "loss": 0.3244,
1068
+ "step": 447
1069
+ },
1070
+ {
1071
+ "epoch": 1.3353115727002967,
1072
+ "grad_norm": 7.566501617431641,
1073
+ "learning_rate": 1.5e-05,
1074
+ "loss": 0.31,
1075
+ "step": 450
1076
+ },
1077
+ {
1078
+ "epoch": 1.344213649851632,
1079
+ "grad_norm": 5.979765892028809,
1080
+ "learning_rate": 1.5e-05,
1081
+ "loss": 0.3069,
1082
+ "step": 453
1083
+ },
1084
+ {
1085
+ "epoch": 1.3531157270029674,
1086
+ "grad_norm": 6.646083354949951,
1087
+ "learning_rate": 1.5e-05,
1088
+ "loss": 0.3026,
1089
+ "step": 456
1090
+ },
1091
+ {
1092
+ "epoch": 1.3620178041543027,
1093
+ "grad_norm": 6.50187349319458,
1094
+ "learning_rate": 1.5e-05,
1095
+ "loss": 0.3065,
1096
+ "step": 459
1097
+ },
1098
+ {
1099
+ "epoch": 1.370919881305638,
1100
+ "grad_norm": 4.8104705810546875,
1101
+ "learning_rate": 1.5e-05,
1102
+ "loss": 0.307,
1103
+ "step": 462
1104
+ },
1105
+ {
1106
+ "epoch": 1.3798219584569733,
1107
+ "grad_norm": 4.24050235748291,
1108
+ "learning_rate": 1.5e-05,
1109
+ "loss": 0.3011,
1110
+ "step": 465
1111
+ },
1112
+ {
1113
+ "epoch": 1.3887240356083086,
1114
+ "grad_norm": 7.853260040283203,
1115
+ "learning_rate": 1.5e-05,
1116
+ "loss": 0.3051,
1117
+ "step": 468
1118
+ },
1119
+ {
1120
+ "epoch": 1.3976261127596439,
1121
+ "grad_norm": 6.0949602127075195,
1122
+ "learning_rate": 1.5e-05,
1123
+ "loss": 0.2931,
1124
+ "step": 471
1125
+ },
1126
+ {
1127
+ "epoch": 1.4065281899109792,
1128
+ "grad_norm": 11.793612480163574,
1129
+ "learning_rate": 1.5e-05,
1130
+ "loss": 0.2982,
1131
+ "step": 474
1132
+ },
1133
+ {
1134
+ "epoch": 1.4154302670623147,
1135
+ "grad_norm": 8.261275291442871,
1136
+ "learning_rate": 1.5e-05,
1137
+ "loss": 0.2966,
1138
+ "step": 477
1139
+ },
1140
+ {
1141
+ "epoch": 1.4243323442136497,
1142
+ "grad_norm": 6.895599365234375,
1143
+ "learning_rate": 1.5e-05,
1144
+ "loss": 0.3195,
1145
+ "step": 480
1146
+ },
1147
+ {
1148
+ "epoch": 1.4332344213649852,
1149
+ "grad_norm": 5.414015293121338,
1150
+ "learning_rate": 1.5e-05,
1151
+ "loss": 0.3063,
1152
+ "step": 483
1153
+ },
1154
+ {
1155
+ "epoch": 1.4421364985163205,
1156
+ "grad_norm": 4.563000202178955,
1157
+ "learning_rate": 1.5e-05,
1158
+ "loss": 0.3079,
1159
+ "step": 486
1160
+ },
1161
+ {
1162
+ "epoch": 1.4510385756676558,
1163
+ "grad_norm": 7.205160617828369,
1164
+ "learning_rate": 1.5e-05,
1165
+ "loss": 0.3204,
1166
+ "step": 489
1167
+ },
1168
+ {
1169
+ "epoch": 1.459940652818991,
1170
+ "grad_norm": 7.146437168121338,
1171
+ "learning_rate": 1.5e-05,
1172
+ "loss": 0.3049,
1173
+ "step": 492
1174
+ },
1175
+ {
1176
+ "epoch": 1.4688427299703264,
1177
+ "grad_norm": 8.912725448608398,
1178
+ "learning_rate": 1.5e-05,
1179
+ "loss": 0.3004,
1180
+ "step": 495
1181
+ },
1182
+ {
1183
+ "epoch": 1.4777448071216617,
1184
+ "grad_norm": 5.934146881103516,
1185
+ "learning_rate": 1.5e-05,
1186
+ "loss": 0.3053,
1187
+ "step": 498
1188
+ },
1189
+ {
1190
+ "epoch": 1.486646884272997,
1191
+ "grad_norm": 7.54482889175415,
1192
+ "learning_rate": 1.5e-05,
1193
+ "loss": 0.2962,
1194
+ "step": 501
1195
+ },
1196
+ {
1197
+ "epoch": 1.4955489614243325,
1198
+ "grad_norm": 11.391508102416992,
1199
+ "learning_rate": 1.5e-05,
1200
+ "loss": 0.3291,
1201
+ "step": 504
1202
+ },
1203
+ {
1204
+ "epoch": 1.5044510385756675,
1205
+ "grad_norm": 9.863611221313477,
1206
+ "learning_rate": 1.5e-05,
1207
+ "loss": 0.3068,
1208
+ "step": 507
1209
+ },
1210
+ {
1211
+ "epoch": 1.513353115727003,
1212
+ "grad_norm": 7.5741376876831055,
1213
+ "learning_rate": 1.5e-05,
1214
+ "loss": 0.3036,
1215
+ "step": 510
1216
+ },
1217
+ {
1218
+ "epoch": 1.5222551928783383,
1219
+ "grad_norm": 11.626495361328125,
1220
+ "learning_rate": 1.5e-05,
1221
+ "loss": 0.3131,
1222
+ "step": 513
1223
+ },
1224
+ {
1225
+ "epoch": 1.5311572700296736,
1226
+ "grad_norm": 4.790311813354492,
1227
+ "learning_rate": 1.5e-05,
1228
+ "loss": 0.3126,
1229
+ "step": 516
1230
+ },
1231
+ {
1232
+ "epoch": 1.540059347181009,
1233
+ "grad_norm": 5.693728446960449,
1234
+ "learning_rate": 1.5e-05,
1235
+ "loss": 0.3221,
1236
+ "step": 519
1237
+ },
1238
+ {
1239
+ "epoch": 1.5489614243323442,
1240
+ "grad_norm": 9.541658401489258,
1241
+ "learning_rate": 1.5e-05,
1242
+ "loss": 0.3186,
1243
+ "step": 522
1244
+ },
1245
+ {
1246
+ "epoch": 1.5578635014836797,
1247
+ "grad_norm": 10.08277416229248,
1248
+ "learning_rate": 1.5e-05,
1249
+ "loss": 0.3094,
1250
+ "step": 525
1251
+ },
1252
+ {
1253
+ "epoch": 1.5667655786350148,
1254
+ "grad_norm": 10.004911422729492,
1255
+ "learning_rate": 1.5e-05,
1256
+ "loss": 0.3081,
1257
+ "step": 528
1258
+ },
1259
+ {
1260
+ "epoch": 1.5756676557863503,
1261
+ "grad_norm": 4.247671127319336,
1262
+ "learning_rate": 1.5e-05,
1263
+ "loss": 0.3173,
1264
+ "step": 531
1265
+ },
1266
+ {
1267
+ "epoch": 1.5845697329376853,
1268
+ "grad_norm": 6.010837078094482,
1269
+ "learning_rate": 1.5e-05,
1270
+ "loss": 0.314,
1271
+ "step": 534
1272
+ },
1273
+ {
1274
+ "epoch": 1.5934718100890208,
1275
+ "grad_norm": 10.42171859741211,
1276
+ "learning_rate": 1.5e-05,
1277
+ "loss": 0.3111,
1278
+ "step": 537
1279
+ },
1280
+ {
1281
+ "epoch": 1.6023738872403561,
1282
+ "grad_norm": 11.672240257263184,
1283
+ "learning_rate": 1.5e-05,
1284
+ "loss": 0.3263,
1285
+ "step": 540
1286
+ },
1287
+ {
1288
+ "epoch": 1.6112759643916914,
1289
+ "grad_norm": 9.143010139465332,
1290
+ "learning_rate": 1.5e-05,
1291
+ "loss": 0.2983,
1292
+ "step": 543
1293
+ },
1294
+ {
1295
+ "epoch": 1.6201780415430267,
1296
+ "grad_norm": 7.786658763885498,
1297
+ "learning_rate": 1.5e-05,
1298
+ "loss": 0.3089,
1299
+ "step": 546
1300
+ },
1301
+ {
1302
+ "epoch": 1.629080118694362,
1303
+ "grad_norm": 5.973340034484863,
1304
+ "learning_rate": 1.5e-05,
1305
+ "loss": 0.303,
1306
+ "step": 549
1307
+ },
1308
+ {
1309
+ "epoch": 1.6379821958456975,
1310
+ "grad_norm": 4.11182975769043,
1311
+ "learning_rate": 1.5e-05,
1312
+ "loss": 0.3059,
1313
+ "step": 552
1314
+ },
1315
+ {
1316
+ "epoch": 1.6468842729970326,
1317
+ "grad_norm": 6.210434913635254,
1318
+ "learning_rate": 1.5e-05,
1319
+ "loss": 0.3133,
1320
+ "step": 555
1321
+ },
1322
+ {
1323
+ "epoch": 1.655786350148368,
1324
+ "grad_norm": 11.501874923706055,
1325
+ "learning_rate": 1.5e-05,
1326
+ "loss": 0.3078,
1327
+ "step": 558
1328
+ },
1329
+ {
1330
+ "epoch": 1.6646884272997031,
1331
+ "grad_norm": 8.35253620147705,
1332
+ "learning_rate": 1.5e-05,
1333
+ "loss": 0.3147,
1334
+ "step": 561
1335
+ },
1336
+ {
1337
+ "epoch": 1.6735905044510386,
1338
+ "grad_norm": 6.669034957885742,
1339
+ "learning_rate": 1.5e-05,
1340
+ "loss": 0.3104,
1341
+ "step": 564
1342
+ },
1343
+ {
1344
+ "epoch": 1.682492581602374,
1345
+ "grad_norm": 13.310565948486328,
1346
+ "learning_rate": 1.5e-05,
1347
+ "loss": 0.3172,
1348
+ "step": 567
1349
+ },
1350
+ {
1351
+ "epoch": 1.6913946587537092,
1352
+ "grad_norm": 6.960197448730469,
1353
+ "learning_rate": 1.5e-05,
1354
+ "loss": 0.3192,
1355
+ "step": 570
1356
+ },
1357
+ {
1358
+ "epoch": 1.7002967359050445,
1359
+ "grad_norm": 10.452018737792969,
1360
+ "learning_rate": 1.5e-05,
1361
+ "loss": 0.3072,
1362
+ "step": 573
1363
+ },
1364
+ {
1365
+ "epoch": 1.7091988130563798,
1366
+ "grad_norm": 6.1864190101623535,
1367
+ "learning_rate": 1.5e-05,
1368
+ "loss": 0.3178,
1369
+ "step": 576
1370
+ },
1371
+ {
1372
+ "epoch": 1.7181008902077153,
1373
+ "grad_norm": 6.356491565704346,
1374
+ "learning_rate": 1.5e-05,
1375
+ "loss": 0.3176,
1376
+ "step": 579
1377
+ },
1378
+ {
1379
+ "epoch": 1.7270029673590503,
1380
+ "grad_norm": 5.232566833496094,
1381
+ "learning_rate": 1.5e-05,
1382
+ "loss": 0.2963,
1383
+ "step": 582
1384
+ },
1385
+ {
1386
+ "epoch": 1.7359050445103859,
1387
+ "grad_norm": 3.332583427429199,
1388
+ "learning_rate": 1.5e-05,
1389
+ "loss": 0.2999,
1390
+ "step": 585
1391
+ },
1392
+ {
1393
+ "epoch": 1.744807121661721,
1394
+ "grad_norm": 5.193176746368408,
1395
+ "learning_rate": 1.5e-05,
1396
+ "loss": 0.3192,
1397
+ "step": 588
1398
+ },
1399
+ {
1400
+ "epoch": 1.7537091988130564,
1401
+ "grad_norm": 6.814889907836914,
1402
+ "learning_rate": 1.5e-05,
1403
+ "loss": 0.2958,
1404
+ "step": 591
1405
+ },
1406
+ {
1407
+ "epoch": 1.7626112759643917,
1408
+ "grad_norm": 9.611870765686035,
1409
+ "learning_rate": 1.5e-05,
1410
+ "loss": 0.3091,
1411
+ "step": 594
1412
+ },
1413
+ {
1414
+ "epoch": 1.771513353115727,
1415
+ "grad_norm": 7.733308792114258,
1416
+ "learning_rate": 1.5e-05,
1417
+ "loss": 0.3026,
1418
+ "step": 597
1419
+ },
1420
+ {
1421
+ "epoch": 1.7804154302670623,
1422
+ "grad_norm": 5.742140769958496,
1423
+ "learning_rate": 1.5e-05,
1424
+ "loss": 0.2962,
1425
+ "step": 600
1426
+ },
1427
+ {
1428
+ "epoch": 1.7893175074183976,
1429
+ "grad_norm": 11.053295135498047,
1430
+ "learning_rate": 1.5e-05,
1431
+ "loss": 0.2967,
1432
+ "step": 603
1433
+ },
1434
+ {
1435
+ "epoch": 1.798219584569733,
1436
+ "grad_norm": 7.031610012054443,
1437
+ "learning_rate": 1.5e-05,
1438
+ "loss": 0.2927,
1439
+ "step": 606
1440
+ },
1441
+ {
1442
+ "epoch": 1.8071216617210681,
1443
+ "grad_norm": 6.521071910858154,
1444
+ "learning_rate": 1.5e-05,
1445
+ "loss": 0.3139,
1446
+ "step": 609
1447
+ },
1448
+ {
1449
+ "epoch": 1.8160237388724036,
1450
+ "grad_norm": 6.417489528656006,
1451
+ "learning_rate": 1.5e-05,
1452
+ "loss": 0.3081,
1453
+ "step": 612
1454
+ },
1455
+ {
1456
+ "epoch": 1.8249258160237387,
1457
+ "grad_norm": 9.378142356872559,
1458
+ "learning_rate": 1.5e-05,
1459
+ "loss": 0.298,
1460
+ "step": 615
1461
+ },
1462
+ {
1463
+ "epoch": 1.8338278931750742,
1464
+ "grad_norm": 8.447271347045898,
1465
+ "learning_rate": 1.5e-05,
1466
+ "loss": 0.3141,
1467
+ "step": 618
1468
+ },
1469
+ {
1470
+ "epoch": 1.8427299703264095,
1471
+ "grad_norm": 10.930451393127441,
1472
+ "learning_rate": 1.5e-05,
1473
+ "loss": 0.3021,
1474
+ "step": 621
1475
+ },
1476
+ {
1477
+ "epoch": 1.8516320474777448,
1478
+ "grad_norm": 8.880478858947754,
1479
+ "learning_rate": 1.5e-05,
1480
+ "loss": 0.3136,
1481
+ "step": 624
1482
+ },
1483
+ {
1484
+ "epoch": 1.86053412462908,
1485
+ "grad_norm": 5.905041217803955,
1486
+ "learning_rate": 1.5e-05,
1487
+ "loss": 0.3191,
1488
+ "step": 627
1489
+ },
1490
+ {
1491
+ "epoch": 1.8694362017804154,
1492
+ "grad_norm": 6.188875675201416,
1493
+ "learning_rate": 1.5e-05,
1494
+ "loss": 0.3283,
1495
+ "step": 630
1496
+ },
1497
+ {
1498
+ "epoch": 1.8783382789317509,
1499
+ "grad_norm": 11.83849811553955,
1500
+ "learning_rate": 1.5e-05,
1501
+ "loss": 0.3235,
1502
+ "step": 633
1503
+ },
1504
+ {
1505
+ "epoch": 1.887240356083086,
1506
+ "grad_norm": 7.689598560333252,
1507
+ "learning_rate": 1.5e-05,
1508
+ "loss": 0.3162,
1509
+ "step": 636
1510
+ },
1511
+ {
1512
+ "epoch": 1.8961424332344214,
1513
+ "grad_norm": 3.9637110233306885,
1514
+ "learning_rate": 1.5e-05,
1515
+ "loss": 0.3127,
1516
+ "step": 639
1517
+ },
1518
+ {
1519
+ "epoch": 1.9050445103857567,
1520
+ "grad_norm": 13.587063789367676,
1521
+ "learning_rate": 1.5e-05,
1522
+ "loss": 0.3268,
1523
+ "step": 642
1524
+ },
1525
+ {
1526
+ "epoch": 1.913946587537092,
1527
+ "grad_norm": 7.881510257720947,
1528
+ "learning_rate": 1.5e-05,
1529
+ "loss": 0.3038,
1530
+ "step": 645
1531
+ },
1532
+ {
1533
+ "epoch": 1.9228486646884273,
1534
+ "grad_norm": 6.357386112213135,
1535
+ "learning_rate": 1.5e-05,
1536
+ "loss": 0.3097,
1537
+ "step": 648
1538
+ },
1539
+ {
1540
+ "epoch": 1.9317507418397626,
1541
+ "grad_norm": 6.852357387542725,
1542
+ "learning_rate": 1.5e-05,
1543
+ "loss": 0.3056,
1544
+ "step": 651
1545
+ },
1546
+ {
1547
+ "epoch": 1.9406528189910979,
1548
+ "grad_norm": 6.557038307189941,
1549
+ "learning_rate": 1.5e-05,
1550
+ "loss": 0.3209,
1551
+ "step": 654
1552
+ },
1553
+ {
1554
+ "epoch": 1.9495548961424332,
1555
+ "grad_norm": 7.013545036315918,
1556
+ "learning_rate": 1.5e-05,
1557
+ "loss": 0.3237,
1558
+ "step": 657
1559
+ },
1560
+ {
1561
+ "epoch": 1.9584569732937687,
1562
+ "grad_norm": 9.902325630187988,
1563
+ "learning_rate": 1.5e-05,
1564
+ "loss": 0.3166,
1565
+ "step": 660
1566
+ },
1567
+ {
1568
+ "epoch": 1.9673590504451037,
1569
+ "grad_norm": 6.723764896392822,
1570
+ "learning_rate": 1.5e-05,
1571
+ "loss": 0.3198,
1572
+ "step": 663
1573
+ },
1574
+ {
1575
+ "epoch": 1.9762611275964392,
1576
+ "grad_norm": 9.627095222473145,
1577
+ "learning_rate": 1.5e-05,
1578
+ "loss": 0.321,
1579
+ "step": 666
1580
+ },
1581
+ {
1582
+ "epoch": 1.9851632047477745,
1583
+ "grad_norm": 8.035420417785645,
1584
+ "learning_rate": 1.5e-05,
1585
+ "loss": 0.31,
1586
+ "step": 669
1587
+ },
1588
+ {
1589
+ "epoch": 1.9940652818991098,
1590
+ "grad_norm": 10.477612495422363,
1591
+ "learning_rate": 1.5e-05,
1592
+ "loss": 0.2995,
1593
+ "step": 672
1594
+ },
1595
+ {
1596
+ "epoch": 2.0,
1597
+ "eval_loss": 0.6920689940452576,
1598
+ "eval_runtime": 296.7344,
1599
+ "eval_samples_per_second": 5.197,
1600
+ "eval_steps_per_second": 0.65,
1601
+ "step": 674
1602
+ },
1603
+ {
1604
+ "epoch": 2.0029673590504453,
1605
+ "grad_norm": 4.917605400085449,
1606
+ "learning_rate": 1.5e-05,
1607
+ "loss": 0.3129,
1608
+ "step": 675
1609
+ },
1610
+ {
1611
+ "epoch": 2.0118694362017804,
1612
+ "grad_norm": 14.471161842346191,
1613
+ "learning_rate": 1.5e-05,
1614
+ "loss": 0.3121,
1615
+ "step": 678
1616
+ },
1617
+ {
1618
+ "epoch": 2.020771513353116,
1619
+ "grad_norm": 10.123734474182129,
1620
+ "learning_rate": 1.5e-05,
1621
+ "loss": 0.3136,
1622
+ "step": 681
1623
+ },
1624
+ {
1625
+ "epoch": 2.029673590504451,
1626
+ "grad_norm": 7.0058794021606445,
1627
+ "learning_rate": 1.5e-05,
1628
+ "loss": 0.314,
1629
+ "step": 684
1630
+ },
1631
+ {
1632
+ "epoch": 2.0385756676557865,
1633
+ "grad_norm": 5.461868762969971,
1634
+ "learning_rate": 1.5e-05,
1635
+ "loss": 0.307,
1636
+ "step": 687
1637
+ },
1638
+ {
1639
+ "epoch": 2.0474777448071215,
1640
+ "grad_norm": 5.689599514007568,
1641
+ "learning_rate": 1.5e-05,
1642
+ "loss": 0.3053,
1643
+ "step": 690
1644
+ },
1645
+ {
1646
+ "epoch": 2.056379821958457,
1647
+ "grad_norm": 8.585354804992676,
1648
+ "learning_rate": 1.5e-05,
1649
+ "loss": 0.3041,
1650
+ "step": 693
1651
+ },
1652
+ {
1653
+ "epoch": 2.065281899109792,
1654
+ "grad_norm": 4.620091915130615,
1655
+ "learning_rate": 1.5e-05,
1656
+ "loss": 0.2921,
1657
+ "step": 696
1658
+ },
1659
+ {
1660
+ "epoch": 2.0741839762611276,
1661
+ "grad_norm": 6.909940719604492,
1662
+ "learning_rate": 1.5e-05,
1663
+ "loss": 0.3087,
1664
+ "step": 699
1665
+ },
1666
+ {
1667
+ "epoch": 2.083086053412463,
1668
+ "grad_norm": 5.3829426765441895,
1669
+ "learning_rate": 1.5e-05,
1670
+ "loss": 0.294,
1671
+ "step": 702
1672
+ },
1673
+ {
1674
+ "epoch": 2.091988130563798,
1675
+ "grad_norm": 10.095771789550781,
1676
+ "learning_rate": 1.5e-05,
1677
+ "loss": 0.3027,
1678
+ "step": 705
1679
+ },
1680
+ {
1681
+ "epoch": 2.1008902077151337,
1682
+ "grad_norm": 7.622206687927246,
1683
+ "learning_rate": 1.5e-05,
1684
+ "loss": 0.2936,
1685
+ "step": 708
1686
+ },
1687
+ {
1688
+ "epoch": 2.1097922848664687,
1689
+ "grad_norm": 9.839076042175293,
1690
+ "learning_rate": 1.5e-05,
1691
+ "loss": 0.3093,
1692
+ "step": 711
1693
+ },
1694
+ {
1695
+ "epoch": 2.1186943620178043,
1696
+ "grad_norm": 13.05020809173584,
1697
+ "learning_rate": 1.5e-05,
1698
+ "loss": 0.3076,
1699
+ "step": 714
1700
+ },
1701
+ {
1702
+ "epoch": 2.1275964391691393,
1703
+ "grad_norm": 4.418980598449707,
1704
+ "learning_rate": 1.5e-05,
1705
+ "loss": 0.3043,
1706
+ "step": 717
1707
+ },
1708
+ {
1709
+ "epoch": 2.136498516320475,
1710
+ "grad_norm": 3.569221019744873,
1711
+ "learning_rate": 1.5e-05,
1712
+ "loss": 0.3083,
1713
+ "step": 720
1714
+ },
1715
+ {
1716
+ "epoch": 2.14540059347181,
1717
+ "grad_norm": 6.468089580535889,
1718
+ "learning_rate": 1.5e-05,
1719
+ "loss": 0.3016,
1720
+ "step": 723
1721
+ },
1722
+ {
1723
+ "epoch": 2.1543026706231454,
1724
+ "grad_norm": 8.789352416992188,
1725
+ "learning_rate": 1.5e-05,
1726
+ "loss": 0.3022,
1727
+ "step": 726
1728
+ },
1729
+ {
1730
+ "epoch": 2.163204747774481,
1731
+ "grad_norm": 8.202059745788574,
1732
+ "learning_rate": 1.5e-05,
1733
+ "loss": 0.311,
1734
+ "step": 729
1735
+ },
1736
+ {
1737
+ "epoch": 2.172106824925816,
1738
+ "grad_norm": 6.959595203399658,
1739
+ "learning_rate": 1.5e-05,
1740
+ "loss": 0.2947,
1741
+ "step": 732
1742
+ },
1743
+ {
1744
+ "epoch": 2.1810089020771515,
1745
+ "grad_norm": 11.653180122375488,
1746
+ "learning_rate": 1.5e-05,
1747
+ "loss": 0.3094,
1748
+ "step": 735
1749
+ },
1750
+ {
1751
+ "epoch": 2.1899109792284865,
1752
+ "grad_norm": 8.507452964782715,
1753
+ "learning_rate": 1.5e-05,
1754
+ "loss": 0.3094,
1755
+ "step": 738
1756
+ },
1757
+ {
1758
+ "epoch": 2.198813056379822,
1759
+ "grad_norm": 3.680802583694458,
1760
+ "learning_rate": 1.5e-05,
1761
+ "loss": 0.3054,
1762
+ "step": 741
1763
+ },
1764
+ {
1765
+ "epoch": 2.207715133531157,
1766
+ "grad_norm": 9.95173454284668,
1767
+ "learning_rate": 1.5e-05,
1768
+ "loss": 0.2928,
1769
+ "step": 744
1770
+ },
1771
+ {
1772
+ "epoch": 2.2166172106824926,
1773
+ "grad_norm": 10.835822105407715,
1774
+ "learning_rate": 1.5e-05,
1775
+ "loss": 0.2882,
1776
+ "step": 747
1777
+ },
1778
+ {
1779
+ "epoch": 2.2255192878338277,
1780
+ "grad_norm": 12.096845626831055,
1781
+ "learning_rate": 1.5e-05,
1782
+ "loss": 0.308,
1783
+ "step": 750
1784
+ },
1785
+ {
1786
+ "epoch": 2.234421364985163,
1787
+ "grad_norm": 4.49980354309082,
1788
+ "learning_rate": 1.5e-05,
1789
+ "loss": 0.3173,
1790
+ "step": 753
1791
+ },
1792
+ {
1793
+ "epoch": 2.2433234421364987,
1794
+ "grad_norm": 9.042285919189453,
1795
+ "learning_rate": 1.5e-05,
1796
+ "loss": 0.3073,
1797
+ "step": 756
1798
+ },
1799
+ {
1800
+ "epoch": 2.2522255192878338,
1801
+ "grad_norm": 5.250131130218506,
1802
+ "learning_rate": 1.5e-05,
1803
+ "loss": 0.2966,
1804
+ "step": 759
1805
+ },
1806
+ {
1807
+ "epoch": 2.2611275964391693,
1808
+ "grad_norm": 9.235132217407227,
1809
+ "learning_rate": 1.5e-05,
1810
+ "loss": 0.3168,
1811
+ "step": 762
1812
+ },
1813
+ {
1814
+ "epoch": 2.2700296735905043,
1815
+ "grad_norm": 7.330996513366699,
1816
+ "learning_rate": 1.5e-05,
1817
+ "loss": 0.3027,
1818
+ "step": 765
1819
+ },
1820
+ {
1821
+ "epoch": 2.27893175074184,
1822
+ "grad_norm": 5.805144309997559,
1823
+ "learning_rate": 1.5e-05,
1824
+ "loss": 0.3232,
1825
+ "step": 768
1826
+ },
1827
+ {
1828
+ "epoch": 2.287833827893175,
1829
+ "grad_norm": 10.95457649230957,
1830
+ "learning_rate": 1.5e-05,
1831
+ "loss": 0.307,
1832
+ "step": 771
1833
+ },
1834
+ {
1835
+ "epoch": 2.2967359050445104,
1836
+ "grad_norm": 5.920906066894531,
1837
+ "learning_rate": 1.5e-05,
1838
+ "loss": 0.3052,
1839
+ "step": 774
1840
+ },
1841
+ {
1842
+ "epoch": 2.3056379821958455,
1843
+ "grad_norm": 7.4418511390686035,
1844
+ "learning_rate": 1.5e-05,
1845
+ "loss": 0.3195,
1846
+ "step": 777
1847
+ },
1848
+ {
1849
+ "epoch": 2.314540059347181,
1850
+ "grad_norm": 9.739228248596191,
1851
+ "learning_rate": 1.5e-05,
1852
+ "loss": 0.3146,
1853
+ "step": 780
1854
+ },
1855
+ {
1856
+ "epoch": 2.3234421364985165,
1857
+ "grad_norm": 11.025596618652344,
1858
+ "learning_rate": 1.5e-05,
1859
+ "loss": 0.3061,
1860
+ "step": 783
1861
+ },
1862
+ {
1863
+ "epoch": 2.3323442136498516,
1864
+ "grad_norm": 5.031250953674316,
1865
+ "learning_rate": 1.5e-05,
1866
+ "loss": 0.3128,
1867
+ "step": 786
1868
+ },
1869
+ {
1870
+ "epoch": 2.341246290801187,
1871
+ "grad_norm": 9.482969284057617,
1872
+ "learning_rate": 1.5e-05,
1873
+ "loss": 0.3067,
1874
+ "step": 789
1875
+ },
1876
+ {
1877
+ "epoch": 2.350148367952522,
1878
+ "grad_norm": 4.4395270347595215,
1879
+ "learning_rate": 1.5e-05,
1880
+ "loss": 0.2972,
1881
+ "step": 792
1882
+ },
1883
+ {
1884
+ "epoch": 2.3590504451038576,
1885
+ "grad_norm": 4.755709171295166,
1886
+ "learning_rate": 1.5e-05,
1887
+ "loss": 0.3078,
1888
+ "step": 795
1889
+ },
1890
+ {
1891
+ "epoch": 2.3679525222551927,
1892
+ "grad_norm": 6.278073310852051,
1893
+ "learning_rate": 1.5e-05,
1894
+ "loss": 0.3107,
1895
+ "step": 798
1896
+ },
1897
+ {
1898
+ "epoch": 2.376854599406528,
1899
+ "grad_norm": 7.922651767730713,
1900
+ "learning_rate": 1.5e-05,
1901
+ "loss": 0.3043,
1902
+ "step": 801
1903
+ },
1904
+ {
1905
+ "epoch": 2.3857566765578637,
1906
+ "grad_norm": 9.521344184875488,
1907
+ "learning_rate": 1.5e-05,
1908
+ "loss": 0.3158,
1909
+ "step": 804
1910
+ },
1911
+ {
1912
+ "epoch": 2.394658753709199,
1913
+ "grad_norm": 12.499236106872559,
1914
+ "learning_rate": 1.5e-05,
1915
+ "loss": 0.3086,
1916
+ "step": 807
1917
+ },
1918
+ {
1919
+ "epoch": 2.4035608308605343,
1920
+ "grad_norm": 6.426900863647461,
1921
+ "learning_rate": 1.5e-05,
1922
+ "loss": 0.3126,
1923
+ "step": 810
1924
+ },
1925
+ {
1926
+ "epoch": 2.4124629080118694,
1927
+ "grad_norm": 8.431981086730957,
1928
+ "learning_rate": 1.5e-05,
1929
+ "loss": 0.3,
1930
+ "step": 813
1931
+ },
1932
+ {
1933
+ "epoch": 2.421364985163205,
1934
+ "grad_norm": 12.86776351928711,
1935
+ "learning_rate": 1.5e-05,
1936
+ "loss": 0.2995,
1937
+ "step": 816
1938
+ },
1939
+ {
1940
+ "epoch": 2.43026706231454,
1941
+ "grad_norm": 6.822738170623779,
1942
+ "learning_rate": 1.5e-05,
1943
+ "loss": 0.3115,
1944
+ "step": 819
1945
+ },
1946
+ {
1947
+ "epoch": 2.4391691394658754,
1948
+ "grad_norm": 6.153812408447266,
1949
+ "learning_rate": 1.5e-05,
1950
+ "loss": 0.297,
1951
+ "step": 822
1952
+ },
1953
+ {
1954
+ "epoch": 2.4480712166172105,
1955
+ "grad_norm": 11.699315071105957,
1956
+ "learning_rate": 1.5e-05,
1957
+ "loss": 0.2951,
1958
+ "step": 825
1959
+ },
1960
+ {
1961
+ "epoch": 2.456973293768546,
1962
+ "grad_norm": 5.795748710632324,
1963
+ "learning_rate": 1.5e-05,
1964
+ "loss": 0.3062,
1965
+ "step": 828
1966
+ },
1967
+ {
1968
+ "epoch": 2.465875370919881,
1969
+ "grad_norm": 6.4195756912231445,
1970
+ "learning_rate": 1.5e-05,
1971
+ "loss": 0.2938,
1972
+ "step": 831
1973
+ },
1974
+ {
1975
+ "epoch": 2.4747774480712166,
1976
+ "grad_norm": 6.024349212646484,
1977
+ "learning_rate": 1.5e-05,
1978
+ "loss": 0.2887,
1979
+ "step": 834
1980
+ },
1981
+ {
1982
+ "epoch": 2.483679525222552,
1983
+ "grad_norm": 5.880214691162109,
1984
+ "learning_rate": 1.5e-05,
1985
+ "loss": 0.2943,
1986
+ "step": 837
1987
+ },
1988
+ {
1989
+ "epoch": 2.492581602373887,
1990
+ "grad_norm": 18.98047637939453,
1991
+ "learning_rate": 1.5e-05,
1992
+ "loss": 0.2903,
1993
+ "step": 840
1994
+ },
1995
+ {
1996
+ "epoch": 2.5014836795252227,
1997
+ "grad_norm": 14.550153732299805,
1998
+ "learning_rate": 1.5e-05,
1999
+ "loss": 0.2999,
2000
+ "step": 843
2001
+ },
2002
+ {
2003
+ "epoch": 2.5103857566765577,
2004
+ "grad_norm": 11.062093734741211,
2005
+ "learning_rate": 1.5e-05,
2006
+ "loss": 0.3281,
2007
+ "step": 846
2008
+ },
2009
+ {
2010
+ "epoch": 2.5192878338278932,
2011
+ "grad_norm": 6.1865644454956055,
2012
+ "learning_rate": 1.5e-05,
2013
+ "loss": 0.3073,
2014
+ "step": 849
2015
+ },
2016
+ {
2017
+ "epoch": 2.5281899109792283,
2018
+ "grad_norm": 10.409070014953613,
2019
+ "learning_rate": 1.5e-05,
2020
+ "loss": 0.3155,
2021
+ "step": 852
2022
+ },
2023
+ {
2024
+ "epoch": 2.537091988130564,
2025
+ "grad_norm": 12.40860366821289,
2026
+ "learning_rate": 1.5e-05,
2027
+ "loss": 0.3013,
2028
+ "step": 855
2029
+ },
2030
+ {
2031
+ "epoch": 2.5459940652818993,
2032
+ "grad_norm": 6.20428466796875,
2033
+ "learning_rate": 1.5e-05,
2034
+ "loss": 0.3141,
2035
+ "step": 858
2036
+ },
2037
+ {
2038
+ "epoch": 2.5548961424332344,
2039
+ "grad_norm": 4.158163547515869,
2040
+ "learning_rate": 1.5e-05,
2041
+ "loss": 0.307,
2042
+ "step": 861
2043
+ },
2044
+ {
2045
+ "epoch": 2.56379821958457,
2046
+ "grad_norm": 7.828709602355957,
2047
+ "learning_rate": 1.5e-05,
2048
+ "loss": 0.3191,
2049
+ "step": 864
2050
+ },
2051
+ {
2052
+ "epoch": 2.572700296735905,
2053
+ "grad_norm": 8.588981628417969,
2054
+ "learning_rate": 1.5e-05,
2055
+ "loss": 0.3237,
2056
+ "step": 867
2057
+ },
2058
+ {
2059
+ "epoch": 2.5816023738872405,
2060
+ "grad_norm": 6.725210189819336,
2061
+ "learning_rate": 1.5e-05,
2062
+ "loss": 0.293,
2063
+ "step": 870
2064
+ },
2065
+ {
2066
+ "epoch": 2.5905044510385755,
2067
+ "grad_norm": 8.876666069030762,
2068
+ "learning_rate": 1.5e-05,
2069
+ "loss": 0.3042,
2070
+ "step": 873
2071
+ },
2072
+ {
2073
+ "epoch": 2.599406528189911,
2074
+ "grad_norm": 8.503588676452637,
2075
+ "learning_rate": 1.5e-05,
2076
+ "loss": 0.3058,
2077
+ "step": 876
2078
+ },
2079
+ {
2080
+ "epoch": 2.6083086053412465,
2081
+ "grad_norm": 7.051385402679443,
2082
+ "learning_rate": 1.5e-05,
2083
+ "loss": 0.2856,
2084
+ "step": 879
2085
+ },
2086
+ {
2087
+ "epoch": 2.6172106824925816,
2088
+ "grad_norm": 11.214133262634277,
2089
+ "learning_rate": 1.5e-05,
2090
+ "loss": 0.2899,
2091
+ "step": 882
2092
+ },
2093
+ {
2094
+ "epoch": 2.6261127596439167,
2095
+ "grad_norm": 5.270874977111816,
2096
+ "learning_rate": 1.5e-05,
2097
+ "loss": 0.2947,
2098
+ "step": 885
2099
+ },
2100
+ {
2101
+ "epoch": 2.635014836795252,
2102
+ "grad_norm": 13.623291015625,
2103
+ "learning_rate": 1.5e-05,
2104
+ "loss": 0.3001,
2105
+ "step": 888
2106
+ },
2107
+ {
2108
+ "epoch": 2.6439169139465877,
2109
+ "grad_norm": 3.9485678672790527,
2110
+ "learning_rate": 1.5e-05,
2111
+ "loss": 0.3027,
2112
+ "step": 891
2113
+ },
2114
+ {
2115
+ "epoch": 2.6528189910979227,
2116
+ "grad_norm": 7.7399725914001465,
2117
+ "learning_rate": 1.5e-05,
2118
+ "loss": 0.2988,
2119
+ "step": 894
2120
+ },
2121
+ {
2122
+ "epoch": 2.6617210682492582,
2123
+ "grad_norm": 7.428469181060791,
2124
+ "learning_rate": 1.5e-05,
2125
+ "loss": 0.2896,
2126
+ "step": 897
2127
+ },
2128
+ {
2129
+ "epoch": 2.6706231454005933,
2130
+ "grad_norm": 4.9085001945495605,
2131
+ "learning_rate": 1.5e-05,
2132
+ "loss": 0.2955,
2133
+ "step": 900
2134
+ },
2135
+ {
2136
+ "epoch": 2.679525222551929,
2137
+ "grad_norm": 7.616215705871582,
2138
+ "learning_rate": 1.5e-05,
2139
+ "loss": 0.3143,
2140
+ "step": 903
2141
+ },
2142
+ {
2143
+ "epoch": 2.688427299703264,
2144
+ "grad_norm": 6.225953102111816,
2145
+ "learning_rate": 1.5e-05,
2146
+ "loss": 0.3004,
2147
+ "step": 906
2148
+ },
2149
+ {
2150
+ "epoch": 2.6973293768545994,
2151
+ "grad_norm": 5.675787448883057,
2152
+ "learning_rate": 1.5e-05,
2153
+ "loss": 0.2946,
2154
+ "step": 909
2155
+ },
2156
+ {
2157
+ "epoch": 2.706231454005935,
2158
+ "grad_norm": 7.747137069702148,
2159
+ "learning_rate": 1.5e-05,
2160
+ "loss": 0.2966,
2161
+ "step": 912
2162
+ },
2163
+ {
2164
+ "epoch": 2.71513353115727,
2165
+ "grad_norm": 12.72786808013916,
2166
+ "learning_rate": 1.5e-05,
2167
+ "loss": 0.3106,
2168
+ "step": 915
2169
+ },
2170
+ {
2171
+ "epoch": 2.7240356083086055,
2172
+ "grad_norm": 7.423135280609131,
2173
+ "learning_rate": 1.5e-05,
2174
+ "loss": 0.2838,
2175
+ "step": 918
2176
+ },
2177
+ {
2178
+ "epoch": 2.7329376854599405,
2179
+ "grad_norm": 6.8378520011901855,
2180
+ "learning_rate": 1.5e-05,
2181
+ "loss": 0.3165,
2182
+ "step": 921
2183
+ },
2184
+ {
2185
+ "epoch": 2.741839762611276,
2186
+ "grad_norm": 5.68455696105957,
2187
+ "learning_rate": 1.5e-05,
2188
+ "loss": 0.3078,
2189
+ "step": 924
2190
+ },
2191
+ {
2192
+ "epoch": 2.750741839762611,
2193
+ "grad_norm": 13.37850570678711,
2194
+ "learning_rate": 1.5e-05,
2195
+ "loss": 0.3005,
2196
+ "step": 927
2197
+ },
2198
+ {
2199
+ "epoch": 2.7596439169139466,
2200
+ "grad_norm": 5.610422611236572,
2201
+ "learning_rate": 1.5e-05,
2202
+ "loss": 0.2948,
2203
+ "step": 930
2204
+ },
2205
+ {
2206
+ "epoch": 2.768545994065282,
2207
+ "grad_norm": 9.621097564697266,
2208
+ "learning_rate": 1.5e-05,
2209
+ "loss": 0.307,
2210
+ "step": 933
2211
+ },
2212
+ {
2213
+ "epoch": 2.777448071216617,
2214
+ "grad_norm": 4.709936141967773,
2215
+ "learning_rate": 1.5e-05,
2216
+ "loss": 0.3011,
2217
+ "step": 936
2218
+ },
2219
+ {
2220
+ "epoch": 2.7863501483679523,
2221
+ "grad_norm": 7.198949813842773,
2222
+ "learning_rate": 1.5e-05,
2223
+ "loss": 0.2938,
2224
+ "step": 939
2225
+ },
2226
+ {
2227
+ "epoch": 2.7952522255192878,
2228
+ "grad_norm": 6.532808303833008,
2229
+ "learning_rate": 1.5e-05,
2230
+ "loss": 0.3158,
2231
+ "step": 942
2232
+ },
2233
+ {
2234
+ "epoch": 2.8041543026706233,
2235
+ "grad_norm": 10.170119285583496,
2236
+ "learning_rate": 1.5e-05,
2237
+ "loss": 0.2862,
2238
+ "step": 945
2239
+ },
2240
+ {
2241
+ "epoch": 2.8130563798219583,
2242
+ "grad_norm": 7.333060264587402,
2243
+ "learning_rate": 1.5e-05,
2244
+ "loss": 0.2989,
2245
+ "step": 948
2246
+ },
2247
+ {
2248
+ "epoch": 2.821958456973294,
2249
+ "grad_norm": 3.9618520736694336,
2250
+ "learning_rate": 1.5e-05,
2251
+ "loss": 0.2759,
2252
+ "step": 951
2253
+ },
2254
+ {
2255
+ "epoch": 2.8308605341246293,
2256
+ "grad_norm": 5.956901550292969,
2257
+ "learning_rate": 1.5e-05,
2258
+ "loss": 0.294,
2259
+ "step": 954
2260
+ },
2261
+ {
2262
+ "epoch": 2.8397626112759644,
2263
+ "grad_norm": 5.030998706817627,
2264
+ "learning_rate": 1.5e-05,
2265
+ "loss": 0.3016,
2266
+ "step": 957
2267
+ },
2268
+ {
2269
+ "epoch": 2.8486646884272995,
2270
+ "grad_norm": 8.330857276916504,
2271
+ "learning_rate": 1.5e-05,
2272
+ "loss": 0.3029,
2273
+ "step": 960
2274
+ },
2275
+ {
2276
+ "epoch": 2.857566765578635,
2277
+ "grad_norm": 10.079005241394043,
2278
+ "learning_rate": 1.5e-05,
2279
+ "loss": 0.2955,
2280
+ "step": 963
2281
+ },
2282
+ {
2283
+ "epoch": 2.8664688427299705,
2284
+ "grad_norm": 9.091019630432129,
2285
+ "learning_rate": 1.5e-05,
2286
+ "loss": 0.2999,
2287
+ "step": 966
2288
+ },
2289
+ {
2290
+ "epoch": 2.8753709198813056,
2291
+ "grad_norm": 7.372535705566406,
2292
+ "learning_rate": 1.5e-05,
2293
+ "loss": 0.2949,
2294
+ "step": 969
2295
+ },
2296
+ {
2297
+ "epoch": 2.884272997032641,
2298
+ "grad_norm": 8.11223030090332,
2299
+ "learning_rate": 1.5e-05,
2300
+ "loss": 0.2852,
2301
+ "step": 972
2302
+ },
2303
+ {
2304
+ "epoch": 2.893175074183976,
2305
+ "grad_norm": 3.835611343383789,
2306
+ "learning_rate": 1.5e-05,
2307
+ "loss": 0.2745,
2308
+ "step": 975
2309
+ },
2310
+ {
2311
+ "epoch": 2.9020771513353116,
2312
+ "grad_norm": 11.748644828796387,
2313
+ "learning_rate": 1.5e-05,
2314
+ "loss": 0.2875,
2315
+ "step": 978
2316
+ },
2317
+ {
2318
+ "epoch": 2.9109792284866467,
2319
+ "grad_norm": 14.599609375,
2320
+ "learning_rate": 1.5e-05,
2321
+ "loss": 0.2854,
2322
+ "step": 981
2323
+ },
2324
+ {
2325
+ "epoch": 2.919881305637982,
2326
+ "grad_norm": 8.011322021484375,
2327
+ "learning_rate": 1.5e-05,
2328
+ "loss": 0.2924,
2329
+ "step": 984
2330
+ },
2331
+ {
2332
+ "epoch": 2.9287833827893177,
2333
+ "grad_norm": 5.392467498779297,
2334
+ "learning_rate": 1.5e-05,
2335
+ "loss": 0.293,
2336
+ "step": 987
2337
+ },
2338
+ {
2339
+ "epoch": 2.9376854599406528,
2340
+ "grad_norm": 10.867618560791016,
2341
+ "learning_rate": 1.5e-05,
2342
+ "loss": 0.3049,
2343
+ "step": 990
2344
+ },
2345
+ {
2346
+ "epoch": 2.9465875370919883,
2347
+ "grad_norm": 11.08749771118164,
2348
+ "learning_rate": 1.5e-05,
2349
+ "loss": 0.2943,
2350
+ "step": 993
2351
+ },
2352
+ {
2353
+ "epoch": 2.9554896142433233,
2354
+ "grad_norm": 7.80095100402832,
2355
+ "learning_rate": 1.5e-05,
2356
+ "loss": 0.2984,
2357
+ "step": 996
2358
+ },
2359
+ {
2360
+ "epoch": 2.964391691394659,
2361
+ "grad_norm": 6.650088310241699,
2362
+ "learning_rate": 1.5e-05,
2363
+ "loss": 0.3048,
2364
+ "step": 999
2365
+ },
2366
+ {
2367
+ "epoch": 2.973293768545994,
2368
+ "grad_norm": 9.152456283569336,
2369
+ "learning_rate": 1.5e-05,
2370
+ "loss": 0.2985,
2371
+ "step": 1002
2372
+ },
2373
+ {
2374
+ "epoch": 2.9821958456973294,
2375
+ "grad_norm": 10.47088623046875,
2376
+ "learning_rate": 1.5e-05,
2377
+ "loss": 0.2934,
2378
+ "step": 1005
2379
+ },
2380
+ {
2381
+ "epoch": 2.991097922848665,
2382
+ "grad_norm": 3.175657272338867,
2383
+ "learning_rate": 1.5e-05,
2384
+ "loss": 0.2741,
2385
+ "step": 1008
2386
+ },
2387
+ {
2388
+ "epoch": 3.0,
2389
+ "grad_norm": 10.17156982421875,
2390
+ "learning_rate": 1.5e-05,
2391
+ "loss": 0.2926,
2392
+ "step": 1011
2393
+ },
2394
+ {
2395
+ "epoch": 3.0,
2396
+ "eval_loss": 0.6839648485183716,
2397
+ "eval_runtime": 298.4807,
2398
+ "eval_samples_per_second": 5.166,
2399
+ "eval_steps_per_second": 0.647,
2400
+ "step": 1011
2401
+ }
2402
+ ],
2403
+ "logging_steps": 3,
2404
+ "max_steps": 3370,
2405
+ "num_input_tokens_seen": 0,
2406
+ "num_train_epochs": 10,
2407
+ "save_steps": 500,
2408
+ "stateful_callbacks": {
2409
+ "EarlyStoppingCallback": {
2410
+ "args": {
2411
+ "early_stopping_patience": 3,
2412
+ "early_stopping_threshold": 0.0
2413
+ },
2414
+ "attributes": {
2415
+ "early_stopping_patience_counter": 0
2416
+ }
2417
+ },
2418
+ "TrainerControl": {
2419
+ "args": {
2420
+ "should_epoch_stop": false,
2421
+ "should_evaluate": false,
2422
+ "should_log": false,
2423
+ "should_save": true,
2424
+ "should_training_stop": false
2425
+ },
2426
+ "attributes": {}
2427
+ }
2428
+ },
2429
+ "total_flos": 0.0,
2430
+ "train_batch_size": 4,
2431
+ "trial_name": null,
2432
+ "trial_params": null
2433
+ }
training_args.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d9c57423b57f286016400325e513804db93dc5ba332bd7242f27d3a0181b5820
3
+ size 7608
zero_to_fp32.py ADDED
@@ -0,0 +1,760 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python
2
+
3
+ # Copyright (c) Microsoft Corporation.
4
+ # SPDX-License-Identifier: Apache-2.0
5
+
6
+ # DeepSpeed Team
7
+
8
+ # This script extracts fp32 consolidated weights from a zero 1, 2 and 3 DeepSpeed checkpoints. It gets
9
+ # copied into the top level checkpoint dir, so the user can easily do the conversion at any point in
10
+ # the future. Once extracted, the weights don't require DeepSpeed and can be used in any
11
+ # application.
12
+ #
13
+ # example:
14
+ # python zero_to_fp32.py . output_dir/
15
+ # or
16
+ # python zero_to_fp32.py . output_dir/ --safe_serialization
17
+
18
+ import argparse
19
+ import torch
20
+ import glob
21
+ import math
22
+ import os
23
+ import re
24
+ import gc
25
+ import json
26
+ import numpy as np
27
+ from tqdm import tqdm
28
+ from collections import OrderedDict
29
+ from dataclasses import dataclass
30
+
31
+ # while this script doesn't use deepspeed to recover data, since the checkpoints are pickled with
32
+ # DeepSpeed data structures it has to be available in the current python environment.
33
+ from deepspeed.utils import logger
34
+ from deepspeed.checkpoint.constants import (DS_VERSION, OPTIMIZER_STATE_DICT, SINGLE_PARTITION_OF_FP32_GROUPS,
35
+ FP32_FLAT_GROUPS, ZERO_STAGE, PARTITION_COUNT, PARAM_SHAPES, BUFFER_NAMES,
36
+ FROZEN_PARAM_SHAPES, FROZEN_PARAM_FRAGMENTS)
37
+
38
+
39
+ @dataclass
40
+ class zero_model_state:
41
+ buffers: dict()
42
+ param_shapes: dict()
43
+ shared_params: list
44
+ ds_version: int
45
+ frozen_param_shapes: dict()
46
+ frozen_param_fragments: dict()
47
+
48
+
49
+ debug = 0
50
+
51
+ # load to cpu
52
+ device = torch.device('cpu')
53
+
54
+
55
+ def atoi(text):
56
+ return int(text) if text.isdigit() else text
57
+
58
+
59
+ def natural_keys(text):
60
+ '''
61
+ alist.sort(key=natural_keys) sorts in human order
62
+ http://nedbatchelder.com/blog/200712/human_sorting.html
63
+ (See Toothy's implementation in the comments)
64
+ '''
65
+ return [atoi(c) for c in re.split(r'(\d+)', text)]
66
+
67
+
68
+ def get_model_state_file(checkpoint_dir, zero_stage):
69
+ if not os.path.isdir(checkpoint_dir):
70
+ raise FileNotFoundError(f"Directory '{checkpoint_dir}' doesn't exist")
71
+
72
+ # there should be only one file
73
+ if zero_stage <= 2:
74
+ file = os.path.join(checkpoint_dir, "mp_rank_00_model_states.pt")
75
+ elif zero_stage == 3:
76
+ file = os.path.join(checkpoint_dir, "zero_pp_rank_0_mp_rank_00_model_states.pt")
77
+
78
+ if not os.path.exists(file):
79
+ raise FileNotFoundError(f"can't find model states file at '{file}'")
80
+
81
+ return file
82
+
83
+
84
+ def get_checkpoint_files(checkpoint_dir, glob_pattern):
85
+ # XXX: need to test that this simple glob rule works for multi-node setup too
86
+ ckpt_files = sorted(glob.glob(os.path.join(checkpoint_dir, glob_pattern)), key=natural_keys)
87
+
88
+ if len(ckpt_files) == 0:
89
+ raise FileNotFoundError(f"can't find {glob_pattern} files in directory '{checkpoint_dir}'")
90
+
91
+ return ckpt_files
92
+
93
+
94
+ def get_optim_files(checkpoint_dir):
95
+ return get_checkpoint_files(checkpoint_dir, "*_optim_states.pt")
96
+
97
+
98
+ def get_model_state_files(checkpoint_dir):
99
+ return get_checkpoint_files(checkpoint_dir, "*_model_states.pt")
100
+
101
+
102
+ def parse_model_states(files):
103
+ zero_model_states = []
104
+ for file in files:
105
+ state_dict = torch.load(file, map_location=device, weights_only=False)
106
+
107
+ if BUFFER_NAMES not in state_dict:
108
+ raise ValueError(f"{file} is not a model state checkpoint")
109
+ buffer_names = state_dict[BUFFER_NAMES]
110
+ if debug:
111
+ print("Found buffers:", buffer_names)
112
+
113
+ # recover just the buffers while restoring them to fp32 if they were saved in fp16
114
+ buffers = {k: v.float() for k, v in state_dict["module"].items() if k in buffer_names}
115
+ param_shapes = state_dict[PARAM_SHAPES]
116
+
117
+ # collect parameters that are included in param_shapes
118
+ param_names = []
119
+ for s in param_shapes:
120
+ for name in s.keys():
121
+ param_names.append(name)
122
+
123
+ # update with frozen parameters
124
+ frozen_param_shapes = state_dict.get(FROZEN_PARAM_SHAPES, None)
125
+ if frozen_param_shapes is not None:
126
+ if debug:
127
+ print(f"Found frozen_param_shapes: {frozen_param_shapes}")
128
+ param_names += list(frozen_param_shapes.keys())
129
+
130
+ # handle shared params
131
+ shared_params = [[k, v] for k, v in state_dict["shared_params"].items()]
132
+
133
+ ds_version = state_dict.get(DS_VERSION, None)
134
+
135
+ frozen_param_fragments = state_dict.get(FROZEN_PARAM_FRAGMENTS, None)
136
+
137
+ z_model_state = zero_model_state(buffers=buffers,
138
+ param_shapes=param_shapes,
139
+ shared_params=shared_params,
140
+ ds_version=ds_version,
141
+ frozen_param_shapes=frozen_param_shapes,
142
+ frozen_param_fragments=frozen_param_fragments)
143
+ zero_model_states.append(z_model_state)
144
+
145
+ return zero_model_states
146
+
147
+
148
+ def parse_optim_states(files, ds_checkpoint_dir):
149
+ total_files = len(files)
150
+ state_dicts = []
151
+ for f in tqdm(files, desc='Loading checkpoint shards'):
152
+ state_dict = torch.load(f, map_location=device, mmap=True, weights_only=False)
153
+ # immediately discard the potentially huge 2 optimizer states as we only care for fp32 master weights
154
+ # and also handle the case where it was already removed by another helper script
155
+ state_dict["optimizer_state_dict"].pop("optimizer_state_dict", None)
156
+ state_dicts.append(state_dict)
157
+
158
+ if not ZERO_STAGE in state_dicts[0][OPTIMIZER_STATE_DICT]:
159
+ raise ValueError(f"{files[0]} is not a zero checkpoint")
160
+ zero_stage = state_dicts[0][OPTIMIZER_STATE_DICT][ZERO_STAGE]
161
+ world_size = state_dicts[0][OPTIMIZER_STATE_DICT][PARTITION_COUNT]
162
+
163
+ # For ZeRO-2 each param group can have different partition_count as data parallelism for expert
164
+ # parameters can be different from data parallelism for non-expert parameters. So we can just
165
+ # use the max of the partition_count to get the dp world_size.
166
+
167
+ if type(world_size) is list:
168
+ world_size = max(world_size)
169
+
170
+ if world_size != total_files:
171
+ raise ValueError(
172
+ f"Expected {world_size} of '*_optim_states.pt' under '{ds_checkpoint_dir}' but found {total_files} files. "
173
+ "Possibly due to an overwrite of an old checkpoint, or a checkpoint didn't get saved by one or more processes."
174
+ )
175
+
176
+ # the groups are named differently in each stage
177
+ if zero_stage <= 2:
178
+ fp32_groups_key = SINGLE_PARTITION_OF_FP32_GROUPS
179
+ elif zero_stage == 3:
180
+ fp32_groups_key = FP32_FLAT_GROUPS
181
+ else:
182
+ raise ValueError(f"unknown zero stage {zero_stage}")
183
+
184
+ fp32_flat_groups = [state_dicts[i][OPTIMIZER_STATE_DICT][fp32_groups_key] for i in range(len(state_dicts))]
185
+ return zero_stage, world_size, fp32_flat_groups
186
+
187
+
188
+ def _get_fp32_state_dict_from_zero_checkpoint(ds_checkpoint_dir, exclude_frozen_parameters):
189
+ """
190
+ Returns fp32 state_dict reconstructed from ds checkpoint
191
+
192
+ Args:
193
+ - ``ds_checkpoint_dir``: path to the deepspeed checkpoint folder (where the optimizer files are)
194
+
195
+ """
196
+ print(f"Processing zero checkpoint '{ds_checkpoint_dir}'")
197
+
198
+ optim_files = get_optim_files(ds_checkpoint_dir)
199
+ zero_stage, world_size, fp32_flat_groups = parse_optim_states(optim_files, ds_checkpoint_dir)
200
+ print(f"Detected checkpoint of type zero stage {zero_stage}, world_size: {world_size}")
201
+
202
+ model_files = get_model_state_files(ds_checkpoint_dir)
203
+
204
+ zero_model_states = parse_model_states(model_files)
205
+ print(f'Parsing checkpoint created by deepspeed=={zero_model_states[0].ds_version}')
206
+
207
+ if zero_stage <= 2:
208
+ return _get_fp32_state_dict_from_zero2_checkpoint(world_size, fp32_flat_groups, zero_model_states,
209
+ exclude_frozen_parameters)
210
+ elif zero_stage == 3:
211
+ return _get_fp32_state_dict_from_zero3_checkpoint(world_size, fp32_flat_groups, zero_model_states,
212
+ exclude_frozen_parameters)
213
+
214
+
215
+ def _zero2_merge_frozen_params(state_dict, zero_model_states):
216
+ if zero_model_states[0].frozen_param_shapes is None or len(zero_model_states[0].frozen_param_shapes) == 0:
217
+ return
218
+
219
+ frozen_param_shapes = zero_model_states[0].frozen_param_shapes
220
+ frozen_param_fragments = zero_model_states[0].frozen_param_fragments
221
+
222
+ if debug:
223
+ num_elem = sum(s.numel() for s in frozen_param_shapes.values())
224
+ print(f'rank 0: {FROZEN_PARAM_SHAPES}.numel = {num_elem}')
225
+
226
+ wanted_params = len(frozen_param_shapes)
227
+ wanted_numel = sum(s.numel() for s in frozen_param_shapes.values())
228
+ avail_numel = sum([p.numel() for p in frozen_param_fragments.values()])
229
+ print(f'Frozen params: Have {avail_numel} numels to process.')
230
+ print(f'Frozen params: Need {wanted_numel} numels in {wanted_params} params')
231
+
232
+ total_params = 0
233
+ total_numel = 0
234
+ for name, shape in frozen_param_shapes.items():
235
+ total_params += 1
236
+ unpartitioned_numel = shape.numel()
237
+ total_numel += unpartitioned_numel
238
+
239
+ state_dict[name] = frozen_param_fragments[name]
240
+
241
+ if debug:
242
+ print(f"{name} full shape: {shape} unpartitioned numel {unpartitioned_numel} ")
243
+
244
+ print(f"Reconstructed Frozen fp32 state dict with {total_params} params {total_numel} elements")
245
+
246
+
247
+ def _has_callable(obj, fn):
248
+ attr = getattr(obj, fn, None)
249
+ return callable(attr)
250
+
251
+
252
+ def _zero2_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states):
253
+ param_shapes = zero_model_states[0].param_shapes
254
+
255
+ # Reconstruction protocol:
256
+ #
257
+ # XXX: document this
258
+
259
+ if debug:
260
+ for i in range(world_size):
261
+ for j in range(len(fp32_flat_groups[0])):
262
+ print(f"{FP32_FLAT_GROUPS}[{i}][{j}].shape={fp32_flat_groups[i][j].shape}")
263
+
264
+ # XXX: memory usage doubles here (zero2)
265
+ num_param_groups = len(fp32_flat_groups[0])
266
+ merged_single_partition_of_fp32_groups = []
267
+ for i in range(num_param_groups):
268
+ merged_partitions = [sd[i] for sd in fp32_flat_groups]
269
+ full_single_fp32_vector = torch.cat(merged_partitions, 0)
270
+ merged_single_partition_of_fp32_groups.append(full_single_fp32_vector)
271
+ avail_numel = sum(
272
+ [full_single_fp32_vector.numel() for full_single_fp32_vector in merged_single_partition_of_fp32_groups])
273
+
274
+ if debug:
275
+ wanted_params = sum([len(shapes) for shapes in param_shapes])
276
+ wanted_numel = sum([sum(shape.numel() for shape in shapes.values()) for shapes in param_shapes])
277
+ # not asserting if there is a mismatch due to possible padding
278
+ print(f"Have {avail_numel} numels to process.")
279
+ print(f"Need {wanted_numel} numels in {wanted_params} params.")
280
+
281
+ # params
282
+ # XXX: for huge models that can't fit into the host's RAM we will have to recode this to support
283
+ # out-of-core computing solution
284
+ total_numel = 0
285
+ total_params = 0
286
+ for shapes, full_single_fp32_vector in zip(param_shapes, merged_single_partition_of_fp32_groups):
287
+ offset = 0
288
+ avail_numel = full_single_fp32_vector.numel()
289
+ for name, shape in shapes.items():
290
+
291
+ unpartitioned_numel = shape.numel() if _has_callable(shape, 'numel') else math.prod(shape)
292
+ total_numel += unpartitioned_numel
293
+ total_params += 1
294
+
295
+ if debug:
296
+ print(f"{name} full shape: {shape} unpartitioned numel {unpartitioned_numel} ")
297
+ state_dict[name] = full_single_fp32_vector.narrow(0, offset, unpartitioned_numel).view(shape)
298
+ offset += unpartitioned_numel
299
+
300
+ # Z2 started to align to 2*world_size to improve nccl performance. Therefore both offset and
301
+ # avail_numel can differ by anywhere between 0..2*world_size. Due to two unrelated complex
302
+ # paddings performed in the code it's almost impossible to predict the exact numbers w/o the
303
+ # live optimizer object, so we are checking that the numbers are within the right range
304
+ align_to = 2 * world_size
305
+
306
+ def zero2_align(x):
307
+ return align_to * math.ceil(x / align_to)
308
+
309
+ if debug:
310
+ print(f"original offset={offset}, avail_numel={avail_numel}")
311
+
312
+ offset = zero2_align(offset)
313
+ avail_numel = zero2_align(avail_numel)
314
+
315
+ if debug:
316
+ print(f"aligned offset={offset}, avail_numel={avail_numel}")
317
+
318
+ # Sanity check
319
+ if offset != avail_numel:
320
+ raise ValueError(f"consumed {offset} numels out of {avail_numel} - something is wrong")
321
+
322
+ print(f"Reconstructed fp32 state dict with {total_params} params {total_numel} elements")
323
+
324
+
325
+ def _get_fp32_state_dict_from_zero2_checkpoint(world_size, fp32_flat_groups, zero_model_states,
326
+ exclude_frozen_parameters):
327
+ state_dict = OrderedDict()
328
+
329
+ # buffers
330
+ buffers = zero_model_states[0].buffers
331
+ state_dict.update(buffers)
332
+ if debug:
333
+ print(f"added {len(buffers)} buffers")
334
+
335
+ if not exclude_frozen_parameters:
336
+ _zero2_merge_frozen_params(state_dict, zero_model_states)
337
+
338
+ _zero2_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states)
339
+
340
+ # recover shared parameters
341
+ for pair in zero_model_states[0].shared_params:
342
+ if pair[1] in state_dict:
343
+ state_dict[pair[0]] = state_dict[pair[1]]
344
+
345
+ return state_dict
346
+
347
+
348
+ def zero3_partitioned_param_info(unpartitioned_numel, world_size):
349
+ remainder = unpartitioned_numel % world_size
350
+ padding_numel = (world_size - remainder) if remainder else 0
351
+ partitioned_numel = math.ceil(unpartitioned_numel / world_size)
352
+ return partitioned_numel, padding_numel
353
+
354
+
355
+ def _zero3_merge_frozen_params(state_dict, world_size, zero_model_states):
356
+ if zero_model_states[0].frozen_param_shapes is None or len(zero_model_states[0].frozen_param_shapes) == 0:
357
+ return
358
+
359
+ if debug:
360
+ for i in range(world_size):
361
+ num_elem = sum(s.numel() for s in zero_model_states[i].frozen_param_fragments.values())
362
+ print(f'rank {i}: {FROZEN_PARAM_SHAPES}.numel = {num_elem}')
363
+
364
+ frozen_param_shapes = zero_model_states[0].frozen_param_shapes
365
+ wanted_params = len(frozen_param_shapes)
366
+ wanted_numel = sum(s.numel() for s in frozen_param_shapes.values())
367
+ avail_numel = sum([p.numel() for p in zero_model_states[0].frozen_param_fragments.values()]) * world_size
368
+ print(f'Frozen params: Have {avail_numel} numels to process.')
369
+ print(f'Frozen params: Need {wanted_numel} numels in {wanted_params} params')
370
+
371
+ total_params = 0
372
+ total_numel = 0
373
+ for name, shape in zero_model_states[0].frozen_param_shapes.items():
374
+ total_params += 1
375
+ unpartitioned_numel = shape.numel()
376
+ total_numel += unpartitioned_numel
377
+
378
+ param_frags = tuple(model_state.frozen_param_fragments[name] for model_state in zero_model_states)
379
+ state_dict[name] = torch.cat(param_frags, 0).narrow(0, 0, unpartitioned_numel).view(shape)
380
+
381
+ partitioned_numel, partitioned_padding_numel = zero3_partitioned_param_info(unpartitioned_numel, world_size)
382
+
383
+ if debug:
384
+ print(
385
+ f"Frozen params: {total_params} {name} full shape: {shape} partition0 numel={partitioned_numel} partitioned_padding_numel={partitioned_padding_numel}"
386
+ )
387
+
388
+ print(f"Reconstructed Frozen fp32 state dict with {total_params} params {total_numel} elements")
389
+
390
+
391
+ class GatheredTensor:
392
+ """
393
+ A pseudo tensor that collects partitioned weights.
394
+ It is more memory efficient when there are multiple groups.
395
+ """
396
+
397
+ def __init__(self, flat_groups, flat_groups_offset, offset, partitioned_numel, shape):
398
+ self.flat_groups = flat_groups
399
+ self.flat_groups_offset = flat_groups_offset
400
+ self.offset = offset
401
+ self.partitioned_numel = partitioned_numel
402
+ self.shape = shape
403
+ self.dtype = self.flat_groups[0][0].dtype
404
+
405
+ def contiguous(self):
406
+ """
407
+ Merge partitioned weights from flat_groups into a single tensor.
408
+ """
409
+ end_idx = self.offset + self.partitioned_numel
410
+ world_size = len(self.flat_groups)
411
+ pad_flat_param_chunks = []
412
+
413
+ for rank_i in range(world_size):
414
+ # for each rank, we need to collect weights from related group/groups
415
+ flat_groups_at_rank_i = self.flat_groups[rank_i]
416
+ start_group_id = None
417
+ end_group_id = None
418
+ for group_id in range(len(self.flat_groups_offset)):
419
+ if self.flat_groups_offset[group_id] <= self.offset < self.flat_groups_offset[group_id + 1]:
420
+ start_group_id = group_id
421
+ if self.flat_groups_offset[group_id] < end_idx <= self.flat_groups_offset[group_id + 1]:
422
+ end_group_id = group_id
423
+ break
424
+ # collect weights from related group/groups
425
+ for group_id in range(start_group_id, end_group_id + 1):
426
+ flat_tensor = flat_groups_at_rank_i[group_id]
427
+ start_offset = self.offset - self.flat_groups_offset[group_id]
428
+ end_offset = min(end_idx, self.flat_groups_offset[group_id + 1]) - self.flat_groups_offset[group_id]
429
+ pad_flat_param_chunks.append(flat_tensor[start_offset:end_offset])
430
+
431
+ # collect weights from all ranks
432
+ pad_flat_param = torch.cat(pad_flat_param_chunks, dim=0)
433
+ param = pad_flat_param[:self.shape.numel()].view(self.shape).contiguous()
434
+ return param
435
+
436
+
437
+ def _zero3_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states):
438
+ param_shapes = zero_model_states[0].param_shapes
439
+ avail_numel = sum([flat_group.numel() for flat_group in fp32_flat_groups[0]]) * world_size
440
+
441
+ # Reconstruction protocol: For zero3 we need to zip the partitions together at boundary of each
442
+ # param, re-consolidating each param, while dealing with padding if any
443
+
444
+ # merge list of dicts, preserving order
445
+ param_shapes = {k: v for d in param_shapes for k, v in d.items()}
446
+
447
+ if debug:
448
+ for i in range(world_size):
449
+ print(f"{FP32_FLAT_GROUPS}[{i}].shape={fp32_flat_groups[i].shape}")
450
+
451
+ wanted_params = len(param_shapes)
452
+ wanted_numel = sum(shape.numel() for shape in param_shapes.values())
453
+ # not asserting if there is a mismatch due to possible padding
454
+ avail_numel = fp32_flat_groups[0].numel() * world_size
455
+ print(f"Trainable params: Have {avail_numel} numels to process.")
456
+ print(f"Trainable params: Need {wanted_numel} numels in {wanted_params} params.")
457
+
458
+ # params
459
+ # XXX: for huge models that can't fit into the host's RAM we will have to recode this to support
460
+ # out-of-core computing solution
461
+ offset = 0
462
+ total_numel = 0
463
+ total_params = 0
464
+ flat_groups_offset = [0] + list(np.cumsum([flat_tensor.numel() for flat_tensor in fp32_flat_groups[0]]))
465
+ for name, shape in tqdm(param_shapes.items(), desc='Gathering sharded weights'):
466
+ unpartitioned_numel = shape.numel()
467
+ total_numel += unpartitioned_numel
468
+ total_params += 1
469
+ partitioned_numel, partitioned_padding_numel = zero3_partitioned_param_info(unpartitioned_numel, world_size)
470
+
471
+ if debug:
472
+ print(
473
+ f"Trainable params: {total_params} {name} full shape: {shape} partition0 numel={partitioned_numel} partitioned_padding_numel={partitioned_padding_numel}"
474
+ )
475
+
476
+ # memory efficient tensor
477
+ tensor = GatheredTensor(fp32_flat_groups, flat_groups_offset, offset, partitioned_numel, shape)
478
+ state_dict[name] = tensor
479
+ offset += partitioned_numel
480
+
481
+ offset *= world_size
482
+
483
+ # Sanity check
484
+ if offset != avail_numel:
485
+ raise ValueError(f"consumed {offset} numels out of {avail_numel} - something is wrong")
486
+
487
+ print(f"Reconstructed Trainable fp32 state dict with {total_params} params {total_numel} elements")
488
+
489
+
490
+ def _get_fp32_state_dict_from_zero3_checkpoint(world_size, fp32_flat_groups, zero_model_states,
491
+ exclude_frozen_parameters):
492
+ state_dict = OrderedDict()
493
+
494
+ # buffers
495
+ buffers = zero_model_states[0].buffers
496
+ state_dict.update(buffers)
497
+ if debug:
498
+ print(f"added {len(buffers)} buffers")
499
+
500
+ if not exclude_frozen_parameters:
501
+ _zero3_merge_frozen_params(state_dict, world_size, zero_model_states)
502
+
503
+ _zero3_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states)
504
+
505
+ # recover shared parameters
506
+ for pair in zero_model_states[0].shared_params:
507
+ if pair[1] in state_dict:
508
+ state_dict[pair[0]] = state_dict[pair[1]]
509
+
510
+ return state_dict
511
+
512
+
513
+ def to_torch_tensor(state_dict, return_empty_tensor=False):
514
+ """
515
+ Convert state_dict of GatheredTensor to torch tensor
516
+ """
517
+ torch_state_dict = {}
518
+ converted_tensors = {}
519
+ for name, tensor in state_dict.items():
520
+ tensor_id = id(tensor)
521
+ if tensor_id in converted_tensors: # shared tensors
522
+ shared_tensor = torch_state_dict[converted_tensors[tensor_id]]
523
+ torch_state_dict[name] = shared_tensor
524
+ else:
525
+ converted_tensors[tensor_id] = name
526
+ if return_empty_tensor:
527
+ torch_state_dict[name] = torch.empty(tensor.shape, dtype=tensor.dtype)
528
+ else:
529
+ torch_state_dict[name] = tensor.contiguous()
530
+ return torch_state_dict
531
+
532
+
533
+ def get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir,
534
+ tag=None,
535
+ exclude_frozen_parameters=False,
536
+ lazy_mode=False):
537
+ """
538
+ Convert ZeRO 2 or 3 checkpoint into a single fp32 consolidated state_dict that can be loaded with
539
+ ``load_state_dict()`` and used for training without DeepSpeed or shared with others, for example
540
+ via a model hub.
541
+
542
+ Args:
543
+ - ``checkpoint_dir``: path to the desired checkpoint folder
544
+ - ``tag``: checkpoint tag used as a unique identifier for checkpoint. If not provided will attempt to load tag in 'latest' file. e.g., ``global_step14``
545
+ - ``exclude_frozen_parameters``: exclude frozen parameters
546
+ - ``lazy_mode``: get state_dict in lazy mode. It returns a dict of pesduo tensor instead of torch tensor, which is more memory efficient.
547
+ Convert the pesduo tensor to torch tensor by ``.contiguous()``
548
+
549
+ Returns:
550
+ - pytorch ``state_dict``
551
+
552
+ A typical usage might be ::
553
+
554
+ from deepspeed.utils.zero_to_fp32 import get_fp32_state_dict_from_zero_checkpoint
555
+ # do the training and checkpoint saving
556
+ state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir) # already on cpu
557
+ model = model.cpu() # move to cpu
558
+ model.load_state_dict(state_dict)
559
+ # submit to model hub or save the model to share with others
560
+
561
+ In this example the ``model`` will no longer be usable in the deepspeed context of the same
562
+ application. i.e. you will need to re-initialize the deepspeed engine, since
563
+ ``model.load_state_dict(state_dict)`` will remove all the deepspeed magic from it.
564
+
565
+ If you want it all done for you, use ``load_state_dict_from_zero_checkpoint`` instead.
566
+
567
+ Note: the above usage may not work if your application doesn't have sufficient free CPU memory.
568
+ You may need to use the offline approach using the ``zero_to_fp32.py`` script that is saved with
569
+ the checkpoint. Or you can load state_dict in lazy mode ::
570
+
571
+ from deepspeed.utils.zero_to_fp32 import get_fp32_state_dict_from_zero_checkpoint
572
+ state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir, lazy_mode=True) # not on cpu
573
+ for name, lazy_tensor in state_dict.item():
574
+ tensor = lazy_tensor.contiguous() # to cpu
575
+ print(name, tensor)
576
+ # del tensor to release memory if it no longer in use
577
+ """
578
+ if tag is None:
579
+ latest_path = os.path.join(checkpoint_dir, 'latest')
580
+ if os.path.isfile(latest_path):
581
+ with open(latest_path, 'r') as fd:
582
+ tag = fd.read().strip()
583
+ else:
584
+ raise ValueError(f"Unable to find 'latest' file at {latest_path}")
585
+
586
+ ds_checkpoint_dir = os.path.join(checkpoint_dir, tag)
587
+
588
+ if not os.path.isdir(ds_checkpoint_dir):
589
+ raise FileNotFoundError(f"Directory '{ds_checkpoint_dir}' doesn't exist")
590
+
591
+ state_dict = _get_fp32_state_dict_from_zero_checkpoint(ds_checkpoint_dir, exclude_frozen_parameters)
592
+ if lazy_mode:
593
+ return state_dict
594
+ else:
595
+ return to_torch_tensor(state_dict)
596
+
597
+
598
+ def convert_zero_checkpoint_to_fp32_state_dict(checkpoint_dir,
599
+ output_dir,
600
+ max_shard_size="5GB",
601
+ safe_serialization=False,
602
+ tag=None,
603
+ exclude_frozen_parameters=False):
604
+ """
605
+ Convert ZeRO 2 or 3 checkpoint into a single fp32 consolidated ``state_dict`` file that can be
606
+ loaded with ``torch.load(file)`` + ``load_state_dict()`` and used for training without DeepSpeed.
607
+
608
+ Args:
609
+ - ``checkpoint_dir``: path to the desired checkpoint folder. (one that contains the tag-folder, like ``global_step14``)
610
+ - ``output_dir``: directory to the pytorch fp32 state_dict output files
611
+ - ``max_shard_size``: the maximum size for a checkpoint before being sharded, default value is 5GB
612
+ - ``safe_serialization``: whether to save the model using `safetensors` or the traditional PyTorch way (that uses `pickle`).
613
+ - ``tag``: checkpoint tag used as a unique identifier for checkpoint. If not provided will attempt to load tag in the file named ``latest`` in the checkpoint folder, e.g., ``global_step14``
614
+ - ``exclude_frozen_parameters``: exclude frozen parameters
615
+ """
616
+
617
+ # Dependency pre-check
618
+ if safe_serialization:
619
+ try:
620
+ from safetensors.torch import save_file
621
+ except ImportError:
622
+ print('If you want to use `safe_serialization`, please `pip install safetensors`')
623
+ raise
624
+ if max_shard_size is not None:
625
+ try:
626
+ from huggingface_hub import split_torch_state_dict_into_shards
627
+ except ImportError:
628
+ print('If you want to use `max_shard_size`, please `pip install huggingface_hub`')
629
+ raise
630
+
631
+ # Convert zero checkpoint to state_dict
632
+ state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir,
633
+ tag,
634
+ exclude_frozen_parameters,
635
+ lazy_mode=True)
636
+
637
+ # Shard the model if it is too big.
638
+ weights_name = "model.safetensors" if safe_serialization else "pytorch_model.bin"
639
+ if max_shard_size is not None:
640
+ filename_pattern = weights_name.replace(".bin", "{suffix}.bin").replace(".safetensors", "{suffix}.safetensors")
641
+ # an memory-efficient approach for sharding
642
+ empty_state_dict = to_torch_tensor(state_dict, return_empty_tensor=True)
643
+ state_dict_split = split_torch_state_dict_into_shards(empty_state_dict,
644
+ filename_pattern=filename_pattern,
645
+ max_shard_size=max_shard_size)
646
+ else:
647
+ from collections import namedtuple
648
+ StateDictSplit = namedtuple("StateDictSplit", ["is_sharded", "filename_to_tensors"])
649
+ state_dict_split = StateDictSplit(is_sharded=False,
650
+ filename_to_tensors={weights_name: list(state_dict.keys())})
651
+
652
+ # Save the model by shard
653
+ os.makedirs(output_dir, exist_ok=True)
654
+ filename_to_tensors = state_dict_split.filename_to_tensors.items()
655
+ for shard_file, tensors in tqdm(filename_to_tensors, desc="Saving checkpoint shards"):
656
+ shard_state_dict = {tensor_name: state_dict[tensor_name] for tensor_name in tensors}
657
+ shard_state_dict = to_torch_tensor(shard_state_dict)
658
+ output_path = os.path.join(output_dir, shard_file)
659
+ if safe_serialization:
660
+ save_file(shard_state_dict, output_path, metadata={"format": "pt"})
661
+ else:
662
+ torch.save(shard_state_dict, output_path)
663
+ # release the memory of current shard
664
+ for tensor_name in list(shard_state_dict.keys()):
665
+ del state_dict[tensor_name]
666
+ del shard_state_dict[tensor_name]
667
+ del shard_state_dict
668
+ gc.collect()
669
+
670
+ # Save index if sharded
671
+ if state_dict_split.is_sharded:
672
+ index = {
673
+ "metadata": state_dict_split.metadata,
674
+ "weight_map": state_dict_split.tensor_to_filename,
675
+ }
676
+ save_index_file = "model.safetensors.index.json" if safe_serialization else "pytorch_model.bin.index.json"
677
+ save_index_file = os.path.join(output_dir, save_index_file)
678
+ with open(save_index_file, "w", encoding="utf-8") as f:
679
+ content = json.dumps(index, indent=2, sort_keys=True) + "\n"
680
+ f.write(content)
681
+
682
+
683
+ def load_state_dict_from_zero_checkpoint(model, checkpoint_dir, tag=None):
684
+ """
685
+ 1. Put the provided model to cpu
686
+ 2. Convert ZeRO 2 or 3 checkpoint into a single fp32 consolidated ``state_dict``
687
+ 3. Load it into the provided model
688
+
689
+ Args:
690
+ - ``model``: the model object to update
691
+ - ``checkpoint_dir``: path to the desired checkpoint folder. (one that contains the tag-folder, like ``global_step14``)
692
+ - ``tag``: checkpoint tag used as a unique identifier for checkpoint. If not provided will attempt to load tag in the file named ``latest`` in the checkpoint folder, e.g., ``global_step14``
693
+
694
+ Returns:
695
+ - ``model`: modified model
696
+
697
+ Make sure you have plenty of CPU memory available before you call this function. If you don't
698
+ have enough use the ``zero_to_fp32.py`` utility to do the conversion. You will find it
699
+ conveniently placed for you in the checkpoint folder.
700
+
701
+ A typical usage might be ::
702
+
703
+ from deepspeed.utils.zero_to_fp32 import load_state_dict_from_zero_checkpoint
704
+ model = load_state_dict_from_zero_checkpoint(trainer.model, checkpoint_dir)
705
+ # submit to model hub or save the model to share with others
706
+
707
+ Note, that once this was run, the ``model`` will no longer be usable in the deepspeed context
708
+ of the same application. i.e. you will need to re-initialize the deepspeed engine, since
709
+ ``model.load_state_dict(state_dict)`` will remove all the deepspeed magic from it.
710
+
711
+ """
712
+ logger.info(f"Extracting fp32 weights")
713
+ state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir, tag)
714
+
715
+ logger.info(f"Overwriting model with fp32 weights")
716
+ model = model.cpu()
717
+ model.load_state_dict(state_dict, strict=False)
718
+
719
+ return model
720
+
721
+
722
+ if __name__ == "__main__":
723
+ parser = argparse.ArgumentParser()
724
+ parser.add_argument("checkpoint_dir",
725
+ type=str,
726
+ help="path to the desired checkpoint folder, e.g., path/checkpoint-12")
727
+ parser.add_argument("output_dir",
728
+ type=str,
729
+ help="directory to the pytorch fp32 state_dict output files"
730
+ "(e.g. path/checkpoint-12-output/)")
731
+ parser.add_argument(
732
+ "--max_shard_size",
733
+ type=str,
734
+ default="5GB",
735
+ help="The maximum size for a checkpoint before being sharded. Checkpoints shard will then be each of size"
736
+ "lower than this size. If expressed as a string, needs to be digits followed by a unit (like `5MB`"
737
+ "We default it to 5GB in order for models to be able to run easily on free-tier google colab instances"
738
+ "without CPU OOM issues.")
739
+ parser.add_argument(
740
+ "--safe_serialization",
741
+ default=False,
742
+ action='store_true',
743
+ help="Whether to save the model using `safetensors` or the traditional PyTorch way (that uses `pickle`).")
744
+ parser.add_argument("-t",
745
+ "--tag",
746
+ type=str,
747
+ default=None,
748
+ help="checkpoint tag used as a unique identifier for checkpoint. e.g., global_step1")
749
+ parser.add_argument("--exclude_frozen_parameters", action='store_true', help="exclude frozen parameters")
750
+ parser.add_argument("-d", "--debug", action='store_true', help="enable debug")
751
+ args = parser.parse_args()
752
+
753
+ debug = args.debug
754
+
755
+ convert_zero_checkpoint_to_fp32_state_dict(args.checkpoint_dir,
756
+ args.output_dir,
757
+ max_shard_size=args.max_shard_size,
758
+ safe_serialization=args.safe_serialization,
759
+ tag=args.tag,
760
+ exclude_frozen_parameters=args.exclude_frozen_parameters)