aaron1141 commited on
Commit
5cf49e2
·
verified ·
1 Parent(s): 5606932

Add files using upload-large-folder tool

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .gitattributes +6 -0
  2. README.md +61 -0
  3. all_results.json +8 -0
  4. chat_template.jinja +154 -0
  5. checkpoint-1876/chat_template.jinja +154 -0
  6. checkpoint-1876/config.json +113 -0
  7. checkpoint-1876/generation_config.json +10 -0
  8. checkpoint-1876/global_step1876/bf16_zero_pp_rank_0_mp_rank_00_optim_states.pt +3 -0
  9. checkpoint-1876/global_step1876/bf16_zero_pp_rank_1_mp_rank_00_optim_states.pt +3 -0
  10. checkpoint-1876/global_step1876/bf16_zero_pp_rank_2_mp_rank_00_optim_states.pt +3 -0
  11. checkpoint-1876/global_step1876/bf16_zero_pp_rank_3_mp_rank_00_optim_states.pt +3 -0
  12. checkpoint-1876/global_step1876/bf16_zero_pp_rank_4_mp_rank_00_optim_states.pt +3 -0
  13. checkpoint-1876/global_step1876/bf16_zero_pp_rank_5_mp_rank_00_optim_states.pt +3 -0
  14. checkpoint-1876/global_step1876/bf16_zero_pp_rank_6_mp_rank_00_optim_states.pt +3 -0
  15. checkpoint-1876/global_step1876/bf16_zero_pp_rank_7_mp_rank_00_optim_states.pt +3 -0
  16. checkpoint-1876/global_step1876/zero_pp_rank_0_mp_rank_00_model_states.pt +3 -0
  17. checkpoint-1876/global_step1876/zero_pp_rank_1_mp_rank_00_model_states.pt +3 -0
  18. checkpoint-1876/global_step1876/zero_pp_rank_2_mp_rank_00_model_states.pt +3 -0
  19. checkpoint-1876/global_step1876/zero_pp_rank_3_mp_rank_00_model_states.pt +3 -0
  20. checkpoint-1876/global_step1876/zero_pp_rank_4_mp_rank_00_model_states.pt +3 -0
  21. checkpoint-1876/global_step1876/zero_pp_rank_5_mp_rank_00_model_states.pt +3 -0
  22. checkpoint-1876/global_step1876/zero_pp_rank_6_mp_rank_00_model_states.pt +3 -0
  23. checkpoint-1876/global_step1876/zero_pp_rank_7_mp_rank_00_model_states.pt +3 -0
  24. checkpoint-1876/latest +1 -0
  25. checkpoint-1876/model.safetensors +3 -0
  26. checkpoint-1876/processor_config.json +60 -0
  27. checkpoint-1876/rng_state_0.pth +3 -0
  28. checkpoint-1876/rng_state_1.pth +3 -0
  29. checkpoint-1876/rng_state_2.pth +3 -0
  30. checkpoint-1876/rng_state_3.pth +3 -0
  31. checkpoint-1876/rng_state_4.pth +3 -0
  32. checkpoint-1876/rng_state_5.pth +3 -0
  33. checkpoint-1876/rng_state_6.pth +3 -0
  34. checkpoint-1876/rng_state_7.pth +3 -0
  35. checkpoint-1876/scheduler.pt +3 -0
  36. checkpoint-1876/tokenizer.json +3 -0
  37. checkpoint-1876/tokenizer_config.json +34 -0
  38. checkpoint-1876/trainer_state.json +1343 -0
  39. checkpoint-1876/training_args.bin +3 -0
  40. checkpoint-1876/zero_to_fp32.py +760 -0
  41. checkpoint-2814/chat_template.jinja +154 -0
  42. checkpoint-2814/config.json +113 -0
  43. checkpoint-2814/generation_config.json +10 -0
  44. checkpoint-2814/global_step2814/bf16_zero_pp_rank_0_mp_rank_00_optim_states.pt +3 -0
  45. checkpoint-2814/global_step2814/bf16_zero_pp_rank_1_mp_rank_00_optim_states.pt +3 -0
  46. checkpoint-2814/global_step2814/bf16_zero_pp_rank_2_mp_rank_00_optim_states.pt +3 -0
  47. checkpoint-2814/global_step2814/bf16_zero_pp_rank_3_mp_rank_00_optim_states.pt +3 -0
  48. checkpoint-2814/global_step2814/bf16_zero_pp_rank_4_mp_rank_00_optim_states.pt +3 -0
  49. checkpoint-2814/global_step2814/bf16_zero_pp_rank_5_mp_rank_00_optim_states.pt +3 -0
  50. checkpoint-2814/global_step2814/bf16_zero_pp_rank_6_mp_rank_00_optim_states.pt +3 -0
.gitattributes CHANGED
@@ -33,3 +33,9 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ checkpoint-1876/tokenizer.json filter=lfs diff=lfs merge=lfs -text
37
+ tokenizer.json filter=lfs diff=lfs merge=lfs -text
38
+ checkpoint-3752/tokenizer.json filter=lfs diff=lfs merge=lfs -text
39
+ checkpoint-938/tokenizer.json filter=lfs diff=lfs merge=lfs -text
40
+ checkpoint-2814/tokenizer.json filter=lfs diff=lfs merge=lfs -text
41
+ checkpoint-4690/tokenizer.json filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ library_name: transformers
3
+ license: other
4
+ base_model: Qwen/Qwen3.5-9B-Base
5
+ tags:
6
+ - llama-factory
7
+ - full
8
+ - generated_from_trainer
9
+ model-index:
10
+ - name: omniscience_vqa_5epoch_full
11
+ results: []
12
+ ---
13
+
14
+ <!-- This model card has been generated automatically according to the information the Trainer had access to. You
15
+ should probably proofread and complete it, then remove this comment. -->
16
+
17
+ # omniscience_vqa_5epoch_full
18
+
19
+ This model is a fine-tuned version of [/jizhicfs/wongzhenhao/models/Qwen3.5-9B-base](https://huggingface.co//jizhicfs/wongzhenhao/models/Qwen3.5-9B-base) on the omniscience_vqa dataset.
20
+
21
+ ## Model description
22
+
23
+ More information needed
24
+
25
+ ## Intended uses & limitations
26
+
27
+ More information needed
28
+
29
+ ## Training and evaluation data
30
+
31
+ More information needed
32
+
33
+ ## Training procedure
34
+
35
+ ### Training hyperparameters
36
+
37
+ The following hyperparameters were used during training:
38
+ - learning_rate: 1e-05
39
+ - train_batch_size: 1
40
+ - eval_batch_size: 8
41
+ - seed: 42
42
+ - distributed_type: multi-GPU
43
+ - num_devices: 8
44
+ - gradient_accumulation_steps: 8
45
+ - total_train_batch_size: 64
46
+ - total_eval_batch_size: 64
47
+ - optimizer: Use OptimizerNames.ADAMW_TORCH_FUSED with betas=(0.9,0.999) and epsilon=1e-08 and optimizer_args=No additional optimizer arguments
48
+ - lr_scheduler_type: cosine
49
+ - lr_scheduler_warmup_steps: 0.03
50
+ - num_epochs: 5
51
+
52
+ ### Training results
53
+
54
+
55
+
56
+ ### Framework versions
57
+
58
+ - Transformers 5.6.0
59
+ - Pytorch 2.8.0+cu128
60
+ - Datasets 4.0.0
61
+ - Tokenizers 0.22.2
all_results.json ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "epoch": 5.0,
3
+ "total_flos": 1.2342291469267108e+18,
4
+ "train_loss": 0.17693393766117502,
5
+ "train_runtime": 154131.4034,
6
+ "train_samples_per_second": 1.946,
7
+ "train_steps_per_second": 0.03
8
+ }
chat_template.jinja ADDED
@@ -0,0 +1,154 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {%- set image_count = namespace(value=0) %}
2
+ {%- set video_count = namespace(value=0) %}
3
+ {%- macro render_content(content, do_vision_count, is_system_content=false) %}
4
+ {%- if content is string %}
5
+ {{- content }}
6
+ {%- elif content is iterable and content is not mapping %}
7
+ {%- for item in content %}
8
+ {%- if 'image' in item or 'image_url' in item or item.type == 'image' %}
9
+ {%- if is_system_content %}
10
+ {{- raise_exception('System message cannot contain images.') }}
11
+ {%- endif %}
12
+ {%- if do_vision_count %}
13
+ {%- set image_count.value = image_count.value + 1 %}
14
+ {%- endif %}
15
+ {%- if add_vision_id %}
16
+ {{- 'Picture ' ~ image_count.value ~ ': ' }}
17
+ {%- endif %}
18
+ {{- '<|vision_start|><|image_pad|><|vision_end|>' }}
19
+ {%- elif 'video' in item or item.type == 'video' %}
20
+ {%- if is_system_content %}
21
+ {{- raise_exception('System message cannot contain videos.') }}
22
+ {%- endif %}
23
+ {%- if do_vision_count %}
24
+ {%- set video_count.value = video_count.value + 1 %}
25
+ {%- endif %}
26
+ {%- if add_vision_id %}
27
+ {{- 'Video ' ~ video_count.value ~ ': ' }}
28
+ {%- endif %}
29
+ {{- '<|vision_start|><|video_pad|><|vision_end|>' }}
30
+ {%- elif 'text' in item %}
31
+ {{- item.text }}
32
+ {%- else %}
33
+ {{- raise_exception('Unexpected item type in content.') }}
34
+ {%- endif %}
35
+ {%- endfor %}
36
+ {%- elif content is none or content is undefined %}
37
+ {{- '' }}
38
+ {%- else %}
39
+ {{- raise_exception('Unexpected content type.') }}
40
+ {%- endif %}
41
+ {%- endmacro %}
42
+ {%- if not messages %}
43
+ {{- raise_exception('No messages provided.') }}
44
+ {%- endif %}
45
+ {%- if tools and tools is iterable and tools is not mapping %}
46
+ {{- '<|im_start|>system\n' }}
47
+ {{- "# Tools\n\nYou have access to the following functions:\n\n<tools>" }}
48
+ {%- for tool in tools %}
49
+ {{- "\n" }}
50
+ {{- tool | tojson }}
51
+ {%- endfor %}
52
+ {{- "\n</tools>" }}
53
+ {{- '\n\nIf you choose to call a function ONLY reply in the following format with NO suffix:\n\n<tool_call>\n<function=example_function_name>\n<parameter=example_parameter_1>\nvalue_1\n</parameter>\n<parameter=example_parameter_2>\nThis is the value for the second parameter\nthat can span\nmultiple lines\n</parameter>\n</function>\n</tool_call>\n\n<IMPORTANT>\nReminder:\n- Function calls MUST follow the specified format: an inner <function=...></function> block must be nested within <tool_call></tool_call> XML tags\n- Required parameters MUST be specified\n- You may provide optional reasoning for your function call in natural language BEFORE the function call, but NOT after\n- If there is no function call available, answer the question like normal with your current knowledge and do not tell the user about function calls\n</IMPORTANT>' }}
54
+ {%- if messages[0].role == 'system' %}
55
+ {%- set content = render_content(messages[0].content, false, true)|trim %}
56
+ {%- if content %}
57
+ {{- '\n\n' + content }}
58
+ {%- endif %}
59
+ {%- endif %}
60
+ {{- '<|im_end|>\n' }}
61
+ {%- else %}
62
+ {%- if messages[0].role == 'system' %}
63
+ {%- set content = render_content(messages[0].content, false, true)|trim %}
64
+ {{- '<|im_start|>system\n' + content + '<|im_end|>\n' }}
65
+ {%- endif %}
66
+ {%- endif %}
67
+ {%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}
68
+ {%- for message in messages[::-1] %}
69
+ {%- set index = (messages|length - 1) - loop.index0 %}
70
+ {%- if ns.multi_step_tool and message.role == "user" %}
71
+ {%- set content = render_content(message.content, false)|trim %}
72
+ {%- if not(content.startswith('<tool_response>') and content.endswith('</tool_response>')) %}
73
+ {%- set ns.multi_step_tool = false %}
74
+ {%- set ns.last_query_index = index %}
75
+ {%- endif %}
76
+ {%- endif %}
77
+ {%- endfor %}
78
+ {%- if ns.multi_step_tool %}
79
+ {{- raise_exception('No user query found in messages.') }}
80
+ {%- endif %}
81
+ {%- for message in messages %}
82
+ {%- set content = render_content(message.content, true)|trim %}
83
+ {%- if message.role == "system" %}
84
+ {%- if not loop.first %}
85
+ {{- raise_exception('System message must be at the beginning.') }}
86
+ {%- endif %}
87
+ {%- elif message.role == "user" %}
88
+ {{- '<|im_start|>' + message.role + '\n' + content + '<|im_end|>' + '\n' }}
89
+ {%- elif message.role == "assistant" %}
90
+ {%- set reasoning_content = '' %}
91
+ {%- if message.reasoning_content is string %}
92
+ {%- set reasoning_content = message.reasoning_content %}
93
+ {%- else %}
94
+ {%- if '</think>' in content %}
95
+ {%- set reasoning_content = content.split('</think>')[0].rstrip('\n').split('<think>')[-1].lstrip('\n') %}
96
+ {%- set content = content.split('</think>')[-1].lstrip('\n') %}
97
+ {%- endif %}
98
+ {%- endif %}
99
+ {%- set reasoning_content = reasoning_content|trim %}
100
+ {%- if loop.index0 > ns.last_query_index %}
101
+ {{- '<|im_start|>' + message.role + '\n<think>\n' + reasoning_content + '\n</think>\n\n' + content }}
102
+ {%- else %}
103
+ {{- '<|im_start|>' + message.role + '\n' + content }}
104
+ {%- endif %}
105
+ {%- if message.tool_calls and message.tool_calls is iterable and message.tool_calls is not mapping %}
106
+ {%- for tool_call in message.tool_calls %}
107
+ {%- if tool_call.function is defined %}
108
+ {%- set tool_call = tool_call.function %}
109
+ {%- endif %}
110
+ {%- if loop.first %}
111
+ {%- if content|trim %}
112
+ {{- '\n\n<tool_call>\n<function=' + tool_call.name + '>\n' }}
113
+ {%- else %}
114
+ {{- '<tool_call>\n<function=' + tool_call.name + '>\n' }}
115
+ {%- endif %}
116
+ {%- else %}
117
+ {{- '\n<tool_call>\n<function=' + tool_call.name + '>\n' }}
118
+ {%- endif %}
119
+ {%- if tool_call.arguments is defined %}
120
+ {%- for args_name, args_value in tool_call.arguments|items %}
121
+ {{- '<parameter=' + args_name + '>\n' }}
122
+ {%- set args_value = args_value | tojson | safe if args_value is mapping or (args_value is sequence and args_value is not string) else args_value | string %}
123
+ {{- args_value }}
124
+ {{- '\n</parameter>\n' }}
125
+ {%- endfor %}
126
+ {%- endif %}
127
+ {{- '</function>\n</tool_call>' }}
128
+ {%- endfor %}
129
+ {%- endif %}
130
+ {{- '<|im_end|>\n' }}
131
+ {%- elif message.role == "tool" %}
132
+ {%- if loop.previtem and loop.previtem.role != "tool" %}
133
+ {{- '<|im_start|>user' }}
134
+ {%- endif %}
135
+ {{- '\n<tool_response>\n' }}
136
+ {{- content }}
137
+ {{- '\n</tool_response>' }}
138
+ {%- if not loop.last and loop.nextitem.role != "tool" %}
139
+ {{- '<|im_end|>\n' }}
140
+ {%- elif loop.last %}
141
+ {{- '<|im_end|>\n' }}
142
+ {%- endif %}
143
+ {%- else %}
144
+ {{- raise_exception('Unexpected message role.') }}
145
+ {%- endif %}
146
+ {%- endfor %}
147
+ {%- if add_generation_prompt %}
148
+ {{- '<|im_start|>assistant\n' }}
149
+ {%- if enable_thinking is defined and enable_thinking is false %}
150
+ {{- '<think>\n\n</think>\n\n' }}
151
+ {%- else %}
152
+ {{- '<think>\n' }}
153
+ {%- endif %}
154
+ {%- endif %}
checkpoint-1876/chat_template.jinja ADDED
@@ -0,0 +1,154 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {%- set image_count = namespace(value=0) %}
2
+ {%- set video_count = namespace(value=0) %}
3
+ {%- macro render_content(content, do_vision_count, is_system_content=false) %}
4
+ {%- if content is string %}
5
+ {{- content }}
6
+ {%- elif content is iterable and content is not mapping %}
7
+ {%- for item in content %}
8
+ {%- if 'image' in item or 'image_url' in item or item.type == 'image' %}
9
+ {%- if is_system_content %}
10
+ {{- raise_exception('System message cannot contain images.') }}
11
+ {%- endif %}
12
+ {%- if do_vision_count %}
13
+ {%- set image_count.value = image_count.value + 1 %}
14
+ {%- endif %}
15
+ {%- if add_vision_id %}
16
+ {{- 'Picture ' ~ image_count.value ~ ': ' }}
17
+ {%- endif %}
18
+ {{- '<|vision_start|><|image_pad|><|vision_end|>' }}
19
+ {%- elif 'video' in item or item.type == 'video' %}
20
+ {%- if is_system_content %}
21
+ {{- raise_exception('System message cannot contain videos.') }}
22
+ {%- endif %}
23
+ {%- if do_vision_count %}
24
+ {%- set video_count.value = video_count.value + 1 %}
25
+ {%- endif %}
26
+ {%- if add_vision_id %}
27
+ {{- 'Video ' ~ video_count.value ~ ': ' }}
28
+ {%- endif %}
29
+ {{- '<|vision_start|><|video_pad|><|vision_end|>' }}
30
+ {%- elif 'text' in item %}
31
+ {{- item.text }}
32
+ {%- else %}
33
+ {{- raise_exception('Unexpected item type in content.') }}
34
+ {%- endif %}
35
+ {%- endfor %}
36
+ {%- elif content is none or content is undefined %}
37
+ {{- '' }}
38
+ {%- else %}
39
+ {{- raise_exception('Unexpected content type.') }}
40
+ {%- endif %}
41
+ {%- endmacro %}
42
+ {%- if not messages %}
43
+ {{- raise_exception('No messages provided.') }}
44
+ {%- endif %}
45
+ {%- if tools and tools is iterable and tools is not mapping %}
46
+ {{- '<|im_start|>system\n' }}
47
+ {{- "# Tools\n\nYou have access to the following functions:\n\n<tools>" }}
48
+ {%- for tool in tools %}
49
+ {{- "\n" }}
50
+ {{- tool | tojson }}
51
+ {%- endfor %}
52
+ {{- "\n</tools>" }}
53
+ {{- '\n\nIf you choose to call a function ONLY reply in the following format with NO suffix:\n\n<tool_call>\n<function=example_function_name>\n<parameter=example_parameter_1>\nvalue_1\n</parameter>\n<parameter=example_parameter_2>\nThis is the value for the second parameter\nthat can span\nmultiple lines\n</parameter>\n</function>\n</tool_call>\n\n<IMPORTANT>\nReminder:\n- Function calls MUST follow the specified format: an inner <function=...></function> block must be nested within <tool_call></tool_call> XML tags\n- Required parameters MUST be specified\n- You may provide optional reasoning for your function call in natural language BEFORE the function call, but NOT after\n- If there is no function call available, answer the question like normal with your current knowledge and do not tell the user about function calls\n</IMPORTANT>' }}
54
+ {%- if messages[0].role == 'system' %}
55
+ {%- set content = render_content(messages[0].content, false, true)|trim %}
56
+ {%- if content %}
57
+ {{- '\n\n' + content }}
58
+ {%- endif %}
59
+ {%- endif %}
60
+ {{- '<|im_end|>\n' }}
61
+ {%- else %}
62
+ {%- if messages[0].role == 'system' %}
63
+ {%- set content = render_content(messages[0].content, false, true)|trim %}
64
+ {{- '<|im_start|>system\n' + content + '<|im_end|>\n' }}
65
+ {%- endif %}
66
+ {%- endif %}
67
+ {%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}
68
+ {%- for message in messages[::-1] %}
69
+ {%- set index = (messages|length - 1) - loop.index0 %}
70
+ {%- if ns.multi_step_tool and message.role == "user" %}
71
+ {%- set content = render_content(message.content, false)|trim %}
72
+ {%- if not(content.startswith('<tool_response>') and content.endswith('</tool_response>')) %}
73
+ {%- set ns.multi_step_tool = false %}
74
+ {%- set ns.last_query_index = index %}
75
+ {%- endif %}
76
+ {%- endif %}
77
+ {%- endfor %}
78
+ {%- if ns.multi_step_tool %}
79
+ {{- raise_exception('No user query found in messages.') }}
80
+ {%- endif %}
81
+ {%- for message in messages %}
82
+ {%- set content = render_content(message.content, true)|trim %}
83
+ {%- if message.role == "system" %}
84
+ {%- if not loop.first %}
85
+ {{- raise_exception('System message must be at the beginning.') }}
86
+ {%- endif %}
87
+ {%- elif message.role == "user" %}
88
+ {{- '<|im_start|>' + message.role + '\n' + content + '<|im_end|>' + '\n' }}
89
+ {%- elif message.role == "assistant" %}
90
+ {%- set reasoning_content = '' %}
91
+ {%- if message.reasoning_content is string %}
92
+ {%- set reasoning_content = message.reasoning_content %}
93
+ {%- else %}
94
+ {%- if '</think>' in content %}
95
+ {%- set reasoning_content = content.split('</think>')[0].rstrip('\n').split('<think>')[-1].lstrip('\n') %}
96
+ {%- set content = content.split('</think>')[-1].lstrip('\n') %}
97
+ {%- endif %}
98
+ {%- endif %}
99
+ {%- set reasoning_content = reasoning_content|trim %}
100
+ {%- if loop.index0 > ns.last_query_index %}
101
+ {{- '<|im_start|>' + message.role + '\n<think>\n' + reasoning_content + '\n</think>\n\n' + content }}
102
+ {%- else %}
103
+ {{- '<|im_start|>' + message.role + '\n' + content }}
104
+ {%- endif %}
105
+ {%- if message.tool_calls and message.tool_calls is iterable and message.tool_calls is not mapping %}
106
+ {%- for tool_call in message.tool_calls %}
107
+ {%- if tool_call.function is defined %}
108
+ {%- set tool_call = tool_call.function %}
109
+ {%- endif %}
110
+ {%- if loop.first %}
111
+ {%- if content|trim %}
112
+ {{- '\n\n<tool_call>\n<function=' + tool_call.name + '>\n' }}
113
+ {%- else %}
114
+ {{- '<tool_call>\n<function=' + tool_call.name + '>\n' }}
115
+ {%- endif %}
116
+ {%- else %}
117
+ {{- '\n<tool_call>\n<function=' + tool_call.name + '>\n' }}
118
+ {%- endif %}
119
+ {%- if tool_call.arguments is defined %}
120
+ {%- for args_name, args_value in tool_call.arguments|items %}
121
+ {{- '<parameter=' + args_name + '>\n' }}
122
+ {%- set args_value = args_value | tojson | safe if args_value is mapping or (args_value is sequence and args_value is not string) else args_value | string %}
123
+ {{- args_value }}
124
+ {{- '\n</parameter>\n' }}
125
+ {%- endfor %}
126
+ {%- endif %}
127
+ {{- '</function>\n</tool_call>' }}
128
+ {%- endfor %}
129
+ {%- endif %}
130
+ {{- '<|im_end|>\n' }}
131
+ {%- elif message.role == "tool" %}
132
+ {%- if loop.previtem and loop.previtem.role != "tool" %}
133
+ {{- '<|im_start|>user' }}
134
+ {%- endif %}
135
+ {{- '\n<tool_response>\n' }}
136
+ {{- content }}
137
+ {{- '\n</tool_response>' }}
138
+ {%- if not loop.last and loop.nextitem.role != "tool" %}
139
+ {{- '<|im_end|>\n' }}
140
+ {%- elif loop.last %}
141
+ {{- '<|im_end|>\n' }}
142
+ {%- endif %}
143
+ {%- else %}
144
+ {{- raise_exception('Unexpected message role.') }}
145
+ {%- endif %}
146
+ {%- endfor %}
147
+ {%- if add_generation_prompt %}
148
+ {{- '<|im_start|>assistant\n' }}
149
+ {%- if enable_thinking is defined and enable_thinking is false %}
150
+ {{- '<think>\n\n</think>\n\n' }}
151
+ {%- else %}
152
+ {{- '<think>\n' }}
153
+ {%- endif %}
154
+ {%- endif %}
checkpoint-1876/config.json ADDED
@@ -0,0 +1,113 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "Qwen3_5ForConditionalGeneration"
4
+ ],
5
+ "dtype": "bfloat16",
6
+ "eos_token_id": 248046,
7
+ "hidden_size": 4096,
8
+ "image_token_id": 248056,
9
+ "model_type": "qwen3_5",
10
+ "pad_token_id": 248044,
11
+ "text_config": {
12
+ "attention_bias": false,
13
+ "attention_dropout": 0.0,
14
+ "attn_output_gate": true,
15
+ "bos_token_id": null,
16
+ "dtype": "bfloat16",
17
+ "eos_token_id": 248044,
18
+ "full_attention_interval": 4,
19
+ "head_dim": 256,
20
+ "hidden_act": "silu",
21
+ "hidden_size": 4096,
22
+ "initializer_range": 0.02,
23
+ "intermediate_size": 12288,
24
+ "layer_types": [
25
+ "linear_attention",
26
+ "linear_attention",
27
+ "linear_attention",
28
+ "full_attention",
29
+ "linear_attention",
30
+ "linear_attention",
31
+ "linear_attention",
32
+ "full_attention",
33
+ "linear_attention",
34
+ "linear_attention",
35
+ "linear_attention",
36
+ "full_attention",
37
+ "linear_attention",
38
+ "linear_attention",
39
+ "linear_attention",
40
+ "full_attention",
41
+ "linear_attention",
42
+ "linear_attention",
43
+ "linear_attention",
44
+ "full_attention",
45
+ "linear_attention",
46
+ "linear_attention",
47
+ "linear_attention",
48
+ "full_attention",
49
+ "linear_attention",
50
+ "linear_attention",
51
+ "linear_attention",
52
+ "full_attention",
53
+ "linear_attention",
54
+ "linear_attention",
55
+ "linear_attention",
56
+ "full_attention"
57
+ ],
58
+ "linear_conv_kernel_dim": 4,
59
+ "linear_key_head_dim": 128,
60
+ "linear_num_key_heads": 16,
61
+ "linear_num_value_heads": 32,
62
+ "linear_value_head_dim": 128,
63
+ "mamba_ssm_dtype": "float32",
64
+ "max_position_embeddings": 262144,
65
+ "mlp_only_layers": [],
66
+ "model_type": "qwen3_5_text",
67
+ "mtp_num_hidden_layers": 1,
68
+ "mtp_use_dedicated_embeddings": false,
69
+ "num_attention_heads": 16,
70
+ "num_hidden_layers": 32,
71
+ "num_key_value_heads": 4,
72
+ "pad_token_id": null,
73
+ "partial_rotary_factor": 0.25,
74
+ "rms_norm_eps": 1e-06,
75
+ "rope_parameters": {
76
+ "mrope_interleaved": true,
77
+ "mrope_section": [
78
+ 11,
79
+ 11,
80
+ 10
81
+ ],
82
+ "partial_rotary_factor": 0.25,
83
+ "rope_theta": 10000000,
84
+ "rope_type": "default"
85
+ },
86
+ "tie_word_embeddings": false,
87
+ "use_cache": false,
88
+ "vocab_size": 248320
89
+ },
90
+ "tie_word_embeddings": false,
91
+ "transformers_version": "5.6.0",
92
+ "use_cache": false,
93
+ "video_token_id": 248057,
94
+ "vision_config": {
95
+ "deepstack_visual_indexes": [],
96
+ "depth": 27,
97
+ "dtype": "bfloat16",
98
+ "hidden_act": "gelu_pytorch_tanh",
99
+ "hidden_size": 1152,
100
+ "in_channels": 3,
101
+ "initializer_range": 0.02,
102
+ "intermediate_size": 4304,
103
+ "model_type": "qwen3_5_vision",
104
+ "num_heads": 16,
105
+ "num_position_embeddings": 2304,
106
+ "out_hidden_size": 4096,
107
+ "patch_size": 16,
108
+ "spatial_merge_size": 2,
109
+ "temporal_patch_size": 2
110
+ },
111
+ "vision_end_token_id": 248054,
112
+ "vision_start_token_id": 248053
113
+ }
checkpoint-1876/generation_config.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "eos_token_id": [
4
+ 248046,
5
+ 248044
6
+ ],
7
+ "pad_token_id": 248044,
8
+ "transformers_version": "5.6.0",
9
+ "use_cache": true
10
+ }
checkpoint-1876/global_step1876/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:bf82b1a19ccba35f81e8e4b185af29d96062602142701d1f6a58655ec37f66b0
3
+ size 13430710881
checkpoint-1876/global_step1876/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:859b6d2114bedd7b24d6f358394c46432690ce5062ebc37252e35c3971d45336
3
+ size 13430710881
checkpoint-1876/global_step1876/bf16_zero_pp_rank_2_mp_rank_00_optim_states.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:282e102cd8975f730d3586fda0567cc6e8f5fe082af8e6965cb913f0aeac067f
3
+ size 13430710881
checkpoint-1876/global_step1876/bf16_zero_pp_rank_3_mp_rank_00_optim_states.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3a58e790c156a3693fba2dac4ef74d8c6aa2c4647eab22086e62a7ba10395e80
3
+ size 13430710881
checkpoint-1876/global_step1876/bf16_zero_pp_rank_4_mp_rank_00_optim_states.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:674c6e8db3ee3b2b9900936f1994fcf2a7fce53015021061b47b31349f4d94ae
3
+ size 13430710881
checkpoint-1876/global_step1876/bf16_zero_pp_rank_5_mp_rank_00_optim_states.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e00b29cafafcdd5d63ee1b31e9b1634a44ebf6abdd5d749ea4bc1cfeeda0d280
3
+ size 13430710881
checkpoint-1876/global_step1876/bf16_zero_pp_rank_6_mp_rank_00_optim_states.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:76bac6ebff4f2a5d30b7b09c386db322c7e79642ad05c3f54188dc3917dfd1da
3
+ size 13430710881
checkpoint-1876/global_step1876/bf16_zero_pp_rank_7_mp_rank_00_optim_states.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f04f9806a0f91f048655c461d8ccc57e97c0a625faa734e1bcfe8a07f1c79876
3
+ size 13430710881
checkpoint-1876/global_step1876/zero_pp_rank_0_mp_rank_00_model_states.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0d63a80ace95e5005f5b156c78e316b02d3989f29a108b7a1b95f9194ea53cde
3
+ size 114502951
checkpoint-1876/global_step1876/zero_pp_rank_1_mp_rank_00_model_states.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7bcd78952c577e661cc8fd8f4a6468f0d0c08bffaaebb1cf7ed8b93c9a662300
3
+ size 114502951
checkpoint-1876/global_step1876/zero_pp_rank_2_mp_rank_00_model_states.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:893d997e54e25165ae787b6e4a2ffcf4cf150c478f77aca79ac0a1766d4a5fa2
3
+ size 114502951
checkpoint-1876/global_step1876/zero_pp_rank_3_mp_rank_00_model_states.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fba79de4f7e65c1d0163a10753b916724ff2e30b646ec2d2ec4c96cd58f4ef82
3
+ size 114502951
checkpoint-1876/global_step1876/zero_pp_rank_4_mp_rank_00_model_states.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3be3f825fdd4eb2c1f74c08705f157cdf6b843889882e8d01d87ddc148ecbae8
3
+ size 114502951
checkpoint-1876/global_step1876/zero_pp_rank_5_mp_rank_00_model_states.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a0d91b67f4f5b909e1050aa7ec5ce71d4b9cf8004b53a9c7c62f649d073b6c6d
3
+ size 114502951
checkpoint-1876/global_step1876/zero_pp_rank_6_mp_rank_00_model_states.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f064dac5a20fdfd0ddeff2edc31fbaef5305e3a192f0630a00f241513143f205
3
+ size 114502951
checkpoint-1876/global_step1876/zero_pp_rank_7_mp_rank_00_model_states.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8634541095796bb8b4accb4395a454df7df547bab8136b6801a1efdf9f908996
3
+ size 114502951
checkpoint-1876/latest ADDED
@@ -0,0 +1 @@
 
 
1
+ global_step1876
checkpoint-1876/model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:38b9ffdc6f38e9d6411ec7e8e8463a9768b88b15207291b5fb8655b7f27adeb6
3
+ size 18819722392
checkpoint-1876/processor_config.json ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "image_processor": {
3
+ "do_convert_rgb": true,
4
+ "do_normalize": true,
5
+ "do_rescale": true,
6
+ "do_resize": true,
7
+ "image_mean": [
8
+ 0.5,
9
+ 0.5,
10
+ 0.5
11
+ ],
12
+ "image_processor_type": "Qwen2VLImageProcessor",
13
+ "image_std": [
14
+ 0.5,
15
+ 0.5,
16
+ 0.5
17
+ ],
18
+ "merge_size": 2,
19
+ "patch_size": 16,
20
+ "resample": 3,
21
+ "rescale_factor": 0.00392156862745098,
22
+ "size": {
23
+ "longest_edge": 16777216,
24
+ "shortest_edge": 65536
25
+ },
26
+ "temporal_patch_size": 2
27
+ },
28
+ "processor_class": "Qwen3VLProcessor",
29
+ "video_processor": {
30
+ "do_convert_rgb": true,
31
+ "do_normalize": true,
32
+ "do_rescale": true,
33
+ "do_resize": true,
34
+ "do_sample_frames": true,
35
+ "fps": 2,
36
+ "image_mean": [
37
+ 0.5,
38
+ 0.5,
39
+ 0.5
40
+ ],
41
+ "image_std": [
42
+ 0.5,
43
+ 0.5,
44
+ 0.5
45
+ ],
46
+ "max_frames": 768,
47
+ "merge_size": 2,
48
+ "min_frames": 4,
49
+ "patch_size": 16,
50
+ "resample": 3,
51
+ "rescale_factor": 0.00392156862745098,
52
+ "return_metadata": false,
53
+ "size": {
54
+ "longest_edge": 234881024,
55
+ "shortest_edge": 4096
56
+ },
57
+ "temporal_patch_size": 2,
58
+ "video_processor_type": "Qwen3VLVideoProcessor"
59
+ }
60
+ }
checkpoint-1876/rng_state_0.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8bfe1981024ef92f2da08a90c72c7c793d1cc9de1547abd2556c968be70232eb
3
+ size 16389
checkpoint-1876/rng_state_1.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a35b845d476d830805793c3dcf8ac2daad87fec289bff3f7eda9e72fc374eda1
3
+ size 16389
checkpoint-1876/rng_state_2.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:03e9880996b01262a807d1ec3ebd91eee540e08130a14a45a4648731fd0d48a9
3
+ size 16389
checkpoint-1876/rng_state_3.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ee25c237d6fe62ec76adcf7daf899d7ed32eab5d1a5b447b911f4451c9a1b258
3
+ size 16389
checkpoint-1876/rng_state_4.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7a6b31133f29a8fc0cb538aa807d6a403bd51939336bfd425cd3d122d8c5595c
3
+ size 16389
checkpoint-1876/rng_state_5.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a26c55b5c7fa0522b1d27b2c00a7ea77ad010f19a1321991165c5c972b8fa97a
3
+ size 16389
checkpoint-1876/rng_state_6.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4a1a3cf85626196804f25a8293e22dc561bba068a70fb123e04afe4896c33972
3
+ size 16389
checkpoint-1876/rng_state_7.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:28f87c1ee5f5db346c7b913137cbccd196eaf8ec5a4cf9f192418a3069269b49
3
+ size 16389
checkpoint-1876/scheduler.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:dced6746ac599c81802139f61ed3e1504bc60c84f0fbf29558268f32b322bbbf
3
+ size 1465
checkpoint-1876/tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:06b9509352d2af50381ab2247e083b80d32d5c0aba91c272ca9ff729b6a0e523
3
+ size 19989325
checkpoint-1876/tokenizer_config.json ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": false,
3
+ "audio_bos_token": "<|audio_start|>",
4
+ "audio_eos_token": "<|audio_end|>",
5
+ "audio_token": "<|audio_pad|>",
6
+ "backend": "tokenizers",
7
+ "bos_token": null,
8
+ "clean_up_tokenization_spaces": false,
9
+ "eos_token": "<|im_end|>",
10
+ "errors": "replace",
11
+ "image_token": "<|image_pad|>",
12
+ "is_local": true,
13
+ "local_files_only": false,
14
+ "model_max_length": 262144,
15
+ "model_specific_special_tokens": {
16
+ "audio_bos_token": "<|audio_start|>",
17
+ "audio_eos_token": "<|audio_end|>",
18
+ "audio_token": "<|audio_pad|>",
19
+ "image_token": "<|image_pad|>",
20
+ "video_token": "<|video_pad|>",
21
+ "vision_bos_token": "<|vision_start|>",
22
+ "vision_eos_token": "<|vision_end|>"
23
+ },
24
+ "pad_token": "<|endoftext|>",
25
+ "padding_side": "right",
26
+ "pretokenize_regex": "(?i:'s|'t|'re|'ve|'m|'ll|'d)|[^\\r\\n\\p{L}\\p{N}]?[\\p{L}\\p{M}]+|\\p{N}| ?[^\\s\\p{L}\\p{M}\\p{N}]+[\\r\\n]*|\\s*[\\r\\n]+|\\s+(?!\\S)|\\s+",
27
+ "processor_class": "Qwen3VLProcessor",
28
+ "split_special_tokens": false,
29
+ "tokenizer_class": "Qwen2Tokenizer",
30
+ "unk_token": null,
31
+ "video_token": "<|video_pad|>",
32
+ "vision_bos_token": "<|vision_start|>",
33
+ "vision_eos_token": "<|vision_end|>"
34
+ }
checkpoint-1876/trainer_state.json ADDED
@@ -0,0 +1,1343 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "best_global_step": null,
3
+ "best_metric": null,
4
+ "best_model_checkpoint": null,
5
+ "epoch": 2.0,
6
+ "eval_steps": 500,
7
+ "global_step": 1876,
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.010666666666666666,
14
+ "grad_norm": 14.719677069033247,
15
+ "learning_rate": 6.382978723404255e-07,
16
+ "loss": 1.131131935119629,
17
+ "step": 10
18
+ },
19
+ {
20
+ "epoch": 0.021333333333333333,
21
+ "grad_norm": 19.789131904372997,
22
+ "learning_rate": 1.347517730496454e-06,
23
+ "loss": 0.8277447700500489,
24
+ "step": 20
25
+ },
26
+ {
27
+ "epoch": 0.032,
28
+ "grad_norm": 4.008811801062304,
29
+ "learning_rate": 2.0567375886524823e-06,
30
+ "loss": 0.5474711418151855,
31
+ "step": 30
32
+ },
33
+ {
34
+ "epoch": 0.042666666666666665,
35
+ "grad_norm": 3.4969831449617863,
36
+ "learning_rate": 2.765957446808511e-06,
37
+ "loss": 0.4969797611236572,
38
+ "step": 40
39
+ },
40
+ {
41
+ "epoch": 0.05333333333333334,
42
+ "grad_norm": 3.496710211411394,
43
+ "learning_rate": 3.4751773049645393e-06,
44
+ "loss": 0.4998605728149414,
45
+ "step": 50
46
+ },
47
+ {
48
+ "epoch": 0.064,
49
+ "grad_norm": 3.3031965730768413,
50
+ "learning_rate": 4.184397163120568e-06,
51
+ "loss": 0.4771441459655762,
52
+ "step": 60
53
+ },
54
+ {
55
+ "epoch": 0.07466666666666667,
56
+ "grad_norm": 3.5681289223245787,
57
+ "learning_rate": 4.893617021276596e-06,
58
+ "loss": 0.4836556434631348,
59
+ "step": 70
60
+ },
61
+ {
62
+ "epoch": 0.08533333333333333,
63
+ "grad_norm": 3.2287114465847284,
64
+ "learning_rate": 5.602836879432625e-06,
65
+ "loss": 0.47313661575317384,
66
+ "step": 80
67
+ },
68
+ {
69
+ "epoch": 0.096,
70
+ "grad_norm": 2.9987978137542015,
71
+ "learning_rate": 6.312056737588653e-06,
72
+ "loss": 0.4791095733642578,
73
+ "step": 90
74
+ },
75
+ {
76
+ "epoch": 0.10666666666666667,
77
+ "grad_norm": 3.340378081154499,
78
+ "learning_rate": 7.021276595744682e-06,
79
+ "loss": 0.47806363105773925,
80
+ "step": 100
81
+ },
82
+ {
83
+ "epoch": 0.11733333333333333,
84
+ "grad_norm": 2.7047692208810417,
85
+ "learning_rate": 7.73049645390071e-06,
86
+ "loss": 0.49144439697265624,
87
+ "step": 110
88
+ },
89
+ {
90
+ "epoch": 0.128,
91
+ "grad_norm": 2.9034932565546754,
92
+ "learning_rate": 8.439716312056738e-06,
93
+ "loss": 0.4856122970581055,
94
+ "step": 120
95
+ },
96
+ {
97
+ "epoch": 0.13866666666666666,
98
+ "grad_norm": 2.8492532284524983,
99
+ "learning_rate": 9.148936170212767e-06,
100
+ "loss": 0.49585614204406736,
101
+ "step": 130
102
+ },
103
+ {
104
+ "epoch": 0.14933333333333335,
105
+ "grad_norm": 3.1897219221657913,
106
+ "learning_rate": 9.858156028368795e-06,
107
+ "loss": 0.4963822364807129,
108
+ "step": 140
109
+ },
110
+ {
111
+ "epoch": 0.16,
112
+ "grad_norm": 3.180291054321027,
113
+ "learning_rate": 9.999923689069412e-06,
114
+ "loss": 0.49301981925964355,
115
+ "step": 150
116
+ },
117
+ {
118
+ "epoch": 0.17066666666666666,
119
+ "grad_norm": 2.5896623193472585,
120
+ "learning_rate": 9.999613679906083e-06,
121
+ "loss": 0.4908170223236084,
122
+ "step": 160
123
+ },
124
+ {
125
+ "epoch": 0.18133333333333335,
126
+ "grad_norm": 2.582517102244016,
127
+ "learning_rate": 9.999065217851136e-06,
128
+ "loss": 0.512379503250122,
129
+ "step": 170
130
+ },
131
+ {
132
+ "epoch": 0.192,
133
+ "grad_norm": 2.9481033540091173,
134
+ "learning_rate": 9.998278329063063e-06,
135
+ "loss": 0.5089564323425293,
136
+ "step": 180
137
+ },
138
+ {
139
+ "epoch": 0.20266666666666666,
140
+ "grad_norm": 2.742530929422462,
141
+ "learning_rate": 9.997253051071943e-06,
142
+ "loss": 0.49326133728027344,
143
+ "step": 190
144
+ },
145
+ {
146
+ "epoch": 0.21333333333333335,
147
+ "grad_norm": 2.765768124507322,
148
+ "learning_rate": 9.99598943277766e-06,
149
+ "loss": 0.4973162651062012,
150
+ "step": 200
151
+ },
152
+ {
153
+ "epoch": 0.224,
154
+ "grad_norm": 2.770226206469208,
155
+ "learning_rate": 9.994487534447554e-06,
156
+ "loss": 0.49165959358215333,
157
+ "step": 210
158
+ },
159
+ {
160
+ "epoch": 0.23466666666666666,
161
+ "grad_norm": 2.6739784925959724,
162
+ "learning_rate": 9.992747427713561e-06,
163
+ "loss": 0.5012942314147949,
164
+ "step": 220
165
+ },
166
+ {
167
+ "epoch": 0.24533333333333332,
168
+ "grad_norm": 2.564165673280976,
169
+ "learning_rate": 9.990769195568787e-06,
170
+ "loss": 0.4979718208312988,
171
+ "step": 230
172
+ },
173
+ {
174
+ "epoch": 0.256,
175
+ "grad_norm": 2.5032814386910713,
176
+ "learning_rate": 9.988552932363563e-06,
177
+ "loss": 0.5078562736511231,
178
+ "step": 240
179
+ },
180
+ {
181
+ "epoch": 0.26666666666666666,
182
+ "grad_norm": 3.0170101170042805,
183
+ "learning_rate": 9.986098743800922e-06,
184
+ "loss": 0.5044580936431885,
185
+ "step": 250
186
+ },
187
+ {
188
+ "epoch": 0.2773333333333333,
189
+ "grad_norm": 2.679278781269865,
190
+ "learning_rate": 9.983406746931588e-06,
191
+ "loss": 0.515423583984375,
192
+ "step": 260
193
+ },
194
+ {
195
+ "epoch": 0.288,
196
+ "grad_norm": 2.446831637429734,
197
+ "learning_rate": 9.980477070148363e-06,
198
+ "loss": 0.4906794548034668,
199
+ "step": 270
200
+ },
201
+ {
202
+ "epoch": 0.2986666666666667,
203
+ "grad_norm": 2.4600457457453326,
204
+ "learning_rate": 9.977309853180024e-06,
205
+ "loss": 0.4913760185241699,
206
+ "step": 280
207
+ },
208
+ {
209
+ "epoch": 0.30933333333333335,
210
+ "grad_norm": 2.6584767292187426,
211
+ "learning_rate": 9.973905247084654e-06,
212
+ "loss": 0.4985548496246338,
213
+ "step": 290
214
+ },
215
+ {
216
+ "epoch": 0.32,
217
+ "grad_norm": 2.4646094466368766,
218
+ "learning_rate": 9.970263414242429e-06,
219
+ "loss": 0.49314355850219727,
220
+ "step": 300
221
+ },
222
+ {
223
+ "epoch": 0.33066666666666666,
224
+ "grad_norm": 3.149315472839174,
225
+ "learning_rate": 9.966384528347886e-06,
226
+ "loss": 0.5047734260559082,
227
+ "step": 310
228
+ },
229
+ {
230
+ "epoch": 0.3413333333333333,
231
+ "grad_norm": 2.618183661885374,
232
+ "learning_rate": 9.96226877440163e-06,
233
+ "loss": 0.4957937240600586,
234
+ "step": 320
235
+ },
236
+ {
237
+ "epoch": 0.352,
238
+ "grad_norm": 2.615669163983153,
239
+ "learning_rate": 9.957916348701515e-06,
240
+ "loss": 0.49486532211303713,
241
+ "step": 330
242
+ },
243
+ {
244
+ "epoch": 0.3626666666666667,
245
+ "grad_norm": 2.6327990047828793,
246
+ "learning_rate": 9.953327458833276e-06,
247
+ "loss": 0.49072465896606443,
248
+ "step": 340
249
+ },
250
+ {
251
+ "epoch": 0.37333333333333335,
252
+ "grad_norm": 2.8831237701931713,
253
+ "learning_rate": 9.948502323660635e-06,
254
+ "loss": 0.5094201564788818,
255
+ "step": 350
256
+ },
257
+ {
258
+ "epoch": 0.384,
259
+ "grad_norm": 2.4981375259751206,
260
+ "learning_rate": 9.943441173314865e-06,
261
+ "loss": 0.4819591522216797,
262
+ "step": 360
263
+ },
264
+ {
265
+ "epoch": 0.39466666666666667,
266
+ "grad_norm": 2.3457990842275374,
267
+ "learning_rate": 9.938144249183797e-06,
268
+ "loss": 0.507014274597168,
269
+ "step": 370
270
+ },
271
+ {
272
+ "epoch": 0.4053333333333333,
273
+ "grad_norm": 2.4847312856992176,
274
+ "learning_rate": 9.932611803900328e-06,
275
+ "loss": 0.48714618682861327,
276
+ "step": 380
277
+ },
278
+ {
279
+ "epoch": 0.416,
280
+ "grad_norm": 2.3913464084324945,
281
+ "learning_rate": 9.926844101330362e-06,
282
+ "loss": 0.4863110542297363,
283
+ "step": 390
284
+ },
285
+ {
286
+ "epoch": 0.4266666666666667,
287
+ "grad_norm": 2.652794886653921,
288
+ "learning_rate": 9.920841416560221e-06,
289
+ "loss": 0.49074840545654297,
290
+ "step": 400
291
+ },
292
+ {
293
+ "epoch": 0.43733333333333335,
294
+ "grad_norm": 2.5625986892418737,
295
+ "learning_rate": 9.914604035883537e-06,
296
+ "loss": 0.4913002014160156,
297
+ "step": 410
298
+ },
299
+ {
300
+ "epoch": 0.448,
301
+ "grad_norm": 2.4680795319586846,
302
+ "learning_rate": 9.908132256787586e-06,
303
+ "loss": 0.48008413314819337,
304
+ "step": 420
305
+ },
306
+ {
307
+ "epoch": 0.45866666666666667,
308
+ "grad_norm": 2.446518908575631,
309
+ "learning_rate": 9.901426387939104e-06,
310
+ "loss": 0.484285306930542,
311
+ "step": 430
312
+ },
313
+ {
314
+ "epoch": 0.4693333333333333,
315
+ "grad_norm": 2.3434078549751973,
316
+ "learning_rate": 9.894486749169564e-06,
317
+ "loss": 0.48981361389160155,
318
+ "step": 440
319
+ },
320
+ {
321
+ "epoch": 0.48,
322
+ "grad_norm": 2.5243663001591665,
323
+ "learning_rate": 9.887313671459929e-06,
324
+ "loss": 0.4931126594543457,
325
+ "step": 450
326
+ },
327
+ {
328
+ "epoch": 0.49066666666666664,
329
+ "grad_norm": 2.5905415730646935,
330
+ "learning_rate": 9.879907496924853e-06,
331
+ "loss": 0.4852896690368652,
332
+ "step": 460
333
+ },
334
+ {
335
+ "epoch": 0.5013333333333333,
336
+ "grad_norm": 2.3175960946503635,
337
+ "learning_rate": 9.872268578796377e-06,
338
+ "loss": 0.4794930458068848,
339
+ "step": 470
340
+ },
341
+ {
342
+ "epoch": 0.512,
343
+ "grad_norm": 2.3169110867720084,
344
+ "learning_rate": 9.864397281407074e-06,
345
+ "loss": 0.49527502059936523,
346
+ "step": 480
347
+ },
348
+ {
349
+ "epoch": 0.5226666666666666,
350
+ "grad_norm": 2.5081805539045763,
351
+ "learning_rate": 9.856293980172676e-06,
352
+ "loss": 0.49238901138305663,
353
+ "step": 490
354
+ },
355
+ {
356
+ "epoch": 0.5333333333333333,
357
+ "grad_norm": 2.4148307543494756,
358
+ "learning_rate": 9.847959061574163e-06,
359
+ "loss": 0.48439202308654783,
360
+ "step": 500
361
+ },
362
+ {
363
+ "epoch": 0.544,
364
+ "grad_norm": 2.417268129552713,
365
+ "learning_rate": 9.83939292313934e-06,
366
+ "loss": 0.48358449935913084,
367
+ "step": 510
368
+ },
369
+ {
370
+ "epoch": 0.5546666666666666,
371
+ "grad_norm": 2.4212977880426583,
372
+ "learning_rate": 9.830595973423868e-06,
373
+ "loss": 0.4881169319152832,
374
+ "step": 520
375
+ },
376
+ {
377
+ "epoch": 0.5653333333333334,
378
+ "grad_norm": 2.2373251511625227,
379
+ "learning_rate": 9.821568631991785e-06,
380
+ "loss": 0.4937411308288574,
381
+ "step": 530
382
+ },
383
+ {
384
+ "epoch": 0.576,
385
+ "grad_norm": 2.6067848093793113,
386
+ "learning_rate": 9.812311329395492e-06,
387
+ "loss": 0.4851250648498535,
388
+ "step": 540
389
+ },
390
+ {
391
+ "epoch": 0.5866666666666667,
392
+ "grad_norm": 2.505779269023947,
393
+ "learning_rate": 9.802824507155215e-06,
394
+ "loss": 0.476285457611084,
395
+ "step": 550
396
+ },
397
+ {
398
+ "epoch": 0.5973333333333334,
399
+ "grad_norm": 2.453798365354759,
400
+ "learning_rate": 9.793108617737953e-06,
401
+ "loss": 0.4898886203765869,
402
+ "step": 560
403
+ },
404
+ {
405
+ "epoch": 0.608,
406
+ "grad_norm": 2.336419532943086,
407
+ "learning_rate": 9.783164124535896e-06,
408
+ "loss": 0.47934665679931643,
409
+ "step": 570
410
+ },
411
+ {
412
+ "epoch": 0.6186666666666667,
413
+ "grad_norm": 2.3622052222837984,
414
+ "learning_rate": 9.77299150184432e-06,
415
+ "loss": 0.4934229850769043,
416
+ "step": 580
417
+ },
418
+ {
419
+ "epoch": 0.6293333333333333,
420
+ "grad_norm": 2.355971888227553,
421
+ "learning_rate": 9.762591234838972e-06,
422
+ "loss": 0.4741045951843262,
423
+ "step": 590
424
+ },
425
+ {
426
+ "epoch": 0.64,
427
+ "grad_norm": 2.335087591202486,
428
+ "learning_rate": 9.751963819552925e-06,
429
+ "loss": 0.4835971832275391,
430
+ "step": 600
431
+ },
432
+ {
433
+ "epoch": 0.6506666666666666,
434
+ "grad_norm": 2.312226806890674,
435
+ "learning_rate": 9.741109762852924e-06,
436
+ "loss": 0.4975107669830322,
437
+ "step": 610
438
+ },
439
+ {
440
+ "epoch": 0.6613333333333333,
441
+ "grad_norm": 2.4120574289328833,
442
+ "learning_rate": 9.730029582415209e-06,
443
+ "loss": 0.4812762260437012,
444
+ "step": 620
445
+ },
446
+ {
447
+ "epoch": 0.672,
448
+ "grad_norm": 2.70147229008976,
449
+ "learning_rate": 9.718723806700818e-06,
450
+ "loss": 0.46732497215270996,
451
+ "step": 630
452
+ },
453
+ {
454
+ "epoch": 0.6826666666666666,
455
+ "grad_norm": 2.4120813404749573,
456
+ "learning_rate": 9.707192974930403e-06,
457
+ "loss": 0.48064889907836916,
458
+ "step": 640
459
+ },
460
+ {
461
+ "epoch": 0.6933333333333334,
462
+ "grad_norm": 2.3262098681526093,
463
+ "learning_rate": 9.695437637058487e-06,
464
+ "loss": 0.49033608436584475,
465
+ "step": 650
466
+ },
467
+ {
468
+ "epoch": 0.704,
469
+ "grad_norm": 2.6101360877178346,
470
+ "learning_rate": 9.68345835374725e-06,
471
+ "loss": 0.48049345016479494,
472
+ "step": 660
473
+ },
474
+ {
475
+ "epoch": 0.7146666666666667,
476
+ "grad_norm": 2.38416338086165,
477
+ "learning_rate": 9.67125569633979e-06,
478
+ "loss": 0.48430418968200684,
479
+ "step": 670
480
+ },
481
+ {
482
+ "epoch": 0.7253333333333334,
483
+ "grad_norm": 2.396147340040666,
484
+ "learning_rate": 9.658830246832858e-06,
485
+ "loss": 0.486968994140625,
486
+ "step": 680
487
+ },
488
+ {
489
+ "epoch": 0.736,
490
+ "grad_norm": 2.1880846756162775,
491
+ "learning_rate": 9.646182597849119e-06,
492
+ "loss": 0.46998023986816406,
493
+ "step": 690
494
+ },
495
+ {
496
+ "epoch": 0.7466666666666667,
497
+ "grad_norm": 2.3991316493747403,
498
+ "learning_rate": 9.633313352608871e-06,
499
+ "loss": 0.4902526378631592,
500
+ "step": 700
501
+ },
502
+ {
503
+ "epoch": 0.7573333333333333,
504
+ "grad_norm": 2.546776822869976,
505
+ "learning_rate": 9.620223124901289e-06,
506
+ "loss": 0.4668087959289551,
507
+ "step": 710
508
+ },
509
+ {
510
+ "epoch": 0.768,
511
+ "grad_norm": 2.186701096003848,
512
+ "learning_rate": 9.606912539055141e-06,
513
+ "loss": 0.48386144638061523,
514
+ "step": 720
515
+ },
516
+ {
517
+ "epoch": 0.7786666666666666,
518
+ "grad_norm": 2.28344654961423,
519
+ "learning_rate": 9.593382229909012e-06,
520
+ "loss": 0.4883030891418457,
521
+ "step": 730
522
+ },
523
+ {
524
+ "epoch": 0.7893333333333333,
525
+ "grad_norm": 2.289876953573637,
526
+ "learning_rate": 9.579632842781033e-06,
527
+ "loss": 0.4781497001647949,
528
+ "step": 740
529
+ },
530
+ {
531
+ "epoch": 0.8,
532
+ "grad_norm": 2.2868985326044813,
533
+ "learning_rate": 9.565665033438089e-06,
534
+ "loss": 0.4757716655731201,
535
+ "step": 750
536
+ },
537
+ {
538
+ "epoch": 0.8106666666666666,
539
+ "grad_norm": 2.30563701368124,
540
+ "learning_rate": 9.551479468064565e-06,
541
+ "loss": 0.48414173126220705,
542
+ "step": 760
543
+ },
544
+ {
545
+ "epoch": 0.8213333333333334,
546
+ "grad_norm": 2.3272021596931296,
547
+ "learning_rate": 9.537076823230547e-06,
548
+ "loss": 0.4821342468261719,
549
+ "step": 770
550
+ },
551
+ {
552
+ "epoch": 0.832,
553
+ "grad_norm": 2.356076098592652,
554
+ "learning_rate": 9.522457785859572e-06,
555
+ "loss": 0.48393640518188474,
556
+ "step": 780
557
+ },
558
+ {
559
+ "epoch": 0.8426666666666667,
560
+ "grad_norm": 2.283081447884378,
561
+ "learning_rate": 9.507623053195861e-06,
562
+ "loss": 0.4777627944946289,
563
+ "step": 790
564
+ },
565
+ {
566
+ "epoch": 0.8533333333333334,
567
+ "grad_norm": 1.9593766326717093,
568
+ "learning_rate": 9.492573332771056e-06,
569
+ "loss": 0.4635260581970215,
570
+ "step": 800
571
+ },
572
+ {
573
+ "epoch": 0.864,
574
+ "grad_norm": 2.4282608759061093,
575
+ "learning_rate": 9.477309342370491e-06,
576
+ "loss": 0.48109025955200196,
577
+ "step": 810
578
+ },
579
+ {
580
+ "epoch": 0.8746666666666667,
581
+ "grad_norm": 2.2037180310212676,
582
+ "learning_rate": 9.461831809998944e-06,
583
+ "loss": 0.47229413986206054,
584
+ "step": 820
585
+ },
586
+ {
587
+ "epoch": 0.8853333333333333,
588
+ "grad_norm": 2.3422653774041384,
589
+ "learning_rate": 9.446141473845917e-06,
590
+ "loss": 0.47471017837524415,
591
+ "step": 830
592
+ },
593
+ {
594
+ "epoch": 0.896,
595
+ "grad_norm": 2.307529643267961,
596
+ "learning_rate": 9.430239082250438e-06,
597
+ "loss": 0.47556605339050295,
598
+ "step": 840
599
+ },
600
+ {
601
+ "epoch": 0.9066666666666666,
602
+ "grad_norm": 2.4685203961814,
603
+ "learning_rate": 9.41412539366536e-06,
604
+ "loss": 0.460905122756958,
605
+ "step": 850
606
+ },
607
+ {
608
+ "epoch": 0.9173333333333333,
609
+ "grad_norm": 2.253282348951304,
610
+ "learning_rate": 9.39780117662119e-06,
611
+ "loss": 0.46721577644348145,
612
+ "step": 860
613
+ },
614
+ {
615
+ "epoch": 0.928,
616
+ "grad_norm": 2.6725399753463663,
617
+ "learning_rate": 9.381267209689433e-06,
618
+ "loss": 0.4595684051513672,
619
+ "step": 870
620
+ },
621
+ {
622
+ "epoch": 0.9386666666666666,
623
+ "grad_norm": 2.1190030812596174,
624
+ "learning_rate": 9.364524281445464e-06,
625
+ "loss": 0.4708869934082031,
626
+ "step": 880
627
+ },
628
+ {
629
+ "epoch": 0.9493333333333334,
630
+ "grad_norm": 2.6687501945392844,
631
+ "learning_rate": 9.347573190430912e-06,
632
+ "loss": 0.4814455032348633,
633
+ "step": 890
634
+ },
635
+ {
636
+ "epoch": 0.96,
637
+ "grad_norm": 2.293302659426518,
638
+ "learning_rate": 9.330414745115576e-06,
639
+ "loss": 0.46994471549987793,
640
+ "step": 900
641
+ },
642
+ {
643
+ "epoch": 0.9706666666666667,
644
+ "grad_norm": 2.3844259241813273,
645
+ "learning_rate": 9.31304976385887e-06,
646
+ "loss": 0.47742176055908203,
647
+ "step": 910
648
+ },
649
+ {
650
+ "epoch": 0.9813333333333333,
651
+ "grad_norm": 2.2795793162673776,
652
+ "learning_rate": 9.295479074870777e-06,
653
+ "loss": 0.4683531761169434,
654
+ "step": 920
655
+ },
656
+ {
657
+ "epoch": 0.992,
658
+ "grad_norm": 2.3912968167883277,
659
+ "learning_rate": 9.27770351617237e-06,
660
+ "loss": 0.4541953086853027,
661
+ "step": 930
662
+ },
663
+ {
664
+ "epoch": 1.0021333333333333,
665
+ "grad_norm": 1.7527643233253156,
666
+ "learning_rate": 9.259723935555824e-06,
667
+ "loss": 0.422662353515625,
668
+ "step": 940
669
+ },
670
+ {
671
+ "epoch": 1.0128,
672
+ "grad_norm": 2.3671794408283113,
673
+ "learning_rate": 9.241541190543995e-06,
674
+ "loss": 0.2570992946624756,
675
+ "step": 950
676
+ },
677
+ {
678
+ "epoch": 1.0234666666666667,
679
+ "grad_norm": 2.1688535112637095,
680
+ "learning_rate": 9.223156148349511e-06,
681
+ "loss": 0.25190885066986085,
682
+ "step": 960
683
+ },
684
+ {
685
+ "epoch": 1.0341333333333333,
686
+ "grad_norm": 2.2112826371708976,
687
+ "learning_rate": 9.204569685833416e-06,
688
+ "loss": 0.2573091983795166,
689
+ "step": 970
690
+ },
691
+ {
692
+ "epoch": 1.0448,
693
+ "grad_norm": 2.360134745847926,
694
+ "learning_rate": 9.185782689463352e-06,
695
+ "loss": 0.24791259765625,
696
+ "step": 980
697
+ },
698
+ {
699
+ "epoch": 1.0554666666666668,
700
+ "grad_norm": 2.1230653101557726,
701
+ "learning_rate": 9.166796055271267e-06,
702
+ "loss": 0.24686360359191895,
703
+ "step": 990
704
+ },
705
+ {
706
+ "epoch": 1.0661333333333334,
707
+ "grad_norm": 2.179214976563206,
708
+ "learning_rate": 9.147610688810695e-06,
709
+ "loss": 0.24492282867431642,
710
+ "step": 1000
711
+ },
712
+ {
713
+ "epoch": 1.0768,
714
+ "grad_norm": 2.0319612229736013,
715
+ "learning_rate": 9.128227505113557e-06,
716
+ "loss": 0.23637039661407472,
717
+ "step": 1010
718
+ },
719
+ {
720
+ "epoch": 1.0874666666666666,
721
+ "grad_norm": 2.145879982585577,
722
+ "learning_rate": 9.108647428646522e-06,
723
+ "loss": 0.244051194190979,
724
+ "step": 1020
725
+ },
726
+ {
727
+ "epoch": 1.0981333333333334,
728
+ "grad_norm": 2.114387055100977,
729
+ "learning_rate": 9.088871393266912e-06,
730
+ "loss": 0.2529242277145386,
731
+ "step": 1030
732
+ },
733
+ {
734
+ "epoch": 1.1088,
735
+ "grad_norm": 2.035177482973937,
736
+ "learning_rate": 9.068900342178169e-06,
737
+ "loss": 0.2405726671218872,
738
+ "step": 1040
739
+ },
740
+ {
741
+ "epoch": 1.1194666666666666,
742
+ "grad_norm": 2.2418308787896217,
743
+ "learning_rate": 9.048735227884861e-06,
744
+ "loss": 0.24377832412719727,
745
+ "step": 1050
746
+ },
747
+ {
748
+ "epoch": 1.1301333333333332,
749
+ "grad_norm": 2.34726411543382,
750
+ "learning_rate": 9.028377012147262e-06,
751
+ "loss": 0.24974491596221923,
752
+ "step": 1060
753
+ },
754
+ {
755
+ "epoch": 1.1408,
756
+ "grad_norm": 2.3290056204741427,
757
+ "learning_rate": 9.007826665935477e-06,
758
+ "loss": 0.23754820823669434,
759
+ "step": 1070
760
+ },
761
+ {
762
+ "epoch": 1.1514666666666666,
763
+ "grad_norm": 2.0722263152081863,
764
+ "learning_rate": 8.987085169383125e-06,
765
+ "loss": 0.24723689556121825,
766
+ "step": 1080
767
+ },
768
+ {
769
+ "epoch": 1.1621333333333332,
770
+ "grad_norm": 2.201847254257956,
771
+ "learning_rate": 8.966153511740612e-06,
772
+ "loss": 0.2497556686401367,
773
+ "step": 1090
774
+ },
775
+ {
776
+ "epoch": 1.1728,
777
+ "grad_norm": 2.189179516457379,
778
+ "learning_rate": 8.945032691327925e-06,
779
+ "loss": 0.24566569328308105,
780
+ "step": 1100
781
+ },
782
+ {
783
+ "epoch": 1.1834666666666667,
784
+ "grad_norm": 2.3721350824712304,
785
+ "learning_rate": 8.923723715487038e-06,
786
+ "loss": 0.25868451595306396,
787
+ "step": 1110
788
+ },
789
+ {
790
+ "epoch": 1.1941333333333333,
791
+ "grad_norm": 2.0834813633873823,
792
+ "learning_rate": 8.902227600533857e-06,
793
+ "loss": 0.2605243444442749,
794
+ "step": 1120
795
+ },
796
+ {
797
+ "epoch": 1.2048,
798
+ "grad_norm": 2.207036591702502,
799
+ "learning_rate": 8.880545371709749e-06,
800
+ "loss": 0.2487651824951172,
801
+ "step": 1130
802
+ },
803
+ {
804
+ "epoch": 1.2154666666666667,
805
+ "grad_norm": 2.2578329927979652,
806
+ "learning_rate": 8.858678063132649e-06,
807
+ "loss": 0.24483366012573243,
808
+ "step": 1140
809
+ },
810
+ {
811
+ "epoch": 1.2261333333333333,
812
+ "grad_norm": 2.10477492412832,
813
+ "learning_rate": 8.836626717747726e-06,
814
+ "loss": 0.24892668724060057,
815
+ "step": 1150
816
+ },
817
+ {
818
+ "epoch": 1.2368000000000001,
819
+ "grad_norm": 2.3387501935576642,
820
+ "learning_rate": 8.81439238727766e-06,
821
+ "loss": 0.24501357078552247,
822
+ "step": 1160
823
+ },
824
+ {
825
+ "epoch": 1.2474666666666667,
826
+ "grad_norm": 2.0333494452475285,
827
+ "learning_rate": 8.791976132172462e-06,
828
+ "loss": 0.24308676719665528,
829
+ "step": 1170
830
+ },
831
+ {
832
+ "epoch": 1.2581333333333333,
833
+ "grad_norm": 3.1826561387331753,
834
+ "learning_rate": 8.769379021558908e-06,
835
+ "loss": 0.25639915466308594,
836
+ "step": 1180
837
+ },
838
+ {
839
+ "epoch": 1.2688,
840
+ "grad_norm": 2.2808934157856444,
841
+ "learning_rate": 8.746602133189542e-06,
842
+ "loss": 0.2509211540222168,
843
+ "step": 1190
844
+ },
845
+ {
846
+ "epoch": 1.2794666666666665,
847
+ "grad_norm": 2.1930257037095187,
848
+ "learning_rate": 8.723646553391275e-06,
849
+ "loss": 0.2533258438110352,
850
+ "step": 1200
851
+ },
852
+ {
853
+ "epoch": 1.2901333333333334,
854
+ "grad_norm": 2.133767732753803,
855
+ "learning_rate": 8.70051337701358e-06,
856
+ "loss": 0.2539417266845703,
857
+ "step": 1210
858
+ },
859
+ {
860
+ "epoch": 1.3008,
861
+ "grad_norm": 2.239505180748716,
862
+ "learning_rate": 8.677203707376261e-06,
863
+ "loss": 0.2511929988861084,
864
+ "step": 1220
865
+ },
866
+ {
867
+ "epoch": 1.3114666666666666,
868
+ "grad_norm": 2.400110342470654,
869
+ "learning_rate": 8.65371865621684e-06,
870
+ "loss": 0.24864754676818848,
871
+ "step": 1230
872
+ },
873
+ {
874
+ "epoch": 1.3221333333333334,
875
+ "grad_norm": 2.074240653541272,
876
+ "learning_rate": 8.630059343637536e-06,
877
+ "loss": 0.25031208992004395,
878
+ "step": 1240
879
+ },
880
+ {
881
+ "epoch": 1.3328,
882
+ "grad_norm": 2.314210134369462,
883
+ "learning_rate": 8.606226898051832e-06,
884
+ "loss": 0.25528905391693113,
885
+ "step": 1250
886
+ },
887
+ {
888
+ "epoch": 1.3434666666666666,
889
+ "grad_norm": 2.266038410404579,
890
+ "learning_rate": 8.582222456130665e-06,
891
+ "loss": 0.2509054183959961,
892
+ "step": 1260
893
+ },
894
+ {
895
+ "epoch": 1.3541333333333334,
896
+ "grad_norm": 2.1656893509907746,
897
+ "learning_rate": 8.55804716274821e-06,
898
+ "loss": 0.2446660041809082,
899
+ "step": 1270
900
+ },
901
+ {
902
+ "epoch": 1.3648,
903
+ "grad_norm": 2.1062431094058067,
904
+ "learning_rate": 8.533702170927274e-06,
905
+ "loss": 0.24778637886047364,
906
+ "step": 1280
907
+ },
908
+ {
909
+ "epoch": 1.3754666666666666,
910
+ "grad_norm": 2.27440775778361,
911
+ "learning_rate": 8.509188641784313e-06,
912
+ "loss": 0.2531563758850098,
913
+ "step": 1290
914
+ },
915
+ {
916
+ "epoch": 1.3861333333333334,
917
+ "grad_norm": 2.0945350781678407,
918
+ "learning_rate": 8.484507744474043e-06,
919
+ "loss": 0.25156211853027344,
920
+ "step": 1300
921
+ },
922
+ {
923
+ "epoch": 1.3968,
924
+ "grad_norm": 2.344329246263725,
925
+ "learning_rate": 8.459660656133676e-06,
926
+ "loss": 0.25161404609680177,
927
+ "step": 1310
928
+ },
929
+ {
930
+ "epoch": 1.4074666666666666,
931
+ "grad_norm": 2.131637669904885,
932
+ "learning_rate": 8.434648561826791e-06,
933
+ "loss": 0.24704971313476562,
934
+ "step": 1320
935
+ },
936
+ {
937
+ "epoch": 1.4181333333333335,
938
+ "grad_norm": 2.084925140729102,
939
+ "learning_rate": 8.409472654486802e-06,
940
+ "loss": 0.2557060956954956,
941
+ "step": 1330
942
+ },
943
+ {
944
+ "epoch": 1.4288,
945
+ "grad_norm": 2.1914203263108405,
946
+ "learning_rate": 8.384134134860057e-06,
947
+ "loss": 0.2547765254974365,
948
+ "step": 1340
949
+ },
950
+ {
951
+ "epoch": 1.4394666666666667,
952
+ "grad_norm": 2.158051551717063,
953
+ "learning_rate": 8.358634211448595e-06,
954
+ "loss": 0.24558641910552978,
955
+ "step": 1350
956
+ },
957
+ {
958
+ "epoch": 1.4501333333333333,
959
+ "grad_norm": 2.2443418909572523,
960
+ "learning_rate": 8.332974100452472e-06,
961
+ "loss": 0.2537588357925415,
962
+ "step": 1360
963
+ },
964
+ {
965
+ "epoch": 1.4607999999999999,
966
+ "grad_norm": 2.0077376058555765,
967
+ "learning_rate": 8.307155025711783e-06,
968
+ "loss": 0.24577705860137938,
969
+ "step": 1370
970
+ },
971
+ {
972
+ "epoch": 1.4714666666666667,
973
+ "grad_norm": 2.065591654232565,
974
+ "learning_rate": 8.281178218648278e-06,
975
+ "loss": 0.25243277549743653,
976
+ "step": 1380
977
+ },
978
+ {
979
+ "epoch": 1.4821333333333333,
980
+ "grad_norm": 2.2061568477558744,
981
+ "learning_rate": 8.255044918206634e-06,
982
+ "loss": 0.2530541896820068,
983
+ "step": 1390
984
+ },
985
+ {
986
+ "epoch": 1.4928,
987
+ "grad_norm": 2.1819835453447842,
988
+ "learning_rate": 8.228756370795367e-06,
989
+ "loss": 0.2566534042358398,
990
+ "step": 1400
991
+ },
992
+ {
993
+ "epoch": 1.5034666666666667,
994
+ "grad_norm": 2.39971243280419,
995
+ "learning_rate": 8.20231383022738e-06,
996
+ "loss": 0.25281970500946044,
997
+ "step": 1410
998
+ },
999
+ {
1000
+ "epoch": 1.5141333333333333,
1001
+ "grad_norm": 2.1788579288513117,
1002
+ "learning_rate": 8.175718557660168e-06,
1003
+ "loss": 0.2553559303283691,
1004
+ "step": 1420
1005
+ },
1006
+ {
1007
+ "epoch": 1.5248,
1008
+ "grad_norm": 1.9859089958121359,
1009
+ "learning_rate": 8.148971821535662e-06,
1010
+ "loss": 0.26154184341430664,
1011
+ "step": 1430
1012
+ },
1013
+ {
1014
+ "epoch": 1.5354666666666668,
1015
+ "grad_norm": 2.2533326386546104,
1016
+ "learning_rate": 8.122074897519743e-06,
1017
+ "loss": 0.2603666543960571,
1018
+ "step": 1440
1019
+ },
1020
+ {
1021
+ "epoch": 1.5461333333333334,
1022
+ "grad_norm": 2.3349705598874477,
1023
+ "learning_rate": 8.095029068441388e-06,
1024
+ "loss": 0.255629825592041,
1025
+ "step": 1450
1026
+ },
1027
+ {
1028
+ "epoch": 1.5568,
1029
+ "grad_norm": 2.0149070325575544,
1030
+ "learning_rate": 8.067835624231488e-06,
1031
+ "loss": 0.2591118812561035,
1032
+ "step": 1460
1033
+ },
1034
+ {
1035
+ "epoch": 1.5674666666666668,
1036
+ "grad_norm": 2.1532244460329966,
1037
+ "learning_rate": 8.040495861861342e-06,
1038
+ "loss": 0.25819978713989256,
1039
+ "step": 1470
1040
+ },
1041
+ {
1042
+ "epoch": 1.5781333333333334,
1043
+ "grad_norm": 2.167458483789604,
1044
+ "learning_rate": 8.013011085280769e-06,
1045
+ "loss": 0.26111855506896975,
1046
+ "step": 1480
1047
+ },
1048
+ {
1049
+ "epoch": 1.5888,
1050
+ "grad_norm": 2.3369281583312267,
1051
+ "learning_rate": 7.985382605355945e-06,
1052
+ "loss": 0.25337657928466795,
1053
+ "step": 1490
1054
+ },
1055
+ {
1056
+ "epoch": 1.5994666666666668,
1057
+ "grad_norm": 2.146446091115663,
1058
+ "learning_rate": 7.957611739806869e-06,
1059
+ "loss": 0.2608675718307495,
1060
+ "step": 1500
1061
+ },
1062
+ {
1063
+ "epoch": 1.6101333333333332,
1064
+ "grad_norm": 2.449035710299386,
1065
+ "learning_rate": 7.929699813144515e-06,
1066
+ "loss": 0.2538380861282349,
1067
+ "step": 1510
1068
+ },
1069
+ {
1070
+ "epoch": 1.6208,
1071
+ "grad_norm": 2.022668293735054,
1072
+ "learning_rate": 7.901648156607666e-06,
1073
+ "loss": 0.2559537410736084,
1074
+ "step": 1520
1075
+ },
1076
+ {
1077
+ "epoch": 1.6314666666666666,
1078
+ "grad_norm": 2.311749346530575,
1079
+ "learning_rate": 7.873458108099414e-06,
1080
+ "loss": 0.2684500217437744,
1081
+ "step": 1530
1082
+ },
1083
+ {
1084
+ "epoch": 1.6421333333333332,
1085
+ "grad_norm": 2.3505705501308496,
1086
+ "learning_rate": 7.845131012123364e-06,
1087
+ "loss": 0.2538013458251953,
1088
+ "step": 1540
1089
+ },
1090
+ {
1091
+ "epoch": 1.6528,
1092
+ "grad_norm": 2.2321743353517567,
1093
+ "learning_rate": 7.816668219719483e-06,
1094
+ "loss": 0.2512939691543579,
1095
+ "step": 1550
1096
+ },
1097
+ {
1098
+ "epoch": 1.6634666666666666,
1099
+ "grad_norm": 2.328319256336755,
1100
+ "learning_rate": 7.788071088399696e-06,
1101
+ "loss": 0.2541865348815918,
1102
+ "step": 1560
1103
+ },
1104
+ {
1105
+ "epoch": 1.6741333333333333,
1106
+ "grad_norm": 2.10587226339982,
1107
+ "learning_rate": 7.75934098208311e-06,
1108
+ "loss": 0.2653418302536011,
1109
+ "step": 1570
1110
+ },
1111
+ {
1112
+ "epoch": 1.6848,
1113
+ "grad_norm": 2.090592027992588,
1114
+ "learning_rate": 7.730479271030986e-06,
1115
+ "loss": 0.24748015403747559,
1116
+ "step": 1580
1117
+ },
1118
+ {
1119
+ "epoch": 1.6954666666666667,
1120
+ "grad_norm": 2.3497226188039275,
1121
+ "learning_rate": 7.701487331781372e-06,
1122
+ "loss": 0.2669647693634033,
1123
+ "step": 1590
1124
+ },
1125
+ {
1126
+ "epoch": 1.7061333333333333,
1127
+ "grad_norm": 2.276620579505611,
1128
+ "learning_rate": 7.672366547083454e-06,
1129
+ "loss": 0.25644373893737793,
1130
+ "step": 1600
1131
+ },
1132
+ {
1133
+ "epoch": 1.7168,
1134
+ "grad_norm": 2.1222637285476162,
1135
+ "learning_rate": 7.643118305831605e-06,
1136
+ "loss": 0.2490679979324341,
1137
+ "step": 1610
1138
+ },
1139
+ {
1140
+ "epoch": 1.7274666666666667,
1141
+ "grad_norm": 2.229863229946843,
1142
+ "learning_rate": 7.6137440029991505e-06,
1143
+ "loss": 0.24733123779296876,
1144
+ "step": 1620
1145
+ },
1146
+ {
1147
+ "epoch": 1.7381333333333333,
1148
+ "grad_norm": 2.2249450908491193,
1149
+ "learning_rate": 7.584245039571822e-06,
1150
+ "loss": 0.25619537830352784,
1151
+ "step": 1630
1152
+ },
1153
+ {
1154
+ "epoch": 1.7488000000000001,
1155
+ "grad_norm": 2.2102876649687326,
1156
+ "learning_rate": 7.554622822480953e-06,
1157
+ "loss": 0.2534807205200195,
1158
+ "step": 1640
1159
+ },
1160
+ {
1161
+ "epoch": 1.7594666666666665,
1162
+ "grad_norm": 2.2712866626459154,
1163
+ "learning_rate": 7.524878764536368e-06,
1164
+ "loss": 0.2548924446105957,
1165
+ "step": 1650
1166
+ },
1167
+ {
1168
+ "epoch": 1.7701333333333333,
1169
+ "grad_norm": 2.22733165752973,
1170
+ "learning_rate": 7.495014284358999e-06,
1171
+ "loss": 0.24510478973388672,
1172
+ "step": 1660
1173
+ },
1174
+ {
1175
+ "epoch": 1.7808000000000002,
1176
+ "grad_norm": 2.099299914243324,
1177
+ "learning_rate": 7.465030806313227e-06,
1178
+ "loss": 0.2522265434265137,
1179
+ "step": 1670
1180
+ },
1181
+ {
1182
+ "epoch": 1.7914666666666665,
1183
+ "grad_norm": 2.197727121468574,
1184
+ "learning_rate": 7.4349297604389555e-06,
1185
+ "loss": 0.26017649173736573,
1186
+ "step": 1680
1187
+ },
1188
+ {
1189
+ "epoch": 1.8021333333333334,
1190
+ "grad_norm": 2.2740805256970096,
1191
+ "learning_rate": 7.40471258238339e-06,
1192
+ "loss": 0.2631208896636963,
1193
+ "step": 1690
1194
+ },
1195
+ {
1196
+ "epoch": 1.8128,
1197
+ "grad_norm": 2.235596970175843,
1198
+ "learning_rate": 7.374380713332581e-06,
1199
+ "loss": 0.2545802354812622,
1200
+ "step": 1700
1201
+ },
1202
+ {
1203
+ "epoch": 1.8234666666666666,
1204
+ "grad_norm": 2.1858944714517463,
1205
+ "learning_rate": 7.343935599942681e-06,
1206
+ "loss": 0.25033328533172605,
1207
+ "step": 1710
1208
+ },
1209
+ {
1210
+ "epoch": 1.8341333333333334,
1211
+ "grad_norm": 2.2088385931044066,
1212
+ "learning_rate": 7.313378694270943e-06,
1213
+ "loss": 0.2528871536254883,
1214
+ "step": 1720
1215
+ },
1216
+ {
1217
+ "epoch": 1.8448,
1218
+ "grad_norm": 2.162468266561391,
1219
+ "learning_rate": 7.282711453706477e-06,
1220
+ "loss": 0.25245530605316163,
1221
+ "step": 1730
1222
+ },
1223
+ {
1224
+ "epoch": 1.8554666666666666,
1225
+ "grad_norm": 2.2054248406128294,
1226
+ "learning_rate": 7.251935340900731e-06,
1227
+ "loss": 0.2531111240386963,
1228
+ "step": 1740
1229
+ },
1230
+ {
1231
+ "epoch": 1.8661333333333334,
1232
+ "grad_norm": 2.674099478078809,
1233
+ "learning_rate": 7.221051823697734e-06,
1234
+ "loss": 0.25325212478637693,
1235
+ "step": 1750
1236
+ },
1237
+ {
1238
+ "epoch": 1.8768,
1239
+ "grad_norm": 2.2247776209641494,
1240
+ "learning_rate": 7.190062375064089e-06,
1241
+ "loss": 0.24999377727508545,
1242
+ "step": 1760
1243
+ },
1244
+ {
1245
+ "epoch": 1.8874666666666666,
1246
+ "grad_norm": 2.200346202814715,
1247
+ "learning_rate": 7.15896847301872e-06,
1248
+ "loss": 0.25710105895996094,
1249
+ "step": 1770
1250
+ },
1251
+ {
1252
+ "epoch": 1.8981333333333335,
1253
+ "grad_norm": 2.6602196093964783,
1254
+ "learning_rate": 7.127771600562385e-06,
1255
+ "loss": 0.24712116718292237,
1256
+ "step": 1780
1257
+ },
1258
+ {
1259
+ "epoch": 1.9088,
1260
+ "grad_norm": 2.0979266321264083,
1261
+ "learning_rate": 7.0964732456069304e-06,
1262
+ "loss": 0.2447052478790283,
1263
+ "step": 1790
1264
+ },
1265
+ {
1266
+ "epoch": 1.9194666666666667,
1267
+ "grad_norm": 2.0469909236188264,
1268
+ "learning_rate": 7.065074900904344e-06,
1269
+ "loss": 0.2608736515045166,
1270
+ "step": 1800
1271
+ },
1272
+ {
1273
+ "epoch": 1.9301333333333335,
1274
+ "grad_norm": 2.1567998095922456,
1275
+ "learning_rate": 7.033578063975546e-06,
1276
+ "loss": 0.2497999668121338,
1277
+ "step": 1810
1278
+ },
1279
+ {
1280
+ "epoch": 1.9407999999999999,
1281
+ "grad_norm": 2.10629682011714,
1282
+ "learning_rate": 7.0019842370389715e-06,
1283
+ "loss": 0.24511592388153075,
1284
+ "step": 1820
1285
+ },
1286
+ {
1287
+ "epoch": 1.9514666666666667,
1288
+ "grad_norm": 2.285009344275457,
1289
+ "learning_rate": 6.9702949269389254e-06,
1290
+ "loss": 0.2560229778289795,
1291
+ "step": 1830
1292
+ },
1293
+ {
1294
+ "epoch": 1.9621333333333333,
1295
+ "grad_norm": 2.1580134702270755,
1296
+ "learning_rate": 6.938511645073709e-06,
1297
+ "loss": 0.24839389324188232,
1298
+ "step": 1840
1299
+ },
1300
+ {
1301
+ "epoch": 1.9727999999999999,
1302
+ "grad_norm": 2.059285536180603,
1303
+ "learning_rate": 6.906635907323538e-06,
1304
+ "loss": 0.24895498752593995,
1305
+ "step": 1850
1306
+ },
1307
+ {
1308
+ "epoch": 1.9834666666666667,
1309
+ "grad_norm": 2.105134983270051,
1310
+ "learning_rate": 6.874669233978245e-06,
1311
+ "loss": 0.24931104183197023,
1312
+ "step": 1860
1313
+ },
1314
+ {
1315
+ "epoch": 1.9941333333333333,
1316
+ "grad_norm": 2.1881330324208808,
1317
+ "learning_rate": 6.842613149664766e-06,
1318
+ "loss": 0.2481091022491455,
1319
+ "step": 1870
1320
+ }
1321
+ ],
1322
+ "logging_steps": 10,
1323
+ "max_steps": 4690,
1324
+ "num_input_tokens_seen": 0,
1325
+ "num_train_epochs": 5,
1326
+ "save_steps": 500,
1327
+ "stateful_callbacks": {
1328
+ "TrainerControl": {
1329
+ "args": {
1330
+ "should_epoch_stop": false,
1331
+ "should_evaluate": false,
1332
+ "should_log": false,
1333
+ "should_save": true,
1334
+ "should_training_stop": false
1335
+ },
1336
+ "attributes": {}
1337
+ }
1338
+ },
1339
+ "total_flos": 4.935356496604037e+17,
1340
+ "train_batch_size": 1,
1341
+ "trial_name": null,
1342
+ "trial_params": null
1343
+ }
checkpoint-1876/training_args.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d7601908377509110784aaf5570cd72f8058db6fa691374b2de503eee9ab4c4c
3
+ size 7441
checkpoint-1876/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 ZERO_STAGE not 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("Extracting fp32 weights")
713
+ state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir, tag)
714
+
715
+ logger.info("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)
checkpoint-2814/chat_template.jinja ADDED
@@ -0,0 +1,154 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {%- set image_count = namespace(value=0) %}
2
+ {%- set video_count = namespace(value=0) %}
3
+ {%- macro render_content(content, do_vision_count, is_system_content=false) %}
4
+ {%- if content is string %}
5
+ {{- content }}
6
+ {%- elif content is iterable and content is not mapping %}
7
+ {%- for item in content %}
8
+ {%- if 'image' in item or 'image_url' in item or item.type == 'image' %}
9
+ {%- if is_system_content %}
10
+ {{- raise_exception('System message cannot contain images.') }}
11
+ {%- endif %}
12
+ {%- if do_vision_count %}
13
+ {%- set image_count.value = image_count.value + 1 %}
14
+ {%- endif %}
15
+ {%- if add_vision_id %}
16
+ {{- 'Picture ' ~ image_count.value ~ ': ' }}
17
+ {%- endif %}
18
+ {{- '<|vision_start|><|image_pad|><|vision_end|>' }}
19
+ {%- elif 'video' in item or item.type == 'video' %}
20
+ {%- if is_system_content %}
21
+ {{- raise_exception('System message cannot contain videos.') }}
22
+ {%- endif %}
23
+ {%- if do_vision_count %}
24
+ {%- set video_count.value = video_count.value + 1 %}
25
+ {%- endif %}
26
+ {%- if add_vision_id %}
27
+ {{- 'Video ' ~ video_count.value ~ ': ' }}
28
+ {%- endif %}
29
+ {{- '<|vision_start|><|video_pad|><|vision_end|>' }}
30
+ {%- elif 'text' in item %}
31
+ {{- item.text }}
32
+ {%- else %}
33
+ {{- raise_exception('Unexpected item type in content.') }}
34
+ {%- endif %}
35
+ {%- endfor %}
36
+ {%- elif content is none or content is undefined %}
37
+ {{- '' }}
38
+ {%- else %}
39
+ {{- raise_exception('Unexpected content type.') }}
40
+ {%- endif %}
41
+ {%- endmacro %}
42
+ {%- if not messages %}
43
+ {{- raise_exception('No messages provided.') }}
44
+ {%- endif %}
45
+ {%- if tools and tools is iterable and tools is not mapping %}
46
+ {{- '<|im_start|>system\n' }}
47
+ {{- "# Tools\n\nYou have access to the following functions:\n\n<tools>" }}
48
+ {%- for tool in tools %}
49
+ {{- "\n" }}
50
+ {{- tool | tojson }}
51
+ {%- endfor %}
52
+ {{- "\n</tools>" }}
53
+ {{- '\n\nIf you choose to call a function ONLY reply in the following format with NO suffix:\n\n<tool_call>\n<function=example_function_name>\n<parameter=example_parameter_1>\nvalue_1\n</parameter>\n<parameter=example_parameter_2>\nThis is the value for the second parameter\nthat can span\nmultiple lines\n</parameter>\n</function>\n</tool_call>\n\n<IMPORTANT>\nReminder:\n- Function calls MUST follow the specified format: an inner <function=...></function> block must be nested within <tool_call></tool_call> XML tags\n- Required parameters MUST be specified\n- You may provide optional reasoning for your function call in natural language BEFORE the function call, but NOT after\n- If there is no function call available, answer the question like normal with your current knowledge and do not tell the user about function calls\n</IMPORTANT>' }}
54
+ {%- if messages[0].role == 'system' %}
55
+ {%- set content = render_content(messages[0].content, false, true)|trim %}
56
+ {%- if content %}
57
+ {{- '\n\n' + content }}
58
+ {%- endif %}
59
+ {%- endif %}
60
+ {{- '<|im_end|>\n' }}
61
+ {%- else %}
62
+ {%- if messages[0].role == 'system' %}
63
+ {%- set content = render_content(messages[0].content, false, true)|trim %}
64
+ {{- '<|im_start|>system\n' + content + '<|im_end|>\n' }}
65
+ {%- endif %}
66
+ {%- endif %}
67
+ {%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}
68
+ {%- for message in messages[::-1] %}
69
+ {%- set index = (messages|length - 1) - loop.index0 %}
70
+ {%- if ns.multi_step_tool and message.role == "user" %}
71
+ {%- set content = render_content(message.content, false)|trim %}
72
+ {%- if not(content.startswith('<tool_response>') and content.endswith('</tool_response>')) %}
73
+ {%- set ns.multi_step_tool = false %}
74
+ {%- set ns.last_query_index = index %}
75
+ {%- endif %}
76
+ {%- endif %}
77
+ {%- endfor %}
78
+ {%- if ns.multi_step_tool %}
79
+ {{- raise_exception('No user query found in messages.') }}
80
+ {%- endif %}
81
+ {%- for message in messages %}
82
+ {%- set content = render_content(message.content, true)|trim %}
83
+ {%- if message.role == "system" %}
84
+ {%- if not loop.first %}
85
+ {{- raise_exception('System message must be at the beginning.') }}
86
+ {%- endif %}
87
+ {%- elif message.role == "user" %}
88
+ {{- '<|im_start|>' + message.role + '\n' + content + '<|im_end|>' + '\n' }}
89
+ {%- elif message.role == "assistant" %}
90
+ {%- set reasoning_content = '' %}
91
+ {%- if message.reasoning_content is string %}
92
+ {%- set reasoning_content = message.reasoning_content %}
93
+ {%- else %}
94
+ {%- if '</think>' in content %}
95
+ {%- set reasoning_content = content.split('</think>')[0].rstrip('\n').split('<think>')[-1].lstrip('\n') %}
96
+ {%- set content = content.split('</think>')[-1].lstrip('\n') %}
97
+ {%- endif %}
98
+ {%- endif %}
99
+ {%- set reasoning_content = reasoning_content|trim %}
100
+ {%- if loop.index0 > ns.last_query_index %}
101
+ {{- '<|im_start|>' + message.role + '\n<think>\n' + reasoning_content + '\n</think>\n\n' + content }}
102
+ {%- else %}
103
+ {{- '<|im_start|>' + message.role + '\n' + content }}
104
+ {%- endif %}
105
+ {%- if message.tool_calls and message.tool_calls is iterable and message.tool_calls is not mapping %}
106
+ {%- for tool_call in message.tool_calls %}
107
+ {%- if tool_call.function is defined %}
108
+ {%- set tool_call = tool_call.function %}
109
+ {%- endif %}
110
+ {%- if loop.first %}
111
+ {%- if content|trim %}
112
+ {{- '\n\n<tool_call>\n<function=' + tool_call.name + '>\n' }}
113
+ {%- else %}
114
+ {{- '<tool_call>\n<function=' + tool_call.name + '>\n' }}
115
+ {%- endif %}
116
+ {%- else %}
117
+ {{- '\n<tool_call>\n<function=' + tool_call.name + '>\n' }}
118
+ {%- endif %}
119
+ {%- if tool_call.arguments is defined %}
120
+ {%- for args_name, args_value in tool_call.arguments|items %}
121
+ {{- '<parameter=' + args_name + '>\n' }}
122
+ {%- set args_value = args_value | tojson | safe if args_value is mapping or (args_value is sequence and args_value is not string) else args_value | string %}
123
+ {{- args_value }}
124
+ {{- '\n</parameter>\n' }}
125
+ {%- endfor %}
126
+ {%- endif %}
127
+ {{- '</function>\n</tool_call>' }}
128
+ {%- endfor %}
129
+ {%- endif %}
130
+ {{- '<|im_end|>\n' }}
131
+ {%- elif message.role == "tool" %}
132
+ {%- if loop.previtem and loop.previtem.role != "tool" %}
133
+ {{- '<|im_start|>user' }}
134
+ {%- endif %}
135
+ {{- '\n<tool_response>\n' }}
136
+ {{- content }}
137
+ {{- '\n</tool_response>' }}
138
+ {%- if not loop.last and loop.nextitem.role != "tool" %}
139
+ {{- '<|im_end|>\n' }}
140
+ {%- elif loop.last %}
141
+ {{- '<|im_end|>\n' }}
142
+ {%- endif %}
143
+ {%- else %}
144
+ {{- raise_exception('Unexpected message role.') }}
145
+ {%- endif %}
146
+ {%- endfor %}
147
+ {%- if add_generation_prompt %}
148
+ {{- '<|im_start|>assistant\n' }}
149
+ {%- if enable_thinking is defined and enable_thinking is false %}
150
+ {{- '<think>\n\n</think>\n\n' }}
151
+ {%- else %}
152
+ {{- '<think>\n' }}
153
+ {%- endif %}
154
+ {%- endif %}
checkpoint-2814/config.json ADDED
@@ -0,0 +1,113 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "Qwen3_5ForConditionalGeneration"
4
+ ],
5
+ "dtype": "bfloat16",
6
+ "eos_token_id": 248046,
7
+ "hidden_size": 4096,
8
+ "image_token_id": 248056,
9
+ "model_type": "qwen3_5",
10
+ "pad_token_id": 248044,
11
+ "text_config": {
12
+ "attention_bias": false,
13
+ "attention_dropout": 0.0,
14
+ "attn_output_gate": true,
15
+ "bos_token_id": null,
16
+ "dtype": "bfloat16",
17
+ "eos_token_id": 248044,
18
+ "full_attention_interval": 4,
19
+ "head_dim": 256,
20
+ "hidden_act": "silu",
21
+ "hidden_size": 4096,
22
+ "initializer_range": 0.02,
23
+ "intermediate_size": 12288,
24
+ "layer_types": [
25
+ "linear_attention",
26
+ "linear_attention",
27
+ "linear_attention",
28
+ "full_attention",
29
+ "linear_attention",
30
+ "linear_attention",
31
+ "linear_attention",
32
+ "full_attention",
33
+ "linear_attention",
34
+ "linear_attention",
35
+ "linear_attention",
36
+ "full_attention",
37
+ "linear_attention",
38
+ "linear_attention",
39
+ "linear_attention",
40
+ "full_attention",
41
+ "linear_attention",
42
+ "linear_attention",
43
+ "linear_attention",
44
+ "full_attention",
45
+ "linear_attention",
46
+ "linear_attention",
47
+ "linear_attention",
48
+ "full_attention",
49
+ "linear_attention",
50
+ "linear_attention",
51
+ "linear_attention",
52
+ "full_attention",
53
+ "linear_attention",
54
+ "linear_attention",
55
+ "linear_attention",
56
+ "full_attention"
57
+ ],
58
+ "linear_conv_kernel_dim": 4,
59
+ "linear_key_head_dim": 128,
60
+ "linear_num_key_heads": 16,
61
+ "linear_num_value_heads": 32,
62
+ "linear_value_head_dim": 128,
63
+ "mamba_ssm_dtype": "float32",
64
+ "max_position_embeddings": 262144,
65
+ "mlp_only_layers": [],
66
+ "model_type": "qwen3_5_text",
67
+ "mtp_num_hidden_layers": 1,
68
+ "mtp_use_dedicated_embeddings": false,
69
+ "num_attention_heads": 16,
70
+ "num_hidden_layers": 32,
71
+ "num_key_value_heads": 4,
72
+ "pad_token_id": null,
73
+ "partial_rotary_factor": 0.25,
74
+ "rms_norm_eps": 1e-06,
75
+ "rope_parameters": {
76
+ "mrope_interleaved": true,
77
+ "mrope_section": [
78
+ 11,
79
+ 11,
80
+ 10
81
+ ],
82
+ "partial_rotary_factor": 0.25,
83
+ "rope_theta": 10000000,
84
+ "rope_type": "default"
85
+ },
86
+ "tie_word_embeddings": false,
87
+ "use_cache": false,
88
+ "vocab_size": 248320
89
+ },
90
+ "tie_word_embeddings": false,
91
+ "transformers_version": "5.6.0",
92
+ "use_cache": false,
93
+ "video_token_id": 248057,
94
+ "vision_config": {
95
+ "deepstack_visual_indexes": [],
96
+ "depth": 27,
97
+ "dtype": "bfloat16",
98
+ "hidden_act": "gelu_pytorch_tanh",
99
+ "hidden_size": 1152,
100
+ "in_channels": 3,
101
+ "initializer_range": 0.02,
102
+ "intermediate_size": 4304,
103
+ "model_type": "qwen3_5_vision",
104
+ "num_heads": 16,
105
+ "num_position_embeddings": 2304,
106
+ "out_hidden_size": 4096,
107
+ "patch_size": 16,
108
+ "spatial_merge_size": 2,
109
+ "temporal_patch_size": 2
110
+ },
111
+ "vision_end_token_id": 248054,
112
+ "vision_start_token_id": 248053
113
+ }
checkpoint-2814/generation_config.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "eos_token_id": [
4
+ 248046,
5
+ 248044
6
+ ],
7
+ "pad_token_id": 248044,
8
+ "transformers_version": "5.6.0",
9
+ "use_cache": true
10
+ }
checkpoint-2814/global_step2814/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:3f4c563ace3bd52defcd0322f2f1e18b7e601162d785cc4168cad9634fd81610
3
+ size 13430710881
checkpoint-2814/global_step2814/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:77ee383c8c79319610c455d709d1b731285da847a036dbe3ee9d384307c61837
3
+ size 13430710881
checkpoint-2814/global_step2814/bf16_zero_pp_rank_2_mp_rank_00_optim_states.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:19abab949f17739e4eb968f44d149893e0ce1adb6bfc4808fafbabbbf114e5c8
3
+ size 13430710881
checkpoint-2814/global_step2814/bf16_zero_pp_rank_3_mp_rank_00_optim_states.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8705c21e99bfb9993971500af26a9535c6ff0b0b72bd1baa68190893c8c300b9
3
+ size 13430710881
checkpoint-2814/global_step2814/bf16_zero_pp_rank_4_mp_rank_00_optim_states.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:aeda2bc1c6679b09a78b2ffe7ade11792d1b6401217a3f92fc84ea3463835913
3
+ size 13430710881
checkpoint-2814/global_step2814/bf16_zero_pp_rank_5_mp_rank_00_optim_states.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4084ef5834ef0d92546b11a03c59e0d3b6ec6635fc0aca8866e8569191013000
3
+ size 13430710881
checkpoint-2814/global_step2814/bf16_zero_pp_rank_6_mp_rank_00_optim_states.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e2b062293ee7405a271e47e54a3ad4f6128b8a6b5a4f5b5bab8b352a518010a2
3
+ size 13430710881