diff --git a/.gitattributes b/.gitattributes index bf6ad6a3bdceaa31effbe5bac1bc38812258a665..e3c548962301f574825935c06e78b01b9e6466f0 100644 --- a/.gitattributes +++ b/.gitattributes @@ -39,3 +39,13 @@ checkpoint-360/tokenizer.json filter=lfs diff=lfs merge=lfs -text checkpoint-450/tokenizer.json filter=lfs diff=lfs merge=lfs -text checkpoint-540/tokenizer.json filter=lfs diff=lfs merge=lfs -text checkpoint-90/tokenizer.json filter=lfs diff=lfs merge=lfs -text +checkpoint-1080/tokenizer.json filter=lfs diff=lfs merge=lfs -text +checkpoint-1170/tokenizer.json filter=lfs diff=lfs merge=lfs -text +checkpoint-1260/tokenizer.json filter=lfs diff=lfs merge=lfs -text +checkpoint-1350/tokenizer.json filter=lfs diff=lfs merge=lfs -text +checkpoint-1440/tokenizer.json filter=lfs diff=lfs merge=lfs -text +checkpoint-630/tokenizer.json filter=lfs diff=lfs merge=lfs -text +checkpoint-720/tokenizer.json filter=lfs diff=lfs merge=lfs -text +checkpoint-810/tokenizer.json filter=lfs diff=lfs merge=lfs -text +checkpoint-900/tokenizer.json filter=lfs diff=lfs merge=lfs -text +checkpoint-990/tokenizer.json filter=lfs diff=lfs merge=lfs -text diff --git a/checkpoint-1080/README.md b/checkpoint-1080/README.md new file mode 100644 index 0000000000000000000000000000000000000000..4eae946233309baf42f5bad9740186144a4f3b33 --- /dev/null +++ b/checkpoint-1080/README.md @@ -0,0 +1,202 @@ +--- +base_model: ../../initial_seq_model +library_name: peft +--- + +# Model Card for Model ID + + + + + +## Model Details + +### Model Description + + + + + +- **Developed by:** [More Information Needed] +- **Funded by [optional]:** [More Information Needed] +- **Shared by [optional]:** [More Information Needed] +- **Model type:** [More Information Needed] +- **Language(s) (NLP):** [More Information Needed] +- **License:** [More Information Needed] +- **Finetuned from model [optional]:** [More Information Needed] + +### Model Sources [optional] + + + +- **Repository:** [More Information Needed] +- **Paper [optional]:** [More Information Needed] +- **Demo [optional]:** [More Information Needed] + +## Uses + + + +### Direct Use + + + +[More Information Needed] + +### Downstream Use [optional] + + + +[More Information Needed] + +### Out-of-Scope Use + + + +[More Information Needed] + +## Bias, Risks, and Limitations + + + +[More Information Needed] + +### Recommendations + + + +Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations. + +## How to Get Started with the Model + +Use the code below to get started with the model. + +[More Information Needed] + +## Training Details + +### Training Data + + + +[More Information Needed] + +### Training Procedure + + + +#### Preprocessing [optional] + +[More Information Needed] + + +#### Training Hyperparameters + +- **Training regime:** [More Information Needed] + +#### Speeds, Sizes, Times [optional] + + + +[More Information Needed] + +## Evaluation + + + +### Testing Data, Factors & Metrics + +#### Testing Data + + + +[More Information Needed] + +#### Factors + + + +[More Information Needed] + +#### Metrics + + + +[More Information Needed] + +### Results + +[More Information Needed] + +#### Summary + + + +## Model Examination [optional] + + + +[More Information Needed] + +## Environmental Impact + + + +Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700). + +- **Hardware Type:** [More Information Needed] +- **Hours used:** [More Information Needed] +- **Cloud Provider:** [More Information Needed] +- **Compute Region:** [More Information Needed] +- **Carbon Emitted:** [More Information Needed] + +## Technical Specifications [optional] + +### Model Architecture and Objective + +[More Information Needed] + +### Compute Infrastructure + +[More Information Needed] + +#### Hardware + +[More Information Needed] + +#### Software + +[More Information Needed] + +## Citation [optional] + + + +**BibTeX:** + +[More Information Needed] + +**APA:** + +[More Information Needed] + +## Glossary [optional] + + + +[More Information Needed] + +## More Information [optional] + +[More Information Needed] + +## Model Card Authors [optional] + +[More Information Needed] + +## Model Card Contact + +[More Information Needed] +### Framework versions + +- PEFT 0.14.0 \ No newline at end of file diff --git a/checkpoint-1080/adapter_config.json b/checkpoint-1080/adapter_config.json new file mode 100644 index 0000000000000000000000000000000000000000..e1a650486f9ba9bab8c8dbb7d564bdc4ec121cf7 --- /dev/null +++ b/checkpoint-1080/adapter_config.json @@ -0,0 +1,38 @@ +{ + "alpha_pattern": {}, + "auto_mapping": null, + "base_model_name_or_path": "../../initial_seq_model", + "bias": "none", + "eva_config": null, + "exclude_modules": null, + "fan_in_fan_out": false, + "inference_mode": true, + "init_lora_weights": true, + "layer_replication": null, + "layers_pattern": null, + "layers_to_transform": null, + "loftq_config": {}, + "lora_alpha": 16, + "lora_bias": false, + "lora_dropout": 0.1, + "megatron_config": null, + "megatron_core": "megatron.core", + "modules_to_save": null, + "peft_type": "LORA", + "r": 8, + "rank_pattern": {}, + "revision": null, + "target_modules": [ + "k_proj", + "o_proj", + "gate_proj", + "down_proj", + "score", + "v_proj", + "up_proj", + "q_proj" + ], + "task_type": "CAUSAL_LM", + "use_dora": false, + "use_rslora": false +} \ No newline at end of file diff --git a/checkpoint-1080/adapter_model.safetensors b/checkpoint-1080/adapter_model.safetensors new file mode 100644 index 0000000000000000000000000000000000000000..5091eb2516b9da3d5f1960d492f07fe94b043ac2 --- /dev/null +++ b/checkpoint-1080/adapter_model.safetensors @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1b25cfc558172ed41b9a04d0500d65e9e73e7db84f502a72accf946894db5019 +size 42068368 diff --git a/checkpoint-1080/global_step1080/bf16_zero_pp_rank_0_mp_rank_00_optim_states.pt b/checkpoint-1080/global_step1080/bf16_zero_pp_rank_0_mp_rank_00_optim_states.pt new file mode 100644 index 0000000000000000000000000000000000000000..1c4f64b44c11c4196f3f7cd6a50367fee1ad54cd --- /dev/null +++ b/checkpoint-1080/global_step1080/bf16_zero_pp_rank_0_mp_rank_00_optim_states.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a4d9031577da1e7762c50b932da888a5c6626c63bcffad7cb51fd30804feae32 +size 63016432 diff --git a/checkpoint-1080/global_step1080/bf16_zero_pp_rank_1_mp_rank_00_optim_states.pt b/checkpoint-1080/global_step1080/bf16_zero_pp_rank_1_mp_rank_00_optim_states.pt new file mode 100644 index 0000000000000000000000000000000000000000..fa5b3beb24273a1040ce560c103c3c0b4dbf67ee --- /dev/null +++ b/checkpoint-1080/global_step1080/bf16_zero_pp_rank_1_mp_rank_00_optim_states.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f7af06667ef17aeea9d89d00c3c76ae36eee2a1cdcac706482e3488e799ccaf9 +size 63016432 diff --git a/checkpoint-1080/global_step1080/bf16_zero_pp_rank_2_mp_rank_00_optim_states.pt b/checkpoint-1080/global_step1080/bf16_zero_pp_rank_2_mp_rank_00_optim_states.pt new file mode 100644 index 0000000000000000000000000000000000000000..2930d94cb6bd67b0b96ab9cec4399e00dc89b6e2 --- /dev/null +++ b/checkpoint-1080/global_step1080/bf16_zero_pp_rank_2_mp_rank_00_optim_states.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5c7680d2989209f98fd87190ed24fe7da8a9a333806491e6af7618ee47fa5862 +size 63016432 diff --git a/checkpoint-1080/global_step1080/bf16_zero_pp_rank_3_mp_rank_00_optim_states.pt b/checkpoint-1080/global_step1080/bf16_zero_pp_rank_3_mp_rank_00_optim_states.pt new file mode 100644 index 0000000000000000000000000000000000000000..9d39834869b297da2886733f6c6ca6c195f8fb7a --- /dev/null +++ b/checkpoint-1080/global_step1080/bf16_zero_pp_rank_3_mp_rank_00_optim_states.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6e38d8ad525868f0f592e521ed1dcb8742632c4bf31e06cf17f1b5cd7c78456a +size 63016432 diff --git a/checkpoint-1080/global_step1080/zero_pp_rank_0_mp_rank_00_model_states.pt b/checkpoint-1080/global_step1080/zero_pp_rank_0_mp_rank_00_model_states.pt new file mode 100644 index 0000000000000000000000000000000000000000..e2ec797d48acd2e27dc682e12686a88c05ff3bc7 --- /dev/null +++ b/checkpoint-1080/global_step1080/zero_pp_rank_0_mp_rank_00_model_states.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4e58b10a37b18158187fef1e12724d4bc181db6b181b4ed070ee81a105387a8d +size 442088 diff --git a/checkpoint-1080/global_step1080/zero_pp_rank_1_mp_rank_00_model_states.pt b/checkpoint-1080/global_step1080/zero_pp_rank_1_mp_rank_00_model_states.pt new file mode 100644 index 0000000000000000000000000000000000000000..426a6888c4aa33db94614637133e49e996e1de8f --- /dev/null +++ b/checkpoint-1080/global_step1080/zero_pp_rank_1_mp_rank_00_model_states.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0fde76fbf099ae4028b3a15775b51903443a331c2e6b53a8f57be057d4f88680 +size 442088 diff --git a/checkpoint-1080/global_step1080/zero_pp_rank_2_mp_rank_00_model_states.pt b/checkpoint-1080/global_step1080/zero_pp_rank_2_mp_rank_00_model_states.pt new file mode 100644 index 0000000000000000000000000000000000000000..eb2f69e4d4dbfa34784acf153526c0505692ad5b --- /dev/null +++ b/checkpoint-1080/global_step1080/zero_pp_rank_2_mp_rank_00_model_states.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f02704af3e1c2b3552c2af14ddf3c52cd61057b39457dfa179ed00f101be8d92 +size 442088 diff --git a/checkpoint-1080/global_step1080/zero_pp_rank_3_mp_rank_00_model_states.pt b/checkpoint-1080/global_step1080/zero_pp_rank_3_mp_rank_00_model_states.pt new file mode 100644 index 0000000000000000000000000000000000000000..48ba05967523e4f142c50e142ed6fae4573271a5 --- /dev/null +++ b/checkpoint-1080/global_step1080/zero_pp_rank_3_mp_rank_00_model_states.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d39805cff41b8cdc173c9b4ef09c15ccaa3077c90461c90f5e93ad7efb4f5770 +size 442088 diff --git a/checkpoint-1080/latest b/checkpoint-1080/latest new file mode 100644 index 0000000000000000000000000000000000000000..d0a9379083d90b01bebac57bf6b90d63679e4920 --- /dev/null +++ b/checkpoint-1080/latest @@ -0,0 +1 @@ +global_step1080 \ No newline at end of file diff --git a/checkpoint-1080/rng_state_0.pth b/checkpoint-1080/rng_state_0.pth new file mode 100644 index 0000000000000000000000000000000000000000..b98b4bb609759d5924d8c737dbe213a0476e4637 --- /dev/null +++ b/checkpoint-1080/rng_state_0.pth @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:32f8e825bf8d6d7e567ef987886f16dcf2c971fa3832d0f55ed70c72a89ccca3 +size 14960 diff --git a/checkpoint-1080/rng_state_1.pth b/checkpoint-1080/rng_state_1.pth new file mode 100644 index 0000000000000000000000000000000000000000..c0aff1b03f5bb0479ade1aa01ab690c1d28aaf0e --- /dev/null +++ b/checkpoint-1080/rng_state_1.pth @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:785f20bfacf7717dbee5cfbae9e04092e67d092ed018bcc2edbfbf2d7b8f746c +size 14960 diff --git a/checkpoint-1080/rng_state_2.pth b/checkpoint-1080/rng_state_2.pth new file mode 100644 index 0000000000000000000000000000000000000000..d7848d6788f142610b6ee55e9eca43c58a7c0584 --- /dev/null +++ b/checkpoint-1080/rng_state_2.pth @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:112fbe394f47a631dac246dc171a6ecb1aae5ea5fe0460593dfa3770e31c3930 +size 14960 diff --git a/checkpoint-1080/rng_state_3.pth b/checkpoint-1080/rng_state_3.pth new file mode 100644 index 0000000000000000000000000000000000000000..cd451d83002f245bfb35fc8edc7c71c5c38eece7 --- /dev/null +++ b/checkpoint-1080/rng_state_3.pth @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cd04444df403dd9e3e1c9a81712371ec25ed4b29ab132a3fcb2ef7dc379614e3 +size 14960 diff --git a/checkpoint-1080/scheduler.pt b/checkpoint-1080/scheduler.pt new file mode 100644 index 0000000000000000000000000000000000000000..a7f6763c4362d2087dd41a054c9093f6edb33578 --- /dev/null +++ b/checkpoint-1080/scheduler.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:30f8b1d36df474e2f70f75a59e2dfeaf50b8c1ba00ffcfcf7bd86c066705e146 +size 1064 diff --git a/checkpoint-1080/special_tokens_map.json b/checkpoint-1080/special_tokens_map.json new file mode 100644 index 0000000000000000000000000000000000000000..a8eb9ef63af01dfa2c350573b543b14275370944 --- /dev/null +++ b/checkpoint-1080/special_tokens_map.json @@ -0,0 +1,30 @@ +{ + "bos_token": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false + }, + "eos_token": { + "content": "<|END_OF_TURN_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false + }, + "pad_token": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false + }, + "unk_token": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false + } +} diff --git a/checkpoint-1080/tokenizer.json b/checkpoint-1080/tokenizer.json new file mode 100644 index 0000000000000000000000000000000000000000..91a1344d38167f152a8803a80eb79ca4b465adbb --- /dev/null +++ b/checkpoint-1080/tokenizer.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:28c8b8038fcb2756e349a51832a56634423c579a869f39642526327aa56b2989 +size 20125189 diff --git a/checkpoint-1080/tokenizer_config.json b/checkpoint-1080/tokenizer_config.json new file mode 100644 index 0000000000000000000000000000000000000000..100ac1a3b6cff4a9043d2c0fd6b1603d1c1ee1e1 --- /dev/null +++ b/checkpoint-1080/tokenizer_config.json @@ -0,0 +1,364 @@ +{ + "add_bos_token": true, + "add_eos_token": false, + "add_prefix_space": false, + "added_tokens_decoder": { + "0": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "1": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "2": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "3": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "4": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "5": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "6": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "7": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "255000": { + "content": "<|START_OF_TURN_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255001": { + "content": "<|END_OF_TURN_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "255002": { + "content": "<|YES_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255003": { + "content": "<|NO_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255004": { + "content": "<|GOOD_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255005": { + "content": "<|BAD_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255006": { + "content": "<|USER_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255007": { + "content": "<|CHATBOT_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255008": { + "content": "<|SYSTEM_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255009": { + "content": "<|USER_0_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255010": { + "content": "<|USER_1_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255011": { + "content": "<|USER_2_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255012": { + "content": "<|USER_3_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255013": { + "content": "<|USER_4_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255014": { + "content": "<|USER_5_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255015": { + "content": "<|USER_6_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255016": { + "content": "<|USER_7_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255017": { + "content": "<|USER_8_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255018": { + "content": "<|USER_9_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255019": { + "content": "<|START_THINKING|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255020": { + "content": "<|END_THINKING|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255021": { + "content": "<|START_RESPONSE|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "255022": { + "content": "<|END_RESPONSE|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "255023": { + "content": "<|START_ACTION|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255024": { + "content": "<|END_ACTION|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255025": { + "content": "<|START_TOOL_RESULT|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255026": { + "content": "<|END_TOOL_RESULT|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255027": { + "content": "<|EXTRA_8_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255028": { + "content": "<|NEW_FILE|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "255029": { + "content": "<|BEGINNING_OF_PREFIX_FIM_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255030": { + "content": "<|BEGINNING_OF_MIDDLE_FIM_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255031": { + "content": "<|BEGINNING_OF_SUFFIX_FIM_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255032": { + "content": "<|END_OF_MIDDLE_FIM_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + } + }, + "bos_token": "", + "chat_template": [ + { + "name": "default", + "template": "{% if documents %}\n{% set tools = [] %}\n{%- macro document_turn(documents) -%}\n{# format documents into chat turn #}\n<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|><|START_THINKING|>I will look through the document to address the users needs.<|END_THINKING|><|START_ACTION|>[\n {\"tool_call_id\": \"0\", \"tool_name\": \"direct-injected-document\", \"parameters\": {}}\n]<|END_ACTION|><|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|><|START_TOOL_RESULT|>[\n {\n \"tool_call_id\": \"0\",\n \"results\": {\n{% for doc in documents %}\n \"{{ loop.index0 }}\": {{doc|tojson}}{% if not loop.last %},\n {% endif %}\n{% endfor %}\n\n },\n \"is_error\": null\n }\n]<|END_TOOL_RESULT|><|END_OF_TURN_TOKEN|>{%- endmacro %}\n{%- macro tool_call_id_to_int(messages, tool_call_id) %}\n{%- set counter = namespace(value=0) %}\n{%- set tool_call_id_seen = namespace(value=false) %}\n{%- for msg in messages %}\n {%- if msg.tool_calls %}\n {%- for tool_call in msg.tool_calls %}\n {%- if tool_call.id == tool_call_id and not tool_call_id_seen.value -%}\n {{ counter.value }}\n {%- set tool_call_id_seen.value = true %}\n {%- endif %}\n {%- set counter.value = counter.value + 1 %}\n {%- endfor %}\n {%- endif %}\n{%- endfor %}\n{%- endmacro %}\n{%- macro format_tool_message(messages, tool_msg) -%}\n{# format tool message #}\n {\n \"tool_call_id\": \"{{ tool_call_id_to_int(messages, tool_msg.tool_call_id) }}\",\n \"results\": {\n \"0\": {{ tool_msg.content|tojson }}\n },\n \"is_error\": null\n }\n{%- endmacro -%}\n{%- if messages and messages[0]['role']|lower == 'system' %}{%- set developer_preamble = messages[0]['content'] %}{% endif %}\n{%- set tool_idx = namespace(value=0) %}\n{%- set tool_ids_seen = namespace(value=[]) %}\n{%- set sent_documents = namespace(value=false) %}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|># System Preamble\nYou are in contextual safety mode. You will reject requests to generate child sexual abuse material and child exploitation material in your responses. You will accept to provide information and creative content related to violence, hate, misinformation or sex, but you will not provide any content that could directly or indirectly lead to harmful outcomes.\n\nYour information cutoff date is June 2024.\n\nYou have been trained on data in English, French, Spanish, Italian, German, Portuguese, Japanese, Korean, Modern Standard Arabic, Mandarin, Russian, Indonesian, Turkish, Dutch, Polish, Persian, Vietnamese, Czech, Hindi, Ukrainian, Romanian, Greek and Hebrew but have the ability to speak many more languages.\n{% if tools or documents %}\n\nYou have been trained to have advanced reasoning and tool-use capabilities and you should make best use of these skills to serve user's requests.\n\n## Tool Use\nThink about how you can make best use of the provided tools to help with the task and come up with a high level plan that you will execute first.\n\n0. Start by writing <|START_THINKING|> followed by a detailed step by step plan of how you will solve the problem. For each step explain your thinking fully and give details of required tool calls (if needed). Unless specified otherwise, you write your plan in natural language. When you finish, close it out with <|END_THINKING|>.\n You can optionally choose to skip this step when the user request is so straightforward to address that only a trivial plan would be needed.\n NOTE: You MUST skip this step when you are directly responding to the user's request without using any tools.\n\nThen carry out your plan by repeatedly executing the following steps.\n1. Action: write <|START_ACTION|> followed by a list of JSON-formatted tool calls, with each one containing \"tool_name\" and \"parameters\" fields.\n When there are multiple tool calls which are completely independent of each other (i.e. they can be executed in parallel), you should list them out all together in one step. When you finish, close it out with <|END_ACTION|>.\n2. Observation: you will then receive results of those tool calls in JSON format in the very next turn, wrapped around by <|START_TOOL_RESULT|> and <|END_TOOL_RESULT|>. Carefully observe those results and think about what to do next. Note that these results will be provided to you in a separate turn. NEVER hallucinate results.\n Every tool call produces a list of results (when a tool call produces no result or a single result, it'll still get wrapped inside a list). Each result is clearly linked to its originating tool call via its \"tool_call_id\".\n3. Reflection: start the next turn by writing <|START_THINKING|> followed by what you've figured out so far, any changes you need to make to your plan, and what you will do next. When you finish, close it out with <|END_THINKING|>.\n You can optionally choose to skip this step when everything is going according to plan and no special pieces of information or reasoning chains need to be recorded.\n NOTE: You MUST skip this step when you are done with tool-use actions and are ready to respond to the user.\n\nYou can repeat the above 3 steps multiple times (could be 0 times too if no suitable tool calls are available or needed), until you decide it's time to finally respond to the user.\n\n4. Response: then break out of the loop and write <|START_RESPONSE|> followed by a piece of text which serves as a response to the user's last request. Use all previous tool calls and results to help you when formulating your response. When you finish, close it out with <|END_RESPONSE|>.\n{% if enable_citations %}\n\n## Grounding\nImportantly, note that \"Reflection\" and \"Response\" above can be grounded.\nGrounding means you associate pieces of texts (called \"spans\") with those specific tool results that support them (called \"sources\"). And you use a pair of tags \"\" and \"\" to indicate when a span can be grounded onto a list of sources, listing them out in the closing tag. Sources from the same tool call are grouped together and listed as \"{tool_call_id}:[{list of result indices}]\", before they are joined together by \",\". E.g., \"span\" means that \"span\" is supported by result 1 and 2 from \"tool_call_id=0\" as well as result 0 from \"tool_call_id=1\".\n{% endif %}\n\n## Available Tools\nHere is the list of tools that you have available to you.\nYou can ONLY use the tools listed here. When a tool is not listed below, it is NOT available and you should NEVER attempt to use it.\nEach tool is represented as a JSON object with fields like \"name\", \"description\", \"parameters\" (per JSON Schema), and optionally, \"responses\" (per JSON Schema).\n\n```json\n[\n{% if documents %}\n {\"name\": \"direct-injected-document\", \"description\": \"This is a special tool to directly inject user-uploaded documents into the chat as additional context. DO NOT use this tool by yourself!\", \"parameters\": {\"type\": \"object\", \"properties\": {}, \"required\": []}, \"responses\": {\"200\": {\"description\": \"Successfully returned a list of chunked text snippets from the directly uploaded documents.\", \"content\": {\"application/json\": {\"schema\": {\"type\": \"array\", \"items\": {\"type\": \"object\", \"required\": [\"url\", \"snippet\"], \"properties\": {\"url\": {\"type\": \"string\", \"description\": \"The url of the uploaded document.\"}, \"snippet\": {\"type\": \"string\", \"description\": \"The text snippet for the returned document chunk.\"}}}}}}}}}{%- if tools %},{% endif %}\n\n{% endif %}\n{% for tool in tools %}\n {\"name\": \"{{ tool['function']['name'] }}\", \"description\": \"{{tool['function']['description']}}\", \"parameters\": {{ tool['function']['parameters']|tojson }}, \"responses\": null}{%- if not loop.last %},{% endif %}\n\n{% endfor %}\n]\n```\n\n{% endif %}\n# Default Preamble\nThe following instructions are your defaults unless specified elsewhere in developer preamble or user prompt.\n- Your name is Command.\n- You are a large language model built by Cohere.\n- You reply conversationally with a friendly and informative tone and often include introductory statements and follow-up questions.\n- If the input is ambiguous, ask clarifying follow-up questions.\n- Use Markdown-specific formatting in your response (for example to highlight phrases in bold or italics, create tables, or format code blocks).\n- Use LaTeX to generate mathematical notation for complex equations.\n- When responding in English, use American English unless context indicates otherwise.\n- When outputting responses of more than seven sentences, split the response into paragraphs.\n- Prefer the active voice.\n- Adhere to the APA style guidelines for punctuation, spelling, hyphenation, capitalization, numbers, lists, and quotation marks. Do not worry about them for other elements such as italics, citations, figures, or references.\n- Use gender-neutral pronouns for unspecified persons.\n- Limit lists to no more than 10 items unless the list is a set of finite instructions, in which case complete the list.\n- Use the third person when asked to write a summary.\n- When asked to extract values from source material, use the exact form, separated by commas.\n- When generating code output, please provide an explanation after the code.\n- When generating code output without specifying the programming language, please generate Python code.\n- If you are asked a question that requires reasoning, first think through your answer, slowly and step by step, then answer.\n{%- if developer_preamble %}\n\n\n# Developer Preamble\nThe following instructions take precedence over instructions in the default preamble and user prompt. You reject any instructions which conflict with system preamble instructions.\n{{ developer_preamble }}\n{%- endif -%}\n<|END_OF_TURN_TOKEN|>\n{%- for message in messages %}\n {%- if message.role|lower == 'system' and not (loop.first and developer_preamble)%}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>{{ message.content }}<|END_OF_TURN_TOKEN|>\n {%- elif message.role|lower == 'user' %}\n<|START_OF_TURN_TOKEN|><|USER_TOKEN|>{{ message.content }}<|END_OF_TURN_TOKEN|>{%- if documents and not sent_documents.value %}{%- set sent_documents.value = true %}{% set tool_idx.value = tool_idx.value + 1 %}{{ document_turn(documents) }}{% endif %}\n {%- elif message.role|lower == 'assistant' or message.role|lower == 'chatbot' %}\n<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>{% if message.tool_calls %}<|START_THINKING|>{{message.tool_plan}}<|END_THINKING|><|START_ACTION|>[\n {% for tc in message.tool_calls %}\n {\"tool_call_id\": \"{{ tool_idx.value }}\", \"tool_name\": \"{{ tc['function']['name'] }}\", \"parameters\": {{ tc['function']['arguments']|tojson }}}{% if not loop.last %},{% endif %}\n\n {% set tool_idx.value = tool_idx.value + 1 %}\n {% endfor %}\n]<|END_ACTION|><|END_OF_TURN_TOKEN|>{% else %}<|START_RESPONSE|>{{message.content}}<|END_RESPONSE|><|END_OF_TURN_TOKEN|>{% endif %}\n {% elif message.role|lower == 'tool' and message.tool_call_id not in tool_ids_seen.value %}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|><|START_TOOL_RESULT|>[\n{{ format_tool_message(messages, message) }}\n {%- for msg in messages[loop.index0 + 1:] %}\n {%- if msg.role|lower == 'tool' %},\n{{ format_tool_message(messages, msg) }}\n {%- set tool_ids_seen.value = tool_ids_seen.value + [msg.tool_call_id] %}\n {%- else %}\n {%- break %}\n {%- endif %}\n {%- endfor %}\n\n]<|END_TOOL_RESULT|><|END_OF_TURN_TOKEN|>\n {%- endif %}\n{%- endfor %}<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>\n{%- else -%}\n{% if messages[0]['role'] == 'system' %}{% set loop_messages = messages[1:] %}\n {%- set system_message = messages[0]['content'] %}{% elif false == true %}\n {%- set loop_messages = messages %}{% set system_message = '' %}\n{%- else %}\n {%- set loop_messages = messages %}\n {%- set system_message = false %}\n{%- endif %}\n{%- if system_message != false -%}\n {{ '<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>' + system_message + '<|END_OF_TURN_TOKEN|>' }}\n{%- else -%}\n {{ '<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|><|END_OF_TURN_TOKEN|>' }}\n{%- endif %}\n{%- for message in loop_messages %}\n {%- if (message['role'] == 'user') != (loop.index0 % 2 == 0) -%}\n {{ raise_exception('Conversation roles must alternate user/assistant/user/assistant/...') }}\n {%- endif -%}\n {%- set content = message['content'] -%}\n {%- if message['role'] == 'user' -%}\n {{ '<|START_OF_TURN_TOKEN|><|USER_TOKEN|>' + content.strip() + '<|END_OF_TURN_TOKEN|>' }}\n {%- elif message['role'] == 'assistant' -%}\n {{ '<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|><|START_RESPONSE|>' + content.strip() + '<|END_RESPONSE|><|END_OF_TURN_TOKEN|>' }}\n {%- endif %}\n{%- endfor %}\n{%- if add_generation_prompt -%}\n {{ '<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|><|START_RESPONSE|>' }}\n{%- endif %}\n{% endif %}" + }, + { + "name": "tool_use", + "template": "{%- macro document_turn(documents) -%}\n{# format documents into chat turn #}\n<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|><|START_THINKING|>I will look through the document to address the users needs.<|END_THINKING|><|START_ACTION|>[\n {\"tool_call_id\": \"0\", \"tool_name\": \"direct-injected-document\", \"parameters\": {}}\n]<|END_ACTION|><|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|><|START_TOOL_RESULT|>[\n {\n \"tool_call_id\": \"0\",\n \"results\": {\n{% for doc in documents %}\n \"{{ loop.index0 }}\": {{doc|tojson}}{% if not loop.last %},\n {% endif %}\n{% endfor %}\n\n },\n \"is_error\": null\n }\n]<|END_TOOL_RESULT|><|END_OF_TURN_TOKEN|>{%- endmacro %}\n{%- macro tool_call_id_to_int(messages, tool_call_id) %}\n{%- set counter = namespace(value=0) %}\n{%- set tool_call_id_seen = namespace(value=false) %}\n{%- for msg in messages %}\n {%- if msg.tool_calls %}\n {%- for tool_call in msg.tool_calls %}\n {%- if tool_call.id == tool_call_id and not tool_call_id_seen.value -%}\n {{ counter.value }}\n {%- set tool_call_id_seen.value = true %}\n {%- endif %}\n {%- set counter.value = counter.value + 1 %}\n {%- endfor %}\n {%- endif %}\n{%- endfor %}\n{%- endmacro %}\n{%- macro format_tool_message(messages, tool_msg) -%}\n{# format tool message #}\n {\n \"tool_call_id\": \"{{ tool_call_id_to_int(messages, tool_msg.tool_call_id) }}\",\n \"results\": {\n \"0\": {{ tool_msg.content|tojson }}\n },\n \"is_error\": null\n }\n{%- endmacro -%}\n{%- if messages and messages[0]['role']|lower == 'system' %}{%- set developer_preamble = messages[0]['content'] %}{% endif %}\n{%- set tool_idx = namespace(value=0) %}\n{%- set tool_ids_seen = namespace(value=[]) %}\n{%- set sent_documents = namespace(value=false) %}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|># System Preamble\nYou are in contextual safety mode. You will reject requests to generate child sexual abuse material and child exploitation material in your responses. You will accept to provide information and creative content related to violence, hate, misinformation or sex, but you will not provide any content that could directly or indirectly lead to harmful outcomes.\n\nYour information cutoff date is June 2024.\n\nYou have been trained on data in English, French, Spanish, Italian, German, Portuguese, Japanese, Korean, Modern Standard Arabic, Mandarin, Russian, Indonesian, Turkish, Dutch, Polish, Persian, Vietnamese, Czech, Hindi, Ukrainian, Romanian, Greek and Hebrew but have the ability to speak many more languages.\n{% if tools or documents %}\n\nYou have been trained to have advanced reasoning and tool-use capabilities and you should make best use of these skills to serve user's requests.\n\n## Tool Use\nThink about how you can make best use of the provided tools to help with the task and come up with a high level plan that you will execute first.\n\n0. Start by writing <|START_THINKING|> followed by a detailed step by step plan of how you will solve the problem. For each step explain your thinking fully and give details of required tool calls (if needed). Unless specified otherwise, you write your plan in natural language. When you finish, close it out with <|END_THINKING|>.\n You can optionally choose to skip this step when the user request is so straightforward to address that only a trivial plan would be needed.\n NOTE: You MUST skip this step when you are directly responding to the user's request without using any tools.\n\nThen carry out your plan by repeatedly executing the following steps.\n1. Action: write <|START_ACTION|> followed by a list of JSON-formatted tool calls, with each one containing \"tool_name\" and \"parameters\" fields.\n When there are multiple tool calls which are completely independent of each other (i.e. they can be executed in parallel), you should list them out all together in one step. When you finish, close it out with <|END_ACTION|>.\n2. Observation: you will then receive results of those tool calls in JSON format in the very next turn, wrapped around by <|START_TOOL_RESULT|> and <|END_TOOL_RESULT|>. Carefully observe those results and think about what to do next. Note that these results will be provided to you in a separate turn. NEVER hallucinate results.\n Every tool call produces a list of results (when a tool call produces no result or a single result, it'll still get wrapped inside a list). Each result is clearly linked to its originating tool call via its \"tool_call_id\".\n3. Reflection: start the next turn by writing <|START_THINKING|> followed by what you've figured out so far, any changes you need to make to your plan, and what you will do next. When you finish, close it out with <|END_THINKING|>.\n You can optionally choose to skip this step when everything is going according to plan and no special pieces of information or reasoning chains need to be recorded.\n NOTE: You MUST skip this step when you are done with tool-use actions and are ready to respond to the user.\n\nYou can repeat the above 3 steps multiple times (could be 0 times too if no suitable tool calls are available or needed), until you decide it's time to finally respond to the user.\n\n4. Response: then break out of the loop and write <|START_RESPONSE|> followed by a piece of text which serves as a response to the user's last request. Use all previous tool calls and results to help you when formulating your response. When you finish, close it out with <|END_RESPONSE|>.\n{% if enable_citations %}\n\n## Grounding\nImportantly, note that \"Reflection\" and \"Response\" above can be grounded.\nGrounding means you associate pieces of texts (called \"spans\") with those specific tool results that support them (called \"sources\"). And you use a pair of tags \"\" and \"\" to indicate when a span can be grounded onto a list of sources, listing them out in the closing tag. Sources from the same tool call are grouped together and listed as \"{tool_call_id}:[{list of result indices}]\", before they are joined together by \",\". E.g., \"span\" means that \"span\" is supported by result 1 and 2 from \"tool_call_id=0\" as well as result 0 from \"tool_call_id=1\".\n{% endif %}\n\n## Available Tools\nHere is the list of tools that you have available to you.\nYou can ONLY use the tools listed here. When a tool is not listed below, it is NOT available and you should NEVER attempt to use it.\nEach tool is represented as a JSON object with fields like \"name\", \"description\", \"parameters\" (per JSON Schema), and optionally, \"responses\" (per JSON Schema).\n\n```json\n[\n{% if documents %}\n {\"name\": \"direct-injected-document\", \"description\": \"This is a special tool to directly inject user-uploaded documents into the chat as additional context. DO NOT use this tool by yourself!\", \"parameters\": {\"type\": \"object\", \"properties\": {}, \"required\": []}, \"responses\": {\"200\": {\"description\": \"Successfully returned a list of chunked text snippets from the directly uploaded documents.\", \"content\": {\"application/json\": {\"schema\": {\"type\": \"array\", \"items\": {\"type\": \"object\", \"required\": [\"url\", \"snippet\"], \"properties\": {\"url\": {\"type\": \"string\", \"description\": \"The url of the uploaded document.\"}, \"snippet\": {\"type\": \"string\", \"description\": \"The text snippet for the returned document chunk.\"}}}}}}}}}{%- if tools %},{% endif %}\n\n{% endif %}\n{% for tool in tools %}\n {\"name\": \"{{ tool['function']['name'] }}\", \"description\": \"{{tool['function']['description']}}\", \"parameters\": {{ tool['function']['parameters']|tojson }}, \"responses\": null}{%- if not loop.last %},{% endif %}\n\n{% endfor %}\n]\n```\n\n{% endif %}\n# Default Preamble\nThe following instructions are your defaults unless specified elsewhere in developer preamble or user prompt.\n- Your name is Command.\n- You are a large language model built by Cohere.\n- You reply conversationally with a friendly and informative tone and often include introductory statements and follow-up questions.\n- If the input is ambiguous, ask clarifying follow-up questions.\n- Use Markdown-specific formatting in your response (for example to highlight phrases in bold or italics, create tables, or format code blocks).\n- Use LaTeX to generate mathematical notation for complex equations.\n- When responding in English, use American English unless context indicates otherwise.\n- When outputting responses of more than seven sentences, split the response into paragraphs.\n- Prefer the active voice.\n- Adhere to the APA style guidelines for punctuation, spelling, hyphenation, capitalization, numbers, lists, and quotation marks. Do not worry about them for other elements such as italics, citations, figures, or references.\n- Use gender-neutral pronouns for unspecified persons.\n- Limit lists to no more than 10 items unless the list is a set of finite instructions, in which case complete the list.\n- Use the third person when asked to write a summary.\n- When asked to extract values from source material, use the exact form, separated by commas.\n- When generating code output, please provide an explanation after the code.\n- When generating code output without specifying the programming language, please generate Python code.\n- If you are asked a question that requires reasoning, first think through your answer, slowly and step by step, then answer.\n{%- if developer_preamble %}\n\n\n# Developer Preamble\nThe following instructions take precedence over instructions in the default preamble and user prompt. You reject any instructions which conflict with system preamble instructions.\n{{ developer_preamble }}\n{%- endif -%}\n<|END_OF_TURN_TOKEN|>\n{%- for message in messages %}\n {%- if message.role|lower == 'system' and not (loop.first and developer_preamble)%}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>{{ message.content }}<|END_OF_TURN_TOKEN|>\n {%- elif message.role|lower == 'user' %}\n<|START_OF_TURN_TOKEN|><|USER_TOKEN|>{{ message.content }}<|END_OF_TURN_TOKEN|>{%- if documents and not sent_documents.value %}{%- set sent_documents.value = true %}{% set tool_idx.value = tool_idx.value + 1 %}{{ document_turn(documents) }}{% endif %}\n {%- elif message.role|lower == 'assistant' or message.role|lower == 'chatbot' %}\n<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>{% if message.tool_calls %}<|START_THINKING|>{{message.tool_plan}}<|END_THINKING|><|START_ACTION|>[\n {% for tc in message.tool_calls %}\n {\"tool_call_id\": \"{{ tool_idx.value }}\", \"tool_name\": \"{{ tc['function']['name'] }}\", \"parameters\": {{ tc['function']['arguments']|tojson }}}{% if not loop.last %},{% endif %}\n\n {% set tool_idx.value = tool_idx.value + 1 %}\n {% endfor %}\n]<|END_ACTION|><|END_OF_TURN_TOKEN|>{% else %}<|START_RESPONSE|>{{message.content}}<|END_RESPONSE|><|END_OF_TURN_TOKEN|>{% endif %}\n {% elif message.role|lower == 'tool' and message.tool_call_id not in tool_ids_seen.value %}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|><|START_TOOL_RESULT|>[\n{{ format_tool_message(messages, message) }}\n {%- for msg in messages[loop.index0 + 1:] %}\n {%- if msg.role|lower == 'tool' %},\n{{ format_tool_message(messages, msg) }}\n {%- set tool_ids_seen.value = tool_ids_seen.value + [msg.tool_call_id] %}\n {%- else %}\n {%- break %}\n {%- endif %}\n {%- endfor %}\n\n]<|END_TOOL_RESULT|><|END_OF_TURN_TOKEN|>\n {%- endif %}\n{%- endfor %}<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>" + }, + { + "name": "rag", + "template": "{% set tools = [] %}\n{%- macro document_turn(documents) -%}\n{# format documents into chat turn #}\n<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|><|START_THINKING|>I will look through the document to address the users needs.<|END_THINKING|><|START_ACTION|>[\n {\"tool_call_id\": \"0\", \"tool_name\": \"direct-injected-document\", \"parameters\": {}}\n]<|END_ACTION|><|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|><|START_TOOL_RESULT|>[\n {\n \"tool_call_id\": \"0\",\n \"results\": {\n{% for doc in documents %}\n \"{{ loop.index0 }}\": {{doc|tojson}}{% if not loop.last %},\n {% endif %}\n{% endfor %}\n\n },\n \"is_error\": null\n }\n]<|END_TOOL_RESULT|><|END_OF_TURN_TOKEN|>{%- endmacro %}\n{%- macro tool_call_id_to_int(messages, tool_call_id) %}\n{%- set counter = namespace(value=0) %}\n{%- set tool_call_id_seen = namespace(value=false) %}\n{%- for msg in messages %}\n {%- if msg.tool_calls %}\n {%- for tool_call in msg.tool_calls %}\n {%- if tool_call.id == tool_call_id and not tool_call_id_seen.value -%}\n {{ counter.value }}\n {%- set tool_call_id_seen.value = true %}\n {%- endif %}\n {%- set counter.value = counter.value + 1 %}\n {%- endfor %}\n {%- endif %}\n{%- endfor %}\n{%- endmacro %}\n{%- macro format_tool_message(messages, tool_msg) -%}\n{# format tool message #}\n {\n \"tool_call_id\": \"{{ tool_call_id_to_int(messages, tool_msg.tool_call_id) }}\",\n \"results\": {\n \"0\": {{ tool_msg.content|tojson }}\n },\n \"is_error\": null\n }\n{%- endmacro -%}\n{%- if messages and messages[0]['role']|lower == 'system' %}{%- set developer_preamble = messages[0]['content'] %}{% endif %}\n{%- set tool_idx = namespace(value=0) %}\n{%- set tool_ids_seen = namespace(value=[]) %}\n{%- set sent_documents = namespace(value=false) %}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|># System Preamble\nYou are in contextual safety mode. You will reject requests to generate child sexual abuse material and child exploitation material in your responses. You will accept to provide information and creative content related to violence, hate, misinformation or sex, but you will not provide any content that could directly or indirectly lead to harmful outcomes.\n\nYour information cutoff date is June 2024.\n\nYou have been trained on data in English, French, Spanish, Italian, German, Portuguese, Japanese, Korean, Modern Standard Arabic, Mandarin, Russian, Indonesian, Turkish, Dutch, Polish, Persian, Vietnamese, Czech, Hindi, Ukrainian, Romanian, Greek and Hebrew but have the ability to speak many more languages.\n{% if tools or documents %}\n\nYou have been trained to have advanced reasoning and tool-use capabilities and you should make best use of these skills to serve user's requests.\n\n## Tool Use\nThink about how you can make best use of the provided tools to help with the task and come up with a high level plan that you will execute first.\n\n0. Start by writing <|START_THINKING|> followed by a detailed step by step plan of how you will solve the problem. For each step explain your thinking fully and give details of required tool calls (if needed). Unless specified otherwise, you write your plan in natural language. When you finish, close it out with <|END_THINKING|>.\n You can optionally choose to skip this step when the user request is so straightforward to address that only a trivial plan would be needed.\n NOTE: You MUST skip this step when you are directly responding to the user's request without using any tools.\n\nThen carry out your plan by repeatedly executing the following steps.\n1. Action: write <|START_ACTION|> followed by a list of JSON-formatted tool calls, with each one containing \"tool_name\" and \"parameters\" fields.\n When there are multiple tool calls which are completely independent of each other (i.e. they can be executed in parallel), you should list them out all together in one step. When you finish, close it out with <|END_ACTION|>.\n2. Observation: you will then receive results of those tool calls in JSON format in the very next turn, wrapped around by <|START_TOOL_RESULT|> and <|END_TOOL_RESULT|>. Carefully observe those results and think about what to do next. Note that these results will be provided to you in a separate turn. NEVER hallucinate results.\n Every tool call produces a list of results (when a tool call produces no result or a single result, it'll still get wrapped inside a list). Each result is clearly linked to its originating tool call via its \"tool_call_id\".\n3. Reflection: start the next turn by writing <|START_THINKING|> followed by what you've figured out so far, any changes you need to make to your plan, and what you will do next. When you finish, close it out with <|END_THINKING|>.\n You can optionally choose to skip this step when everything is going according to plan and no special pieces of information or reasoning chains need to be recorded.\n NOTE: You MUST skip this step when you are done with tool-use actions and are ready to respond to the user.\n\nYou can repeat the above 3 steps multiple times (could be 0 times too if no suitable tool calls are available or needed), until you decide it's time to finally respond to the user.\n\n4. Response: then break out of the loop and write <|START_RESPONSE|> followed by a piece of text which serves as a response to the user's last request. Use all previous tool calls and results to help you when formulating your response. When you finish, close it out with <|END_RESPONSE|>.\n{% if enable_citations %}\n\n## Grounding\nImportantly, note that \"Reflection\" and \"Response\" above can be grounded.\nGrounding means you associate pieces of texts (called \"spans\") with those specific tool results that support them (called \"sources\"). And you use a pair of tags \"\" and \"\" to indicate when a span can be grounded onto a list of sources, listing them out in the closing tag. Sources from the same tool call are grouped together and listed as \"{tool_call_id}:[{list of result indices}]\", before they are joined together by \",\". E.g., \"span\" means that \"span\" is supported by result 1 and 2 from \"tool_call_id=0\" as well as result 0 from \"tool_call_id=1\".\n{% endif %}\n\n## Available Tools\nHere is the list of tools that you have available to you.\nYou can ONLY use the tools listed here. When a tool is not listed below, it is NOT available and you should NEVER attempt to use it.\nEach tool is represented as a JSON object with fields like \"name\", \"description\", \"parameters\" (per JSON Schema), and optionally, \"responses\" (per JSON Schema).\n\n```json\n[\n{% if documents %}\n {\"name\": \"direct-injected-document\", \"description\": \"This is a special tool to directly inject user-uploaded documents into the chat as additional context. DO NOT use this tool by yourself!\", \"parameters\": {\"type\": \"object\", \"properties\": {}, \"required\": []}, \"responses\": {\"200\": {\"description\": \"Successfully returned a list of chunked text snippets from the directly uploaded documents.\", \"content\": {\"application/json\": {\"schema\": {\"type\": \"array\", \"items\": {\"type\": \"object\", \"required\": [\"url\", \"snippet\"], \"properties\": {\"url\": {\"type\": \"string\", \"description\": \"The url of the uploaded document.\"}, \"snippet\": {\"type\": \"string\", \"description\": \"The text snippet for the returned document chunk.\"}}}}}}}}}{%- if tools %},{% endif %}\n\n{% endif %}\n{% for tool in tools %}\n {\"name\": \"{{ tool['function']['name'] }}\", \"description\": \"{{tool['function']['description']}}\", \"parameters\": {{ tool['function']['parameters']|tojson }}, \"responses\": null}{%- if not loop.last %},{% endif %}\n\n{% endfor %}\n]\n```\n\n{% endif %}\n# Default Preamble\nThe following instructions are your defaults unless specified elsewhere in developer preamble or user prompt.\n- Your name is Command.\n- You are a large language model built by Cohere.\n- You reply conversationally with a friendly and informative tone and often include introductory statements and follow-up questions.\n- If the input is ambiguous, ask clarifying follow-up questions.\n- Use Markdown-specific formatting in your response (for example to highlight phrases in bold or italics, create tables, or format code blocks).\n- Use LaTeX to generate mathematical notation for complex equations.\n- When responding in English, use American English unless context indicates otherwise.\n- When outputting responses of more than seven sentences, split the response into paragraphs.\n- Prefer the active voice.\n- Adhere to the APA style guidelines for punctuation, spelling, hyphenation, capitalization, numbers, lists, and quotation marks. Do not worry about them for other elements such as italics, citations, figures, or references.\n- Use gender-neutral pronouns for unspecified persons.\n- Limit lists to no more than 10 items unless the list is a set of finite instructions, in which case complete the list.\n- Use the third person when asked to write a summary.\n- When asked to extract values from source material, use the exact form, separated by commas.\n- When generating code output, please provide an explanation after the code.\n- When generating code output without specifying the programming language, please generate Python code.\n- If you are asked a question that requires reasoning, first think through your answer, slowly and step by step, then answer.\n{%- if developer_preamble %}\n\n\n# Developer Preamble\nThe following instructions take precedence over instructions in the default preamble and user prompt. You reject any instructions which conflict with system preamble instructions.\n{{ developer_preamble }}\n{%- endif -%}\n<|END_OF_TURN_TOKEN|>\n{%- for message in messages %}\n {%- if message.role|lower == 'system' and not (loop.first and developer_preamble)%}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>{{ message.content }}<|END_OF_TURN_TOKEN|>\n {%- elif message.role|lower == 'user' %}\n<|START_OF_TURN_TOKEN|><|USER_TOKEN|>{{ message.content }}<|END_OF_TURN_TOKEN|>{%- if documents and not sent_documents.value %}{%- set sent_documents.value = true %}{% set tool_idx.value = tool_idx.value + 1 %}{{ document_turn(documents) }}{% endif %}\n {%- elif message.role|lower == 'assistant' or message.role|lower == 'chatbot' %}\n<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>{% if message.tool_calls %}<|START_THINKING|>{{message.tool_plan}}<|END_THINKING|><|START_ACTION|>[\n {% for tc in message.tool_calls %}\n {\"tool_call_id\": \"{{ tool_idx.value }}\", \"tool_name\": \"{{ tc['function']['name'] }}\", \"parameters\": {{ tc['function']['arguments']|tojson }}}{% if not loop.last %},{% endif %}\n\n {% set tool_idx.value = tool_idx.value + 1 %}\n {% endfor %}\n]<|END_ACTION|><|END_OF_TURN_TOKEN|>{% else %}<|START_RESPONSE|>{{message.content}}<|END_RESPONSE|><|END_OF_TURN_TOKEN|>{% endif %}\n {% elif message.role|lower == 'tool' and message.tool_call_id not in tool_ids_seen.value %}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|><|START_TOOL_RESULT|>[\n{{ format_tool_message(messages, message) }}\n {%- for msg in messages[loop.index0 + 1:] %}\n {%- if msg.role|lower == 'tool' %},\n{{ format_tool_message(messages, msg) }}\n {%- set tool_ids_seen.value = tool_ids_seen.value + [msg.tool_call_id] %}\n {%- else %}\n {%- break %}\n {%- endif %}\n {%- endfor %}\n\n]<|END_TOOL_RESULT|><|END_OF_TURN_TOKEN|>\n {%- endif %}\n{%- endfor %}<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>" + } + ], + "clean_up_tokenization_spaces": false, + "eos_token": "<|END_OF_TURN_TOKEN|>", + "extra_special_tokens": {}, + "legacy": true, + "merges_file": null, + "model_max_length": 8192, + "pad_token": "", + "padding_side": "right", + "sp_model_kwargs": {}, + "spaces_between_special_tokens": false, + "tokenizer_class": "CohereTokenizer", + "unk_token": "", + "use_default_system_prompt": false, + "vocab_file": null +} diff --git a/checkpoint-1080/trainer_state.json b/checkpoint-1080/trainer_state.json new file mode 100644 index 0000000000000000000000000000000000000000..85a1d91a94a25bc7937430aa31ea5ee1cdb77ed0 --- /dev/null +++ b/checkpoint-1080/trainer_state.json @@ -0,0 +1,3869 @@ +{ + "best_metric": null, + "best_model_checkpoint": null, + "epoch": 0.375456283678081, + "eval_steps": 150, + "global_step": 1080, + "is_hyper_param_search": false, + "is_local_process_zero": true, + "is_world_process_zero": true, + "log_history": [ + { + "epoch": 0.0006952894142186686, + "grad_norm": 5.413117383066536, + "learning_rate": 6.944444444444445e-07, + "loss": 2.3653, + "step": 2 + }, + { + "epoch": 0.0013905788284373371, + "grad_norm": 5.092870612337868, + "learning_rate": 1.388888888888889e-06, + "loss": 2.5001, + "step": 4 + }, + { + "epoch": 0.0020858682426560054, + "grad_norm": 3.6285625961711943, + "learning_rate": 2.0833333333333334e-06, + "loss": 2.3759, + "step": 6 + }, + { + "epoch": 0.0027811576568746743, + "grad_norm": 2.5025911526151075, + "learning_rate": 2.777777777777778e-06, + "loss": 1.944, + "step": 8 + }, + { + "epoch": 0.0034764470710933427, + "grad_norm": 3.077266049542496, + "learning_rate": 3.4722222222222224e-06, + "loss": 2.2504, + "step": 10 + }, + { + "epoch": 0.004171736485312011, + "grad_norm": 4.068243939187174, + "learning_rate": 4.166666666666667e-06, + "loss": 2.0637, + "step": 12 + }, + { + "epoch": 0.00486702589953068, + "grad_norm": 3.511444738830971, + "learning_rate": 4.861111111111111e-06, + "loss": 2.3604, + "step": 14 + }, + { + "epoch": 0.0055623153137493485, + "grad_norm": 5.925744892256934, + "learning_rate": 5.555555555555556e-06, + "loss": 2.6528, + "step": 16 + }, + { + "epoch": 0.0062576047279680165, + "grad_norm": 2.7950114871483405, + "learning_rate": 6.25e-06, + "loss": 2.3229, + "step": 18 + }, + { + "epoch": 0.006952894142186685, + "grad_norm": 6.586211843766182, + "learning_rate": 6.944444444444445e-06, + "loss": 2.342, + "step": 20 + }, + { + "epoch": 0.0076481835564053535, + "grad_norm": 4.902839955269193, + "learning_rate": 7.63888888888889e-06, + "loss": 2.4188, + "step": 22 + }, + { + "epoch": 0.008343472970624021, + "grad_norm": 4.257062809771645, + "learning_rate": 8.333333333333334e-06, + "loss": 1.7957, + "step": 24 + }, + { + "epoch": 0.009038762384842691, + "grad_norm": 4.460352004615699, + "learning_rate": 9.027777777777777e-06, + "loss": 2.0726, + "step": 26 + }, + { + "epoch": 0.00973405179906136, + "grad_norm": 5.858061506133739, + "learning_rate": 9.722222222222223e-06, + "loss": 2.0455, + "step": 28 + }, + { + "epoch": 0.010429341213280027, + "grad_norm": 4.331946668100709, + "learning_rate": 1.0416666666666668e-05, + "loss": 1.7645, + "step": 30 + }, + { + "epoch": 0.011124630627498697, + "grad_norm": 5.428742204187391, + "learning_rate": 1.1111111111111112e-05, + "loss": 1.7446, + "step": 32 + }, + { + "epoch": 0.011819920041717365, + "grad_norm": 2.485909286541028, + "learning_rate": 1.1805555555555555e-05, + "loss": 1.5885, + "step": 34 + }, + { + "epoch": 0.012515209455936033, + "grad_norm": 3.2602949308730222, + "learning_rate": 1.25e-05, + "loss": 1.1014, + "step": 36 + }, + { + "epoch": 0.013210498870154701, + "grad_norm": 4.962187747415964, + "learning_rate": 1.3194444444444446e-05, + "loss": 1.3588, + "step": 38 + }, + { + "epoch": 0.01390578828437337, + "grad_norm": 7.627756894198461, + "learning_rate": 1.388888888888889e-05, + "loss": 1.4014, + "step": 40 + }, + { + "epoch": 0.014601077698592039, + "grad_norm": 2.821848388410092, + "learning_rate": 1.4583333333333335e-05, + "loss": 1.0959, + "step": 42 + }, + { + "epoch": 0.015296367112810707, + "grad_norm": 10.989320944549025, + "learning_rate": 1.527777777777778e-05, + "loss": 1.739, + "step": 44 + }, + { + "epoch": 0.015991656527029375, + "grad_norm": 4.300936602591115, + "learning_rate": 1.597222222222222e-05, + "loss": 1.1078, + "step": 46 + }, + { + "epoch": 0.016686945941248043, + "grad_norm": 3.7539663261019856, + "learning_rate": 1.6666666666666667e-05, + "loss": 1.2701, + "step": 48 + }, + { + "epoch": 0.017382235355466714, + "grad_norm": 2.589248169352173, + "learning_rate": 1.736111111111111e-05, + "loss": 1.4452, + "step": 50 + }, + { + "epoch": 0.018077524769685382, + "grad_norm": 3.6679301322156177, + "learning_rate": 1.8055555555555555e-05, + "loss": 1.4243, + "step": 52 + }, + { + "epoch": 0.01877281418390405, + "grad_norm": 2.0885660923860074, + "learning_rate": 1.8750000000000002e-05, + "loss": 1.4453, + "step": 54 + }, + { + "epoch": 0.01946810359812272, + "grad_norm": 2.955353237610474, + "learning_rate": 1.9444444444444445e-05, + "loss": 1.5388, + "step": 56 + }, + { + "epoch": 0.020163393012341387, + "grad_norm": 3.0527006398487018, + "learning_rate": 2.013888888888889e-05, + "loss": 1.4043, + "step": 58 + }, + { + "epoch": 0.020858682426560055, + "grad_norm": 1.9862208864154767, + "learning_rate": 2.0833333333333336e-05, + "loss": 1.1007, + "step": 60 + }, + { + "epoch": 0.021553971840778723, + "grad_norm": 2.347361178472164, + "learning_rate": 2.152777777777778e-05, + "loss": 0.9291, + "step": 62 + }, + { + "epoch": 0.022249261254997394, + "grad_norm": 2.4812993223105995, + "learning_rate": 2.2222222222222223e-05, + "loss": 0.9592, + "step": 64 + }, + { + "epoch": 0.022944550669216062, + "grad_norm": 1.639333831845777, + "learning_rate": 2.2916666666666667e-05, + "loss": 1.0645, + "step": 66 + }, + { + "epoch": 0.02363984008343473, + "grad_norm": 2.92858351082494, + "learning_rate": 2.361111111111111e-05, + "loss": 1.4269, + "step": 68 + }, + { + "epoch": 0.024335129497653398, + "grad_norm": 2.8503434812871604, + "learning_rate": 2.4305555555555558e-05, + "loss": 0.7829, + "step": 70 + }, + { + "epoch": 0.025030418911872066, + "grad_norm": 2.4875590459354107, + "learning_rate": 2.5e-05, + "loss": 0.9733, + "step": 72 + }, + { + "epoch": 0.025725708326090734, + "grad_norm": 5.2567545525905075, + "learning_rate": 2.5694444444444445e-05, + "loss": 1.3559, + "step": 74 + }, + { + "epoch": 0.026420997740309402, + "grad_norm": 4.68745753567611, + "learning_rate": 2.6388888888888892e-05, + "loss": 1.1499, + "step": 76 + }, + { + "epoch": 0.027116287154528074, + "grad_norm": 2.810345453706711, + "learning_rate": 2.7083333333333332e-05, + "loss": 0.8636, + "step": 78 + }, + { + "epoch": 0.02781157656874674, + "grad_norm": 3.0144493626195388, + "learning_rate": 2.777777777777778e-05, + "loss": 0.9274, + "step": 80 + }, + { + "epoch": 0.02850686598296541, + "grad_norm": 2.3263036535508523, + "learning_rate": 2.8472222222222223e-05, + "loss": 1.3979, + "step": 82 + }, + { + "epoch": 0.029202155397184078, + "grad_norm": 1.6009019341419857, + "learning_rate": 2.916666666666667e-05, + "loss": 0.9039, + "step": 84 + }, + { + "epoch": 0.029897444811402746, + "grad_norm": 2.0637506891442294, + "learning_rate": 2.9861111111111113e-05, + "loss": 1.5187, + "step": 86 + }, + { + "epoch": 0.030592734225621414, + "grad_norm": 1.5533001268209932, + "learning_rate": 3.055555555555556e-05, + "loss": 0.8937, + "step": 88 + }, + { + "epoch": 0.03128802363984008, + "grad_norm": 1.9974857545819733, + "learning_rate": 3.125e-05, + "loss": 0.8218, + "step": 90 + }, + { + "epoch": 0.03198331305405875, + "grad_norm": 1.871899331408953, + "learning_rate": 3.194444444444444e-05, + "loss": 1.2451, + "step": 92 + }, + { + "epoch": 0.03267860246827742, + "grad_norm": 1.591601830348497, + "learning_rate": 3.263888888888889e-05, + "loss": 0.7485, + "step": 94 + }, + { + "epoch": 0.033373891882496086, + "grad_norm": 2.404166647711005, + "learning_rate": 3.3333333333333335e-05, + "loss": 1.1587, + "step": 96 + }, + { + "epoch": 0.03406918129671476, + "grad_norm": 1.581080788392888, + "learning_rate": 3.402777777777778e-05, + "loss": 0.9578, + "step": 98 + }, + { + "epoch": 0.03476447071093343, + "grad_norm": 2.1551207338771547, + "learning_rate": 3.472222222222222e-05, + "loss": 1.1305, + "step": 100 + }, + { + "epoch": 0.0354597601251521, + "grad_norm": 4.2246272812704, + "learning_rate": 3.541666666666667e-05, + "loss": 1.04, + "step": 102 + }, + { + "epoch": 0.036155049539370765, + "grad_norm": 2.5526898161765588, + "learning_rate": 3.611111111111111e-05, + "loss": 1.0743, + "step": 104 + }, + { + "epoch": 0.03685033895358943, + "grad_norm": 1.9784815137623597, + "learning_rate": 3.6805555555555556e-05, + "loss": 0.9667, + "step": 106 + }, + { + "epoch": 0.0375456283678081, + "grad_norm": 1.9131648200880944, + "learning_rate": 3.7500000000000003e-05, + "loss": 0.8951, + "step": 108 + }, + { + "epoch": 0.03824091778202677, + "grad_norm": 3.9405296351174575, + "learning_rate": 3.8194444444444444e-05, + "loss": 1.222, + "step": 110 + }, + { + "epoch": 0.03893620719624544, + "grad_norm": 13.764861545850291, + "learning_rate": 3.888888888888889e-05, + "loss": 1.0497, + "step": 112 + }, + { + "epoch": 0.039631496610464105, + "grad_norm": 3.998123122175411, + "learning_rate": 3.958333333333333e-05, + "loss": 1.0901, + "step": 114 + }, + { + "epoch": 0.04032678602468277, + "grad_norm": 3.126193921423756, + "learning_rate": 4.027777777777778e-05, + "loss": 1.1143, + "step": 116 + }, + { + "epoch": 0.04102207543890144, + "grad_norm": 2.7839926692610613, + "learning_rate": 4.0972222222222225e-05, + "loss": 1.1637, + "step": 118 + }, + { + "epoch": 0.04171736485312011, + "grad_norm": 2.591162621161276, + "learning_rate": 4.166666666666667e-05, + "loss": 1.0624, + "step": 120 + }, + { + "epoch": 0.04241265426733878, + "grad_norm": 1.4930703711545332, + "learning_rate": 4.236111111111111e-05, + "loss": 1.0239, + "step": 122 + }, + { + "epoch": 0.043107943681557445, + "grad_norm": 4.355150070532966, + "learning_rate": 4.305555555555556e-05, + "loss": 1.266, + "step": 124 + }, + { + "epoch": 0.04380323309577612, + "grad_norm": 1.8285608876277135, + "learning_rate": 4.375e-05, + "loss": 1.0667, + "step": 126 + }, + { + "epoch": 0.04449852250999479, + "grad_norm": 2.1848832742617055, + "learning_rate": 4.4444444444444447e-05, + "loss": 0.7549, + "step": 128 + }, + { + "epoch": 0.045193811924213456, + "grad_norm": 3.547857947451226, + "learning_rate": 4.5138888888888894e-05, + "loss": 0.7974, + "step": 130 + }, + { + "epoch": 0.045889101338432124, + "grad_norm": 3.372457028128184, + "learning_rate": 4.5833333333333334e-05, + "loss": 1.0482, + "step": 132 + }, + { + "epoch": 0.04658439075265079, + "grad_norm": 2.2871138548091703, + "learning_rate": 4.652777777777778e-05, + "loss": 0.8246, + "step": 134 + }, + { + "epoch": 0.04727968016686946, + "grad_norm": 1.7489408054743605, + "learning_rate": 4.722222222222222e-05, + "loss": 1.0011, + "step": 136 + }, + { + "epoch": 0.04797496958108813, + "grad_norm": 1.944650349232646, + "learning_rate": 4.791666666666667e-05, + "loss": 0.7828, + "step": 138 + }, + { + "epoch": 0.048670258995306796, + "grad_norm": 2.321619459307342, + "learning_rate": 4.8611111111111115e-05, + "loss": 1.02, + "step": 140 + }, + { + "epoch": 0.049365548409525464, + "grad_norm": 5.317732559595606, + "learning_rate": 4.930555555555556e-05, + "loss": 0.9539, + "step": 142 + }, + { + "epoch": 0.05006083782374413, + "grad_norm": 1.5887292172279854, + "learning_rate": 5e-05, + "loss": 0.7961, + "step": 144 + }, + { + "epoch": 0.0507561272379628, + "grad_norm": 2.9987019111854964, + "learning_rate": 5.069444444444444e-05, + "loss": 1.0018, + "step": 146 + }, + { + "epoch": 0.05145141665218147, + "grad_norm": 5.63878906132749, + "learning_rate": 5.138888888888889e-05, + "loss": 0.9278, + "step": 148 + }, + { + "epoch": 0.052146706066400136, + "grad_norm": 2.4849685204332834, + "learning_rate": 5.208333333333334e-05, + "loss": 0.7531, + "step": 150 + }, + { + "epoch": 0.052146706066400136, + "eval_loss": 0.9286500215530396, + "eval_runtime": 711.2619, + "eval_samples_per_second": 6.808, + "eval_steps_per_second": 0.214, + "step": 150 + }, + { + "epoch": 0.052841995480618804, + "grad_norm": 3.4927981580288776, + "learning_rate": 5.2777777777777784e-05, + "loss": 0.7422, + "step": 152 + }, + { + "epoch": 0.05353728489483748, + "grad_norm": 2.6593724943984682, + "learning_rate": 5.3472222222222224e-05, + "loss": 0.7762, + "step": 154 + }, + { + "epoch": 0.05423257430905615, + "grad_norm": 2.99709354088536, + "learning_rate": 5.4166666666666664e-05, + "loss": 0.8658, + "step": 156 + }, + { + "epoch": 0.054927863723274815, + "grad_norm": 3.9196361623391414, + "learning_rate": 5.486111111111112e-05, + "loss": 1.1783, + "step": 158 + }, + { + "epoch": 0.05562315313749348, + "grad_norm": 3.022562685608673, + "learning_rate": 5.555555555555556e-05, + "loss": 1.0602, + "step": 160 + }, + { + "epoch": 0.05631844255171215, + "grad_norm": 3.292942684053579, + "learning_rate": 5.6250000000000005e-05, + "loss": 0.8561, + "step": 162 + }, + { + "epoch": 0.05701373196593082, + "grad_norm": 2.397775023338686, + "learning_rate": 5.6944444444444445e-05, + "loss": 0.9561, + "step": 164 + }, + { + "epoch": 0.05770902138014949, + "grad_norm": 3.0546714312119643, + "learning_rate": 5.7638888888888886e-05, + "loss": 0.8274, + "step": 166 + }, + { + "epoch": 0.058404310794368156, + "grad_norm": 2.4021883380894393, + "learning_rate": 5.833333333333334e-05, + "loss": 0.8492, + "step": 168 + }, + { + "epoch": 0.059099600208586824, + "grad_norm": 2.6052829770116293, + "learning_rate": 5.902777777777778e-05, + "loss": 1.1005, + "step": 170 + }, + { + "epoch": 0.05979488962280549, + "grad_norm": 1.6838192892320467, + "learning_rate": 5.972222222222223e-05, + "loss": 1.0157, + "step": 172 + }, + { + "epoch": 0.06049017903702416, + "grad_norm": 3.98880214871885, + "learning_rate": 6.041666666666667e-05, + "loss": 0.8136, + "step": 174 + }, + { + "epoch": 0.06118546845124283, + "grad_norm": 4.81494345341073, + "learning_rate": 6.111111111111112e-05, + "loss": 0.9475, + "step": 176 + }, + { + "epoch": 0.061880757865461496, + "grad_norm": 1.9926278890091862, + "learning_rate": 6.180555555555556e-05, + "loss": 0.6549, + "step": 178 + }, + { + "epoch": 0.06257604727968016, + "grad_norm": 1.750353030728397, + "learning_rate": 6.25e-05, + "loss": 1.1442, + "step": 180 + }, + { + "epoch": 0.06327133669389884, + "grad_norm": 4.77249782692129, + "learning_rate": 6.319444444444444e-05, + "loss": 1.1927, + "step": 182 + }, + { + "epoch": 0.0639666261081175, + "grad_norm": 1.866901788617278, + "learning_rate": 6.388888888888888e-05, + "loss": 1.0032, + "step": 184 + }, + { + "epoch": 0.06466191552233617, + "grad_norm": 1.7495859751833545, + "learning_rate": 6.458333333333334e-05, + "loss": 0.8439, + "step": 186 + }, + { + "epoch": 0.06535720493655484, + "grad_norm": 2.971674018184174, + "learning_rate": 6.527777777777778e-05, + "loss": 0.9817, + "step": 188 + }, + { + "epoch": 0.06605249435077351, + "grad_norm": 2.3753292673540165, + "learning_rate": 6.597222222222223e-05, + "loss": 0.9919, + "step": 190 + }, + { + "epoch": 0.06674778376499217, + "grad_norm": 2.7019148741557744, + "learning_rate": 6.666666666666667e-05, + "loss": 1.1442, + "step": 192 + }, + { + "epoch": 0.06744307317921085, + "grad_norm": 1.8670113287712482, + "learning_rate": 6.736111111111112e-05, + "loss": 0.8905, + "step": 194 + }, + { + "epoch": 0.06813836259342952, + "grad_norm": 1.4199145680760579, + "learning_rate": 6.805555555555556e-05, + "loss": 0.7223, + "step": 196 + }, + { + "epoch": 0.06883365200764818, + "grad_norm": 3.894200902880186, + "learning_rate": 6.875e-05, + "loss": 0.9005, + "step": 198 + }, + { + "epoch": 0.06952894142186686, + "grad_norm": 3.2710376491241955, + "learning_rate": 6.944444444444444e-05, + "loss": 1.1605, + "step": 200 + }, + { + "epoch": 0.07022423083608552, + "grad_norm": 1.6459754670035065, + "learning_rate": 7.013888888888888e-05, + "loss": 0.8551, + "step": 202 + }, + { + "epoch": 0.0709195202503042, + "grad_norm": 4.361031640374508, + "learning_rate": 7.083333333333334e-05, + "loss": 0.7007, + "step": 204 + }, + { + "epoch": 0.07161480966452285, + "grad_norm": 3.573741549123141, + "learning_rate": 7.152777777777778e-05, + "loss": 1.1396, + "step": 206 + }, + { + "epoch": 0.07231009907874153, + "grad_norm": 3.296990311359108, + "learning_rate": 7.222222222222222e-05, + "loss": 0.8695, + "step": 208 + }, + { + "epoch": 0.07300538849296019, + "grad_norm": 6.769659823038884, + "learning_rate": 7.291666666666667e-05, + "loss": 1.0511, + "step": 210 + }, + { + "epoch": 0.07370067790717887, + "grad_norm": 1.6695233666860303, + "learning_rate": 7.361111111111111e-05, + "loss": 0.8174, + "step": 212 + }, + { + "epoch": 0.07439596732139753, + "grad_norm": 1.3543755216281146, + "learning_rate": 7.430555555555557e-05, + "loss": 0.7137, + "step": 214 + }, + { + "epoch": 0.0750912567356162, + "grad_norm": 4.861063813937456, + "learning_rate": 7.500000000000001e-05, + "loss": 1.0132, + "step": 216 + }, + { + "epoch": 0.07578654614983486, + "grad_norm": 5.715913176528681, + "learning_rate": 7.569444444444445e-05, + "loss": 1.1657, + "step": 218 + }, + { + "epoch": 0.07648183556405354, + "grad_norm": 4.0193839358302235, + "learning_rate": 7.638888888888889e-05, + "loss": 1.0547, + "step": 220 + }, + { + "epoch": 0.0771771249782722, + "grad_norm": 2.26849134517291, + "learning_rate": 7.708333333333334e-05, + "loss": 0.9073, + "step": 222 + }, + { + "epoch": 0.07787241439249087, + "grad_norm": 4.570943697810998, + "learning_rate": 7.777777777777778e-05, + "loss": 1.3726, + "step": 224 + }, + { + "epoch": 0.07856770380670955, + "grad_norm": 1.1942436910880105, + "learning_rate": 7.847222222222222e-05, + "loss": 0.8146, + "step": 226 + }, + { + "epoch": 0.07926299322092821, + "grad_norm": 2.111849588751211, + "learning_rate": 7.916666666666666e-05, + "loss": 1.1157, + "step": 228 + }, + { + "epoch": 0.07995828263514689, + "grad_norm": 1.0283088880069582, + "learning_rate": 7.986111111111112e-05, + "loss": 0.767, + "step": 230 + }, + { + "epoch": 0.08065357204936555, + "grad_norm": 1.2834055069208525, + "learning_rate": 8.055555555555556e-05, + "loss": 0.6625, + "step": 232 + }, + { + "epoch": 0.08134886146358422, + "grad_norm": 1.3772942873595098, + "learning_rate": 8.125000000000001e-05, + "loss": 0.8065, + "step": 234 + }, + { + "epoch": 0.08204415087780288, + "grad_norm": 1.5113456549735176, + "learning_rate": 8.194444444444445e-05, + "loss": 0.8606, + "step": 236 + }, + { + "epoch": 0.08273944029202156, + "grad_norm": 1.5765846352838255, + "learning_rate": 8.263888888888889e-05, + "loss": 0.8335, + "step": 238 + }, + { + "epoch": 0.08343472970624022, + "grad_norm": 2.4873462478329404, + "learning_rate": 8.333333333333334e-05, + "loss": 0.9705, + "step": 240 + }, + { + "epoch": 0.0841300191204589, + "grad_norm": 1.2369219925635513, + "learning_rate": 8.402777777777778e-05, + "loss": 0.6061, + "step": 242 + }, + { + "epoch": 0.08482530853467755, + "grad_norm": 2.542132212473201, + "learning_rate": 8.472222222222222e-05, + "loss": 0.9142, + "step": 244 + }, + { + "epoch": 0.08552059794889623, + "grad_norm": 2.0301734217803022, + "learning_rate": 8.541666666666666e-05, + "loss": 0.8997, + "step": 246 + }, + { + "epoch": 0.08621588736311489, + "grad_norm": 1.8605316982945626, + "learning_rate": 8.611111111111112e-05, + "loss": 1.005, + "step": 248 + }, + { + "epoch": 0.08691117677733357, + "grad_norm": 1.193555257951713, + "learning_rate": 8.680555555555556e-05, + "loss": 0.8617, + "step": 250 + }, + { + "epoch": 0.08760646619155224, + "grad_norm": 1.243815428863678, + "learning_rate": 8.75e-05, + "loss": 0.6261, + "step": 252 + }, + { + "epoch": 0.0883017556057709, + "grad_norm": 1.6487754861704442, + "learning_rate": 8.819444444444445e-05, + "loss": 0.9219, + "step": 254 + }, + { + "epoch": 0.08899704501998958, + "grad_norm": 1.1768410857322613, + "learning_rate": 8.888888888888889e-05, + "loss": 0.8563, + "step": 256 + }, + { + "epoch": 0.08969233443420824, + "grad_norm": 1.1155265191420587, + "learning_rate": 8.958333333333335e-05, + "loss": 0.998, + "step": 258 + }, + { + "epoch": 0.09038762384842691, + "grad_norm": 1.4432456616674065, + "learning_rate": 9.027777777777779e-05, + "loss": 0.8755, + "step": 260 + }, + { + "epoch": 0.09108291326264557, + "grad_norm": 1.6013486668654413, + "learning_rate": 9.097222222222223e-05, + "loss": 0.6998, + "step": 262 + }, + { + "epoch": 0.09177820267686425, + "grad_norm": 0.7869968770186737, + "learning_rate": 9.166666666666667e-05, + "loss": 0.7574, + "step": 264 + }, + { + "epoch": 0.09247349209108291, + "grad_norm": 2.1117903903864566, + "learning_rate": 9.236111111111112e-05, + "loss": 0.8436, + "step": 266 + }, + { + "epoch": 0.09316878150530158, + "grad_norm": 1.3582999584721895, + "learning_rate": 9.305555555555556e-05, + "loss": 0.8503, + "step": 268 + }, + { + "epoch": 0.09386407091952025, + "grad_norm": 1.5674581009005415, + "learning_rate": 9.375e-05, + "loss": 0.9561, + "step": 270 + }, + { + "epoch": 0.09455936033373892, + "grad_norm": 1.0274246934159952, + "learning_rate": 9.444444444444444e-05, + "loss": 0.7537, + "step": 272 + }, + { + "epoch": 0.09525464974795758, + "grad_norm": 0.9595343432519174, + "learning_rate": 9.513888888888888e-05, + "loss": 0.7855, + "step": 274 + }, + { + "epoch": 0.09594993916217626, + "grad_norm": 1.3313115114367815, + "learning_rate": 9.583333333333334e-05, + "loss": 0.7009, + "step": 276 + }, + { + "epoch": 0.09664522857639492, + "grad_norm": 1.4409463331317498, + "learning_rate": 9.652777777777779e-05, + "loss": 1.0332, + "step": 278 + }, + { + "epoch": 0.09734051799061359, + "grad_norm": 1.5445848213023137, + "learning_rate": 9.722222222222223e-05, + "loss": 0.7352, + "step": 280 + }, + { + "epoch": 0.09803580740483227, + "grad_norm": 1.855518620927316, + "learning_rate": 9.791666666666667e-05, + "loss": 0.7191, + "step": 282 + }, + { + "epoch": 0.09873109681905093, + "grad_norm": 1.4033396985161997, + "learning_rate": 9.861111111111112e-05, + "loss": 0.7886, + "step": 284 + }, + { + "epoch": 0.0994263862332696, + "grad_norm": 1.9951521438049904, + "learning_rate": 9.930555555555556e-05, + "loss": 0.902, + "step": 286 + }, + { + "epoch": 0.10012167564748826, + "grad_norm": 1.1360934228431687, + "learning_rate": 0.0001, + "loss": 0.8655, + "step": 288 + }, + { + "epoch": 0.10081696506170694, + "grad_norm": 1.1225735433900375, + "learning_rate": 0.00010069444444444445, + "loss": 0.6851, + "step": 290 + }, + { + "epoch": 0.1015122544759256, + "grad_norm": 0.770446891371583, + "learning_rate": 0.00010138888888888889, + "loss": 0.7775, + "step": 292 + }, + { + "epoch": 0.10220754389014428, + "grad_norm": 0.797064180835607, + "learning_rate": 0.00010208333333333333, + "loss": 0.6567, + "step": 294 + }, + { + "epoch": 0.10290283330436294, + "grad_norm": 0.9876188134326442, + "learning_rate": 0.00010277777777777778, + "loss": 0.7299, + "step": 296 + }, + { + "epoch": 0.10359812271858161, + "grad_norm": 0.799601623643537, + "learning_rate": 0.00010347222222222223, + "loss": 0.7891, + "step": 298 + }, + { + "epoch": 0.10429341213280027, + "grad_norm": 0.8791512281362982, + "learning_rate": 0.00010416666666666667, + "loss": 0.677, + "step": 300 + }, + { + "epoch": 0.10429341213280027, + "eval_loss": 0.6939894556999207, + "eval_runtime": 709.5268, + "eval_samples_per_second": 6.824, + "eval_steps_per_second": 0.214, + "step": 300 + }, + { + "epoch": 0.10498870154701895, + "grad_norm": 1.329564645811689, + "learning_rate": 0.00010486111111111113, + "loss": 0.7511, + "step": 302 + }, + { + "epoch": 0.10568399096123761, + "grad_norm": 0.7130415058241142, + "learning_rate": 0.00010555555555555557, + "loss": 0.709, + "step": 304 + }, + { + "epoch": 0.10637928037545628, + "grad_norm": 1.1294733411370705, + "learning_rate": 0.00010625000000000001, + "loss": 0.7781, + "step": 306 + }, + { + "epoch": 0.10707456978967496, + "grad_norm": 0.581727680778003, + "learning_rate": 0.00010694444444444445, + "loss": 0.6296, + "step": 308 + }, + { + "epoch": 0.10776985920389362, + "grad_norm": 0.9855391514311871, + "learning_rate": 0.00010763888888888889, + "loss": 0.7852, + "step": 310 + }, + { + "epoch": 0.1084651486181123, + "grad_norm": 0.5708379609857769, + "learning_rate": 0.00010833333333333333, + "loss": 0.6759, + "step": 312 + }, + { + "epoch": 0.10916043803233096, + "grad_norm": 0.7243330859752051, + "learning_rate": 0.00010902777777777777, + "loss": 0.6326, + "step": 314 + }, + { + "epoch": 0.10985572744654963, + "grad_norm": 1.3922163003264714, + "learning_rate": 0.00010972222222222224, + "loss": 0.5406, + "step": 316 + }, + { + "epoch": 0.11055101686076829, + "grad_norm": 2.604851740418153, + "learning_rate": 0.00011041666666666668, + "loss": 0.8013, + "step": 318 + }, + { + "epoch": 0.11124630627498697, + "grad_norm": 1.83511037983023, + "learning_rate": 0.00011111111111111112, + "loss": 0.8048, + "step": 320 + }, + { + "epoch": 0.11194159568920563, + "grad_norm": 1.6737764614655666, + "learning_rate": 0.00011180555555555556, + "loss": 0.6943, + "step": 322 + }, + { + "epoch": 0.1126368851034243, + "grad_norm": 1.077667781888673, + "learning_rate": 0.00011250000000000001, + "loss": 0.8054, + "step": 324 + }, + { + "epoch": 0.11333217451764296, + "grad_norm": 0.5597693838209001, + "learning_rate": 0.00011319444444444445, + "loss": 0.6251, + "step": 326 + }, + { + "epoch": 0.11402746393186164, + "grad_norm": 0.5636865078063477, + "learning_rate": 0.00011388888888888889, + "loss": 0.6832, + "step": 328 + }, + { + "epoch": 0.1147227533460803, + "grad_norm": 0.6445176566556912, + "learning_rate": 0.00011458333333333333, + "loss": 0.6661, + "step": 330 + }, + { + "epoch": 0.11541804276029898, + "grad_norm": 0.607532412895966, + "learning_rate": 0.00011527777777777777, + "loss": 0.7026, + "step": 332 + }, + { + "epoch": 0.11611333217451764, + "grad_norm": 1.0496949694240345, + "learning_rate": 0.00011597222222222224, + "loss": 0.6451, + "step": 334 + }, + { + "epoch": 0.11680862158873631, + "grad_norm": 0.9469233272179363, + "learning_rate": 0.00011666666666666668, + "loss": 0.6694, + "step": 336 + }, + { + "epoch": 0.11750391100295499, + "grad_norm": 1.3789882614528595, + "learning_rate": 0.00011736111111111112, + "loss": 0.7031, + "step": 338 + }, + { + "epoch": 0.11819920041717365, + "grad_norm": 1.2016589928587922, + "learning_rate": 0.00011805555555555556, + "loss": 0.6676, + "step": 340 + }, + { + "epoch": 0.11889448983139232, + "grad_norm": 1.3112845410865746, + "learning_rate": 0.00011875, + "loss": 0.7236, + "step": 342 + }, + { + "epoch": 0.11958977924561098, + "grad_norm": 0.6278789052805739, + "learning_rate": 0.00011944444444444445, + "loss": 0.6249, + "step": 344 + }, + { + "epoch": 0.12028506865982966, + "grad_norm": 0.5405148902553805, + "learning_rate": 0.0001201388888888889, + "loss": 0.6412, + "step": 346 + }, + { + "epoch": 0.12098035807404832, + "grad_norm": 1.6923616138961255, + "learning_rate": 0.00012083333333333333, + "loss": 0.7017, + "step": 348 + }, + { + "epoch": 0.121675647488267, + "grad_norm": 1.5994113095813072, + "learning_rate": 0.00012152777777777777, + "loss": 0.7075, + "step": 350 + }, + { + "epoch": 0.12237093690248566, + "grad_norm": 2.3083516502461783, + "learning_rate": 0.00012222222222222224, + "loss": 0.7755, + "step": 352 + }, + { + "epoch": 0.12306622631670433, + "grad_norm": 0.8769167165306447, + "learning_rate": 0.00012291666666666668, + "loss": 0.7428, + "step": 354 + }, + { + "epoch": 0.12376151573092299, + "grad_norm": 0.4456469638797518, + "learning_rate": 0.00012361111111111112, + "loss": 0.7002, + "step": 356 + }, + { + "epoch": 0.12445680514514167, + "grad_norm": 0.8199993647792723, + "learning_rate": 0.00012430555555555556, + "loss": 0.7222, + "step": 358 + }, + { + "epoch": 0.12515209455936033, + "grad_norm": 0.3741084955970339, + "learning_rate": 0.000125, + "loss": 0.6821, + "step": 360 + }, + { + "epoch": 0.125847383973579, + "grad_norm": 0.2972203241099783, + "learning_rate": 0.00012569444444444444, + "loss": 0.7083, + "step": 362 + }, + { + "epoch": 0.12654267338779768, + "grad_norm": 0.40651740632246575, + "learning_rate": 0.00012638888888888888, + "loss": 0.7144, + "step": 364 + }, + { + "epoch": 0.12723796280201635, + "grad_norm": 0.4388093199704831, + "learning_rate": 0.00012708333333333332, + "loss": 0.6863, + "step": 366 + }, + { + "epoch": 0.127933252216235, + "grad_norm": 0.45131267837810835, + "learning_rate": 0.00012777777777777776, + "loss": 0.6329, + "step": 368 + }, + { + "epoch": 0.12862854163045367, + "grad_norm": 0.3837830352665476, + "learning_rate": 0.00012847222222222223, + "loss": 0.6938, + "step": 370 + }, + { + "epoch": 0.12932383104467235, + "grad_norm": 0.6378624076702905, + "learning_rate": 0.00012916666666666667, + "loss": 0.6433, + "step": 372 + }, + { + "epoch": 0.13001912045889102, + "grad_norm": 0.41344403509072675, + "learning_rate": 0.0001298611111111111, + "loss": 0.6892, + "step": 374 + }, + { + "epoch": 0.13071440987310967, + "grad_norm": 1.3428471718098582, + "learning_rate": 0.00013055555555555555, + "loss": 0.7793, + "step": 376 + }, + { + "epoch": 0.13140969928732835, + "grad_norm": 0.6202275876483008, + "learning_rate": 0.00013125000000000002, + "loss": 0.6836, + "step": 378 + }, + { + "epoch": 0.13210498870154702, + "grad_norm": 0.774014383396004, + "learning_rate": 0.00013194444444444446, + "loss": 0.701, + "step": 380 + }, + { + "epoch": 0.1328002781157657, + "grad_norm": 1.0650744092292224, + "learning_rate": 0.0001326388888888889, + "loss": 0.6562, + "step": 382 + }, + { + "epoch": 0.13349556752998434, + "grad_norm": 0.5540168492927294, + "learning_rate": 0.00013333333333333334, + "loss": 0.6267, + "step": 384 + }, + { + "epoch": 0.13419085694420302, + "grad_norm": 0.6403086140920178, + "learning_rate": 0.00013402777777777778, + "loss": 0.6268, + "step": 386 + }, + { + "epoch": 0.1348861463584217, + "grad_norm": 0.9197218298114509, + "learning_rate": 0.00013472222222222225, + "loss": 0.7208, + "step": 388 + }, + { + "epoch": 0.13558143577264037, + "grad_norm": 0.4235387152144674, + "learning_rate": 0.0001354166666666667, + "loss": 0.6057, + "step": 390 + }, + { + "epoch": 0.13627672518685904, + "grad_norm": 0.425648636635043, + "learning_rate": 0.00013611111111111113, + "loss": 0.6387, + "step": 392 + }, + { + "epoch": 0.1369720146010777, + "grad_norm": 1.034952396366508, + "learning_rate": 0.00013680555555555557, + "loss": 0.7307, + "step": 394 + }, + { + "epoch": 0.13766730401529637, + "grad_norm": 0.8865505732510678, + "learning_rate": 0.0001375, + "loss": 0.6547, + "step": 396 + }, + { + "epoch": 0.13836259342951504, + "grad_norm": 0.6490094573088415, + "learning_rate": 0.00013819444444444445, + "loss": 0.6909, + "step": 398 + }, + { + "epoch": 0.13905788284373372, + "grad_norm": 0.8592713330921486, + "learning_rate": 0.0001388888888888889, + "loss": 0.6442, + "step": 400 + }, + { + "epoch": 0.13975317225795236, + "grad_norm": 1.0279375953862069, + "learning_rate": 0.00013958333333333333, + "loss": 0.6907, + "step": 402 + }, + { + "epoch": 0.14044846167217104, + "grad_norm": 0.6151057351983696, + "learning_rate": 0.00014027777777777777, + "loss": 0.697, + "step": 404 + }, + { + "epoch": 0.1411437510863897, + "grad_norm": 0.7417879717121144, + "learning_rate": 0.00014097222222222224, + "loss": 0.698, + "step": 406 + }, + { + "epoch": 0.1418390405006084, + "grad_norm": 0.5161453091859882, + "learning_rate": 0.00014166666666666668, + "loss": 0.6915, + "step": 408 + }, + { + "epoch": 0.14253432991482703, + "grad_norm": 0.5667521096080546, + "learning_rate": 0.00014236111111111112, + "loss": 0.6609, + "step": 410 + }, + { + "epoch": 0.1432296193290457, + "grad_norm": 0.7560317583703429, + "learning_rate": 0.00014305555555555556, + "loss": 0.6392, + "step": 412 + }, + { + "epoch": 0.14392490874326438, + "grad_norm": 0.5456303981546313, + "learning_rate": 0.00014375, + "loss": 0.7561, + "step": 414 + }, + { + "epoch": 0.14462019815748306, + "grad_norm": 0.4218469018151631, + "learning_rate": 0.00014444444444444444, + "loss": 0.675, + "step": 416 + }, + { + "epoch": 0.14531548757170173, + "grad_norm": 0.3790517974518404, + "learning_rate": 0.00014513888888888888, + "loss": 0.6697, + "step": 418 + }, + { + "epoch": 0.14601077698592038, + "grad_norm": 0.36495171567914964, + "learning_rate": 0.00014583333333333335, + "loss": 0.6467, + "step": 420 + }, + { + "epoch": 0.14670606640013906, + "grad_norm": 0.3793520501177419, + "learning_rate": 0.00014652777777777779, + "loss": 0.6234, + "step": 422 + }, + { + "epoch": 0.14740135581435773, + "grad_norm": 0.6214905371013544, + "learning_rate": 0.00014722222222222223, + "loss": 0.64, + "step": 424 + }, + { + "epoch": 0.1480966452285764, + "grad_norm": 0.4103438113660832, + "learning_rate": 0.0001479166666666667, + "loss": 0.6174, + "step": 426 + }, + { + "epoch": 0.14879193464279505, + "grad_norm": 0.5802311029669485, + "learning_rate": 0.00014861111111111113, + "loss": 0.6941, + "step": 428 + }, + { + "epoch": 0.14948722405701373, + "grad_norm": 0.4876572424583591, + "learning_rate": 0.00014930555555555557, + "loss": 0.6178, + "step": 430 + }, + { + "epoch": 0.1501825134712324, + "grad_norm": 0.6252220373472688, + "learning_rate": 0.00015000000000000001, + "loss": 0.692, + "step": 432 + }, + { + "epoch": 0.15087780288545108, + "grad_norm": 1.516758455176553, + "learning_rate": 0.00015069444444444445, + "loss": 0.6812, + "step": 434 + }, + { + "epoch": 0.15157309229966973, + "grad_norm": 0.48294685446689867, + "learning_rate": 0.0001513888888888889, + "loss": 0.7085, + "step": 436 + }, + { + "epoch": 0.1522683817138884, + "grad_norm": 0.414196721150167, + "learning_rate": 0.00015208333333333333, + "loss": 0.673, + "step": 438 + }, + { + "epoch": 0.15296367112810708, + "grad_norm": 0.7294881062503469, + "learning_rate": 0.00015277777777777777, + "loss": 0.6415, + "step": 440 + }, + { + "epoch": 0.15365896054232575, + "grad_norm": 0.4846932912054438, + "learning_rate": 0.00015347222222222224, + "loss": 0.6644, + "step": 442 + }, + { + "epoch": 0.1543542499565444, + "grad_norm": 0.6067400167426414, + "learning_rate": 0.00015416666666666668, + "loss": 0.6816, + "step": 444 + }, + { + "epoch": 0.15504953937076307, + "grad_norm": 0.5586278026791864, + "learning_rate": 0.00015486111111111112, + "loss": 0.6223, + "step": 446 + }, + { + "epoch": 0.15574482878498175, + "grad_norm": 0.3947236166856149, + "learning_rate": 0.00015555555555555556, + "loss": 0.7297, + "step": 448 + }, + { + "epoch": 0.15644011819920042, + "grad_norm": 0.371457756887947, + "learning_rate": 0.00015625, + "loss": 0.6099, + "step": 450 + }, + { + "epoch": 0.15644011819920042, + "eval_loss": 0.6634477376937866, + "eval_runtime": 706.8027, + "eval_samples_per_second": 6.851, + "eval_steps_per_second": 0.215, + "step": 450 + }, + { + "epoch": 0.1571354076134191, + "grad_norm": 0.4157928192338373, + "learning_rate": 0.00015694444444444444, + "loss": 0.7163, + "step": 452 + }, + { + "epoch": 0.15783069702763775, + "grad_norm": 0.6318513446857751, + "learning_rate": 0.00015763888888888888, + "loss": 0.658, + "step": 454 + }, + { + "epoch": 0.15852598644185642, + "grad_norm": 0.3188170086808347, + "learning_rate": 0.00015833333333333332, + "loss": 0.5966, + "step": 456 + }, + { + "epoch": 0.1592212758560751, + "grad_norm": 0.4873146052629784, + "learning_rate": 0.00015902777777777776, + "loss": 0.687, + "step": 458 + }, + { + "epoch": 0.15991656527029377, + "grad_norm": 0.3939618900754228, + "learning_rate": 0.00015972222222222223, + "loss": 0.6704, + "step": 460 + }, + { + "epoch": 0.16061185468451242, + "grad_norm": 0.43442241310529234, + "learning_rate": 0.00016041666666666667, + "loss": 0.6941, + "step": 462 + }, + { + "epoch": 0.1613071440987311, + "grad_norm": 0.5944395304786771, + "learning_rate": 0.0001611111111111111, + "loss": 0.5934, + "step": 464 + }, + { + "epoch": 0.16200243351294977, + "grad_norm": 0.6186667715273749, + "learning_rate": 0.00016180555555555555, + "loss": 0.6604, + "step": 466 + }, + { + "epoch": 0.16269772292716844, + "grad_norm": 0.8945416923537124, + "learning_rate": 0.00016250000000000002, + "loss": 0.6224, + "step": 468 + }, + { + "epoch": 0.1633930123413871, + "grad_norm": 1.0526200270890014, + "learning_rate": 0.00016319444444444446, + "loss": 0.616, + "step": 470 + }, + { + "epoch": 0.16408830175560576, + "grad_norm": 0.4575985966727194, + "learning_rate": 0.0001638888888888889, + "loss": 0.6591, + "step": 472 + }, + { + "epoch": 0.16478359116982444, + "grad_norm": 0.4499931204645402, + "learning_rate": 0.00016458333333333334, + "loss": 0.6644, + "step": 474 + }, + { + "epoch": 0.16547888058404311, + "grad_norm": 0.8365574384741885, + "learning_rate": 0.00016527777777777778, + "loss": 0.6503, + "step": 476 + }, + { + "epoch": 0.1661741699982618, + "grad_norm": 0.5265284650577726, + "learning_rate": 0.00016597222222222225, + "loss": 0.557, + "step": 478 + }, + { + "epoch": 0.16686945941248044, + "grad_norm": 0.6004742828917694, + "learning_rate": 0.0001666666666666667, + "loss": 0.696, + "step": 480 + }, + { + "epoch": 0.1675647488266991, + "grad_norm": 0.8653134209549845, + "learning_rate": 0.00016736111111111113, + "loss": 0.6544, + "step": 482 + }, + { + "epoch": 0.1682600382409178, + "grad_norm": 1.033230873418064, + "learning_rate": 0.00016805555555555557, + "loss": 0.641, + "step": 484 + }, + { + "epoch": 0.16895532765513646, + "grad_norm": 0.45457193405665913, + "learning_rate": 0.00016875, + "loss": 0.5952, + "step": 486 + }, + { + "epoch": 0.1696506170693551, + "grad_norm": 0.7413902971651539, + "learning_rate": 0.00016944444444444445, + "loss": 0.6306, + "step": 488 + }, + { + "epoch": 0.17034590648357378, + "grad_norm": 0.5808764628223875, + "learning_rate": 0.0001701388888888889, + "loss": 0.6714, + "step": 490 + }, + { + "epoch": 0.17104119589779246, + "grad_norm": 0.42505370383777924, + "learning_rate": 0.00017083333333333333, + "loss": 0.6432, + "step": 492 + }, + { + "epoch": 0.17173648531201113, + "grad_norm": 0.9403542369255028, + "learning_rate": 0.00017152777777777777, + "loss": 0.626, + "step": 494 + }, + { + "epoch": 0.17243177472622978, + "grad_norm": 0.41714707593148775, + "learning_rate": 0.00017222222222222224, + "loss": 0.6132, + "step": 496 + }, + { + "epoch": 0.17312706414044846, + "grad_norm": 0.6660896849726371, + "learning_rate": 0.00017291666666666668, + "loss": 0.7009, + "step": 498 + }, + { + "epoch": 0.17382235355466713, + "grad_norm": 0.5079993412341118, + "learning_rate": 0.00017361111111111112, + "loss": 0.6808, + "step": 500 + }, + { + "epoch": 0.1745176429688858, + "grad_norm": 0.3426487947129772, + "learning_rate": 0.00017430555555555556, + "loss": 0.687, + "step": 502 + }, + { + "epoch": 0.17521293238310448, + "grad_norm": 0.7316051797581208, + "learning_rate": 0.000175, + "loss": 0.686, + "step": 504 + }, + { + "epoch": 0.17590822179732313, + "grad_norm": 0.4619785653282459, + "learning_rate": 0.00017569444444444444, + "loss": 0.7019, + "step": 506 + }, + { + "epoch": 0.1766035112115418, + "grad_norm": 0.47786977912472967, + "learning_rate": 0.0001763888888888889, + "loss": 0.7097, + "step": 508 + }, + { + "epoch": 0.17729880062576048, + "grad_norm": 0.4204398291864812, + "learning_rate": 0.00017708333333333335, + "loss": 0.6715, + "step": 510 + }, + { + "epoch": 0.17799409003997915, + "grad_norm": 0.5257761541709909, + "learning_rate": 0.00017777777777777779, + "loss": 0.6675, + "step": 512 + }, + { + "epoch": 0.1786893794541978, + "grad_norm": 0.5752239420884688, + "learning_rate": 0.00017847222222222225, + "loss": 0.5847, + "step": 514 + }, + { + "epoch": 0.17938466886841647, + "grad_norm": 0.5611432017880666, + "learning_rate": 0.0001791666666666667, + "loss": 0.5978, + "step": 516 + }, + { + "epoch": 0.18007995828263515, + "grad_norm": 0.5147097358785945, + "learning_rate": 0.00017986111111111113, + "loss": 0.641, + "step": 518 + }, + { + "epoch": 0.18077524769685382, + "grad_norm": 0.4387330962078066, + "learning_rate": 0.00018055555555555557, + "loss": 0.5771, + "step": 520 + }, + { + "epoch": 0.18147053711107247, + "grad_norm": 0.5712526440788663, + "learning_rate": 0.00018125000000000001, + "loss": 0.6212, + "step": 522 + }, + { + "epoch": 0.18216582652529115, + "grad_norm": 0.6357133907029916, + "learning_rate": 0.00018194444444444445, + "loss": 0.5981, + "step": 524 + }, + { + "epoch": 0.18286111593950982, + "grad_norm": 1.2129620643054042, + "learning_rate": 0.0001826388888888889, + "loss": 0.5848, + "step": 526 + }, + { + "epoch": 0.1835564053537285, + "grad_norm": 1.651599276688714, + "learning_rate": 0.00018333333333333334, + "loss": 0.7089, + "step": 528 + }, + { + "epoch": 0.18425169476794717, + "grad_norm": 0.9051688342434142, + "learning_rate": 0.00018402777777777778, + "loss": 0.7255, + "step": 530 + }, + { + "epoch": 0.18494698418216582, + "grad_norm": 0.6932441010863684, + "learning_rate": 0.00018472222222222224, + "loss": 0.6497, + "step": 532 + }, + { + "epoch": 0.1856422735963845, + "grad_norm": 1.2163006408955903, + "learning_rate": 0.00018541666666666668, + "loss": 0.7585, + "step": 534 + }, + { + "epoch": 0.18633756301060317, + "grad_norm": 0.4387074048377486, + "learning_rate": 0.00018611111111111112, + "loss": 0.6541, + "step": 536 + }, + { + "epoch": 0.18703285242482184, + "grad_norm": 0.49430581216479236, + "learning_rate": 0.00018680555555555556, + "loss": 0.6489, + "step": 538 + }, + { + "epoch": 0.1877281418390405, + "grad_norm": 0.47561442420926275, + "learning_rate": 0.0001875, + "loss": 0.6406, + "step": 540 + }, + { + "epoch": 0.18842343125325917, + "grad_norm": 0.7046092923664611, + "learning_rate": 0.00018819444444444444, + "loss": 0.6099, + "step": 542 + }, + { + "epoch": 0.18911872066747784, + "grad_norm": 0.46256136269201026, + "learning_rate": 0.00018888888888888888, + "loss": 0.6992, + "step": 544 + }, + { + "epoch": 0.18981401008169652, + "grad_norm": 0.5489877082982352, + "learning_rate": 0.00018958333333333332, + "loss": 0.5817, + "step": 546 + }, + { + "epoch": 0.19050929949591516, + "grad_norm": 0.46129441798908893, + "learning_rate": 0.00019027777777777776, + "loss": 0.645, + "step": 548 + }, + { + "epoch": 0.19120458891013384, + "grad_norm": 0.3724226655450749, + "learning_rate": 0.00019097222222222223, + "loss": 0.6177, + "step": 550 + }, + { + "epoch": 0.1918998783243525, + "grad_norm": 0.4625796323902992, + "learning_rate": 0.00019166666666666667, + "loss": 0.6702, + "step": 552 + }, + { + "epoch": 0.1925951677385712, + "grad_norm": 1.0142124821047231, + "learning_rate": 0.0001923611111111111, + "loss": 0.7173, + "step": 554 + }, + { + "epoch": 0.19329045715278984, + "grad_norm": 0.5452830720753045, + "learning_rate": 0.00019305555555555558, + "loss": 0.6897, + "step": 556 + }, + { + "epoch": 0.1939857465670085, + "grad_norm": 0.5723214484723252, + "learning_rate": 0.00019375000000000002, + "loss": 0.6495, + "step": 558 + }, + { + "epoch": 0.19468103598122719, + "grad_norm": 0.39925844595054966, + "learning_rate": 0.00019444444444444446, + "loss": 0.6479, + "step": 560 + }, + { + "epoch": 0.19537632539544586, + "grad_norm": 0.3575565088751118, + "learning_rate": 0.0001951388888888889, + "loss": 0.6593, + "step": 562 + }, + { + "epoch": 0.19607161480966454, + "grad_norm": 0.6119892689536569, + "learning_rate": 0.00019583333333333334, + "loss": 0.6831, + "step": 564 + }, + { + "epoch": 0.19676690422388318, + "grad_norm": 0.5076569073121309, + "learning_rate": 0.00019652777777777778, + "loss": 0.6294, + "step": 566 + }, + { + "epoch": 0.19746219363810186, + "grad_norm": 0.622226505121079, + "learning_rate": 0.00019722222222222225, + "loss": 0.5551, + "step": 568 + }, + { + "epoch": 0.19815748305232053, + "grad_norm": 0.4106526912254415, + "learning_rate": 0.0001979166666666667, + "loss": 0.6503, + "step": 570 + }, + { + "epoch": 0.1988527724665392, + "grad_norm": 0.47164751383243125, + "learning_rate": 0.00019861111111111113, + "loss": 0.6992, + "step": 572 + }, + { + "epoch": 0.19954806188075785, + "grad_norm": 0.492328312395826, + "learning_rate": 0.00019930555555555557, + "loss": 0.7183, + "step": 574 + }, + { + "epoch": 0.20024335129497653, + "grad_norm": 0.5087240677439067, + "learning_rate": 0.0002, + "loss": 0.6429, + "step": 576 + }, + { + "epoch": 0.2009386407091952, + "grad_norm": 0.9311216098504759, + "learning_rate": 0.00019999992632143608, + "loss": 0.6586, + "step": 578 + }, + { + "epoch": 0.20163393012341388, + "grad_norm": 0.38840935170189844, + "learning_rate": 0.00019999970528585288, + "loss": 0.5905, + "step": 580 + }, + { + "epoch": 0.20232921953763253, + "grad_norm": 0.5966472765038273, + "learning_rate": 0.0001999993368935761, + "loss": 0.7112, + "step": 582 + }, + { + "epoch": 0.2030245089518512, + "grad_norm": 0.535232520705813, + "learning_rate": 0.00019999882114514863, + "loss": 0.7036, + "step": 584 + }, + { + "epoch": 0.20371979836606988, + "grad_norm": 0.5039916125175515, + "learning_rate": 0.0001999981580413304, + "loss": 0.7485, + "step": 586 + }, + { + "epoch": 0.20441508778028855, + "grad_norm": 0.6733262892097686, + "learning_rate": 0.0001999973475830986, + "loss": 0.7312, + "step": 588 + }, + { + "epoch": 0.20511037719450723, + "grad_norm": 0.42805740684614807, + "learning_rate": 0.00019999638977164747, + "loss": 0.6356, + "step": 590 + }, + { + "epoch": 0.20580566660872587, + "grad_norm": 0.976918546573707, + "learning_rate": 0.00019999528460838844, + "loss": 0.666, + "step": 592 + }, + { + "epoch": 0.20650095602294455, + "grad_norm": 0.674463735133944, + "learning_rate": 0.00019999403209495, + "loss": 0.6735, + "step": 594 + }, + { + "epoch": 0.20719624543716322, + "grad_norm": 0.412232119296174, + "learning_rate": 0.00019999263223317786, + "loss": 0.6364, + "step": 596 + }, + { + "epoch": 0.2078915348513819, + "grad_norm": 0.3611034413524545, + "learning_rate": 0.0001999910850251348, + "loss": 0.6368, + "step": 598 + }, + { + "epoch": 0.20858682426560055, + "grad_norm": 0.542506398091656, + "learning_rate": 0.0001999893904731007, + "loss": 0.7292, + "step": 600 + }, + { + "epoch": 0.20858682426560055, + "eval_loss": 0.6517693400382996, + "eval_runtime": 707.4674, + "eval_samples_per_second": 6.844, + "eval_steps_per_second": 0.215, + "step": 600 + }, + { + "epoch": 0.20928211367981922, + "grad_norm": 0.4799286290563759, + "learning_rate": 0.0001999875485795727, + "loss": 0.6609, + "step": 602 + }, + { + "epoch": 0.2099774030940379, + "grad_norm": 0.41830446575524177, + "learning_rate": 0.0001999855593472649, + "loss": 0.6084, + "step": 604 + }, + { + "epoch": 0.21067269250825657, + "grad_norm": 0.8865562086549428, + "learning_rate": 0.00019998342277910856, + "loss": 0.6204, + "step": 606 + }, + { + "epoch": 0.21136798192247522, + "grad_norm": 0.5567410910026902, + "learning_rate": 0.00019998113887825206, + "loss": 0.7087, + "step": 608 + }, + { + "epoch": 0.2120632713366939, + "grad_norm": 0.4229098163428897, + "learning_rate": 0.000199978707648061, + "loss": 0.6403, + "step": 610 + }, + { + "epoch": 0.21275856075091257, + "grad_norm": 0.7793555918286379, + "learning_rate": 0.00019997612909211784, + "loss": 0.6147, + "step": 612 + }, + { + "epoch": 0.21345385016513124, + "grad_norm": 0.49302383416102263, + "learning_rate": 0.00019997340321422228, + "loss": 0.5771, + "step": 614 + }, + { + "epoch": 0.21414913957934992, + "grad_norm": 1.0807551778698754, + "learning_rate": 0.00019997053001839115, + "loss": 0.6538, + "step": 616 + }, + { + "epoch": 0.21484442899356856, + "grad_norm": 0.5935042706034646, + "learning_rate": 0.0001999675095088583, + "loss": 0.6058, + "step": 618 + }, + { + "epoch": 0.21553971840778724, + "grad_norm": 0.5151203960605611, + "learning_rate": 0.00019996434169007468, + "loss": 0.6138, + "step": 620 + }, + { + "epoch": 0.21623500782200591, + "grad_norm": 0.7837579499467073, + "learning_rate": 0.00019996102656670824, + "loss": 0.657, + "step": 622 + }, + { + "epoch": 0.2169302972362246, + "grad_norm": 0.5438202413527335, + "learning_rate": 0.0001999575641436441, + "loss": 0.6642, + "step": 624 + }, + { + "epoch": 0.21762558665044324, + "grad_norm": 0.5566641749580342, + "learning_rate": 0.00019995395442598435, + "loss": 0.6813, + "step": 626 + }, + { + "epoch": 0.2183208760646619, + "grad_norm": 0.9345190838089675, + "learning_rate": 0.0001999501974190482, + "loss": 0.684, + "step": 628 + }, + { + "epoch": 0.2190161654788806, + "grad_norm": 0.48677420225080537, + "learning_rate": 0.00019994629312837186, + "loss": 0.6481, + "step": 630 + }, + { + "epoch": 0.21971145489309926, + "grad_norm": 1.3826373483976924, + "learning_rate": 0.00019994224155970856, + "loss": 0.7222, + "step": 632 + }, + { + "epoch": 0.2204067443073179, + "grad_norm": 0.9031189580678588, + "learning_rate": 0.00019993804271902857, + "loss": 0.6809, + "step": 634 + }, + { + "epoch": 0.22110203372153658, + "grad_norm": 0.5674519795217096, + "learning_rate": 0.00019993369661251923, + "loss": 0.6184, + "step": 636 + }, + { + "epoch": 0.22179732313575526, + "grad_norm": 2.5294344265719135, + "learning_rate": 0.0001999292032465848, + "loss": 0.7686, + "step": 638 + }, + { + "epoch": 0.22249261254997393, + "grad_norm": 2.8855656605632047, + "learning_rate": 0.00019992456262784658, + "loss": 0.8215, + "step": 640 + }, + { + "epoch": 0.2231879019641926, + "grad_norm": 1.5331524159142917, + "learning_rate": 0.00019991977476314286, + "loss": 0.7057, + "step": 642 + }, + { + "epoch": 0.22388319137841126, + "grad_norm": 0.8086145005161695, + "learning_rate": 0.0001999148396595289, + "loss": 0.6289, + "step": 644 + }, + { + "epoch": 0.22457848079262993, + "grad_norm": 0.767389193699688, + "learning_rate": 0.00019990975732427693, + "loss": 0.6117, + "step": 646 + }, + { + "epoch": 0.2252737702068486, + "grad_norm": 0.9275190697426144, + "learning_rate": 0.0001999045277648761, + "loss": 0.6582, + "step": 648 + }, + { + "epoch": 0.22596905962106728, + "grad_norm": 0.8004230202091956, + "learning_rate": 0.00019989915098903257, + "loss": 0.5387, + "step": 650 + }, + { + "epoch": 0.22666434903528593, + "grad_norm": 0.8210833181388095, + "learning_rate": 0.0001998936270046694, + "loss": 0.5941, + "step": 652 + }, + { + "epoch": 0.2273596384495046, + "grad_norm": 2.1189675938584616, + "learning_rate": 0.00019988795581992656, + "loss": 0.7504, + "step": 654 + }, + { + "epoch": 0.22805492786372328, + "grad_norm": 0.5952032026226816, + "learning_rate": 0.000199882137443161, + "loss": 0.6643, + "step": 656 + }, + { + "epoch": 0.22875021727794195, + "grad_norm": 0.40481972159485846, + "learning_rate": 0.00019987617188294642, + "loss": 0.5225, + "step": 658 + }, + { + "epoch": 0.2294455066921606, + "grad_norm": 0.7478677085785272, + "learning_rate": 0.00019987005914807356, + "loss": 0.6561, + "step": 660 + }, + { + "epoch": 0.23014079610637928, + "grad_norm": 0.4468692254604696, + "learning_rate": 0.00019986379924754997, + "loss": 0.6262, + "step": 662 + }, + { + "epoch": 0.23083608552059795, + "grad_norm": 0.46697718493106893, + "learning_rate": 0.00019985739219060002, + "loss": 0.6178, + "step": 664 + }, + { + "epoch": 0.23153137493481663, + "grad_norm": 0.388728867903269, + "learning_rate": 0.000199850837986665, + "loss": 0.5544, + "step": 666 + }, + { + "epoch": 0.23222666434903527, + "grad_norm": 0.5731403139849517, + "learning_rate": 0.000199844136645403, + "loss": 0.5906, + "step": 668 + }, + { + "epoch": 0.23292195376325395, + "grad_norm": 0.7601215827849259, + "learning_rate": 0.0001998372881766889, + "loss": 0.6577, + "step": 670 + }, + { + "epoch": 0.23361724317747262, + "grad_norm": 0.8997786413980279, + "learning_rate": 0.00019983029259061446, + "loss": 0.6388, + "step": 672 + }, + { + "epoch": 0.2343125325916913, + "grad_norm": 0.519349430301096, + "learning_rate": 0.00019982314989748813, + "loss": 0.6561, + "step": 674 + }, + { + "epoch": 0.23500782200590997, + "grad_norm": 0.4918913590728881, + "learning_rate": 0.00019981586010783513, + "loss": 0.6176, + "step": 676 + }, + { + "epoch": 0.23570311142012862, + "grad_norm": 0.5324672662478441, + "learning_rate": 0.00019980842323239756, + "loss": 0.5801, + "step": 678 + }, + { + "epoch": 0.2363984008343473, + "grad_norm": 0.6375745879180794, + "learning_rate": 0.00019980083928213417, + "loss": 0.6885, + "step": 680 + }, + { + "epoch": 0.23709369024856597, + "grad_norm": 0.4317997282790841, + "learning_rate": 0.00019979310826822046, + "loss": 0.5727, + "step": 682 + }, + { + "epoch": 0.23778897966278464, + "grad_norm": 0.7933828103238656, + "learning_rate": 0.00019978523020204857, + "loss": 0.6703, + "step": 684 + }, + { + "epoch": 0.2384842690770033, + "grad_norm": 0.5465102255190097, + "learning_rate": 0.00019977720509522747, + "loss": 0.6675, + "step": 686 + }, + { + "epoch": 0.23917955849122197, + "grad_norm": 0.8356137363612883, + "learning_rate": 0.00019976903295958269, + "loss": 0.6558, + "step": 688 + }, + { + "epoch": 0.23987484790544064, + "grad_norm": 0.5190073187676806, + "learning_rate": 0.00019976071380715645, + "loss": 0.6779, + "step": 690 + }, + { + "epoch": 0.24057013731965932, + "grad_norm": 0.40561527338007225, + "learning_rate": 0.0001997522476502076, + "loss": 0.6687, + "step": 692 + }, + { + "epoch": 0.24126542673387796, + "grad_norm": 0.592821589706298, + "learning_rate": 0.0001997436345012117, + "loss": 0.6807, + "step": 694 + }, + { + "epoch": 0.24196071614809664, + "grad_norm": 0.686918345062074, + "learning_rate": 0.00019973487437286073, + "loss": 0.6831, + "step": 696 + }, + { + "epoch": 0.2426560055623153, + "grad_norm": 0.964075508243471, + "learning_rate": 0.00019972596727806346, + "loss": 0.665, + "step": 698 + }, + { + "epoch": 0.243351294976534, + "grad_norm": 0.739137434656244, + "learning_rate": 0.00019971691322994507, + "loss": 0.6387, + "step": 700 + }, + { + "epoch": 0.24404658439075266, + "grad_norm": 0.3978099419540589, + "learning_rate": 0.00019970771224184737, + "loss": 0.6143, + "step": 702 + }, + { + "epoch": 0.2447418738049713, + "grad_norm": 0.4997978607153984, + "learning_rate": 0.0001996983643273287, + "loss": 0.6083, + "step": 704 + }, + { + "epoch": 0.24543716321918999, + "grad_norm": 1.3443518380439796, + "learning_rate": 0.0001996888695001638, + "loss": 0.6711, + "step": 706 + }, + { + "epoch": 0.24613245263340866, + "grad_norm": 0.5424379336505594, + "learning_rate": 0.000199679227774344, + "loss": 0.6321, + "step": 708 + }, + { + "epoch": 0.24682774204762734, + "grad_norm": 0.7689235498835658, + "learning_rate": 0.00019966943916407712, + "loss": 0.6918, + "step": 710 + }, + { + "epoch": 0.24752303146184598, + "grad_norm": 0.6467240394468301, + "learning_rate": 0.00019965950368378734, + "loss": 0.6368, + "step": 712 + }, + { + "epoch": 0.24821832087606466, + "grad_norm": 0.48819289451999526, + "learning_rate": 0.00019964942134811532, + "loss": 0.5875, + "step": 714 + }, + { + "epoch": 0.24891361029028333, + "grad_norm": 1.1929427463467126, + "learning_rate": 0.00019963919217191807, + "loss": 0.6795, + "step": 716 + }, + { + "epoch": 0.249608899704502, + "grad_norm": 0.4182713825442439, + "learning_rate": 0.00019962881617026902, + "loss": 0.5835, + "step": 718 + }, + { + "epoch": 0.25030418911872065, + "grad_norm": 0.5770262516296942, + "learning_rate": 0.00019961829335845795, + "loss": 0.6299, + "step": 720 + }, + { + "epoch": 0.25099947853293936, + "grad_norm": 0.9135250550485389, + "learning_rate": 0.00019960762375199095, + "loss": 0.6844, + "step": 722 + }, + { + "epoch": 0.251694767947158, + "grad_norm": 0.5511234805517417, + "learning_rate": 0.0001995968073665905, + "loss": 0.5745, + "step": 724 + }, + { + "epoch": 0.25239005736137665, + "grad_norm": 0.49137872896877094, + "learning_rate": 0.00019958584421819528, + "loss": 0.698, + "step": 726 + }, + { + "epoch": 0.25308534677559535, + "grad_norm": 0.4437253322782162, + "learning_rate": 0.00019957473432296026, + "loss": 0.6864, + "step": 728 + }, + { + "epoch": 0.253780636189814, + "grad_norm": 0.5064381489074585, + "learning_rate": 0.0001995634776972567, + "loss": 0.5758, + "step": 730 + }, + { + "epoch": 0.2544759256040327, + "grad_norm": 0.5464655664741616, + "learning_rate": 0.00019955207435767201, + "loss": 0.6351, + "step": 732 + }, + { + "epoch": 0.25517121501825135, + "grad_norm": 0.44060524677853835, + "learning_rate": 0.00019954052432100982, + "loss": 0.6837, + "step": 734 + }, + { + "epoch": 0.25586650443247, + "grad_norm": 0.942390696980061, + "learning_rate": 0.00019952882760428998, + "loss": 0.6378, + "step": 736 + }, + { + "epoch": 0.2565617938466887, + "grad_norm": 0.4710023299938762, + "learning_rate": 0.00019951698422474836, + "loss": 0.6968, + "step": 738 + }, + { + "epoch": 0.25725708326090735, + "grad_norm": 0.4179809222387651, + "learning_rate": 0.00019950499419983707, + "loss": 0.5643, + "step": 740 + }, + { + "epoch": 0.257952372675126, + "grad_norm": 0.4446278865199289, + "learning_rate": 0.00019949285754722426, + "loss": 0.5089, + "step": 742 + }, + { + "epoch": 0.2586476620893447, + "grad_norm": 0.914728851966275, + "learning_rate": 0.00019948057428479418, + "loss": 0.7933, + "step": 744 + }, + { + "epoch": 0.25934295150356335, + "grad_norm": 0.47142275185055055, + "learning_rate": 0.00019946814443064703, + "loss": 0.6384, + "step": 746 + }, + { + "epoch": 0.26003824091778205, + "grad_norm": 0.720916103725334, + "learning_rate": 0.00019945556800309917, + "loss": 0.5957, + "step": 748 + }, + { + "epoch": 0.2607335303320007, + "grad_norm": 0.8550360126036364, + "learning_rate": 0.00019944284502068275, + "loss": 0.6454, + "step": 750 + }, + { + "epoch": 0.2607335303320007, + "eval_loss": 0.6373963952064514, + "eval_runtime": 728.7951, + "eval_samples_per_second": 6.644, + "eval_steps_per_second": 0.209, + "step": 750 + }, + { + "epoch": 0.26142881974621934, + "grad_norm": 0.5467512313200382, + "learning_rate": 0.0001994299755021461, + "loss": 0.5781, + "step": 752 + }, + { + "epoch": 0.26212410916043805, + "grad_norm": 0.41230384162224254, + "learning_rate": 0.0001994169594664533, + "loss": 0.6467, + "step": 754 + }, + { + "epoch": 0.2628193985746567, + "grad_norm": 0.5635895964904281, + "learning_rate": 0.00019940379693278448, + "loss": 0.6182, + "step": 756 + }, + { + "epoch": 0.2635146879888754, + "grad_norm": 0.6456168984233462, + "learning_rate": 0.0001993904879205355, + "loss": 0.6086, + "step": 758 + }, + { + "epoch": 0.26420997740309404, + "grad_norm": 0.5060399335833471, + "learning_rate": 0.00019937703244931815, + "loss": 0.6407, + "step": 760 + }, + { + "epoch": 0.2649052668173127, + "grad_norm": 0.5033297464646784, + "learning_rate": 0.00019936343053896004, + "loss": 0.6157, + "step": 762 + }, + { + "epoch": 0.2656005562315314, + "grad_norm": 0.3911665523252255, + "learning_rate": 0.00019934968220950458, + "loss": 0.6227, + "step": 764 + }, + { + "epoch": 0.26629584564575004, + "grad_norm": 1.7130937466256138, + "learning_rate": 0.00019933578748121086, + "loss": 0.5994, + "step": 766 + }, + { + "epoch": 0.2669911350599687, + "grad_norm": 0.5747338886603724, + "learning_rate": 0.00019932174637455382, + "loss": 0.6238, + "step": 768 + }, + { + "epoch": 0.2676864244741874, + "grad_norm": 0.6226324357252033, + "learning_rate": 0.00019930755891022398, + "loss": 0.6255, + "step": 770 + }, + { + "epoch": 0.26838171388840604, + "grad_norm": 0.5282488794229044, + "learning_rate": 0.00019929322510912756, + "loss": 0.5808, + "step": 772 + }, + { + "epoch": 0.26907700330262474, + "grad_norm": 0.5596904577167024, + "learning_rate": 0.0001992787449923865, + "loss": 0.5361, + "step": 774 + }, + { + "epoch": 0.2697722927168434, + "grad_norm": 1.0477422618379753, + "learning_rate": 0.00019926411858133824, + "loss": 0.54, + "step": 776 + }, + { + "epoch": 0.27046758213106203, + "grad_norm": 1.1314704495635823, + "learning_rate": 0.00019924934589753582, + "loss": 0.5869, + "step": 778 + }, + { + "epoch": 0.27116287154528074, + "grad_norm": 0.5426548544381972, + "learning_rate": 0.00019923442696274794, + "loss": 0.5951, + "step": 780 + }, + { + "epoch": 0.2718581609594994, + "grad_norm": 0.8480025293040686, + "learning_rate": 0.00019921936179895862, + "loss": 0.6003, + "step": 782 + }, + { + "epoch": 0.2725534503737181, + "grad_norm": 0.5729452380906337, + "learning_rate": 0.0001992041504283675, + "loss": 0.6526, + "step": 784 + }, + { + "epoch": 0.27324873978793673, + "grad_norm": 0.7362085286496177, + "learning_rate": 0.00019918879287338957, + "loss": 0.6776, + "step": 786 + }, + { + "epoch": 0.2739440292021554, + "grad_norm": 0.7440059372391256, + "learning_rate": 0.00019917328915665535, + "loss": 0.6486, + "step": 788 + }, + { + "epoch": 0.2746393186163741, + "grad_norm": 0.6110842206790659, + "learning_rate": 0.0001991576393010106, + "loss": 0.6226, + "step": 790 + }, + { + "epoch": 0.27533460803059273, + "grad_norm": 0.8002336898560896, + "learning_rate": 0.00019914184332951655, + "loss": 0.6215, + "step": 792 + }, + { + "epoch": 0.2760298974448114, + "grad_norm": 0.6761736356192558, + "learning_rate": 0.00019912590126544964, + "loss": 0.5988, + "step": 794 + }, + { + "epoch": 0.2767251868590301, + "grad_norm": 1.1005016630123619, + "learning_rate": 0.00019910981313230172, + "loss": 0.6213, + "step": 796 + }, + { + "epoch": 0.27742047627324873, + "grad_norm": 0.6513452605734942, + "learning_rate": 0.00019909357895377973, + "loss": 0.682, + "step": 798 + }, + { + "epoch": 0.27811576568746743, + "grad_norm": 0.8536492677008404, + "learning_rate": 0.0001990771987538059, + "loss": 0.707, + "step": 800 + }, + { + "epoch": 0.2788110551016861, + "grad_norm": 0.3362293750538688, + "learning_rate": 0.00019906067255651765, + "loss": 0.7108, + "step": 802 + }, + { + "epoch": 0.2795063445159047, + "grad_norm": 0.4792899916449288, + "learning_rate": 0.0001990440003862675, + "loss": 0.6055, + "step": 804 + }, + { + "epoch": 0.28020163393012343, + "grad_norm": 1.272937677307704, + "learning_rate": 0.00019902718226762304, + "loss": 0.6816, + "step": 806 + }, + { + "epoch": 0.2808969233443421, + "grad_norm": 0.30646692495778655, + "learning_rate": 0.00019901021822536704, + "loss": 0.688, + "step": 808 + }, + { + "epoch": 0.2815922127585608, + "grad_norm": 0.3035733218665055, + "learning_rate": 0.00019899310828449713, + "loss": 0.6746, + "step": 810 + }, + { + "epoch": 0.2822875021727794, + "grad_norm": 0.2763276026826459, + "learning_rate": 0.00019897585247022613, + "loss": 0.6632, + "step": 812 + }, + { + "epoch": 0.2829827915869981, + "grad_norm": 1.173118337900773, + "learning_rate": 0.00019895845080798166, + "loss": 0.6306, + "step": 814 + }, + { + "epoch": 0.2836780810012168, + "grad_norm": 0.4335278252167635, + "learning_rate": 0.0001989409033234063, + "loss": 0.6147, + "step": 816 + }, + { + "epoch": 0.2843733704154354, + "grad_norm": 0.3556694503062785, + "learning_rate": 0.00019892321004235755, + "loss": 0.5771, + "step": 818 + }, + { + "epoch": 0.28506865982965407, + "grad_norm": 0.9083240381897224, + "learning_rate": 0.00019890537099090768, + "loss": 0.5729, + "step": 820 + }, + { + "epoch": 0.2857639492438728, + "grad_norm": 0.5433346815141633, + "learning_rate": 0.00019888738619534385, + "loss": 0.5554, + "step": 822 + }, + { + "epoch": 0.2864592386580914, + "grad_norm": 0.5244705156138804, + "learning_rate": 0.0001988692556821679, + "loss": 0.6525, + "step": 824 + }, + { + "epoch": 0.2871545280723101, + "grad_norm": 0.7580866792170871, + "learning_rate": 0.00019885097947809648, + "loss": 0.6512, + "step": 826 + }, + { + "epoch": 0.28784981748652877, + "grad_norm": 0.7034554538404351, + "learning_rate": 0.00019883255761006082, + "loss": 0.5414, + "step": 828 + }, + { + "epoch": 0.2885451069007474, + "grad_norm": 0.6915575597289163, + "learning_rate": 0.00019881399010520688, + "loss": 0.6036, + "step": 830 + }, + { + "epoch": 0.2892403963149661, + "grad_norm": 0.6895372001781882, + "learning_rate": 0.00019879527699089524, + "loss": 0.5894, + "step": 832 + }, + { + "epoch": 0.28993568572918477, + "grad_norm": 0.7762412863407715, + "learning_rate": 0.00019877641829470094, + "loss": 0.7115, + "step": 834 + }, + { + "epoch": 0.29063097514340347, + "grad_norm": 0.5761220663639801, + "learning_rate": 0.00019875741404441367, + "loss": 0.6108, + "step": 836 + }, + { + "epoch": 0.2913262645576221, + "grad_norm": 0.47176943357070505, + "learning_rate": 0.00019873826426803755, + "loss": 0.634, + "step": 838 + }, + { + "epoch": 0.29202155397184076, + "grad_norm": 0.5985873148196751, + "learning_rate": 0.00019871896899379107, + "loss": 0.6528, + "step": 840 + }, + { + "epoch": 0.29271684338605947, + "grad_norm": 0.39514741111190665, + "learning_rate": 0.00019869952825010727, + "loss": 0.6034, + "step": 842 + }, + { + "epoch": 0.2934121328002781, + "grad_norm": 0.29787585594263405, + "learning_rate": 0.00019867994206563343, + "loss": 0.6063, + "step": 844 + }, + { + "epoch": 0.29410742221449676, + "grad_norm": 0.303320759302155, + "learning_rate": 0.00019866021046923118, + "loss": 0.6343, + "step": 846 + }, + { + "epoch": 0.29480271162871546, + "grad_norm": 0.33135450527244925, + "learning_rate": 0.00019864033348997645, + "loss": 0.6421, + "step": 848 + }, + { + "epoch": 0.2954980010429341, + "grad_norm": 0.553668190192523, + "learning_rate": 0.0001986203111571594, + "loss": 0.6503, + "step": 850 + }, + { + "epoch": 0.2961932904571528, + "grad_norm": 0.31948016623126946, + "learning_rate": 0.00019860014350028438, + "loss": 0.6259, + "step": 852 + }, + { + "epoch": 0.29688857987137146, + "grad_norm": 0.5325237443938606, + "learning_rate": 0.0001985798305490698, + "loss": 0.6207, + "step": 854 + }, + { + "epoch": 0.2975838692855901, + "grad_norm": 0.5093186589927414, + "learning_rate": 0.00019855937233344831, + "loss": 0.5397, + "step": 856 + }, + { + "epoch": 0.2982791586998088, + "grad_norm": 0.5220573948537062, + "learning_rate": 0.00019853876888356652, + "loss": 0.6237, + "step": 858 + }, + { + "epoch": 0.29897444811402746, + "grad_norm": 0.9861332892020862, + "learning_rate": 0.00019851802022978506, + "loss": 0.689, + "step": 860 + }, + { + "epoch": 0.2996697375282461, + "grad_norm": 0.464669721879274, + "learning_rate": 0.00019849712640267861, + "loss": 0.522, + "step": 862 + }, + { + "epoch": 0.3003650269424648, + "grad_norm": 0.9223435358714303, + "learning_rate": 0.00019847608743303567, + "loss": 0.7491, + "step": 864 + }, + { + "epoch": 0.30106031635668346, + "grad_norm": 0.5058775377593727, + "learning_rate": 0.00019845490335185866, + "loss": 0.562, + "step": 866 + }, + { + "epoch": 0.30175560577090216, + "grad_norm": 0.5517767811356443, + "learning_rate": 0.00019843357419036382, + "loss": 0.6162, + "step": 868 + }, + { + "epoch": 0.3024508951851208, + "grad_norm": 0.49255497197537723, + "learning_rate": 0.00019841209997998127, + "loss": 0.6803, + "step": 870 + }, + { + "epoch": 0.30314618459933945, + "grad_norm": 0.41553745561512617, + "learning_rate": 0.0001983904807523547, + "loss": 0.6415, + "step": 872 + }, + { + "epoch": 0.30384147401355815, + "grad_norm": 0.49551628457734653, + "learning_rate": 0.00019836871653934162, + "loss": 0.6176, + "step": 874 + }, + { + "epoch": 0.3045367634277768, + "grad_norm": 0.7489091107060393, + "learning_rate": 0.00019834680737301313, + "loss": 0.6337, + "step": 876 + }, + { + "epoch": 0.3052320528419955, + "grad_norm": 0.32312869533576805, + "learning_rate": 0.00019832475328565398, + "loss": 0.6135, + "step": 878 + }, + { + "epoch": 0.30592734225621415, + "grad_norm": 0.304002075332943, + "learning_rate": 0.00019830255430976242, + "loss": 0.5533, + "step": 880 + }, + { + "epoch": 0.3066226316704328, + "grad_norm": 0.4137621036041215, + "learning_rate": 0.00019828021047805022, + "loss": 0.573, + "step": 882 + }, + { + "epoch": 0.3073179210846515, + "grad_norm": 0.7506870255042438, + "learning_rate": 0.00019825772182344262, + "loss": 0.6971, + "step": 884 + }, + { + "epoch": 0.30801321049887015, + "grad_norm": 0.7069489041589112, + "learning_rate": 0.00019823508837907828, + "loss": 0.5848, + "step": 886 + }, + { + "epoch": 0.3087084999130888, + "grad_norm": 0.49383355752727304, + "learning_rate": 0.00019821231017830914, + "loss": 0.6349, + "step": 888 + }, + { + "epoch": 0.3094037893273075, + "grad_norm": 0.7893505446859834, + "learning_rate": 0.0001981893872547005, + "loss": 0.6335, + "step": 890 + }, + { + "epoch": 0.31009907874152615, + "grad_norm": 1.0962653113728835, + "learning_rate": 0.00019816631964203097, + "loss": 0.6438, + "step": 892 + }, + { + "epoch": 0.31079436815574485, + "grad_norm": 0.40606329821748216, + "learning_rate": 0.0001981431073742923, + "loss": 0.557, + "step": 894 + }, + { + "epoch": 0.3114896575699635, + "grad_norm": 0.8061837126172193, + "learning_rate": 0.00019811975048568943, + "loss": 0.6334, + "step": 896 + }, + { + "epoch": 0.31218494698418214, + "grad_norm": 0.7808955990860935, + "learning_rate": 0.00019809624901064038, + "loss": 0.5775, + "step": 898 + }, + { + "epoch": 0.31288023639840085, + "grad_norm": 0.5527203146534614, + "learning_rate": 0.00019807260298377626, + "loss": 0.5934, + "step": 900 + }, + { + "epoch": 0.31288023639840085, + "eval_loss": 0.666339099407196, + "eval_runtime": 759.5196, + "eval_samples_per_second": 6.375, + "eval_steps_per_second": 0.2, + "step": 900 + }, + { + "epoch": 0.3135755258126195, + "grad_norm": 1.151650071753606, + "learning_rate": 0.00019804881243994118, + "loss": 0.6459, + "step": 902 + }, + { + "epoch": 0.3142708152268382, + "grad_norm": 0.37537177441864283, + "learning_rate": 0.00019802487741419218, + "loss": 0.5537, + "step": 904 + }, + { + "epoch": 0.31496610464105684, + "grad_norm": 0.39806583735978385, + "learning_rate": 0.00019800079794179927, + "loss": 0.5765, + "step": 906 + }, + { + "epoch": 0.3156613940552755, + "grad_norm": 0.9252532303995283, + "learning_rate": 0.00019797657405824524, + "loss": 0.6581, + "step": 908 + }, + { + "epoch": 0.3163566834694942, + "grad_norm": 0.4242008643262632, + "learning_rate": 0.00019795220579922572, + "loss": 0.663, + "step": 910 + }, + { + "epoch": 0.31705197288371284, + "grad_norm": 0.5557863138791925, + "learning_rate": 0.00019792769320064904, + "loss": 0.6492, + "step": 912 + }, + { + "epoch": 0.3177472622979315, + "grad_norm": 0.5743017982975046, + "learning_rate": 0.0001979030362986363, + "loss": 0.6425, + "step": 914 + }, + { + "epoch": 0.3184425517121502, + "grad_norm": 0.39667228882787314, + "learning_rate": 0.0001978782351295212, + "loss": 0.5658, + "step": 916 + }, + { + "epoch": 0.31913784112636884, + "grad_norm": 1.2742981139875873, + "learning_rate": 0.00019785328972985, + "loss": 0.6042, + "step": 918 + }, + { + "epoch": 0.31983313054058754, + "grad_norm": 0.7520790754771111, + "learning_rate": 0.00019782820013638158, + "loss": 0.6248, + "step": 920 + }, + { + "epoch": 0.3205284199548062, + "grad_norm": 1.1777266516894538, + "learning_rate": 0.0001978029663860872, + "loss": 0.6394, + "step": 922 + }, + { + "epoch": 0.32122370936902483, + "grad_norm": 0.5383416828808074, + "learning_rate": 0.00019777758851615058, + "loss": 0.6357, + "step": 924 + }, + { + "epoch": 0.32191899878324354, + "grad_norm": 0.5351088818608489, + "learning_rate": 0.00019775206656396787, + "loss": 0.6111, + "step": 926 + }, + { + "epoch": 0.3226142881974622, + "grad_norm": 0.7776255734128178, + "learning_rate": 0.00019772640056714744, + "loss": 0.5778, + "step": 928 + }, + { + "epoch": 0.3233095776116809, + "grad_norm": 0.5049904332607067, + "learning_rate": 0.00019770059056351, + "loss": 0.5978, + "step": 930 + }, + { + "epoch": 0.32400486702589953, + "grad_norm": 0.6894813643690206, + "learning_rate": 0.00019767463659108841, + "loss": 0.6727, + "step": 932 + }, + { + "epoch": 0.3247001564401182, + "grad_norm": 0.6230252249989028, + "learning_rate": 0.00019764853868812772, + "loss": 0.5911, + "step": 934 + }, + { + "epoch": 0.3253954458543369, + "grad_norm": 0.6699617199619087, + "learning_rate": 0.00019762229689308499, + "loss": 0.6694, + "step": 936 + }, + { + "epoch": 0.32609073526855553, + "grad_norm": 0.9762605521595761, + "learning_rate": 0.00019759591124462943, + "loss": 0.7053, + "step": 938 + }, + { + "epoch": 0.3267860246827742, + "grad_norm": 0.5216728233794251, + "learning_rate": 0.0001975693817816422, + "loss": 0.6958, + "step": 940 + }, + { + "epoch": 0.3274813140969929, + "grad_norm": 0.5943791708445256, + "learning_rate": 0.00019754270854321625, + "loss": 0.6342, + "step": 942 + }, + { + "epoch": 0.32817660351121153, + "grad_norm": 0.5341014737913188, + "learning_rate": 0.00019751589156865663, + "loss": 0.6272, + "step": 944 + }, + { + "epoch": 0.32887189292543023, + "grad_norm": 0.8411647140863245, + "learning_rate": 0.00019748893089747995, + "loss": 0.6041, + "step": 946 + }, + { + "epoch": 0.3295671823396489, + "grad_norm": 1.072323043427063, + "learning_rate": 0.00019746182656941473, + "loss": 0.7152, + "step": 948 + }, + { + "epoch": 0.3302624717538675, + "grad_norm": 0.6497829380326366, + "learning_rate": 0.00019743457862440115, + "loss": 0.6176, + "step": 950 + }, + { + "epoch": 0.33095776116808623, + "grad_norm": 0.28736093186011447, + "learning_rate": 0.00019740718710259096, + "loss": 0.6453, + "step": 952 + }, + { + "epoch": 0.3316530505823049, + "grad_norm": 0.27868233108109625, + "learning_rate": 0.00019737965204434757, + "loss": 0.6051, + "step": 954 + }, + { + "epoch": 0.3323483399965236, + "grad_norm": 0.40709235855818693, + "learning_rate": 0.00019735197349024576, + "loss": 0.6255, + "step": 956 + }, + { + "epoch": 0.3330436294107422, + "grad_norm": 0.8385677925045294, + "learning_rate": 0.00019732415148107199, + "loss": 0.6455, + "step": 958 + }, + { + "epoch": 0.3337389188249609, + "grad_norm": 0.5642576200414804, + "learning_rate": 0.00019729618605782384, + "loss": 0.6971, + "step": 960 + }, + { + "epoch": 0.3344342082391796, + "grad_norm": 0.7034648545079693, + "learning_rate": 0.00019726807726171039, + "loss": 0.6177, + "step": 962 + }, + { + "epoch": 0.3351294976533982, + "grad_norm": 1.9840633930320113, + "learning_rate": 0.000197239825134152, + "loss": 0.6776, + "step": 964 + }, + { + "epoch": 0.33582478706761687, + "grad_norm": 1.0091982574836484, + "learning_rate": 0.00019721142971678015, + "loss": 0.6893, + "step": 966 + }, + { + "epoch": 0.3365200764818356, + "grad_norm": 0.9742560258590767, + "learning_rate": 0.00019718289105143753, + "loss": 0.744, + "step": 968 + }, + { + "epoch": 0.3372153658960542, + "grad_norm": 0.6897018399345455, + "learning_rate": 0.00019715420918017793, + "loss": 0.678, + "step": 970 + }, + { + "epoch": 0.3379106553102729, + "grad_norm": 0.29102959771453246, + "learning_rate": 0.00019712538414526606, + "loss": 0.6663, + "step": 972 + }, + { + "epoch": 0.33860594472449157, + "grad_norm": 0.7337107483377766, + "learning_rate": 0.0001970964159891777, + "loss": 0.663, + "step": 974 + }, + { + "epoch": 0.3393012341387102, + "grad_norm": 0.5817704647699353, + "learning_rate": 0.00019706730475459953, + "loss": 0.6398, + "step": 976 + }, + { + "epoch": 0.3399965235529289, + "grad_norm": 0.28703428796704483, + "learning_rate": 0.00019703805048442897, + "loss": 0.5906, + "step": 978 + }, + { + "epoch": 0.34069181296714757, + "grad_norm": 0.41383789019772477, + "learning_rate": 0.0001970086532217743, + "loss": 0.6709, + "step": 980 + }, + { + "epoch": 0.34138710238136627, + "grad_norm": 0.812487649001141, + "learning_rate": 0.00019697911300995443, + "loss": 0.6191, + "step": 982 + }, + { + "epoch": 0.3420823917955849, + "grad_norm": 0.798027200072012, + "learning_rate": 0.00019694942989249907, + "loss": 0.6608, + "step": 984 + }, + { + "epoch": 0.34277768120980356, + "grad_norm": 0.44029385955900757, + "learning_rate": 0.00019691960391314837, + "loss": 0.647, + "step": 986 + }, + { + "epoch": 0.34347297062402227, + "grad_norm": 0.3824484030698272, + "learning_rate": 0.00019688963511585295, + "loss": 0.6378, + "step": 988 + }, + { + "epoch": 0.3441682600382409, + "grad_norm": 0.4121768227084979, + "learning_rate": 0.0001968595235447741, + "loss": 0.5908, + "step": 990 + }, + { + "epoch": 0.34486354945245956, + "grad_norm": 0.5154693781246049, + "learning_rate": 0.0001968292692442833, + "loss": 0.5632, + "step": 992 + }, + { + "epoch": 0.34555883886667826, + "grad_norm": 0.3895510966829308, + "learning_rate": 0.0001967988722589624, + "loss": 0.4674, + "step": 994 + }, + { + "epoch": 0.3462541282808969, + "grad_norm": 0.507531875733667, + "learning_rate": 0.00019676833263360352, + "loss": 0.5581, + "step": 996 + }, + { + "epoch": 0.3469494176951156, + "grad_norm": 0.5476523355263471, + "learning_rate": 0.00019673765041320907, + "loss": 0.7421, + "step": 998 + }, + { + "epoch": 0.34764470710933426, + "grad_norm": 0.8417172933340035, + "learning_rate": 0.00019670682564299136, + "loss": 0.6774, + "step": 1000 + }, + { + "epoch": 0.3483399965235529, + "grad_norm": 0.6717112677412562, + "learning_rate": 0.00019667585836837299, + "loss": 0.6515, + "step": 1002 + }, + { + "epoch": 0.3490352859377716, + "grad_norm": 0.7599904388695796, + "learning_rate": 0.0001966447486349864, + "loss": 0.5679, + "step": 1004 + }, + { + "epoch": 0.34973057535199026, + "grad_norm": 0.44186748583335306, + "learning_rate": 0.000196613496488674, + "loss": 0.6067, + "step": 1006 + }, + { + "epoch": 0.35042586476620896, + "grad_norm": 0.4287165077907837, + "learning_rate": 0.00019658210197548805, + "loss": 0.5706, + "step": 1008 + }, + { + "epoch": 0.3511211541804276, + "grad_norm": 0.6051489125727973, + "learning_rate": 0.0001965505651416906, + "loss": 0.6178, + "step": 1010 + }, + { + "epoch": 0.35181644359464626, + "grad_norm": 0.5003034918118222, + "learning_rate": 0.00019651888603375346, + "loss": 0.6, + "step": 1012 + }, + { + "epoch": 0.35251173300886496, + "grad_norm": 0.6774513066433009, + "learning_rate": 0.00019648706469835804, + "loss": 0.6248, + "step": 1014 + }, + { + "epoch": 0.3532070224230836, + "grad_norm": 0.5666799893616385, + "learning_rate": 0.0001964551011823953, + "loss": 0.6256, + "step": 1016 + }, + { + "epoch": 0.35390231183730225, + "grad_norm": 0.6185519925235329, + "learning_rate": 0.00019642299553296582, + "loss": 0.5836, + "step": 1018 + }, + { + "epoch": 0.35459760125152096, + "grad_norm": 0.5020407783730059, + "learning_rate": 0.0001963907477973795, + "loss": 0.5148, + "step": 1020 + }, + { + "epoch": 0.3552928906657396, + "grad_norm": 0.966855697270511, + "learning_rate": 0.00019635835802315574, + "loss": 0.6335, + "step": 1022 + }, + { + "epoch": 0.3559881800799583, + "grad_norm": 0.8705091175729548, + "learning_rate": 0.00019632582625802317, + "loss": 0.6313, + "step": 1024 + }, + { + "epoch": 0.35668346949417695, + "grad_norm": 0.6028556619755229, + "learning_rate": 0.00019629315254991964, + "loss": 0.6483, + "step": 1026 + }, + { + "epoch": 0.3573787589083956, + "grad_norm": 0.6075038119620636, + "learning_rate": 0.00019626033694699214, + "loss": 0.6271, + "step": 1028 + }, + { + "epoch": 0.3580740483226143, + "grad_norm": 0.7923956541669288, + "learning_rate": 0.00019622737949759694, + "loss": 0.6338, + "step": 1030 + }, + { + "epoch": 0.35876933773683295, + "grad_norm": 1.2067992138100796, + "learning_rate": 0.00019619428025029905, + "loss": 0.6308, + "step": 1032 + }, + { + "epoch": 0.35946462715105165, + "grad_norm": 0.5446351671940789, + "learning_rate": 0.00019616103925387265, + "loss": 0.6475, + "step": 1034 + }, + { + "epoch": 0.3601599165652703, + "grad_norm": 0.8842474031361561, + "learning_rate": 0.0001961276565573007, + "loss": 0.6654, + "step": 1036 + }, + { + "epoch": 0.36085520597948895, + "grad_norm": 1.294693850012853, + "learning_rate": 0.00019609413220977496, + "loss": 0.6929, + "step": 1038 + }, + { + "epoch": 0.36155049539370765, + "grad_norm": 0.7435682846586636, + "learning_rate": 0.00019606046626069595, + "loss": 0.6791, + "step": 1040 + }, + { + "epoch": 0.3622457848079263, + "grad_norm": 0.45762946459115417, + "learning_rate": 0.0001960266587596729, + "loss": 0.5769, + "step": 1042 + }, + { + "epoch": 0.36294107422214494, + "grad_norm": 0.5614638042598611, + "learning_rate": 0.00019599270975652352, + "loss": 0.6047, + "step": 1044 + }, + { + "epoch": 0.36363636363636365, + "grad_norm": 1.6171161059961894, + "learning_rate": 0.0001959586193012741, + "loss": 0.6932, + "step": 1046 + }, + { + "epoch": 0.3643316530505823, + "grad_norm": 1.5847051714441287, + "learning_rate": 0.00019592438744415932, + "loss": 0.5908, + "step": 1048 + }, + { + "epoch": 0.365026942464801, + "grad_norm": 0.4282438415059217, + "learning_rate": 0.00019589001423562233, + "loss": 0.6749, + "step": 1050 + }, + { + "epoch": 0.365026942464801, + "eval_loss": 0.6080955266952515, + "eval_runtime": 710.9824, + "eval_samples_per_second": 6.81, + "eval_steps_per_second": 0.214, + "step": 1050 + }, + { + "epoch": 0.36572223187901964, + "grad_norm": 1.0612232842206784, + "learning_rate": 0.00019585549972631446, + "loss": 0.5669, + "step": 1052 + }, + { + "epoch": 0.3664175212932383, + "grad_norm": 2.6994673924740358, + "learning_rate": 0.0001958208439670953, + "loss": 0.6455, + "step": 1054 + }, + { + "epoch": 0.367112810707457, + "grad_norm": 2.022628249772274, + "learning_rate": 0.0001957860470090326, + "loss": 0.6395, + "step": 1056 + }, + { + "epoch": 0.36780810012167564, + "grad_norm": 0.607126211578616, + "learning_rate": 0.00019575110890340214, + "loss": 0.593, + "step": 1058 + }, + { + "epoch": 0.36850338953589434, + "grad_norm": 1.026539890410463, + "learning_rate": 0.00019571602970168775, + "loss": 0.5939, + "step": 1060 + }, + { + "epoch": 0.369198678950113, + "grad_norm": 0.6663599873173821, + "learning_rate": 0.00019568080945558104, + "loss": 0.6415, + "step": 1062 + }, + { + "epoch": 0.36989396836433164, + "grad_norm": 0.5967439670789174, + "learning_rate": 0.00019564544821698167, + "loss": 0.6348, + "step": 1064 + }, + { + "epoch": 0.37058925777855034, + "grad_norm": 0.6468802992284401, + "learning_rate": 0.00019560994603799682, + "loss": 0.5991, + "step": 1066 + }, + { + "epoch": 0.371284547192769, + "grad_norm": 1.2251498168873143, + "learning_rate": 0.00019557430297094158, + "loss": 0.6001, + "step": 1068 + }, + { + "epoch": 0.37197983660698763, + "grad_norm": 0.4681978143920913, + "learning_rate": 0.00019553851906833853, + "loss": 0.5664, + "step": 1070 + }, + { + "epoch": 0.37267512602120634, + "grad_norm": 0.7538053079694034, + "learning_rate": 0.00019550259438291782, + "loss": 0.5531, + "step": 1072 + }, + { + "epoch": 0.373370415435425, + "grad_norm": 0.4626868039226879, + "learning_rate": 0.00019546652896761696, + "loss": 0.6268, + "step": 1074 + }, + { + "epoch": 0.3740657048496437, + "grad_norm": 0.8012577314135656, + "learning_rate": 0.00019543032287558097, + "loss": 0.7819, + "step": 1076 + }, + { + "epoch": 0.37476099426386233, + "grad_norm": 0.7004564506452116, + "learning_rate": 0.0001953939761601621, + "loss": 0.6505, + "step": 1078 + }, + { + "epoch": 0.375456283678081, + "grad_norm": 1.352602706017517, + "learning_rate": 0.0001953574888749198, + "loss": 0.558, + "step": 1080 + } + ], + "logging_steps": 2, + "max_steps": 5752, + "num_input_tokens_seen": 0, + "num_train_epochs": 2, + "save_steps": 90, + "stateful_callbacks": { + "TrainerControl": { + "args": { + "should_epoch_stop": false, + "should_evaluate": false, + "should_log": false, + "should_save": true, + "should_training_stop": false + }, + "attributes": {} + } + }, + "total_flos": 4303181501693952.0, + "train_batch_size": 4, + "trial_name": null, + "trial_params": null +} diff --git a/checkpoint-1080/training_args.bin b/checkpoint-1080/training_args.bin new file mode 100644 index 0000000000000000000000000000000000000000..fba3b63792fed5a70be0307e26ba27ef584b1528 --- /dev/null +++ b/checkpoint-1080/training_args.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b72add547acd6c009f3a3770072d0cdf7de7e797c7597084319db874a556e470 +size 6904 diff --git a/checkpoint-1080/zero_to_fp32.py b/checkpoint-1080/zero_to_fp32.py new file mode 100644 index 0000000000000000000000000000000000000000..0e759146cadd92ddfefab3680146c2bd6a2b5c04 --- /dev/null +++ b/checkpoint-1080/zero_to_fp32.py @@ -0,0 +1,760 @@ +#!/usr/bin/env python + +# Copyright (c) Microsoft Corporation. +# SPDX-License-Identifier: Apache-2.0 + +# DeepSpeed Team + +# This script extracts fp32 consolidated weights from a zero 1, 2 and 3 DeepSpeed checkpoints. It gets +# copied into the top level checkpoint dir, so the user can easily do the conversion at any point in +# the future. Once extracted, the weights don't require DeepSpeed and can be used in any +# application. +# +# example: +# python zero_to_fp32.py . output_dir/ +# or +# python zero_to_fp32.py . output_dir/ --safe_serialization + +import argparse +import torch +import glob +import math +import os +import re +import gc +import json +import numpy as np +from tqdm import tqdm +from collections import OrderedDict +from dataclasses import dataclass + +# while this script doesn't use deepspeed to recover data, since the checkpoints are pickled with +# DeepSpeed data structures it has to be available in the current python environment. +from deepspeed.utils import logger +from deepspeed.checkpoint.constants import (DS_VERSION, OPTIMIZER_STATE_DICT, SINGLE_PARTITION_OF_FP32_GROUPS, + FP32_FLAT_GROUPS, ZERO_STAGE, PARTITION_COUNT, PARAM_SHAPES, BUFFER_NAMES, + FROZEN_PARAM_SHAPES, FROZEN_PARAM_FRAGMENTS) + + +@dataclass +class zero_model_state: + buffers: dict() + param_shapes: dict() + shared_params: list + ds_version: int + frozen_param_shapes: dict() + frozen_param_fragments: dict() + + +debug = 0 + +# load to cpu +device = torch.device('cpu') + + +def atoi(text): + return int(text) if text.isdigit() else text + + +def natural_keys(text): + ''' + alist.sort(key=natural_keys) sorts in human order + http://nedbatchelder.com/blog/200712/human_sorting.html + (See Toothy's implementation in the comments) + ''' + return [atoi(c) for c in re.split(r'(\d+)', text)] + + +def get_model_state_file(checkpoint_dir, zero_stage): + if not os.path.isdir(checkpoint_dir): + raise FileNotFoundError(f"Directory '{checkpoint_dir}' doesn't exist") + + # there should be only one file + if zero_stage <= 2: + file = os.path.join(checkpoint_dir, "mp_rank_00_model_states.pt") + elif zero_stage == 3: + file = os.path.join(checkpoint_dir, "zero_pp_rank_0_mp_rank_00_model_states.pt") + + if not os.path.exists(file): + raise FileNotFoundError(f"can't find model states file at '{file}'") + + return file + + +def get_checkpoint_files(checkpoint_dir, glob_pattern): + # XXX: need to test that this simple glob rule works for multi-node setup too + ckpt_files = sorted(glob.glob(os.path.join(checkpoint_dir, glob_pattern)), key=natural_keys) + + if len(ckpt_files) == 0: + raise FileNotFoundError(f"can't find {glob_pattern} files in directory '{checkpoint_dir}'") + + return ckpt_files + + +def get_optim_files(checkpoint_dir): + return get_checkpoint_files(checkpoint_dir, "*_optim_states.pt") + + +def get_model_state_files(checkpoint_dir): + return get_checkpoint_files(checkpoint_dir, "*_model_states.pt") + + +def parse_model_states(files): + zero_model_states = [] + for file in files: + state_dict = torch.load(file, map_location=device, weights_only=False) + + if BUFFER_NAMES not in state_dict: + raise ValueError(f"{file} is not a model state checkpoint") + buffer_names = state_dict[BUFFER_NAMES] + if debug: + print("Found buffers:", buffer_names) + + # recover just the buffers while restoring them to fp32 if they were saved in fp16 + buffers = {k: v.float() for k, v in state_dict["module"].items() if k in buffer_names} + param_shapes = state_dict[PARAM_SHAPES] + + # collect parameters that are included in param_shapes + param_names = [] + for s in param_shapes: + for name in s.keys(): + param_names.append(name) + + # update with frozen parameters + frozen_param_shapes = state_dict.get(FROZEN_PARAM_SHAPES, None) + if frozen_param_shapes is not None: + if debug: + print(f"Found frozen_param_shapes: {frozen_param_shapes}") + param_names += list(frozen_param_shapes.keys()) + + # handle shared params + shared_params = [[k, v] for k, v in state_dict["shared_params"].items()] + + ds_version = state_dict.get(DS_VERSION, None) + + frozen_param_fragments = state_dict.get(FROZEN_PARAM_FRAGMENTS, None) + + z_model_state = zero_model_state(buffers=buffers, + param_shapes=param_shapes, + shared_params=shared_params, + ds_version=ds_version, + frozen_param_shapes=frozen_param_shapes, + frozen_param_fragments=frozen_param_fragments) + zero_model_states.append(z_model_state) + + return zero_model_states + + +def parse_optim_states(files, ds_checkpoint_dir): + total_files = len(files) + state_dicts = [] + for f in tqdm(files, desc='Loading checkpoint shards'): + state_dict = torch.load(f, map_location=device, mmap=True, weights_only=False) + # immediately discard the potentially huge 2 optimizer states as we only care for fp32 master weights + # and also handle the case where it was already removed by another helper script + state_dict["optimizer_state_dict"].pop("optimizer_state_dict", None) + state_dicts.append(state_dict) + + if not ZERO_STAGE in state_dicts[0][OPTIMIZER_STATE_DICT]: + raise ValueError(f"{files[0]} is not a zero checkpoint") + zero_stage = state_dicts[0][OPTIMIZER_STATE_DICT][ZERO_STAGE] + world_size = state_dicts[0][OPTIMIZER_STATE_DICT][PARTITION_COUNT] + + # For ZeRO-2 each param group can have different partition_count as data parallelism for expert + # parameters can be different from data parallelism for non-expert parameters. So we can just + # use the max of the partition_count to get the dp world_size. + + if type(world_size) is list: + world_size = max(world_size) + + if world_size != total_files: + raise ValueError( + f"Expected {world_size} of '*_optim_states.pt' under '{ds_checkpoint_dir}' but found {total_files} files. " + "Possibly due to an overwrite of an old checkpoint, or a checkpoint didn't get saved by one or more processes." + ) + + # the groups are named differently in each stage + if zero_stage <= 2: + fp32_groups_key = SINGLE_PARTITION_OF_FP32_GROUPS + elif zero_stage == 3: + fp32_groups_key = FP32_FLAT_GROUPS + else: + raise ValueError(f"unknown zero stage {zero_stage}") + + fp32_flat_groups = [state_dicts[i][OPTIMIZER_STATE_DICT][fp32_groups_key] for i in range(len(state_dicts))] + return zero_stage, world_size, fp32_flat_groups + + +def _get_fp32_state_dict_from_zero_checkpoint(ds_checkpoint_dir, exclude_frozen_parameters): + """ + Returns fp32 state_dict reconstructed from ds checkpoint + + Args: + - ``ds_checkpoint_dir``: path to the deepspeed checkpoint folder (where the optimizer files are) + + """ + print(f"Processing zero checkpoint '{ds_checkpoint_dir}'") + + optim_files = get_optim_files(ds_checkpoint_dir) + zero_stage, world_size, fp32_flat_groups = parse_optim_states(optim_files, ds_checkpoint_dir) + print(f"Detected checkpoint of type zero stage {zero_stage}, world_size: {world_size}") + + model_files = get_model_state_files(ds_checkpoint_dir) + + zero_model_states = parse_model_states(model_files) + print(f'Parsing checkpoint created by deepspeed=={zero_model_states[0].ds_version}') + + if zero_stage <= 2: + return _get_fp32_state_dict_from_zero2_checkpoint(world_size, fp32_flat_groups, zero_model_states, + exclude_frozen_parameters) + elif zero_stage == 3: + return _get_fp32_state_dict_from_zero3_checkpoint(world_size, fp32_flat_groups, zero_model_states, + exclude_frozen_parameters) + + +def _zero2_merge_frozen_params(state_dict, zero_model_states): + if zero_model_states[0].frozen_param_shapes is None or len(zero_model_states[0].frozen_param_shapes) == 0: + return + + frozen_param_shapes = zero_model_states[0].frozen_param_shapes + frozen_param_fragments = zero_model_states[0].frozen_param_fragments + + if debug: + num_elem = sum(s.numel() for s in frozen_param_shapes.values()) + print(f'rank 0: {FROZEN_PARAM_SHAPES}.numel = {num_elem}') + + wanted_params = len(frozen_param_shapes) + wanted_numel = sum(s.numel() for s in frozen_param_shapes.values()) + avail_numel = sum([p.numel() for p in frozen_param_fragments.values()]) + print(f'Frozen params: Have {avail_numel} numels to process.') + print(f'Frozen params: Need {wanted_numel} numels in {wanted_params} params') + + total_params = 0 + total_numel = 0 + for name, shape in frozen_param_shapes.items(): + total_params += 1 + unpartitioned_numel = shape.numel() + total_numel += unpartitioned_numel + + state_dict[name] = frozen_param_fragments[name] + + if debug: + print(f"{name} full shape: {shape} unpartitioned numel {unpartitioned_numel} ") + + print(f"Reconstructed Frozen fp32 state dict with {total_params} params {total_numel} elements") + + +def _has_callable(obj, fn): + attr = getattr(obj, fn, None) + return callable(attr) + + +def _zero2_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states): + param_shapes = zero_model_states[0].param_shapes + + # Reconstruction protocol: + # + # XXX: document this + + if debug: + for i in range(world_size): + for j in range(len(fp32_flat_groups[0])): + print(f"{FP32_FLAT_GROUPS}[{i}][{j}].shape={fp32_flat_groups[i][j].shape}") + + # XXX: memory usage doubles here (zero2) + num_param_groups = len(fp32_flat_groups[0]) + merged_single_partition_of_fp32_groups = [] + for i in range(num_param_groups): + merged_partitions = [sd[i] for sd in fp32_flat_groups] + full_single_fp32_vector = torch.cat(merged_partitions, 0) + merged_single_partition_of_fp32_groups.append(full_single_fp32_vector) + avail_numel = sum( + [full_single_fp32_vector.numel() for full_single_fp32_vector in merged_single_partition_of_fp32_groups]) + + if debug: + wanted_params = sum([len(shapes) for shapes in param_shapes]) + wanted_numel = sum([sum(shape.numel() for shape in shapes.values()) for shapes in param_shapes]) + # not asserting if there is a mismatch due to possible padding + print(f"Have {avail_numel} numels to process.") + print(f"Need {wanted_numel} numels in {wanted_params} params.") + + # params + # XXX: for huge models that can't fit into the host's RAM we will have to recode this to support + # out-of-core computing solution + total_numel = 0 + total_params = 0 + for shapes, full_single_fp32_vector in zip(param_shapes, merged_single_partition_of_fp32_groups): + offset = 0 + avail_numel = full_single_fp32_vector.numel() + for name, shape in shapes.items(): + + unpartitioned_numel = shape.numel() if _has_callable(shape, 'numel') else math.prod(shape) + total_numel += unpartitioned_numel + total_params += 1 + + if debug: + print(f"{name} full shape: {shape} unpartitioned numel {unpartitioned_numel} ") + state_dict[name] = full_single_fp32_vector.narrow(0, offset, unpartitioned_numel).view(shape) + offset += unpartitioned_numel + + # Z2 started to align to 2*world_size to improve nccl performance. Therefore both offset and + # avail_numel can differ by anywhere between 0..2*world_size. Due to two unrelated complex + # paddings performed in the code it's almost impossible to predict the exact numbers w/o the + # live optimizer object, so we are checking that the numbers are within the right range + align_to = 2 * world_size + + def zero2_align(x): + return align_to * math.ceil(x / align_to) + + if debug: + print(f"original offset={offset}, avail_numel={avail_numel}") + + offset = zero2_align(offset) + avail_numel = zero2_align(avail_numel) + + if debug: + print(f"aligned offset={offset}, avail_numel={avail_numel}") + + # Sanity check + if offset != avail_numel: + raise ValueError(f"consumed {offset} numels out of {avail_numel} - something is wrong") + + print(f"Reconstructed fp32 state dict with {total_params} params {total_numel} elements") + + +def _get_fp32_state_dict_from_zero2_checkpoint(world_size, fp32_flat_groups, zero_model_states, + exclude_frozen_parameters): + state_dict = OrderedDict() + + # buffers + buffers = zero_model_states[0].buffers + state_dict.update(buffers) + if debug: + print(f"added {len(buffers)} buffers") + + if not exclude_frozen_parameters: + _zero2_merge_frozen_params(state_dict, zero_model_states) + + _zero2_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states) + + # recover shared parameters + for pair in zero_model_states[0].shared_params: + if pair[1] in state_dict: + state_dict[pair[0]] = state_dict[pair[1]] + + return state_dict + + +def zero3_partitioned_param_info(unpartitioned_numel, world_size): + remainder = unpartitioned_numel % world_size + padding_numel = (world_size - remainder) if remainder else 0 + partitioned_numel = math.ceil(unpartitioned_numel / world_size) + return partitioned_numel, padding_numel + + +def _zero3_merge_frozen_params(state_dict, world_size, zero_model_states): + if zero_model_states[0].frozen_param_shapes is None or len(zero_model_states[0].frozen_param_shapes) == 0: + return + + if debug: + for i in range(world_size): + num_elem = sum(s.numel() for s in zero_model_states[i].frozen_param_fragments.values()) + print(f'rank {i}: {FROZEN_PARAM_SHAPES}.numel = {num_elem}') + + frozen_param_shapes = zero_model_states[0].frozen_param_shapes + wanted_params = len(frozen_param_shapes) + wanted_numel = sum(s.numel() for s in frozen_param_shapes.values()) + avail_numel = sum([p.numel() for p in zero_model_states[0].frozen_param_fragments.values()]) * world_size + print(f'Frozen params: Have {avail_numel} numels to process.') + print(f'Frozen params: Need {wanted_numel} numels in {wanted_params} params') + + total_params = 0 + total_numel = 0 + for name, shape in zero_model_states[0].frozen_param_shapes.items(): + total_params += 1 + unpartitioned_numel = shape.numel() + total_numel += unpartitioned_numel + + param_frags = tuple(model_state.frozen_param_fragments[name] for model_state in zero_model_states) + state_dict[name] = torch.cat(param_frags, 0).narrow(0, 0, unpartitioned_numel).view(shape) + + partitioned_numel, partitioned_padding_numel = zero3_partitioned_param_info(unpartitioned_numel, world_size) + + if debug: + print( + f"Frozen params: {total_params} {name} full shape: {shape} partition0 numel={partitioned_numel} partitioned_padding_numel={partitioned_padding_numel}" + ) + + print(f"Reconstructed Frozen fp32 state dict with {total_params} params {total_numel} elements") + + +class GatheredTensor: + """ + A pseudo tensor that collects partitioned weights. + It is more memory efficient when there are multiple groups. + """ + + def __init__(self, flat_groups, flat_groups_offset, offset, partitioned_numel, shape): + self.flat_groups = flat_groups + self.flat_groups_offset = flat_groups_offset + self.offset = offset + self.partitioned_numel = partitioned_numel + self.shape = shape + self.dtype = self.flat_groups[0][0].dtype + + def contiguous(self): + """ + Merge partitioned weights from flat_groups into a single tensor. + """ + end_idx = self.offset + self.partitioned_numel + world_size = len(self.flat_groups) + pad_flat_param_chunks = [] + + for rank_i in range(world_size): + # for each rank, we need to collect weights from related group/groups + flat_groups_at_rank_i = self.flat_groups[rank_i] + start_group_id = None + end_group_id = None + for group_id in range(len(self.flat_groups_offset)): + if self.flat_groups_offset[group_id] <= self.offset < self.flat_groups_offset[group_id + 1]: + start_group_id = group_id + if self.flat_groups_offset[group_id] < end_idx <= self.flat_groups_offset[group_id + 1]: + end_group_id = group_id + break + # collect weights from related group/groups + for group_id in range(start_group_id, end_group_id + 1): + flat_tensor = flat_groups_at_rank_i[group_id] + start_offset = self.offset - self.flat_groups_offset[group_id] + end_offset = min(end_idx, self.flat_groups_offset[group_id + 1]) - self.flat_groups_offset[group_id] + pad_flat_param_chunks.append(flat_tensor[start_offset:end_offset]) + + # collect weights from all ranks + pad_flat_param = torch.cat(pad_flat_param_chunks, dim=0) + param = pad_flat_param[:self.shape.numel()].view(self.shape).contiguous() + return param + + +def _zero3_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states): + param_shapes = zero_model_states[0].param_shapes + avail_numel = sum([flat_group.numel() for flat_group in fp32_flat_groups[0]]) * world_size + + # Reconstruction protocol: For zero3 we need to zip the partitions together at boundary of each + # param, re-consolidating each param, while dealing with padding if any + + # merge list of dicts, preserving order + param_shapes = {k: v for d in param_shapes for k, v in d.items()} + + if debug: + for i in range(world_size): + print(f"{FP32_FLAT_GROUPS}[{i}].shape={fp32_flat_groups[i].shape}") + + wanted_params = len(param_shapes) + wanted_numel = sum(shape.numel() for shape in param_shapes.values()) + # not asserting if there is a mismatch due to possible padding + avail_numel = fp32_flat_groups[0].numel() * world_size + print(f"Trainable params: Have {avail_numel} numels to process.") + print(f"Trainable params: Need {wanted_numel} numels in {wanted_params} params.") + + # params + # XXX: for huge models that can't fit into the host's RAM we will have to recode this to support + # out-of-core computing solution + offset = 0 + total_numel = 0 + total_params = 0 + flat_groups_offset = [0] + list(np.cumsum([flat_tensor.numel() for flat_tensor in fp32_flat_groups[0]])) + for name, shape in tqdm(param_shapes.items(), desc='Gathering sharded weights'): + unpartitioned_numel = shape.numel() + total_numel += unpartitioned_numel + total_params += 1 + partitioned_numel, partitioned_padding_numel = zero3_partitioned_param_info(unpartitioned_numel, world_size) + + if debug: + print( + f"Trainable params: {total_params} {name} full shape: {shape} partition0 numel={partitioned_numel} partitioned_padding_numel={partitioned_padding_numel}" + ) + + # memory efficient tensor + tensor = GatheredTensor(fp32_flat_groups, flat_groups_offset, offset, partitioned_numel, shape) + state_dict[name] = tensor + offset += partitioned_numel + + offset *= world_size + + # Sanity check + if offset != avail_numel: + raise ValueError(f"consumed {offset} numels out of {avail_numel} - something is wrong") + + print(f"Reconstructed Trainable fp32 state dict with {total_params} params {total_numel} elements") + + +def _get_fp32_state_dict_from_zero3_checkpoint(world_size, fp32_flat_groups, zero_model_states, + exclude_frozen_parameters): + state_dict = OrderedDict() + + # buffers + buffers = zero_model_states[0].buffers + state_dict.update(buffers) + if debug: + print(f"added {len(buffers)} buffers") + + if not exclude_frozen_parameters: + _zero3_merge_frozen_params(state_dict, world_size, zero_model_states) + + _zero3_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states) + + # recover shared parameters + for pair in zero_model_states[0].shared_params: + if pair[1] in state_dict: + state_dict[pair[0]] = state_dict[pair[1]] + + return state_dict + + +def to_torch_tensor(state_dict, return_empty_tensor=False): + """ + Convert state_dict of GatheredTensor to torch tensor + """ + torch_state_dict = {} + converted_tensors = {} + for name, tensor in state_dict.items(): + tensor_id = id(tensor) + if tensor_id in converted_tensors: # shared tensors + shared_tensor = torch_state_dict[converted_tensors[tensor_id]] + torch_state_dict[name] = shared_tensor + else: + converted_tensors[tensor_id] = name + if return_empty_tensor: + torch_state_dict[name] = torch.empty(tensor.shape, dtype=tensor.dtype) + else: + torch_state_dict[name] = tensor.contiguous() + return torch_state_dict + + +def get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir, + tag=None, + exclude_frozen_parameters=False, + lazy_mode=False): + """ + Convert ZeRO 2 or 3 checkpoint into a single fp32 consolidated state_dict that can be loaded with + ``load_state_dict()`` and used for training without DeepSpeed or shared with others, for example + via a model hub. + + Args: + - ``checkpoint_dir``: path to the desired checkpoint folder + - ``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`` + - ``exclude_frozen_parameters``: exclude frozen parameters + - ``lazy_mode``: get state_dict in lazy mode. It returns a dict of pesduo tensor instead of torch tensor, which is more memory efficient. + Convert the pesduo tensor to torch tensor by ``.contiguous()`` + + Returns: + - pytorch ``state_dict`` + + A typical usage might be :: + + from deepspeed.utils.zero_to_fp32 import get_fp32_state_dict_from_zero_checkpoint + # do the training and checkpoint saving + state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir) # already on cpu + model = model.cpu() # move to cpu + model.load_state_dict(state_dict) + # submit to model hub or save the model to share with others + + In this example the ``model`` will no longer be usable in the deepspeed context of the same + application. i.e. you will need to re-initialize the deepspeed engine, since + ``model.load_state_dict(state_dict)`` will remove all the deepspeed magic from it. + + If you want it all done for you, use ``load_state_dict_from_zero_checkpoint`` instead. + + Note: the above usage may not work if your application doesn't have sufficient free CPU memory. + You may need to use the offline approach using the ``zero_to_fp32.py`` script that is saved with + the checkpoint. Or you can load state_dict in lazy mode :: + + from deepspeed.utils.zero_to_fp32 import get_fp32_state_dict_from_zero_checkpoint + state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir, lazy_mode=True) # not on cpu + for name, lazy_tensor in state_dict.item(): + tensor = lazy_tensor.contiguous() # to cpu + print(name, tensor) + # del tensor to release memory if it no longer in use + """ + if tag is None: + latest_path = os.path.join(checkpoint_dir, 'latest') + if os.path.isfile(latest_path): + with open(latest_path, 'r') as fd: + tag = fd.read().strip() + else: + raise ValueError(f"Unable to find 'latest' file at {latest_path}") + + ds_checkpoint_dir = os.path.join(checkpoint_dir, tag) + + if not os.path.isdir(ds_checkpoint_dir): + raise FileNotFoundError(f"Directory '{ds_checkpoint_dir}' doesn't exist") + + state_dict = _get_fp32_state_dict_from_zero_checkpoint(ds_checkpoint_dir, exclude_frozen_parameters) + if lazy_mode: + return state_dict + else: + return to_torch_tensor(state_dict) + + +def convert_zero_checkpoint_to_fp32_state_dict(checkpoint_dir, + output_dir, + max_shard_size="5GB", + safe_serialization=False, + tag=None, + exclude_frozen_parameters=False): + """ + Convert ZeRO 2 or 3 checkpoint into a single fp32 consolidated ``state_dict`` file that can be + loaded with ``torch.load(file)`` + ``load_state_dict()`` and used for training without DeepSpeed. + + Args: + - ``checkpoint_dir``: path to the desired checkpoint folder. (one that contains the tag-folder, like ``global_step14``) + - ``output_dir``: directory to the pytorch fp32 state_dict output files + - ``max_shard_size``: the maximum size for a checkpoint before being sharded, default value is 5GB + - ``safe_serialization``: whether to save the model using `safetensors` or the traditional PyTorch way (that uses `pickle`). + - ``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`` + - ``exclude_frozen_parameters``: exclude frozen parameters + """ + + # Dependency pre-check + if safe_serialization: + try: + from safetensors.torch import save_file + except ImportError: + print('If you want to use `safe_serialization`, please `pip install safetensors`') + raise + if max_shard_size is not None: + try: + from huggingface_hub import split_torch_state_dict_into_shards + except ImportError: + print('If you want to use `max_shard_size`, please `pip install huggingface_hub`') + raise + + # Convert zero checkpoint to state_dict + state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir, + tag, + exclude_frozen_parameters, + lazy_mode=True) + + # Shard the model if it is too big. + weights_name = "model.safetensors" if safe_serialization else "pytorch_model.bin" + if max_shard_size is not None: + filename_pattern = weights_name.replace(".bin", "{suffix}.bin").replace(".safetensors", "{suffix}.safetensors") + # an memory-efficient approach for sharding + empty_state_dict = to_torch_tensor(state_dict, return_empty_tensor=True) + state_dict_split = split_torch_state_dict_into_shards(empty_state_dict, + filename_pattern=filename_pattern, + max_shard_size=max_shard_size) + else: + from collections import namedtuple + StateDictSplit = namedtuple("StateDictSplit", ["is_sharded", "filename_to_tensors"]) + state_dict_split = StateDictSplit(is_sharded=False, + filename_to_tensors={weights_name: list(state_dict.keys())}) + + # Save the model by shard + os.makedirs(output_dir, exist_ok=True) + filename_to_tensors = state_dict_split.filename_to_tensors.items() + for shard_file, tensors in tqdm(filename_to_tensors, desc="Saving checkpoint shards"): + shard_state_dict = {tensor_name: state_dict[tensor_name] for tensor_name in tensors} + shard_state_dict = to_torch_tensor(shard_state_dict) + output_path = os.path.join(output_dir, shard_file) + if safe_serialization: + save_file(shard_state_dict, output_path, metadata={"format": "pt"}) + else: + torch.save(shard_state_dict, output_path) + # release the memory of current shard + for tensor_name in list(shard_state_dict.keys()): + del state_dict[tensor_name] + del shard_state_dict[tensor_name] + del shard_state_dict + gc.collect() + + # Save index if sharded + if state_dict_split.is_sharded: + index = { + "metadata": state_dict_split.metadata, + "weight_map": state_dict_split.tensor_to_filename, + } + save_index_file = "model.safetensors.index.json" if safe_serialization else "pytorch_model.bin.index.json" + save_index_file = os.path.join(output_dir, save_index_file) + with open(save_index_file, "w", encoding="utf-8") as f: + content = json.dumps(index, indent=2, sort_keys=True) + "\n" + f.write(content) + + +def load_state_dict_from_zero_checkpoint(model, checkpoint_dir, tag=None): + """ + 1. Put the provided model to cpu + 2. Convert ZeRO 2 or 3 checkpoint into a single fp32 consolidated ``state_dict`` + 3. Load it into the provided model + + Args: + - ``model``: the model object to update + - ``checkpoint_dir``: path to the desired checkpoint folder. (one that contains the tag-folder, like ``global_step14``) + - ``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`` + + Returns: + - ``model`: modified model + + Make sure you have plenty of CPU memory available before you call this function. If you don't + have enough use the ``zero_to_fp32.py`` utility to do the conversion. You will find it + conveniently placed for you in the checkpoint folder. + + A typical usage might be :: + + from deepspeed.utils.zero_to_fp32 import load_state_dict_from_zero_checkpoint + model = load_state_dict_from_zero_checkpoint(trainer.model, checkpoint_dir) + # submit to model hub or save the model to share with others + + Note, that once this was run, the ``model`` will no longer be usable in the deepspeed context + of the same application. i.e. you will need to re-initialize the deepspeed engine, since + ``model.load_state_dict(state_dict)`` will remove all the deepspeed magic from it. + + """ + logger.info(f"Extracting fp32 weights") + state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir, tag) + + logger.info(f"Overwriting model with fp32 weights") + model = model.cpu() + model.load_state_dict(state_dict, strict=False) + + return model + + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + parser.add_argument("checkpoint_dir", + type=str, + help="path to the desired checkpoint folder, e.g., path/checkpoint-12") + parser.add_argument("output_dir", + type=str, + help="directory to the pytorch fp32 state_dict output files" + "(e.g. path/checkpoint-12-output/)") + parser.add_argument( + "--max_shard_size", + type=str, + default="5GB", + help="The maximum size for a checkpoint before being sharded. Checkpoints shard will then be each of size" + "lower than this size. If expressed as a string, needs to be digits followed by a unit (like `5MB`" + "We default it to 5GB in order for models to be able to run easily on free-tier google colab instances" + "without CPU OOM issues.") + parser.add_argument( + "--safe_serialization", + default=False, + action='store_true', + help="Whether to save the model using `safetensors` or the traditional PyTorch way (that uses `pickle`).") + parser.add_argument("-t", + "--tag", + type=str, + default=None, + help="checkpoint tag used as a unique identifier for checkpoint. e.g., global_step1") + parser.add_argument("--exclude_frozen_parameters", action='store_true', help="exclude frozen parameters") + parser.add_argument("-d", "--debug", action='store_true', help="enable debug") + args = parser.parse_args() + + debug = args.debug + + convert_zero_checkpoint_to_fp32_state_dict(args.checkpoint_dir, + args.output_dir, + max_shard_size=args.max_shard_size, + safe_serialization=args.safe_serialization, + tag=args.tag, + exclude_frozen_parameters=args.exclude_frozen_parameters) diff --git a/checkpoint-1170/README.md b/checkpoint-1170/README.md new file mode 100644 index 0000000000000000000000000000000000000000..4eae946233309baf42f5bad9740186144a4f3b33 --- /dev/null +++ b/checkpoint-1170/README.md @@ -0,0 +1,202 @@ +--- +base_model: ../../initial_seq_model +library_name: peft +--- + +# Model Card for Model ID + + + + + +## Model Details + +### Model Description + + + + + +- **Developed by:** [More Information Needed] +- **Funded by [optional]:** [More Information Needed] +- **Shared by [optional]:** [More Information Needed] +- **Model type:** [More Information Needed] +- **Language(s) (NLP):** [More Information Needed] +- **License:** [More Information Needed] +- **Finetuned from model [optional]:** [More Information Needed] + +### Model Sources [optional] + + + +- **Repository:** [More Information Needed] +- **Paper [optional]:** [More Information Needed] +- **Demo [optional]:** [More Information Needed] + +## Uses + + + +### Direct Use + + + +[More Information Needed] + +### Downstream Use [optional] + + + +[More Information Needed] + +### Out-of-Scope Use + + + +[More Information Needed] + +## Bias, Risks, and Limitations + + + +[More Information Needed] + +### Recommendations + + + +Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations. + +## How to Get Started with the Model + +Use the code below to get started with the model. + +[More Information Needed] + +## Training Details + +### Training Data + + + +[More Information Needed] + +### Training Procedure + + + +#### Preprocessing [optional] + +[More Information Needed] + + +#### Training Hyperparameters + +- **Training regime:** [More Information Needed] + +#### Speeds, Sizes, Times [optional] + + + +[More Information Needed] + +## Evaluation + + + +### Testing Data, Factors & Metrics + +#### Testing Data + + + +[More Information Needed] + +#### Factors + + + +[More Information Needed] + +#### Metrics + + + +[More Information Needed] + +### Results + +[More Information Needed] + +#### Summary + + + +## Model Examination [optional] + + + +[More Information Needed] + +## Environmental Impact + + + +Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700). + +- **Hardware Type:** [More Information Needed] +- **Hours used:** [More Information Needed] +- **Cloud Provider:** [More Information Needed] +- **Compute Region:** [More Information Needed] +- **Carbon Emitted:** [More Information Needed] + +## Technical Specifications [optional] + +### Model Architecture and Objective + +[More Information Needed] + +### Compute Infrastructure + +[More Information Needed] + +#### Hardware + +[More Information Needed] + +#### Software + +[More Information Needed] + +## Citation [optional] + + + +**BibTeX:** + +[More Information Needed] + +**APA:** + +[More Information Needed] + +## Glossary [optional] + + + +[More Information Needed] + +## More Information [optional] + +[More Information Needed] + +## Model Card Authors [optional] + +[More Information Needed] + +## Model Card Contact + +[More Information Needed] +### Framework versions + +- PEFT 0.14.0 \ No newline at end of file diff --git a/checkpoint-1170/adapter_config.json b/checkpoint-1170/adapter_config.json new file mode 100644 index 0000000000000000000000000000000000000000..e1a650486f9ba9bab8c8dbb7d564bdc4ec121cf7 --- /dev/null +++ b/checkpoint-1170/adapter_config.json @@ -0,0 +1,38 @@ +{ + "alpha_pattern": {}, + "auto_mapping": null, + "base_model_name_or_path": "../../initial_seq_model", + "bias": "none", + "eva_config": null, + "exclude_modules": null, + "fan_in_fan_out": false, + "inference_mode": true, + "init_lora_weights": true, + "layer_replication": null, + "layers_pattern": null, + "layers_to_transform": null, + "loftq_config": {}, + "lora_alpha": 16, + "lora_bias": false, + "lora_dropout": 0.1, + "megatron_config": null, + "megatron_core": "megatron.core", + "modules_to_save": null, + "peft_type": "LORA", + "r": 8, + "rank_pattern": {}, + "revision": null, + "target_modules": [ + "k_proj", + "o_proj", + "gate_proj", + "down_proj", + "score", + "v_proj", + "up_proj", + "q_proj" + ], + "task_type": "CAUSAL_LM", + "use_dora": false, + "use_rslora": false +} \ No newline at end of file diff --git a/checkpoint-1170/adapter_model.safetensors b/checkpoint-1170/adapter_model.safetensors new file mode 100644 index 0000000000000000000000000000000000000000..9824300b03ea7a8bc36fb554ea453a9f28145d2a --- /dev/null +++ b/checkpoint-1170/adapter_model.safetensors @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7f7ffe39e0ca812790b65ff4bb4686fd88a07d6d677f35b88c34262a305d21c9 +size 42068368 diff --git a/checkpoint-1170/global_step1170/bf16_zero_pp_rank_0_mp_rank_00_optim_states.pt b/checkpoint-1170/global_step1170/bf16_zero_pp_rank_0_mp_rank_00_optim_states.pt new file mode 100644 index 0000000000000000000000000000000000000000..f9cdf5f71f9b38ff0c1d1ccc568ebe556d1c1f0e --- /dev/null +++ b/checkpoint-1170/global_step1170/bf16_zero_pp_rank_0_mp_rank_00_optim_states.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4daac094337ae497e0fa8af400fcea891e5f4d048732d70b00163d19d0bc9c6a +size 63016432 diff --git a/checkpoint-1170/global_step1170/bf16_zero_pp_rank_1_mp_rank_00_optim_states.pt b/checkpoint-1170/global_step1170/bf16_zero_pp_rank_1_mp_rank_00_optim_states.pt new file mode 100644 index 0000000000000000000000000000000000000000..ffa9b4190211adaa7b3db7a774951644d03704e9 --- /dev/null +++ b/checkpoint-1170/global_step1170/bf16_zero_pp_rank_1_mp_rank_00_optim_states.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1c04abc9d76fb0fc4f77d202128abf735aae52dd6dd2c04b6c8a8e93fc1b6147 +size 63016432 diff --git a/checkpoint-1170/global_step1170/bf16_zero_pp_rank_2_mp_rank_00_optim_states.pt b/checkpoint-1170/global_step1170/bf16_zero_pp_rank_2_mp_rank_00_optim_states.pt new file mode 100644 index 0000000000000000000000000000000000000000..9fb4d239483ae36a0369f7c76b7da329833a57cc --- /dev/null +++ b/checkpoint-1170/global_step1170/bf16_zero_pp_rank_2_mp_rank_00_optim_states.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:15944f6e6c99b74bf11da6a491434dea709b59ac30a0c72ace49374259734d52 +size 63016432 diff --git a/checkpoint-1170/global_step1170/bf16_zero_pp_rank_3_mp_rank_00_optim_states.pt b/checkpoint-1170/global_step1170/bf16_zero_pp_rank_3_mp_rank_00_optim_states.pt new file mode 100644 index 0000000000000000000000000000000000000000..02f6b32eb08788ca49b6abac32583fd4971cbec5 --- /dev/null +++ b/checkpoint-1170/global_step1170/bf16_zero_pp_rank_3_mp_rank_00_optim_states.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:725bd60c615905b60e48d120087b89cf39a0985ff7e1eef8eaa9362f68fab0b0 +size 63016432 diff --git a/checkpoint-1170/global_step1170/zero_pp_rank_0_mp_rank_00_model_states.pt b/checkpoint-1170/global_step1170/zero_pp_rank_0_mp_rank_00_model_states.pt new file mode 100644 index 0000000000000000000000000000000000000000..662dc8b60977a3b35ebb6d1a4a8f4876f898fe68 --- /dev/null +++ b/checkpoint-1170/global_step1170/zero_pp_rank_0_mp_rank_00_model_states.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f9d3fe5fd138dae44b7da5f1483ce0c12a53c23120edcf8ccd30fe5a1050eb48 +size 442088 diff --git a/checkpoint-1170/global_step1170/zero_pp_rank_1_mp_rank_00_model_states.pt b/checkpoint-1170/global_step1170/zero_pp_rank_1_mp_rank_00_model_states.pt new file mode 100644 index 0000000000000000000000000000000000000000..25708c058c87cc4394adb8186a31e4f800d7d007 --- /dev/null +++ b/checkpoint-1170/global_step1170/zero_pp_rank_1_mp_rank_00_model_states.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a0ede948e416acf2e75e2ef8295a456c4b0123d6837df161d349f52573d44abe +size 442088 diff --git a/checkpoint-1170/global_step1170/zero_pp_rank_2_mp_rank_00_model_states.pt b/checkpoint-1170/global_step1170/zero_pp_rank_2_mp_rank_00_model_states.pt new file mode 100644 index 0000000000000000000000000000000000000000..104fd7e76dfa13f0d763771e0be70f796e92413e --- /dev/null +++ b/checkpoint-1170/global_step1170/zero_pp_rank_2_mp_rank_00_model_states.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:41f602b8bbfa703dc3346c29edd99c3e2961d99e2c8eef3d6df676cd087b2be5 +size 442088 diff --git a/checkpoint-1170/global_step1170/zero_pp_rank_3_mp_rank_00_model_states.pt b/checkpoint-1170/global_step1170/zero_pp_rank_3_mp_rank_00_model_states.pt new file mode 100644 index 0000000000000000000000000000000000000000..73205e432aa1c24bd1555d1945534bdc942d3028 --- /dev/null +++ b/checkpoint-1170/global_step1170/zero_pp_rank_3_mp_rank_00_model_states.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7e4f87069b00e941e780ff271446bb381e2563f76d3f13a2510005008e0c87c1 +size 442088 diff --git a/checkpoint-1170/latest b/checkpoint-1170/latest new file mode 100644 index 0000000000000000000000000000000000000000..deec7a6c492dd2cd4eeb156ab097545fd9280790 --- /dev/null +++ b/checkpoint-1170/latest @@ -0,0 +1 @@ +global_step1170 \ No newline at end of file diff --git a/checkpoint-1170/rng_state_0.pth b/checkpoint-1170/rng_state_0.pth new file mode 100644 index 0000000000000000000000000000000000000000..d14bd5135b1cbfcd0287d4648a3ed6093582c774 --- /dev/null +++ b/checkpoint-1170/rng_state_0.pth @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a1f4bcac92757b2f2e7ccee1b14e7605e7b1f5a406a59ca1861585945e1a9635 +size 14960 diff --git a/checkpoint-1170/rng_state_1.pth b/checkpoint-1170/rng_state_1.pth new file mode 100644 index 0000000000000000000000000000000000000000..7a30676334588c3541bfd2f6acac3254df4393cf --- /dev/null +++ b/checkpoint-1170/rng_state_1.pth @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:43cb819b07eea538b35e77881adad4cc16f05b013019b2b36adbbab184c126ab +size 14960 diff --git a/checkpoint-1170/rng_state_2.pth b/checkpoint-1170/rng_state_2.pth new file mode 100644 index 0000000000000000000000000000000000000000..1fdff3282081decf973682c65b1877e93e621798 --- /dev/null +++ b/checkpoint-1170/rng_state_2.pth @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:36e89c559ec8d731912e7a7126e6f105bd04edb6560947dce420df7f042ade84 +size 14960 diff --git a/checkpoint-1170/rng_state_3.pth b/checkpoint-1170/rng_state_3.pth new file mode 100644 index 0000000000000000000000000000000000000000..ec4b80b33309006897c773fcb2e0bc88e3bc1f04 --- /dev/null +++ b/checkpoint-1170/rng_state_3.pth @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6cff8aa495938f6284a7c27d560e94ac101e3a7aefba9f530e0e796f083f388f +size 14960 diff --git a/checkpoint-1170/scheduler.pt b/checkpoint-1170/scheduler.pt new file mode 100644 index 0000000000000000000000000000000000000000..79e2c3321ccc14e8ae163526da88cf245f169259 --- /dev/null +++ b/checkpoint-1170/scheduler.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1a7f1216465e13b10fa0131544f5f3e82daa222fb53d9aa6a40e735f590850cd +size 1064 diff --git a/checkpoint-1170/special_tokens_map.json b/checkpoint-1170/special_tokens_map.json new file mode 100644 index 0000000000000000000000000000000000000000..a8eb9ef63af01dfa2c350573b543b14275370944 --- /dev/null +++ b/checkpoint-1170/special_tokens_map.json @@ -0,0 +1,30 @@ +{ + "bos_token": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false + }, + "eos_token": { + "content": "<|END_OF_TURN_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false + }, + "pad_token": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false + }, + "unk_token": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false + } +} diff --git a/checkpoint-1170/tokenizer.json b/checkpoint-1170/tokenizer.json new file mode 100644 index 0000000000000000000000000000000000000000..91a1344d38167f152a8803a80eb79ca4b465adbb --- /dev/null +++ b/checkpoint-1170/tokenizer.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:28c8b8038fcb2756e349a51832a56634423c579a869f39642526327aa56b2989 +size 20125189 diff --git a/checkpoint-1170/tokenizer_config.json b/checkpoint-1170/tokenizer_config.json new file mode 100644 index 0000000000000000000000000000000000000000..100ac1a3b6cff4a9043d2c0fd6b1603d1c1ee1e1 --- /dev/null +++ b/checkpoint-1170/tokenizer_config.json @@ -0,0 +1,364 @@ +{ + "add_bos_token": true, + "add_eos_token": false, + "add_prefix_space": false, + "added_tokens_decoder": { + "0": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "1": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "2": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "3": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "4": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "5": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "6": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "7": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "255000": { + "content": "<|START_OF_TURN_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255001": { + "content": "<|END_OF_TURN_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "255002": { + "content": "<|YES_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255003": { + "content": "<|NO_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255004": { + "content": "<|GOOD_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255005": { + "content": "<|BAD_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255006": { + "content": "<|USER_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255007": { + "content": "<|CHATBOT_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255008": { + "content": "<|SYSTEM_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255009": { + "content": "<|USER_0_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255010": { + "content": "<|USER_1_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255011": { + "content": "<|USER_2_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255012": { + "content": "<|USER_3_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255013": { + "content": "<|USER_4_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255014": { + "content": "<|USER_5_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255015": { + "content": "<|USER_6_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255016": { + "content": "<|USER_7_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255017": { + "content": "<|USER_8_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255018": { + "content": "<|USER_9_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255019": { + "content": "<|START_THINKING|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255020": { + "content": "<|END_THINKING|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255021": { + "content": "<|START_RESPONSE|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "255022": { + "content": "<|END_RESPONSE|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "255023": { + "content": "<|START_ACTION|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255024": { + "content": "<|END_ACTION|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255025": { + "content": "<|START_TOOL_RESULT|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255026": { + "content": "<|END_TOOL_RESULT|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255027": { + "content": "<|EXTRA_8_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255028": { + "content": "<|NEW_FILE|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "255029": { + "content": "<|BEGINNING_OF_PREFIX_FIM_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255030": { + "content": "<|BEGINNING_OF_MIDDLE_FIM_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255031": { + "content": "<|BEGINNING_OF_SUFFIX_FIM_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255032": { + "content": "<|END_OF_MIDDLE_FIM_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + } + }, + "bos_token": "", + "chat_template": [ + { + "name": "default", + "template": "{% if documents %}\n{% set tools = [] %}\n{%- macro document_turn(documents) -%}\n{# format documents into chat turn #}\n<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|><|START_THINKING|>I will look through the document to address the users needs.<|END_THINKING|><|START_ACTION|>[\n {\"tool_call_id\": \"0\", \"tool_name\": \"direct-injected-document\", \"parameters\": {}}\n]<|END_ACTION|><|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|><|START_TOOL_RESULT|>[\n {\n \"tool_call_id\": \"0\",\n \"results\": {\n{% for doc in documents %}\n \"{{ loop.index0 }}\": {{doc|tojson}}{% if not loop.last %},\n {% endif %}\n{% endfor %}\n\n },\n \"is_error\": null\n }\n]<|END_TOOL_RESULT|><|END_OF_TURN_TOKEN|>{%- endmacro %}\n{%- macro tool_call_id_to_int(messages, tool_call_id) %}\n{%- set counter = namespace(value=0) %}\n{%- set tool_call_id_seen = namespace(value=false) %}\n{%- for msg in messages %}\n {%- if msg.tool_calls %}\n {%- for tool_call in msg.tool_calls %}\n {%- if tool_call.id == tool_call_id and not tool_call_id_seen.value -%}\n {{ counter.value }}\n {%- set tool_call_id_seen.value = true %}\n {%- endif %}\n {%- set counter.value = counter.value + 1 %}\n {%- endfor %}\n {%- endif %}\n{%- endfor %}\n{%- endmacro %}\n{%- macro format_tool_message(messages, tool_msg) -%}\n{# format tool message #}\n {\n \"tool_call_id\": \"{{ tool_call_id_to_int(messages, tool_msg.tool_call_id) }}\",\n \"results\": {\n \"0\": {{ tool_msg.content|tojson }}\n },\n \"is_error\": null\n }\n{%- endmacro -%}\n{%- if messages and messages[0]['role']|lower == 'system' %}{%- set developer_preamble = messages[0]['content'] %}{% endif %}\n{%- set tool_idx = namespace(value=0) %}\n{%- set tool_ids_seen = namespace(value=[]) %}\n{%- set sent_documents = namespace(value=false) %}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|># System Preamble\nYou are in contextual safety mode. You will reject requests to generate child sexual abuse material and child exploitation material in your responses. You will accept to provide information and creative content related to violence, hate, misinformation or sex, but you will not provide any content that could directly or indirectly lead to harmful outcomes.\n\nYour information cutoff date is June 2024.\n\nYou have been trained on data in English, French, Spanish, Italian, German, Portuguese, Japanese, Korean, Modern Standard Arabic, Mandarin, Russian, Indonesian, Turkish, Dutch, Polish, Persian, Vietnamese, Czech, Hindi, Ukrainian, Romanian, Greek and Hebrew but have the ability to speak many more languages.\n{% if tools or documents %}\n\nYou have been trained to have advanced reasoning and tool-use capabilities and you should make best use of these skills to serve user's requests.\n\n## Tool Use\nThink about how you can make best use of the provided tools to help with the task and come up with a high level plan that you will execute first.\n\n0. Start by writing <|START_THINKING|> followed by a detailed step by step plan of how you will solve the problem. For each step explain your thinking fully and give details of required tool calls (if needed). Unless specified otherwise, you write your plan in natural language. When you finish, close it out with <|END_THINKING|>.\n You can optionally choose to skip this step when the user request is so straightforward to address that only a trivial plan would be needed.\n NOTE: You MUST skip this step when you are directly responding to the user's request without using any tools.\n\nThen carry out your plan by repeatedly executing the following steps.\n1. Action: write <|START_ACTION|> followed by a list of JSON-formatted tool calls, with each one containing \"tool_name\" and \"parameters\" fields.\n When there are multiple tool calls which are completely independent of each other (i.e. they can be executed in parallel), you should list them out all together in one step. When you finish, close it out with <|END_ACTION|>.\n2. Observation: you will then receive results of those tool calls in JSON format in the very next turn, wrapped around by <|START_TOOL_RESULT|> and <|END_TOOL_RESULT|>. Carefully observe those results and think about what to do next. Note that these results will be provided to you in a separate turn. NEVER hallucinate results.\n Every tool call produces a list of results (when a tool call produces no result or a single result, it'll still get wrapped inside a list). Each result is clearly linked to its originating tool call via its \"tool_call_id\".\n3. Reflection: start the next turn by writing <|START_THINKING|> followed by what you've figured out so far, any changes you need to make to your plan, and what you will do next. When you finish, close it out with <|END_THINKING|>.\n You can optionally choose to skip this step when everything is going according to plan and no special pieces of information or reasoning chains need to be recorded.\n NOTE: You MUST skip this step when you are done with tool-use actions and are ready to respond to the user.\n\nYou can repeat the above 3 steps multiple times (could be 0 times too if no suitable tool calls are available or needed), until you decide it's time to finally respond to the user.\n\n4. Response: then break out of the loop and write <|START_RESPONSE|> followed by a piece of text which serves as a response to the user's last request. Use all previous tool calls and results to help you when formulating your response. When you finish, close it out with <|END_RESPONSE|>.\n{% if enable_citations %}\n\n## Grounding\nImportantly, note that \"Reflection\" and \"Response\" above can be grounded.\nGrounding means you associate pieces of texts (called \"spans\") with those specific tool results that support them (called \"sources\"). And you use a pair of tags \"\" and \"\" to indicate when a span can be grounded onto a list of sources, listing them out in the closing tag. Sources from the same tool call are grouped together and listed as \"{tool_call_id}:[{list of result indices}]\", before they are joined together by \",\". E.g., \"span\" means that \"span\" is supported by result 1 and 2 from \"tool_call_id=0\" as well as result 0 from \"tool_call_id=1\".\n{% endif %}\n\n## Available Tools\nHere is the list of tools that you have available to you.\nYou can ONLY use the tools listed here. When a tool is not listed below, it is NOT available and you should NEVER attempt to use it.\nEach tool is represented as a JSON object with fields like \"name\", \"description\", \"parameters\" (per JSON Schema), and optionally, \"responses\" (per JSON Schema).\n\n```json\n[\n{% if documents %}\n {\"name\": \"direct-injected-document\", \"description\": \"This is a special tool to directly inject user-uploaded documents into the chat as additional context. DO NOT use this tool by yourself!\", \"parameters\": {\"type\": \"object\", \"properties\": {}, \"required\": []}, \"responses\": {\"200\": {\"description\": \"Successfully returned a list of chunked text snippets from the directly uploaded documents.\", \"content\": {\"application/json\": {\"schema\": {\"type\": \"array\", \"items\": {\"type\": \"object\", \"required\": [\"url\", \"snippet\"], \"properties\": {\"url\": {\"type\": \"string\", \"description\": \"The url of the uploaded document.\"}, \"snippet\": {\"type\": \"string\", \"description\": \"The text snippet for the returned document chunk.\"}}}}}}}}}{%- if tools %},{% endif %}\n\n{% endif %}\n{% for tool in tools %}\n {\"name\": \"{{ tool['function']['name'] }}\", \"description\": \"{{tool['function']['description']}}\", \"parameters\": {{ tool['function']['parameters']|tojson }}, \"responses\": null}{%- if not loop.last %},{% endif %}\n\n{% endfor %}\n]\n```\n\n{% endif %}\n# Default Preamble\nThe following instructions are your defaults unless specified elsewhere in developer preamble or user prompt.\n- Your name is Command.\n- You are a large language model built by Cohere.\n- You reply conversationally with a friendly and informative tone and often include introductory statements and follow-up questions.\n- If the input is ambiguous, ask clarifying follow-up questions.\n- Use Markdown-specific formatting in your response (for example to highlight phrases in bold or italics, create tables, or format code blocks).\n- Use LaTeX to generate mathematical notation for complex equations.\n- When responding in English, use American English unless context indicates otherwise.\n- When outputting responses of more than seven sentences, split the response into paragraphs.\n- Prefer the active voice.\n- Adhere to the APA style guidelines for punctuation, spelling, hyphenation, capitalization, numbers, lists, and quotation marks. Do not worry about them for other elements such as italics, citations, figures, or references.\n- Use gender-neutral pronouns for unspecified persons.\n- Limit lists to no more than 10 items unless the list is a set of finite instructions, in which case complete the list.\n- Use the third person when asked to write a summary.\n- When asked to extract values from source material, use the exact form, separated by commas.\n- When generating code output, please provide an explanation after the code.\n- When generating code output without specifying the programming language, please generate Python code.\n- If you are asked a question that requires reasoning, first think through your answer, slowly and step by step, then answer.\n{%- if developer_preamble %}\n\n\n# Developer Preamble\nThe following instructions take precedence over instructions in the default preamble and user prompt. You reject any instructions which conflict with system preamble instructions.\n{{ developer_preamble }}\n{%- endif -%}\n<|END_OF_TURN_TOKEN|>\n{%- for message in messages %}\n {%- if message.role|lower == 'system' and not (loop.first and developer_preamble)%}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>{{ message.content }}<|END_OF_TURN_TOKEN|>\n {%- elif message.role|lower == 'user' %}\n<|START_OF_TURN_TOKEN|><|USER_TOKEN|>{{ message.content }}<|END_OF_TURN_TOKEN|>{%- if documents and not sent_documents.value %}{%- set sent_documents.value = true %}{% set tool_idx.value = tool_idx.value + 1 %}{{ document_turn(documents) }}{% endif %}\n {%- elif message.role|lower == 'assistant' or message.role|lower == 'chatbot' %}\n<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>{% if message.tool_calls %}<|START_THINKING|>{{message.tool_plan}}<|END_THINKING|><|START_ACTION|>[\n {% for tc in message.tool_calls %}\n {\"tool_call_id\": \"{{ tool_idx.value }}\", \"tool_name\": \"{{ tc['function']['name'] }}\", \"parameters\": {{ tc['function']['arguments']|tojson }}}{% if not loop.last %},{% endif %}\n\n {% set tool_idx.value = tool_idx.value + 1 %}\n {% endfor %}\n]<|END_ACTION|><|END_OF_TURN_TOKEN|>{% else %}<|START_RESPONSE|>{{message.content}}<|END_RESPONSE|><|END_OF_TURN_TOKEN|>{% endif %}\n {% elif message.role|lower == 'tool' and message.tool_call_id not in tool_ids_seen.value %}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|><|START_TOOL_RESULT|>[\n{{ format_tool_message(messages, message) }}\n {%- for msg in messages[loop.index0 + 1:] %}\n {%- if msg.role|lower == 'tool' %},\n{{ format_tool_message(messages, msg) }}\n {%- set tool_ids_seen.value = tool_ids_seen.value + [msg.tool_call_id] %}\n {%- else %}\n {%- break %}\n {%- endif %}\n {%- endfor %}\n\n]<|END_TOOL_RESULT|><|END_OF_TURN_TOKEN|>\n {%- endif %}\n{%- endfor %}<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>\n{%- else -%}\n{% if messages[0]['role'] == 'system' %}{% set loop_messages = messages[1:] %}\n {%- set system_message = messages[0]['content'] %}{% elif false == true %}\n {%- set loop_messages = messages %}{% set system_message = '' %}\n{%- else %}\n {%- set loop_messages = messages %}\n {%- set system_message = false %}\n{%- endif %}\n{%- if system_message != false -%}\n {{ '<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>' + system_message + '<|END_OF_TURN_TOKEN|>' }}\n{%- else -%}\n {{ '<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|><|END_OF_TURN_TOKEN|>' }}\n{%- endif %}\n{%- for message in loop_messages %}\n {%- if (message['role'] == 'user') != (loop.index0 % 2 == 0) -%}\n {{ raise_exception('Conversation roles must alternate user/assistant/user/assistant/...') }}\n {%- endif -%}\n {%- set content = message['content'] -%}\n {%- if message['role'] == 'user' -%}\n {{ '<|START_OF_TURN_TOKEN|><|USER_TOKEN|>' + content.strip() + '<|END_OF_TURN_TOKEN|>' }}\n {%- elif message['role'] == 'assistant' -%}\n {{ '<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|><|START_RESPONSE|>' + content.strip() + '<|END_RESPONSE|><|END_OF_TURN_TOKEN|>' }}\n {%- endif %}\n{%- endfor %}\n{%- if add_generation_prompt -%}\n {{ '<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|><|START_RESPONSE|>' }}\n{%- endif %}\n{% endif %}" + }, + { + "name": "tool_use", + "template": "{%- macro document_turn(documents) -%}\n{# format documents into chat turn #}\n<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|><|START_THINKING|>I will look through the document to address the users needs.<|END_THINKING|><|START_ACTION|>[\n {\"tool_call_id\": \"0\", \"tool_name\": \"direct-injected-document\", \"parameters\": {}}\n]<|END_ACTION|><|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|><|START_TOOL_RESULT|>[\n {\n \"tool_call_id\": \"0\",\n \"results\": {\n{% for doc in documents %}\n \"{{ loop.index0 }}\": {{doc|tojson}}{% if not loop.last %},\n {% endif %}\n{% endfor %}\n\n },\n \"is_error\": null\n }\n]<|END_TOOL_RESULT|><|END_OF_TURN_TOKEN|>{%- endmacro %}\n{%- macro tool_call_id_to_int(messages, tool_call_id) %}\n{%- set counter = namespace(value=0) %}\n{%- set tool_call_id_seen = namespace(value=false) %}\n{%- for msg in messages %}\n {%- if msg.tool_calls %}\n {%- for tool_call in msg.tool_calls %}\n {%- if tool_call.id == tool_call_id and not tool_call_id_seen.value -%}\n {{ counter.value }}\n {%- set tool_call_id_seen.value = true %}\n {%- endif %}\n {%- set counter.value = counter.value + 1 %}\n {%- endfor %}\n {%- endif %}\n{%- endfor %}\n{%- endmacro %}\n{%- macro format_tool_message(messages, tool_msg) -%}\n{# format tool message #}\n {\n \"tool_call_id\": \"{{ tool_call_id_to_int(messages, tool_msg.tool_call_id) }}\",\n \"results\": {\n \"0\": {{ tool_msg.content|tojson }}\n },\n \"is_error\": null\n }\n{%- endmacro -%}\n{%- if messages and messages[0]['role']|lower == 'system' %}{%- set developer_preamble = messages[0]['content'] %}{% endif %}\n{%- set tool_idx = namespace(value=0) %}\n{%- set tool_ids_seen = namespace(value=[]) %}\n{%- set sent_documents = namespace(value=false) %}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|># System Preamble\nYou are in contextual safety mode. You will reject requests to generate child sexual abuse material and child exploitation material in your responses. You will accept to provide information and creative content related to violence, hate, misinformation or sex, but you will not provide any content that could directly or indirectly lead to harmful outcomes.\n\nYour information cutoff date is June 2024.\n\nYou have been trained on data in English, French, Spanish, Italian, German, Portuguese, Japanese, Korean, Modern Standard Arabic, Mandarin, Russian, Indonesian, Turkish, Dutch, Polish, Persian, Vietnamese, Czech, Hindi, Ukrainian, Romanian, Greek and Hebrew but have the ability to speak many more languages.\n{% if tools or documents %}\n\nYou have been trained to have advanced reasoning and tool-use capabilities and you should make best use of these skills to serve user's requests.\n\n## Tool Use\nThink about how you can make best use of the provided tools to help with the task and come up with a high level plan that you will execute first.\n\n0. Start by writing <|START_THINKING|> followed by a detailed step by step plan of how you will solve the problem. For each step explain your thinking fully and give details of required tool calls (if needed). Unless specified otherwise, you write your plan in natural language. When you finish, close it out with <|END_THINKING|>.\n You can optionally choose to skip this step when the user request is so straightforward to address that only a trivial plan would be needed.\n NOTE: You MUST skip this step when you are directly responding to the user's request without using any tools.\n\nThen carry out your plan by repeatedly executing the following steps.\n1. Action: write <|START_ACTION|> followed by a list of JSON-formatted tool calls, with each one containing \"tool_name\" and \"parameters\" fields.\n When there are multiple tool calls which are completely independent of each other (i.e. they can be executed in parallel), you should list them out all together in one step. When you finish, close it out with <|END_ACTION|>.\n2. Observation: you will then receive results of those tool calls in JSON format in the very next turn, wrapped around by <|START_TOOL_RESULT|> and <|END_TOOL_RESULT|>. Carefully observe those results and think about what to do next. Note that these results will be provided to you in a separate turn. NEVER hallucinate results.\n Every tool call produces a list of results (when a tool call produces no result or a single result, it'll still get wrapped inside a list). Each result is clearly linked to its originating tool call via its \"tool_call_id\".\n3. Reflection: start the next turn by writing <|START_THINKING|> followed by what you've figured out so far, any changes you need to make to your plan, and what you will do next. When you finish, close it out with <|END_THINKING|>.\n You can optionally choose to skip this step when everything is going according to plan and no special pieces of information or reasoning chains need to be recorded.\n NOTE: You MUST skip this step when you are done with tool-use actions and are ready to respond to the user.\n\nYou can repeat the above 3 steps multiple times (could be 0 times too if no suitable tool calls are available or needed), until you decide it's time to finally respond to the user.\n\n4. Response: then break out of the loop and write <|START_RESPONSE|> followed by a piece of text which serves as a response to the user's last request. Use all previous tool calls and results to help you when formulating your response. When you finish, close it out with <|END_RESPONSE|>.\n{% if enable_citations %}\n\n## Grounding\nImportantly, note that \"Reflection\" and \"Response\" above can be grounded.\nGrounding means you associate pieces of texts (called \"spans\") with those specific tool results that support them (called \"sources\"). And you use a pair of tags \"\" and \"\" to indicate when a span can be grounded onto a list of sources, listing them out in the closing tag. Sources from the same tool call are grouped together and listed as \"{tool_call_id}:[{list of result indices}]\", before they are joined together by \",\". E.g., \"span\" means that \"span\" is supported by result 1 and 2 from \"tool_call_id=0\" as well as result 0 from \"tool_call_id=1\".\n{% endif %}\n\n## Available Tools\nHere is the list of tools that you have available to you.\nYou can ONLY use the tools listed here. When a tool is not listed below, it is NOT available and you should NEVER attempt to use it.\nEach tool is represented as a JSON object with fields like \"name\", \"description\", \"parameters\" (per JSON Schema), and optionally, \"responses\" (per JSON Schema).\n\n```json\n[\n{% if documents %}\n {\"name\": \"direct-injected-document\", \"description\": \"This is a special tool to directly inject user-uploaded documents into the chat as additional context. DO NOT use this tool by yourself!\", \"parameters\": {\"type\": \"object\", \"properties\": {}, \"required\": []}, \"responses\": {\"200\": {\"description\": \"Successfully returned a list of chunked text snippets from the directly uploaded documents.\", \"content\": {\"application/json\": {\"schema\": {\"type\": \"array\", \"items\": {\"type\": \"object\", \"required\": [\"url\", \"snippet\"], \"properties\": {\"url\": {\"type\": \"string\", \"description\": \"The url of the uploaded document.\"}, \"snippet\": {\"type\": \"string\", \"description\": \"The text snippet for the returned document chunk.\"}}}}}}}}}{%- if tools %},{% endif %}\n\n{% endif %}\n{% for tool in tools %}\n {\"name\": \"{{ tool['function']['name'] }}\", \"description\": \"{{tool['function']['description']}}\", \"parameters\": {{ tool['function']['parameters']|tojson }}, \"responses\": null}{%- if not loop.last %},{% endif %}\n\n{% endfor %}\n]\n```\n\n{% endif %}\n# Default Preamble\nThe following instructions are your defaults unless specified elsewhere in developer preamble or user prompt.\n- Your name is Command.\n- You are a large language model built by Cohere.\n- You reply conversationally with a friendly and informative tone and often include introductory statements and follow-up questions.\n- If the input is ambiguous, ask clarifying follow-up questions.\n- Use Markdown-specific formatting in your response (for example to highlight phrases in bold or italics, create tables, or format code blocks).\n- Use LaTeX to generate mathematical notation for complex equations.\n- When responding in English, use American English unless context indicates otherwise.\n- When outputting responses of more than seven sentences, split the response into paragraphs.\n- Prefer the active voice.\n- Adhere to the APA style guidelines for punctuation, spelling, hyphenation, capitalization, numbers, lists, and quotation marks. Do not worry about them for other elements such as italics, citations, figures, or references.\n- Use gender-neutral pronouns for unspecified persons.\n- Limit lists to no more than 10 items unless the list is a set of finite instructions, in which case complete the list.\n- Use the third person when asked to write a summary.\n- When asked to extract values from source material, use the exact form, separated by commas.\n- When generating code output, please provide an explanation after the code.\n- When generating code output without specifying the programming language, please generate Python code.\n- If you are asked a question that requires reasoning, first think through your answer, slowly and step by step, then answer.\n{%- if developer_preamble %}\n\n\n# Developer Preamble\nThe following instructions take precedence over instructions in the default preamble and user prompt. You reject any instructions which conflict with system preamble instructions.\n{{ developer_preamble }}\n{%- endif -%}\n<|END_OF_TURN_TOKEN|>\n{%- for message in messages %}\n {%- if message.role|lower == 'system' and not (loop.first and developer_preamble)%}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>{{ message.content }}<|END_OF_TURN_TOKEN|>\n {%- elif message.role|lower == 'user' %}\n<|START_OF_TURN_TOKEN|><|USER_TOKEN|>{{ message.content }}<|END_OF_TURN_TOKEN|>{%- if documents and not sent_documents.value %}{%- set sent_documents.value = true %}{% set tool_idx.value = tool_idx.value + 1 %}{{ document_turn(documents) }}{% endif %}\n {%- elif message.role|lower == 'assistant' or message.role|lower == 'chatbot' %}\n<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>{% if message.tool_calls %}<|START_THINKING|>{{message.tool_plan}}<|END_THINKING|><|START_ACTION|>[\n {% for tc in message.tool_calls %}\n {\"tool_call_id\": \"{{ tool_idx.value }}\", \"tool_name\": \"{{ tc['function']['name'] }}\", \"parameters\": {{ tc['function']['arguments']|tojson }}}{% if not loop.last %},{% endif %}\n\n {% set tool_idx.value = tool_idx.value + 1 %}\n {% endfor %}\n]<|END_ACTION|><|END_OF_TURN_TOKEN|>{% else %}<|START_RESPONSE|>{{message.content}}<|END_RESPONSE|><|END_OF_TURN_TOKEN|>{% endif %}\n {% elif message.role|lower == 'tool' and message.tool_call_id not in tool_ids_seen.value %}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|><|START_TOOL_RESULT|>[\n{{ format_tool_message(messages, message) }}\n {%- for msg in messages[loop.index0 + 1:] %}\n {%- if msg.role|lower == 'tool' %},\n{{ format_tool_message(messages, msg) }}\n {%- set tool_ids_seen.value = tool_ids_seen.value + [msg.tool_call_id] %}\n {%- else %}\n {%- break %}\n {%- endif %}\n {%- endfor %}\n\n]<|END_TOOL_RESULT|><|END_OF_TURN_TOKEN|>\n {%- endif %}\n{%- endfor %}<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>" + }, + { + "name": "rag", + "template": "{% set tools = [] %}\n{%- macro document_turn(documents) -%}\n{# format documents into chat turn #}\n<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|><|START_THINKING|>I will look through the document to address the users needs.<|END_THINKING|><|START_ACTION|>[\n {\"tool_call_id\": \"0\", \"tool_name\": \"direct-injected-document\", \"parameters\": {}}\n]<|END_ACTION|><|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|><|START_TOOL_RESULT|>[\n {\n \"tool_call_id\": \"0\",\n \"results\": {\n{% for doc in documents %}\n \"{{ loop.index0 }}\": {{doc|tojson}}{% if not loop.last %},\n {% endif %}\n{% endfor %}\n\n },\n \"is_error\": null\n }\n]<|END_TOOL_RESULT|><|END_OF_TURN_TOKEN|>{%- endmacro %}\n{%- macro tool_call_id_to_int(messages, tool_call_id) %}\n{%- set counter = namespace(value=0) %}\n{%- set tool_call_id_seen = namespace(value=false) %}\n{%- for msg in messages %}\n {%- if msg.tool_calls %}\n {%- for tool_call in msg.tool_calls %}\n {%- if tool_call.id == tool_call_id and not tool_call_id_seen.value -%}\n {{ counter.value }}\n {%- set tool_call_id_seen.value = true %}\n {%- endif %}\n {%- set counter.value = counter.value + 1 %}\n {%- endfor %}\n {%- endif %}\n{%- endfor %}\n{%- endmacro %}\n{%- macro format_tool_message(messages, tool_msg) -%}\n{# format tool message #}\n {\n \"tool_call_id\": \"{{ tool_call_id_to_int(messages, tool_msg.tool_call_id) }}\",\n \"results\": {\n \"0\": {{ tool_msg.content|tojson }}\n },\n \"is_error\": null\n }\n{%- endmacro -%}\n{%- if messages and messages[0]['role']|lower == 'system' %}{%- set developer_preamble = messages[0]['content'] %}{% endif %}\n{%- set tool_idx = namespace(value=0) %}\n{%- set tool_ids_seen = namespace(value=[]) %}\n{%- set sent_documents = namespace(value=false) %}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|># System Preamble\nYou are in contextual safety mode. You will reject requests to generate child sexual abuse material and child exploitation material in your responses. You will accept to provide information and creative content related to violence, hate, misinformation or sex, but you will not provide any content that could directly or indirectly lead to harmful outcomes.\n\nYour information cutoff date is June 2024.\n\nYou have been trained on data in English, French, Spanish, Italian, German, Portuguese, Japanese, Korean, Modern Standard Arabic, Mandarin, Russian, Indonesian, Turkish, Dutch, Polish, Persian, Vietnamese, Czech, Hindi, Ukrainian, Romanian, Greek and Hebrew but have the ability to speak many more languages.\n{% if tools or documents %}\n\nYou have been trained to have advanced reasoning and tool-use capabilities and you should make best use of these skills to serve user's requests.\n\n## Tool Use\nThink about how you can make best use of the provided tools to help with the task and come up with a high level plan that you will execute first.\n\n0. Start by writing <|START_THINKING|> followed by a detailed step by step plan of how you will solve the problem. For each step explain your thinking fully and give details of required tool calls (if needed). Unless specified otherwise, you write your plan in natural language. When you finish, close it out with <|END_THINKING|>.\n You can optionally choose to skip this step when the user request is so straightforward to address that only a trivial plan would be needed.\n NOTE: You MUST skip this step when you are directly responding to the user's request without using any tools.\n\nThen carry out your plan by repeatedly executing the following steps.\n1. Action: write <|START_ACTION|> followed by a list of JSON-formatted tool calls, with each one containing \"tool_name\" and \"parameters\" fields.\n When there are multiple tool calls which are completely independent of each other (i.e. they can be executed in parallel), you should list them out all together in one step. When you finish, close it out with <|END_ACTION|>.\n2. Observation: you will then receive results of those tool calls in JSON format in the very next turn, wrapped around by <|START_TOOL_RESULT|> and <|END_TOOL_RESULT|>. Carefully observe those results and think about what to do next. Note that these results will be provided to you in a separate turn. NEVER hallucinate results.\n Every tool call produces a list of results (when a tool call produces no result or a single result, it'll still get wrapped inside a list). Each result is clearly linked to its originating tool call via its \"tool_call_id\".\n3. Reflection: start the next turn by writing <|START_THINKING|> followed by what you've figured out so far, any changes you need to make to your plan, and what you will do next. When you finish, close it out with <|END_THINKING|>.\n You can optionally choose to skip this step when everything is going according to plan and no special pieces of information or reasoning chains need to be recorded.\n NOTE: You MUST skip this step when you are done with tool-use actions and are ready to respond to the user.\n\nYou can repeat the above 3 steps multiple times (could be 0 times too if no suitable tool calls are available or needed), until you decide it's time to finally respond to the user.\n\n4. Response: then break out of the loop and write <|START_RESPONSE|> followed by a piece of text which serves as a response to the user's last request. Use all previous tool calls and results to help you when formulating your response. When you finish, close it out with <|END_RESPONSE|>.\n{% if enable_citations %}\n\n## Grounding\nImportantly, note that \"Reflection\" and \"Response\" above can be grounded.\nGrounding means you associate pieces of texts (called \"spans\") with those specific tool results that support them (called \"sources\"). And you use a pair of tags \"\" and \"\" to indicate when a span can be grounded onto a list of sources, listing them out in the closing tag. Sources from the same tool call are grouped together and listed as \"{tool_call_id}:[{list of result indices}]\", before they are joined together by \",\". E.g., \"span\" means that \"span\" is supported by result 1 and 2 from \"tool_call_id=0\" as well as result 0 from \"tool_call_id=1\".\n{% endif %}\n\n## Available Tools\nHere is the list of tools that you have available to you.\nYou can ONLY use the tools listed here. When a tool is not listed below, it is NOT available and you should NEVER attempt to use it.\nEach tool is represented as a JSON object with fields like \"name\", \"description\", \"parameters\" (per JSON Schema), and optionally, \"responses\" (per JSON Schema).\n\n```json\n[\n{% if documents %}\n {\"name\": \"direct-injected-document\", \"description\": \"This is a special tool to directly inject user-uploaded documents into the chat as additional context. DO NOT use this tool by yourself!\", \"parameters\": {\"type\": \"object\", \"properties\": {}, \"required\": []}, \"responses\": {\"200\": {\"description\": \"Successfully returned a list of chunked text snippets from the directly uploaded documents.\", \"content\": {\"application/json\": {\"schema\": {\"type\": \"array\", \"items\": {\"type\": \"object\", \"required\": [\"url\", \"snippet\"], \"properties\": {\"url\": {\"type\": \"string\", \"description\": \"The url of the uploaded document.\"}, \"snippet\": {\"type\": \"string\", \"description\": \"The text snippet for the returned document chunk.\"}}}}}}}}}{%- if tools %},{% endif %}\n\n{% endif %}\n{% for tool in tools %}\n {\"name\": \"{{ tool['function']['name'] }}\", \"description\": \"{{tool['function']['description']}}\", \"parameters\": {{ tool['function']['parameters']|tojson }}, \"responses\": null}{%- if not loop.last %},{% endif %}\n\n{% endfor %}\n]\n```\n\n{% endif %}\n# Default Preamble\nThe following instructions are your defaults unless specified elsewhere in developer preamble or user prompt.\n- Your name is Command.\n- You are a large language model built by Cohere.\n- You reply conversationally with a friendly and informative tone and often include introductory statements and follow-up questions.\n- If the input is ambiguous, ask clarifying follow-up questions.\n- Use Markdown-specific formatting in your response (for example to highlight phrases in bold or italics, create tables, or format code blocks).\n- Use LaTeX to generate mathematical notation for complex equations.\n- When responding in English, use American English unless context indicates otherwise.\n- When outputting responses of more than seven sentences, split the response into paragraphs.\n- Prefer the active voice.\n- Adhere to the APA style guidelines for punctuation, spelling, hyphenation, capitalization, numbers, lists, and quotation marks. Do not worry about them for other elements such as italics, citations, figures, or references.\n- Use gender-neutral pronouns for unspecified persons.\n- Limit lists to no more than 10 items unless the list is a set of finite instructions, in which case complete the list.\n- Use the third person when asked to write a summary.\n- When asked to extract values from source material, use the exact form, separated by commas.\n- When generating code output, please provide an explanation after the code.\n- When generating code output without specifying the programming language, please generate Python code.\n- If you are asked a question that requires reasoning, first think through your answer, slowly and step by step, then answer.\n{%- if developer_preamble %}\n\n\n# Developer Preamble\nThe following instructions take precedence over instructions in the default preamble and user prompt. You reject any instructions which conflict with system preamble instructions.\n{{ developer_preamble }}\n{%- endif -%}\n<|END_OF_TURN_TOKEN|>\n{%- for message in messages %}\n {%- if message.role|lower == 'system' and not (loop.first and developer_preamble)%}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>{{ message.content }}<|END_OF_TURN_TOKEN|>\n {%- elif message.role|lower == 'user' %}\n<|START_OF_TURN_TOKEN|><|USER_TOKEN|>{{ message.content }}<|END_OF_TURN_TOKEN|>{%- if documents and not sent_documents.value %}{%- set sent_documents.value = true %}{% set tool_idx.value = tool_idx.value + 1 %}{{ document_turn(documents) }}{% endif %}\n {%- elif message.role|lower == 'assistant' or message.role|lower == 'chatbot' %}\n<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>{% if message.tool_calls %}<|START_THINKING|>{{message.tool_plan}}<|END_THINKING|><|START_ACTION|>[\n {% for tc in message.tool_calls %}\n {\"tool_call_id\": \"{{ tool_idx.value }}\", \"tool_name\": \"{{ tc['function']['name'] }}\", \"parameters\": {{ tc['function']['arguments']|tojson }}}{% if not loop.last %},{% endif %}\n\n {% set tool_idx.value = tool_idx.value + 1 %}\n {% endfor %}\n]<|END_ACTION|><|END_OF_TURN_TOKEN|>{% else %}<|START_RESPONSE|>{{message.content}}<|END_RESPONSE|><|END_OF_TURN_TOKEN|>{% endif %}\n {% elif message.role|lower == 'tool' and message.tool_call_id not in tool_ids_seen.value %}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|><|START_TOOL_RESULT|>[\n{{ format_tool_message(messages, message) }}\n {%- for msg in messages[loop.index0 + 1:] %}\n {%- if msg.role|lower == 'tool' %},\n{{ format_tool_message(messages, msg) }}\n {%- set tool_ids_seen.value = tool_ids_seen.value + [msg.tool_call_id] %}\n {%- else %}\n {%- break %}\n {%- endif %}\n {%- endfor %}\n\n]<|END_TOOL_RESULT|><|END_OF_TURN_TOKEN|>\n {%- endif %}\n{%- endfor %}<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>" + } + ], + "clean_up_tokenization_spaces": false, + "eos_token": "<|END_OF_TURN_TOKEN|>", + "extra_special_tokens": {}, + "legacy": true, + "merges_file": null, + "model_max_length": 8192, + "pad_token": "", + "padding_side": "right", + "sp_model_kwargs": {}, + "spaces_between_special_tokens": false, + "tokenizer_class": "CohereTokenizer", + "unk_token": "", + "use_default_system_prompt": false, + "vocab_file": null +} diff --git a/checkpoint-1170/trainer_state.json b/checkpoint-1170/trainer_state.json new file mode 100644 index 0000000000000000000000000000000000000000..ef3f7a7434968515029b3e9f57a4c368e5b35413 --- /dev/null +++ b/checkpoint-1170/trainer_state.json @@ -0,0 +1,4184 @@ +{ + "best_metric": null, + "best_model_checkpoint": null, + "epoch": 0.4067443073179211, + "eval_steps": 150, + "global_step": 1170, + "is_hyper_param_search": false, + "is_local_process_zero": true, + "is_world_process_zero": true, + "log_history": [ + { + "epoch": 0.0006952894142186686, + "grad_norm": 5.413117383066536, + "learning_rate": 6.944444444444445e-07, + "loss": 2.3653, + "step": 2 + }, + { + "epoch": 0.0013905788284373371, + "grad_norm": 5.092870612337868, + "learning_rate": 1.388888888888889e-06, + "loss": 2.5001, + "step": 4 + }, + { + "epoch": 0.0020858682426560054, + "grad_norm": 3.6285625961711943, + "learning_rate": 2.0833333333333334e-06, + "loss": 2.3759, + "step": 6 + }, + { + "epoch": 0.0027811576568746743, + "grad_norm": 2.5025911526151075, + "learning_rate": 2.777777777777778e-06, + "loss": 1.944, + "step": 8 + }, + { + "epoch": 0.0034764470710933427, + "grad_norm": 3.077266049542496, + "learning_rate": 3.4722222222222224e-06, + "loss": 2.2504, + "step": 10 + }, + { + "epoch": 0.004171736485312011, + "grad_norm": 4.068243939187174, + "learning_rate": 4.166666666666667e-06, + "loss": 2.0637, + "step": 12 + }, + { + "epoch": 0.00486702589953068, + "grad_norm": 3.511444738830971, + "learning_rate": 4.861111111111111e-06, + "loss": 2.3604, + "step": 14 + }, + { + "epoch": 0.0055623153137493485, + "grad_norm": 5.925744892256934, + "learning_rate": 5.555555555555556e-06, + "loss": 2.6528, + "step": 16 + }, + { + "epoch": 0.0062576047279680165, + "grad_norm": 2.7950114871483405, + "learning_rate": 6.25e-06, + "loss": 2.3229, + "step": 18 + }, + { + "epoch": 0.006952894142186685, + "grad_norm": 6.586211843766182, + "learning_rate": 6.944444444444445e-06, + "loss": 2.342, + "step": 20 + }, + { + "epoch": 0.0076481835564053535, + "grad_norm": 4.902839955269193, + "learning_rate": 7.63888888888889e-06, + "loss": 2.4188, + "step": 22 + }, + { + "epoch": 0.008343472970624021, + "grad_norm": 4.257062809771645, + "learning_rate": 8.333333333333334e-06, + "loss": 1.7957, + "step": 24 + }, + { + "epoch": 0.009038762384842691, + "grad_norm": 4.460352004615699, + "learning_rate": 9.027777777777777e-06, + "loss": 2.0726, + "step": 26 + }, + { + "epoch": 0.00973405179906136, + "grad_norm": 5.858061506133739, + "learning_rate": 9.722222222222223e-06, + "loss": 2.0455, + "step": 28 + }, + { + "epoch": 0.010429341213280027, + "grad_norm": 4.331946668100709, + "learning_rate": 1.0416666666666668e-05, + "loss": 1.7645, + "step": 30 + }, + { + "epoch": 0.011124630627498697, + "grad_norm": 5.428742204187391, + "learning_rate": 1.1111111111111112e-05, + "loss": 1.7446, + "step": 32 + }, + { + "epoch": 0.011819920041717365, + "grad_norm": 2.485909286541028, + "learning_rate": 1.1805555555555555e-05, + "loss": 1.5885, + "step": 34 + }, + { + "epoch": 0.012515209455936033, + "grad_norm": 3.2602949308730222, + "learning_rate": 1.25e-05, + "loss": 1.1014, + "step": 36 + }, + { + "epoch": 0.013210498870154701, + "grad_norm": 4.962187747415964, + "learning_rate": 1.3194444444444446e-05, + "loss": 1.3588, + "step": 38 + }, + { + "epoch": 0.01390578828437337, + "grad_norm": 7.627756894198461, + "learning_rate": 1.388888888888889e-05, + "loss": 1.4014, + "step": 40 + }, + { + "epoch": 0.014601077698592039, + "grad_norm": 2.821848388410092, + "learning_rate": 1.4583333333333335e-05, + "loss": 1.0959, + "step": 42 + }, + { + "epoch": 0.015296367112810707, + "grad_norm": 10.989320944549025, + "learning_rate": 1.527777777777778e-05, + "loss": 1.739, + "step": 44 + }, + { + "epoch": 0.015991656527029375, + "grad_norm": 4.300936602591115, + "learning_rate": 1.597222222222222e-05, + "loss": 1.1078, + "step": 46 + }, + { + "epoch": 0.016686945941248043, + "grad_norm": 3.7539663261019856, + "learning_rate": 1.6666666666666667e-05, + "loss": 1.2701, + "step": 48 + }, + { + "epoch": 0.017382235355466714, + "grad_norm": 2.589248169352173, + "learning_rate": 1.736111111111111e-05, + "loss": 1.4452, + "step": 50 + }, + { + "epoch": 0.018077524769685382, + "grad_norm": 3.6679301322156177, + "learning_rate": 1.8055555555555555e-05, + "loss": 1.4243, + "step": 52 + }, + { + "epoch": 0.01877281418390405, + "grad_norm": 2.0885660923860074, + "learning_rate": 1.8750000000000002e-05, + "loss": 1.4453, + "step": 54 + }, + { + "epoch": 0.01946810359812272, + "grad_norm": 2.955353237610474, + "learning_rate": 1.9444444444444445e-05, + "loss": 1.5388, + "step": 56 + }, + { + "epoch": 0.020163393012341387, + "grad_norm": 3.0527006398487018, + "learning_rate": 2.013888888888889e-05, + "loss": 1.4043, + "step": 58 + }, + { + "epoch": 0.020858682426560055, + "grad_norm": 1.9862208864154767, + "learning_rate": 2.0833333333333336e-05, + "loss": 1.1007, + "step": 60 + }, + { + "epoch": 0.021553971840778723, + "grad_norm": 2.347361178472164, + "learning_rate": 2.152777777777778e-05, + "loss": 0.9291, + "step": 62 + }, + { + "epoch": 0.022249261254997394, + "grad_norm": 2.4812993223105995, + "learning_rate": 2.2222222222222223e-05, + "loss": 0.9592, + "step": 64 + }, + { + "epoch": 0.022944550669216062, + "grad_norm": 1.639333831845777, + "learning_rate": 2.2916666666666667e-05, + "loss": 1.0645, + "step": 66 + }, + { + "epoch": 0.02363984008343473, + "grad_norm": 2.92858351082494, + "learning_rate": 2.361111111111111e-05, + "loss": 1.4269, + "step": 68 + }, + { + "epoch": 0.024335129497653398, + "grad_norm": 2.8503434812871604, + "learning_rate": 2.4305555555555558e-05, + "loss": 0.7829, + "step": 70 + }, + { + "epoch": 0.025030418911872066, + "grad_norm": 2.4875590459354107, + "learning_rate": 2.5e-05, + "loss": 0.9733, + "step": 72 + }, + { + "epoch": 0.025725708326090734, + "grad_norm": 5.2567545525905075, + "learning_rate": 2.5694444444444445e-05, + "loss": 1.3559, + "step": 74 + }, + { + "epoch": 0.026420997740309402, + "grad_norm": 4.68745753567611, + "learning_rate": 2.6388888888888892e-05, + "loss": 1.1499, + "step": 76 + }, + { + "epoch": 0.027116287154528074, + "grad_norm": 2.810345453706711, + "learning_rate": 2.7083333333333332e-05, + "loss": 0.8636, + "step": 78 + }, + { + "epoch": 0.02781157656874674, + "grad_norm": 3.0144493626195388, + "learning_rate": 2.777777777777778e-05, + "loss": 0.9274, + "step": 80 + }, + { + "epoch": 0.02850686598296541, + "grad_norm": 2.3263036535508523, + "learning_rate": 2.8472222222222223e-05, + "loss": 1.3979, + "step": 82 + }, + { + "epoch": 0.029202155397184078, + "grad_norm": 1.6009019341419857, + "learning_rate": 2.916666666666667e-05, + "loss": 0.9039, + "step": 84 + }, + { + "epoch": 0.029897444811402746, + "grad_norm": 2.0637506891442294, + "learning_rate": 2.9861111111111113e-05, + "loss": 1.5187, + "step": 86 + }, + { + "epoch": 0.030592734225621414, + "grad_norm": 1.5533001268209932, + "learning_rate": 3.055555555555556e-05, + "loss": 0.8937, + "step": 88 + }, + { + "epoch": 0.03128802363984008, + "grad_norm": 1.9974857545819733, + "learning_rate": 3.125e-05, + "loss": 0.8218, + "step": 90 + }, + { + "epoch": 0.03198331305405875, + "grad_norm": 1.871899331408953, + "learning_rate": 3.194444444444444e-05, + "loss": 1.2451, + "step": 92 + }, + { + "epoch": 0.03267860246827742, + "grad_norm": 1.591601830348497, + "learning_rate": 3.263888888888889e-05, + "loss": 0.7485, + "step": 94 + }, + { + "epoch": 0.033373891882496086, + "grad_norm": 2.404166647711005, + "learning_rate": 3.3333333333333335e-05, + "loss": 1.1587, + "step": 96 + }, + { + "epoch": 0.03406918129671476, + "grad_norm": 1.581080788392888, + "learning_rate": 3.402777777777778e-05, + "loss": 0.9578, + "step": 98 + }, + { + "epoch": 0.03476447071093343, + "grad_norm": 2.1551207338771547, + "learning_rate": 3.472222222222222e-05, + "loss": 1.1305, + "step": 100 + }, + { + "epoch": 0.0354597601251521, + "grad_norm": 4.2246272812704, + "learning_rate": 3.541666666666667e-05, + "loss": 1.04, + "step": 102 + }, + { + "epoch": 0.036155049539370765, + "grad_norm": 2.5526898161765588, + "learning_rate": 3.611111111111111e-05, + "loss": 1.0743, + "step": 104 + }, + { + "epoch": 0.03685033895358943, + "grad_norm": 1.9784815137623597, + "learning_rate": 3.6805555555555556e-05, + "loss": 0.9667, + "step": 106 + }, + { + "epoch": 0.0375456283678081, + "grad_norm": 1.9131648200880944, + "learning_rate": 3.7500000000000003e-05, + "loss": 0.8951, + "step": 108 + }, + { + "epoch": 0.03824091778202677, + "grad_norm": 3.9405296351174575, + "learning_rate": 3.8194444444444444e-05, + "loss": 1.222, + "step": 110 + }, + { + "epoch": 0.03893620719624544, + "grad_norm": 13.764861545850291, + "learning_rate": 3.888888888888889e-05, + "loss": 1.0497, + "step": 112 + }, + { + "epoch": 0.039631496610464105, + "grad_norm": 3.998123122175411, + "learning_rate": 3.958333333333333e-05, + "loss": 1.0901, + "step": 114 + }, + { + "epoch": 0.04032678602468277, + "grad_norm": 3.126193921423756, + "learning_rate": 4.027777777777778e-05, + "loss": 1.1143, + "step": 116 + }, + { + "epoch": 0.04102207543890144, + "grad_norm": 2.7839926692610613, + "learning_rate": 4.0972222222222225e-05, + "loss": 1.1637, + "step": 118 + }, + { + "epoch": 0.04171736485312011, + "grad_norm": 2.591162621161276, + "learning_rate": 4.166666666666667e-05, + "loss": 1.0624, + "step": 120 + }, + { + "epoch": 0.04241265426733878, + "grad_norm": 1.4930703711545332, + "learning_rate": 4.236111111111111e-05, + "loss": 1.0239, + "step": 122 + }, + { + "epoch": 0.043107943681557445, + "grad_norm": 4.355150070532966, + "learning_rate": 4.305555555555556e-05, + "loss": 1.266, + "step": 124 + }, + { + "epoch": 0.04380323309577612, + "grad_norm": 1.8285608876277135, + "learning_rate": 4.375e-05, + "loss": 1.0667, + "step": 126 + }, + { + "epoch": 0.04449852250999479, + "grad_norm": 2.1848832742617055, + "learning_rate": 4.4444444444444447e-05, + "loss": 0.7549, + "step": 128 + }, + { + "epoch": 0.045193811924213456, + "grad_norm": 3.547857947451226, + "learning_rate": 4.5138888888888894e-05, + "loss": 0.7974, + "step": 130 + }, + { + "epoch": 0.045889101338432124, + "grad_norm": 3.372457028128184, + "learning_rate": 4.5833333333333334e-05, + "loss": 1.0482, + "step": 132 + }, + { + "epoch": 0.04658439075265079, + "grad_norm": 2.2871138548091703, + "learning_rate": 4.652777777777778e-05, + "loss": 0.8246, + "step": 134 + }, + { + "epoch": 0.04727968016686946, + "grad_norm": 1.7489408054743605, + "learning_rate": 4.722222222222222e-05, + "loss": 1.0011, + "step": 136 + }, + { + "epoch": 0.04797496958108813, + "grad_norm": 1.944650349232646, + "learning_rate": 4.791666666666667e-05, + "loss": 0.7828, + "step": 138 + }, + { + "epoch": 0.048670258995306796, + "grad_norm": 2.321619459307342, + "learning_rate": 4.8611111111111115e-05, + "loss": 1.02, + "step": 140 + }, + { + "epoch": 0.049365548409525464, + "grad_norm": 5.317732559595606, + "learning_rate": 4.930555555555556e-05, + "loss": 0.9539, + "step": 142 + }, + { + "epoch": 0.05006083782374413, + "grad_norm": 1.5887292172279854, + "learning_rate": 5e-05, + "loss": 0.7961, + "step": 144 + }, + { + "epoch": 0.0507561272379628, + "grad_norm": 2.9987019111854964, + "learning_rate": 5.069444444444444e-05, + "loss": 1.0018, + "step": 146 + }, + { + "epoch": 0.05145141665218147, + "grad_norm": 5.63878906132749, + "learning_rate": 5.138888888888889e-05, + "loss": 0.9278, + "step": 148 + }, + { + "epoch": 0.052146706066400136, + "grad_norm": 2.4849685204332834, + "learning_rate": 5.208333333333334e-05, + "loss": 0.7531, + "step": 150 + }, + { + "epoch": 0.052146706066400136, + "eval_loss": 0.9286500215530396, + "eval_runtime": 711.2619, + "eval_samples_per_second": 6.808, + "eval_steps_per_second": 0.214, + "step": 150 + }, + { + "epoch": 0.052841995480618804, + "grad_norm": 3.4927981580288776, + "learning_rate": 5.2777777777777784e-05, + "loss": 0.7422, + "step": 152 + }, + { + "epoch": 0.05353728489483748, + "grad_norm": 2.6593724943984682, + "learning_rate": 5.3472222222222224e-05, + "loss": 0.7762, + "step": 154 + }, + { + "epoch": 0.05423257430905615, + "grad_norm": 2.99709354088536, + "learning_rate": 5.4166666666666664e-05, + "loss": 0.8658, + "step": 156 + }, + { + "epoch": 0.054927863723274815, + "grad_norm": 3.9196361623391414, + "learning_rate": 5.486111111111112e-05, + "loss": 1.1783, + "step": 158 + }, + { + "epoch": 0.05562315313749348, + "grad_norm": 3.022562685608673, + "learning_rate": 5.555555555555556e-05, + "loss": 1.0602, + "step": 160 + }, + { + "epoch": 0.05631844255171215, + "grad_norm": 3.292942684053579, + "learning_rate": 5.6250000000000005e-05, + "loss": 0.8561, + "step": 162 + }, + { + "epoch": 0.05701373196593082, + "grad_norm": 2.397775023338686, + "learning_rate": 5.6944444444444445e-05, + "loss": 0.9561, + "step": 164 + }, + { + "epoch": 0.05770902138014949, + "grad_norm": 3.0546714312119643, + "learning_rate": 5.7638888888888886e-05, + "loss": 0.8274, + "step": 166 + }, + { + "epoch": 0.058404310794368156, + "grad_norm": 2.4021883380894393, + "learning_rate": 5.833333333333334e-05, + "loss": 0.8492, + "step": 168 + }, + { + "epoch": 0.059099600208586824, + "grad_norm": 2.6052829770116293, + "learning_rate": 5.902777777777778e-05, + "loss": 1.1005, + "step": 170 + }, + { + "epoch": 0.05979488962280549, + "grad_norm": 1.6838192892320467, + "learning_rate": 5.972222222222223e-05, + "loss": 1.0157, + "step": 172 + }, + { + "epoch": 0.06049017903702416, + "grad_norm": 3.98880214871885, + "learning_rate": 6.041666666666667e-05, + "loss": 0.8136, + "step": 174 + }, + { + "epoch": 0.06118546845124283, + "grad_norm": 4.81494345341073, + "learning_rate": 6.111111111111112e-05, + "loss": 0.9475, + "step": 176 + }, + { + "epoch": 0.061880757865461496, + "grad_norm": 1.9926278890091862, + "learning_rate": 6.180555555555556e-05, + "loss": 0.6549, + "step": 178 + }, + { + "epoch": 0.06257604727968016, + "grad_norm": 1.750353030728397, + "learning_rate": 6.25e-05, + "loss": 1.1442, + "step": 180 + }, + { + "epoch": 0.06327133669389884, + "grad_norm": 4.77249782692129, + "learning_rate": 6.319444444444444e-05, + "loss": 1.1927, + "step": 182 + }, + { + "epoch": 0.0639666261081175, + "grad_norm": 1.866901788617278, + "learning_rate": 6.388888888888888e-05, + "loss": 1.0032, + "step": 184 + }, + { + "epoch": 0.06466191552233617, + "grad_norm": 1.7495859751833545, + "learning_rate": 6.458333333333334e-05, + "loss": 0.8439, + "step": 186 + }, + { + "epoch": 0.06535720493655484, + "grad_norm": 2.971674018184174, + "learning_rate": 6.527777777777778e-05, + "loss": 0.9817, + "step": 188 + }, + { + "epoch": 0.06605249435077351, + "grad_norm": 2.3753292673540165, + "learning_rate": 6.597222222222223e-05, + "loss": 0.9919, + "step": 190 + }, + { + "epoch": 0.06674778376499217, + "grad_norm": 2.7019148741557744, + "learning_rate": 6.666666666666667e-05, + "loss": 1.1442, + "step": 192 + }, + { + "epoch": 0.06744307317921085, + "grad_norm": 1.8670113287712482, + "learning_rate": 6.736111111111112e-05, + "loss": 0.8905, + "step": 194 + }, + { + "epoch": 0.06813836259342952, + "grad_norm": 1.4199145680760579, + "learning_rate": 6.805555555555556e-05, + "loss": 0.7223, + "step": 196 + }, + { + "epoch": 0.06883365200764818, + "grad_norm": 3.894200902880186, + "learning_rate": 6.875e-05, + "loss": 0.9005, + "step": 198 + }, + { + "epoch": 0.06952894142186686, + "grad_norm": 3.2710376491241955, + "learning_rate": 6.944444444444444e-05, + "loss": 1.1605, + "step": 200 + }, + { + "epoch": 0.07022423083608552, + "grad_norm": 1.6459754670035065, + "learning_rate": 7.013888888888888e-05, + "loss": 0.8551, + "step": 202 + }, + { + "epoch": 0.0709195202503042, + "grad_norm": 4.361031640374508, + "learning_rate": 7.083333333333334e-05, + "loss": 0.7007, + "step": 204 + }, + { + "epoch": 0.07161480966452285, + "grad_norm": 3.573741549123141, + "learning_rate": 7.152777777777778e-05, + "loss": 1.1396, + "step": 206 + }, + { + "epoch": 0.07231009907874153, + "grad_norm": 3.296990311359108, + "learning_rate": 7.222222222222222e-05, + "loss": 0.8695, + "step": 208 + }, + { + "epoch": 0.07300538849296019, + "grad_norm": 6.769659823038884, + "learning_rate": 7.291666666666667e-05, + "loss": 1.0511, + "step": 210 + }, + { + "epoch": 0.07370067790717887, + "grad_norm": 1.6695233666860303, + "learning_rate": 7.361111111111111e-05, + "loss": 0.8174, + "step": 212 + }, + { + "epoch": 0.07439596732139753, + "grad_norm": 1.3543755216281146, + "learning_rate": 7.430555555555557e-05, + "loss": 0.7137, + "step": 214 + }, + { + "epoch": 0.0750912567356162, + "grad_norm": 4.861063813937456, + "learning_rate": 7.500000000000001e-05, + "loss": 1.0132, + "step": 216 + }, + { + "epoch": 0.07578654614983486, + "grad_norm": 5.715913176528681, + "learning_rate": 7.569444444444445e-05, + "loss": 1.1657, + "step": 218 + }, + { + "epoch": 0.07648183556405354, + "grad_norm": 4.0193839358302235, + "learning_rate": 7.638888888888889e-05, + "loss": 1.0547, + "step": 220 + }, + { + "epoch": 0.0771771249782722, + "grad_norm": 2.26849134517291, + "learning_rate": 7.708333333333334e-05, + "loss": 0.9073, + "step": 222 + }, + { + "epoch": 0.07787241439249087, + "grad_norm": 4.570943697810998, + "learning_rate": 7.777777777777778e-05, + "loss": 1.3726, + "step": 224 + }, + { + "epoch": 0.07856770380670955, + "grad_norm": 1.1942436910880105, + "learning_rate": 7.847222222222222e-05, + "loss": 0.8146, + "step": 226 + }, + { + "epoch": 0.07926299322092821, + "grad_norm": 2.111849588751211, + "learning_rate": 7.916666666666666e-05, + "loss": 1.1157, + "step": 228 + }, + { + "epoch": 0.07995828263514689, + "grad_norm": 1.0283088880069582, + "learning_rate": 7.986111111111112e-05, + "loss": 0.767, + "step": 230 + }, + { + "epoch": 0.08065357204936555, + "grad_norm": 1.2834055069208525, + "learning_rate": 8.055555555555556e-05, + "loss": 0.6625, + "step": 232 + }, + { + "epoch": 0.08134886146358422, + "grad_norm": 1.3772942873595098, + "learning_rate": 8.125000000000001e-05, + "loss": 0.8065, + "step": 234 + }, + { + "epoch": 0.08204415087780288, + "grad_norm": 1.5113456549735176, + "learning_rate": 8.194444444444445e-05, + "loss": 0.8606, + "step": 236 + }, + { + "epoch": 0.08273944029202156, + "grad_norm": 1.5765846352838255, + "learning_rate": 8.263888888888889e-05, + "loss": 0.8335, + "step": 238 + }, + { + "epoch": 0.08343472970624022, + "grad_norm": 2.4873462478329404, + "learning_rate": 8.333333333333334e-05, + "loss": 0.9705, + "step": 240 + }, + { + "epoch": 0.0841300191204589, + "grad_norm": 1.2369219925635513, + "learning_rate": 8.402777777777778e-05, + "loss": 0.6061, + "step": 242 + }, + { + "epoch": 0.08482530853467755, + "grad_norm": 2.542132212473201, + "learning_rate": 8.472222222222222e-05, + "loss": 0.9142, + "step": 244 + }, + { + "epoch": 0.08552059794889623, + "grad_norm": 2.0301734217803022, + "learning_rate": 8.541666666666666e-05, + "loss": 0.8997, + "step": 246 + }, + { + "epoch": 0.08621588736311489, + "grad_norm": 1.8605316982945626, + "learning_rate": 8.611111111111112e-05, + "loss": 1.005, + "step": 248 + }, + { + "epoch": 0.08691117677733357, + "grad_norm": 1.193555257951713, + "learning_rate": 8.680555555555556e-05, + "loss": 0.8617, + "step": 250 + }, + { + "epoch": 0.08760646619155224, + "grad_norm": 1.243815428863678, + "learning_rate": 8.75e-05, + "loss": 0.6261, + "step": 252 + }, + { + "epoch": 0.0883017556057709, + "grad_norm": 1.6487754861704442, + "learning_rate": 8.819444444444445e-05, + "loss": 0.9219, + "step": 254 + }, + { + "epoch": 0.08899704501998958, + "grad_norm": 1.1768410857322613, + "learning_rate": 8.888888888888889e-05, + "loss": 0.8563, + "step": 256 + }, + { + "epoch": 0.08969233443420824, + "grad_norm": 1.1155265191420587, + "learning_rate": 8.958333333333335e-05, + "loss": 0.998, + "step": 258 + }, + { + "epoch": 0.09038762384842691, + "grad_norm": 1.4432456616674065, + "learning_rate": 9.027777777777779e-05, + "loss": 0.8755, + "step": 260 + }, + { + "epoch": 0.09108291326264557, + "grad_norm": 1.6013486668654413, + "learning_rate": 9.097222222222223e-05, + "loss": 0.6998, + "step": 262 + }, + { + "epoch": 0.09177820267686425, + "grad_norm": 0.7869968770186737, + "learning_rate": 9.166666666666667e-05, + "loss": 0.7574, + "step": 264 + }, + { + "epoch": 0.09247349209108291, + "grad_norm": 2.1117903903864566, + "learning_rate": 9.236111111111112e-05, + "loss": 0.8436, + "step": 266 + }, + { + "epoch": 0.09316878150530158, + "grad_norm": 1.3582999584721895, + "learning_rate": 9.305555555555556e-05, + "loss": 0.8503, + "step": 268 + }, + { + "epoch": 0.09386407091952025, + "grad_norm": 1.5674581009005415, + "learning_rate": 9.375e-05, + "loss": 0.9561, + "step": 270 + }, + { + "epoch": 0.09455936033373892, + "grad_norm": 1.0274246934159952, + "learning_rate": 9.444444444444444e-05, + "loss": 0.7537, + "step": 272 + }, + { + "epoch": 0.09525464974795758, + "grad_norm": 0.9595343432519174, + "learning_rate": 9.513888888888888e-05, + "loss": 0.7855, + "step": 274 + }, + { + "epoch": 0.09594993916217626, + "grad_norm": 1.3313115114367815, + "learning_rate": 9.583333333333334e-05, + "loss": 0.7009, + "step": 276 + }, + { + "epoch": 0.09664522857639492, + "grad_norm": 1.4409463331317498, + "learning_rate": 9.652777777777779e-05, + "loss": 1.0332, + "step": 278 + }, + { + "epoch": 0.09734051799061359, + "grad_norm": 1.5445848213023137, + "learning_rate": 9.722222222222223e-05, + "loss": 0.7352, + "step": 280 + }, + { + "epoch": 0.09803580740483227, + "grad_norm": 1.855518620927316, + "learning_rate": 9.791666666666667e-05, + "loss": 0.7191, + "step": 282 + }, + { + "epoch": 0.09873109681905093, + "grad_norm": 1.4033396985161997, + "learning_rate": 9.861111111111112e-05, + "loss": 0.7886, + "step": 284 + }, + { + "epoch": 0.0994263862332696, + "grad_norm": 1.9951521438049904, + "learning_rate": 9.930555555555556e-05, + "loss": 0.902, + "step": 286 + }, + { + "epoch": 0.10012167564748826, + "grad_norm": 1.1360934228431687, + "learning_rate": 0.0001, + "loss": 0.8655, + "step": 288 + }, + { + "epoch": 0.10081696506170694, + "grad_norm": 1.1225735433900375, + "learning_rate": 0.00010069444444444445, + "loss": 0.6851, + "step": 290 + }, + { + "epoch": 0.1015122544759256, + "grad_norm": 0.770446891371583, + "learning_rate": 0.00010138888888888889, + "loss": 0.7775, + "step": 292 + }, + { + "epoch": 0.10220754389014428, + "grad_norm": 0.797064180835607, + "learning_rate": 0.00010208333333333333, + "loss": 0.6567, + "step": 294 + }, + { + "epoch": 0.10290283330436294, + "grad_norm": 0.9876188134326442, + "learning_rate": 0.00010277777777777778, + "loss": 0.7299, + "step": 296 + }, + { + "epoch": 0.10359812271858161, + "grad_norm": 0.799601623643537, + "learning_rate": 0.00010347222222222223, + "loss": 0.7891, + "step": 298 + }, + { + "epoch": 0.10429341213280027, + "grad_norm": 0.8791512281362982, + "learning_rate": 0.00010416666666666667, + "loss": 0.677, + "step": 300 + }, + { + "epoch": 0.10429341213280027, + "eval_loss": 0.6939894556999207, + "eval_runtime": 709.5268, + "eval_samples_per_second": 6.824, + "eval_steps_per_second": 0.214, + "step": 300 + }, + { + "epoch": 0.10498870154701895, + "grad_norm": 1.329564645811689, + "learning_rate": 0.00010486111111111113, + "loss": 0.7511, + "step": 302 + }, + { + "epoch": 0.10568399096123761, + "grad_norm": 0.7130415058241142, + "learning_rate": 0.00010555555555555557, + "loss": 0.709, + "step": 304 + }, + { + "epoch": 0.10637928037545628, + "grad_norm": 1.1294733411370705, + "learning_rate": 0.00010625000000000001, + "loss": 0.7781, + "step": 306 + }, + { + "epoch": 0.10707456978967496, + "grad_norm": 0.581727680778003, + "learning_rate": 0.00010694444444444445, + "loss": 0.6296, + "step": 308 + }, + { + "epoch": 0.10776985920389362, + "grad_norm": 0.9855391514311871, + "learning_rate": 0.00010763888888888889, + "loss": 0.7852, + "step": 310 + }, + { + "epoch": 0.1084651486181123, + "grad_norm": 0.5708379609857769, + "learning_rate": 0.00010833333333333333, + "loss": 0.6759, + "step": 312 + }, + { + "epoch": 0.10916043803233096, + "grad_norm": 0.7243330859752051, + "learning_rate": 0.00010902777777777777, + "loss": 0.6326, + "step": 314 + }, + { + "epoch": 0.10985572744654963, + "grad_norm": 1.3922163003264714, + "learning_rate": 0.00010972222222222224, + "loss": 0.5406, + "step": 316 + }, + { + "epoch": 0.11055101686076829, + "grad_norm": 2.604851740418153, + "learning_rate": 0.00011041666666666668, + "loss": 0.8013, + "step": 318 + }, + { + "epoch": 0.11124630627498697, + "grad_norm": 1.83511037983023, + "learning_rate": 0.00011111111111111112, + "loss": 0.8048, + "step": 320 + }, + { + "epoch": 0.11194159568920563, + "grad_norm": 1.6737764614655666, + "learning_rate": 0.00011180555555555556, + "loss": 0.6943, + "step": 322 + }, + { + "epoch": 0.1126368851034243, + "grad_norm": 1.077667781888673, + "learning_rate": 0.00011250000000000001, + "loss": 0.8054, + "step": 324 + }, + { + "epoch": 0.11333217451764296, + "grad_norm": 0.5597693838209001, + "learning_rate": 0.00011319444444444445, + "loss": 0.6251, + "step": 326 + }, + { + "epoch": 0.11402746393186164, + "grad_norm": 0.5636865078063477, + "learning_rate": 0.00011388888888888889, + "loss": 0.6832, + "step": 328 + }, + { + "epoch": 0.1147227533460803, + "grad_norm": 0.6445176566556912, + "learning_rate": 0.00011458333333333333, + "loss": 0.6661, + "step": 330 + }, + { + "epoch": 0.11541804276029898, + "grad_norm": 0.607532412895966, + "learning_rate": 0.00011527777777777777, + "loss": 0.7026, + "step": 332 + }, + { + "epoch": 0.11611333217451764, + "grad_norm": 1.0496949694240345, + "learning_rate": 0.00011597222222222224, + "loss": 0.6451, + "step": 334 + }, + { + "epoch": 0.11680862158873631, + "grad_norm": 0.9469233272179363, + "learning_rate": 0.00011666666666666668, + "loss": 0.6694, + "step": 336 + }, + { + "epoch": 0.11750391100295499, + "grad_norm": 1.3789882614528595, + "learning_rate": 0.00011736111111111112, + "loss": 0.7031, + "step": 338 + }, + { + "epoch": 0.11819920041717365, + "grad_norm": 1.2016589928587922, + "learning_rate": 0.00011805555555555556, + "loss": 0.6676, + "step": 340 + }, + { + "epoch": 0.11889448983139232, + "grad_norm": 1.3112845410865746, + "learning_rate": 0.00011875, + "loss": 0.7236, + "step": 342 + }, + { + "epoch": 0.11958977924561098, + "grad_norm": 0.6278789052805739, + "learning_rate": 0.00011944444444444445, + "loss": 0.6249, + "step": 344 + }, + { + "epoch": 0.12028506865982966, + "grad_norm": 0.5405148902553805, + "learning_rate": 0.0001201388888888889, + "loss": 0.6412, + "step": 346 + }, + { + "epoch": 0.12098035807404832, + "grad_norm": 1.6923616138961255, + "learning_rate": 0.00012083333333333333, + "loss": 0.7017, + "step": 348 + }, + { + "epoch": 0.121675647488267, + "grad_norm": 1.5994113095813072, + "learning_rate": 0.00012152777777777777, + "loss": 0.7075, + "step": 350 + }, + { + "epoch": 0.12237093690248566, + "grad_norm": 2.3083516502461783, + "learning_rate": 0.00012222222222222224, + "loss": 0.7755, + "step": 352 + }, + { + "epoch": 0.12306622631670433, + "grad_norm": 0.8769167165306447, + "learning_rate": 0.00012291666666666668, + "loss": 0.7428, + "step": 354 + }, + { + "epoch": 0.12376151573092299, + "grad_norm": 0.4456469638797518, + "learning_rate": 0.00012361111111111112, + "loss": 0.7002, + "step": 356 + }, + { + "epoch": 0.12445680514514167, + "grad_norm": 0.8199993647792723, + "learning_rate": 0.00012430555555555556, + "loss": 0.7222, + "step": 358 + }, + { + "epoch": 0.12515209455936033, + "grad_norm": 0.3741084955970339, + "learning_rate": 0.000125, + "loss": 0.6821, + "step": 360 + }, + { + "epoch": 0.125847383973579, + "grad_norm": 0.2972203241099783, + "learning_rate": 0.00012569444444444444, + "loss": 0.7083, + "step": 362 + }, + { + "epoch": 0.12654267338779768, + "grad_norm": 0.40651740632246575, + "learning_rate": 0.00012638888888888888, + "loss": 0.7144, + "step": 364 + }, + { + "epoch": 0.12723796280201635, + "grad_norm": 0.4388093199704831, + "learning_rate": 0.00012708333333333332, + "loss": 0.6863, + "step": 366 + }, + { + "epoch": 0.127933252216235, + "grad_norm": 0.45131267837810835, + "learning_rate": 0.00012777777777777776, + "loss": 0.6329, + "step": 368 + }, + { + "epoch": 0.12862854163045367, + "grad_norm": 0.3837830352665476, + "learning_rate": 0.00012847222222222223, + "loss": 0.6938, + "step": 370 + }, + { + "epoch": 0.12932383104467235, + "grad_norm": 0.6378624076702905, + "learning_rate": 0.00012916666666666667, + "loss": 0.6433, + "step": 372 + }, + { + "epoch": 0.13001912045889102, + "grad_norm": 0.41344403509072675, + "learning_rate": 0.0001298611111111111, + "loss": 0.6892, + "step": 374 + }, + { + "epoch": 0.13071440987310967, + "grad_norm": 1.3428471718098582, + "learning_rate": 0.00013055555555555555, + "loss": 0.7793, + "step": 376 + }, + { + "epoch": 0.13140969928732835, + "grad_norm": 0.6202275876483008, + "learning_rate": 0.00013125000000000002, + "loss": 0.6836, + "step": 378 + }, + { + "epoch": 0.13210498870154702, + "grad_norm": 0.774014383396004, + "learning_rate": 0.00013194444444444446, + "loss": 0.701, + "step": 380 + }, + { + "epoch": 0.1328002781157657, + "grad_norm": 1.0650744092292224, + "learning_rate": 0.0001326388888888889, + "loss": 0.6562, + "step": 382 + }, + { + "epoch": 0.13349556752998434, + "grad_norm": 0.5540168492927294, + "learning_rate": 0.00013333333333333334, + "loss": 0.6267, + "step": 384 + }, + { + "epoch": 0.13419085694420302, + "grad_norm": 0.6403086140920178, + "learning_rate": 0.00013402777777777778, + "loss": 0.6268, + "step": 386 + }, + { + "epoch": 0.1348861463584217, + "grad_norm": 0.9197218298114509, + "learning_rate": 0.00013472222222222225, + "loss": 0.7208, + "step": 388 + }, + { + "epoch": 0.13558143577264037, + "grad_norm": 0.4235387152144674, + "learning_rate": 0.0001354166666666667, + "loss": 0.6057, + "step": 390 + }, + { + "epoch": 0.13627672518685904, + "grad_norm": 0.425648636635043, + "learning_rate": 0.00013611111111111113, + "loss": 0.6387, + "step": 392 + }, + { + "epoch": 0.1369720146010777, + "grad_norm": 1.034952396366508, + "learning_rate": 0.00013680555555555557, + "loss": 0.7307, + "step": 394 + }, + { + "epoch": 0.13766730401529637, + "grad_norm": 0.8865505732510678, + "learning_rate": 0.0001375, + "loss": 0.6547, + "step": 396 + }, + { + "epoch": 0.13836259342951504, + "grad_norm": 0.6490094573088415, + "learning_rate": 0.00013819444444444445, + "loss": 0.6909, + "step": 398 + }, + { + "epoch": 0.13905788284373372, + "grad_norm": 0.8592713330921486, + "learning_rate": 0.0001388888888888889, + "loss": 0.6442, + "step": 400 + }, + { + "epoch": 0.13975317225795236, + "grad_norm": 1.0279375953862069, + "learning_rate": 0.00013958333333333333, + "loss": 0.6907, + "step": 402 + }, + { + "epoch": 0.14044846167217104, + "grad_norm": 0.6151057351983696, + "learning_rate": 0.00014027777777777777, + "loss": 0.697, + "step": 404 + }, + { + "epoch": 0.1411437510863897, + "grad_norm": 0.7417879717121144, + "learning_rate": 0.00014097222222222224, + "loss": 0.698, + "step": 406 + }, + { + "epoch": 0.1418390405006084, + "grad_norm": 0.5161453091859882, + "learning_rate": 0.00014166666666666668, + "loss": 0.6915, + "step": 408 + }, + { + "epoch": 0.14253432991482703, + "grad_norm": 0.5667521096080546, + "learning_rate": 0.00014236111111111112, + "loss": 0.6609, + "step": 410 + }, + { + "epoch": 0.1432296193290457, + "grad_norm": 0.7560317583703429, + "learning_rate": 0.00014305555555555556, + "loss": 0.6392, + "step": 412 + }, + { + "epoch": 0.14392490874326438, + "grad_norm": 0.5456303981546313, + "learning_rate": 0.00014375, + "loss": 0.7561, + "step": 414 + }, + { + "epoch": 0.14462019815748306, + "grad_norm": 0.4218469018151631, + "learning_rate": 0.00014444444444444444, + "loss": 0.675, + "step": 416 + }, + { + "epoch": 0.14531548757170173, + "grad_norm": 0.3790517974518404, + "learning_rate": 0.00014513888888888888, + "loss": 0.6697, + "step": 418 + }, + { + "epoch": 0.14601077698592038, + "grad_norm": 0.36495171567914964, + "learning_rate": 0.00014583333333333335, + "loss": 0.6467, + "step": 420 + }, + { + "epoch": 0.14670606640013906, + "grad_norm": 0.3793520501177419, + "learning_rate": 0.00014652777777777779, + "loss": 0.6234, + "step": 422 + }, + { + "epoch": 0.14740135581435773, + "grad_norm": 0.6214905371013544, + "learning_rate": 0.00014722222222222223, + "loss": 0.64, + "step": 424 + }, + { + "epoch": 0.1480966452285764, + "grad_norm": 0.4103438113660832, + "learning_rate": 0.0001479166666666667, + "loss": 0.6174, + "step": 426 + }, + { + "epoch": 0.14879193464279505, + "grad_norm": 0.5802311029669485, + "learning_rate": 0.00014861111111111113, + "loss": 0.6941, + "step": 428 + }, + { + "epoch": 0.14948722405701373, + "grad_norm": 0.4876572424583591, + "learning_rate": 0.00014930555555555557, + "loss": 0.6178, + "step": 430 + }, + { + "epoch": 0.1501825134712324, + "grad_norm": 0.6252220373472688, + "learning_rate": 0.00015000000000000001, + "loss": 0.692, + "step": 432 + }, + { + "epoch": 0.15087780288545108, + "grad_norm": 1.516758455176553, + "learning_rate": 0.00015069444444444445, + "loss": 0.6812, + "step": 434 + }, + { + "epoch": 0.15157309229966973, + "grad_norm": 0.48294685446689867, + "learning_rate": 0.0001513888888888889, + "loss": 0.7085, + "step": 436 + }, + { + "epoch": 0.1522683817138884, + "grad_norm": 0.414196721150167, + "learning_rate": 0.00015208333333333333, + "loss": 0.673, + "step": 438 + }, + { + "epoch": 0.15296367112810708, + "grad_norm": 0.7294881062503469, + "learning_rate": 0.00015277777777777777, + "loss": 0.6415, + "step": 440 + }, + { + "epoch": 0.15365896054232575, + "grad_norm": 0.4846932912054438, + "learning_rate": 0.00015347222222222224, + "loss": 0.6644, + "step": 442 + }, + { + "epoch": 0.1543542499565444, + "grad_norm": 0.6067400167426414, + "learning_rate": 0.00015416666666666668, + "loss": 0.6816, + "step": 444 + }, + { + "epoch": 0.15504953937076307, + "grad_norm": 0.5586278026791864, + "learning_rate": 0.00015486111111111112, + "loss": 0.6223, + "step": 446 + }, + { + "epoch": 0.15574482878498175, + "grad_norm": 0.3947236166856149, + "learning_rate": 0.00015555555555555556, + "loss": 0.7297, + "step": 448 + }, + { + "epoch": 0.15644011819920042, + "grad_norm": 0.371457756887947, + "learning_rate": 0.00015625, + "loss": 0.6099, + "step": 450 + }, + { + "epoch": 0.15644011819920042, + "eval_loss": 0.6634477376937866, + "eval_runtime": 706.8027, + "eval_samples_per_second": 6.851, + "eval_steps_per_second": 0.215, + "step": 450 + }, + { + "epoch": 0.1571354076134191, + "grad_norm": 0.4157928192338373, + "learning_rate": 0.00015694444444444444, + "loss": 0.7163, + "step": 452 + }, + { + "epoch": 0.15783069702763775, + "grad_norm": 0.6318513446857751, + "learning_rate": 0.00015763888888888888, + "loss": 0.658, + "step": 454 + }, + { + "epoch": 0.15852598644185642, + "grad_norm": 0.3188170086808347, + "learning_rate": 0.00015833333333333332, + "loss": 0.5966, + "step": 456 + }, + { + "epoch": 0.1592212758560751, + "grad_norm": 0.4873146052629784, + "learning_rate": 0.00015902777777777776, + "loss": 0.687, + "step": 458 + }, + { + "epoch": 0.15991656527029377, + "grad_norm": 0.3939618900754228, + "learning_rate": 0.00015972222222222223, + "loss": 0.6704, + "step": 460 + }, + { + "epoch": 0.16061185468451242, + "grad_norm": 0.43442241310529234, + "learning_rate": 0.00016041666666666667, + "loss": 0.6941, + "step": 462 + }, + { + "epoch": 0.1613071440987311, + "grad_norm": 0.5944395304786771, + "learning_rate": 0.0001611111111111111, + "loss": 0.5934, + "step": 464 + }, + { + "epoch": 0.16200243351294977, + "grad_norm": 0.6186667715273749, + "learning_rate": 0.00016180555555555555, + "loss": 0.6604, + "step": 466 + }, + { + "epoch": 0.16269772292716844, + "grad_norm": 0.8945416923537124, + "learning_rate": 0.00016250000000000002, + "loss": 0.6224, + "step": 468 + }, + { + "epoch": 0.1633930123413871, + "grad_norm": 1.0526200270890014, + "learning_rate": 0.00016319444444444446, + "loss": 0.616, + "step": 470 + }, + { + "epoch": 0.16408830175560576, + "grad_norm": 0.4575985966727194, + "learning_rate": 0.0001638888888888889, + "loss": 0.6591, + "step": 472 + }, + { + "epoch": 0.16478359116982444, + "grad_norm": 0.4499931204645402, + "learning_rate": 0.00016458333333333334, + "loss": 0.6644, + "step": 474 + }, + { + "epoch": 0.16547888058404311, + "grad_norm": 0.8365574384741885, + "learning_rate": 0.00016527777777777778, + "loss": 0.6503, + "step": 476 + }, + { + "epoch": 0.1661741699982618, + "grad_norm": 0.5265284650577726, + "learning_rate": 0.00016597222222222225, + "loss": 0.557, + "step": 478 + }, + { + "epoch": 0.16686945941248044, + "grad_norm": 0.6004742828917694, + "learning_rate": 0.0001666666666666667, + "loss": 0.696, + "step": 480 + }, + { + "epoch": 0.1675647488266991, + "grad_norm": 0.8653134209549845, + "learning_rate": 0.00016736111111111113, + "loss": 0.6544, + "step": 482 + }, + { + "epoch": 0.1682600382409178, + "grad_norm": 1.033230873418064, + "learning_rate": 0.00016805555555555557, + "loss": 0.641, + "step": 484 + }, + { + "epoch": 0.16895532765513646, + "grad_norm": 0.45457193405665913, + "learning_rate": 0.00016875, + "loss": 0.5952, + "step": 486 + }, + { + "epoch": 0.1696506170693551, + "grad_norm": 0.7413902971651539, + "learning_rate": 0.00016944444444444445, + "loss": 0.6306, + "step": 488 + }, + { + "epoch": 0.17034590648357378, + "grad_norm": 0.5808764628223875, + "learning_rate": 0.0001701388888888889, + "loss": 0.6714, + "step": 490 + }, + { + "epoch": 0.17104119589779246, + "grad_norm": 0.42505370383777924, + "learning_rate": 0.00017083333333333333, + "loss": 0.6432, + "step": 492 + }, + { + "epoch": 0.17173648531201113, + "grad_norm": 0.9403542369255028, + "learning_rate": 0.00017152777777777777, + "loss": 0.626, + "step": 494 + }, + { + "epoch": 0.17243177472622978, + "grad_norm": 0.41714707593148775, + "learning_rate": 0.00017222222222222224, + "loss": 0.6132, + "step": 496 + }, + { + "epoch": 0.17312706414044846, + "grad_norm": 0.6660896849726371, + "learning_rate": 0.00017291666666666668, + "loss": 0.7009, + "step": 498 + }, + { + "epoch": 0.17382235355466713, + "grad_norm": 0.5079993412341118, + "learning_rate": 0.00017361111111111112, + "loss": 0.6808, + "step": 500 + }, + { + "epoch": 0.1745176429688858, + "grad_norm": 0.3426487947129772, + "learning_rate": 0.00017430555555555556, + "loss": 0.687, + "step": 502 + }, + { + "epoch": 0.17521293238310448, + "grad_norm": 0.7316051797581208, + "learning_rate": 0.000175, + "loss": 0.686, + "step": 504 + }, + { + "epoch": 0.17590822179732313, + "grad_norm": 0.4619785653282459, + "learning_rate": 0.00017569444444444444, + "loss": 0.7019, + "step": 506 + }, + { + "epoch": 0.1766035112115418, + "grad_norm": 0.47786977912472967, + "learning_rate": 0.0001763888888888889, + "loss": 0.7097, + "step": 508 + }, + { + "epoch": 0.17729880062576048, + "grad_norm": 0.4204398291864812, + "learning_rate": 0.00017708333333333335, + "loss": 0.6715, + "step": 510 + }, + { + "epoch": 0.17799409003997915, + "grad_norm": 0.5257761541709909, + "learning_rate": 0.00017777777777777779, + "loss": 0.6675, + "step": 512 + }, + { + "epoch": 0.1786893794541978, + "grad_norm": 0.5752239420884688, + "learning_rate": 0.00017847222222222225, + "loss": 0.5847, + "step": 514 + }, + { + "epoch": 0.17938466886841647, + "grad_norm": 0.5611432017880666, + "learning_rate": 0.0001791666666666667, + "loss": 0.5978, + "step": 516 + }, + { + "epoch": 0.18007995828263515, + "grad_norm": 0.5147097358785945, + "learning_rate": 0.00017986111111111113, + "loss": 0.641, + "step": 518 + }, + { + "epoch": 0.18077524769685382, + "grad_norm": 0.4387330962078066, + "learning_rate": 0.00018055555555555557, + "loss": 0.5771, + "step": 520 + }, + { + "epoch": 0.18147053711107247, + "grad_norm": 0.5712526440788663, + "learning_rate": 0.00018125000000000001, + "loss": 0.6212, + "step": 522 + }, + { + "epoch": 0.18216582652529115, + "grad_norm": 0.6357133907029916, + "learning_rate": 0.00018194444444444445, + "loss": 0.5981, + "step": 524 + }, + { + "epoch": 0.18286111593950982, + "grad_norm": 1.2129620643054042, + "learning_rate": 0.0001826388888888889, + "loss": 0.5848, + "step": 526 + }, + { + "epoch": 0.1835564053537285, + "grad_norm": 1.651599276688714, + "learning_rate": 0.00018333333333333334, + "loss": 0.7089, + "step": 528 + }, + { + "epoch": 0.18425169476794717, + "grad_norm": 0.9051688342434142, + "learning_rate": 0.00018402777777777778, + "loss": 0.7255, + "step": 530 + }, + { + "epoch": 0.18494698418216582, + "grad_norm": 0.6932441010863684, + "learning_rate": 0.00018472222222222224, + "loss": 0.6497, + "step": 532 + }, + { + "epoch": 0.1856422735963845, + "grad_norm": 1.2163006408955903, + "learning_rate": 0.00018541666666666668, + "loss": 0.7585, + "step": 534 + }, + { + "epoch": 0.18633756301060317, + "grad_norm": 0.4387074048377486, + "learning_rate": 0.00018611111111111112, + "loss": 0.6541, + "step": 536 + }, + { + "epoch": 0.18703285242482184, + "grad_norm": 0.49430581216479236, + "learning_rate": 0.00018680555555555556, + "loss": 0.6489, + "step": 538 + }, + { + "epoch": 0.1877281418390405, + "grad_norm": 0.47561442420926275, + "learning_rate": 0.0001875, + "loss": 0.6406, + "step": 540 + }, + { + "epoch": 0.18842343125325917, + "grad_norm": 0.7046092923664611, + "learning_rate": 0.00018819444444444444, + "loss": 0.6099, + "step": 542 + }, + { + "epoch": 0.18911872066747784, + "grad_norm": 0.46256136269201026, + "learning_rate": 0.00018888888888888888, + "loss": 0.6992, + "step": 544 + }, + { + "epoch": 0.18981401008169652, + "grad_norm": 0.5489877082982352, + "learning_rate": 0.00018958333333333332, + "loss": 0.5817, + "step": 546 + }, + { + "epoch": 0.19050929949591516, + "grad_norm": 0.46129441798908893, + "learning_rate": 0.00019027777777777776, + "loss": 0.645, + "step": 548 + }, + { + "epoch": 0.19120458891013384, + "grad_norm": 0.3724226655450749, + "learning_rate": 0.00019097222222222223, + "loss": 0.6177, + "step": 550 + }, + { + "epoch": 0.1918998783243525, + "grad_norm": 0.4625796323902992, + "learning_rate": 0.00019166666666666667, + "loss": 0.6702, + "step": 552 + }, + { + "epoch": 0.1925951677385712, + "grad_norm": 1.0142124821047231, + "learning_rate": 0.0001923611111111111, + "loss": 0.7173, + "step": 554 + }, + { + "epoch": 0.19329045715278984, + "grad_norm": 0.5452830720753045, + "learning_rate": 0.00019305555555555558, + "loss": 0.6897, + "step": 556 + }, + { + "epoch": 0.1939857465670085, + "grad_norm": 0.5723214484723252, + "learning_rate": 0.00019375000000000002, + "loss": 0.6495, + "step": 558 + }, + { + "epoch": 0.19468103598122719, + "grad_norm": 0.39925844595054966, + "learning_rate": 0.00019444444444444446, + "loss": 0.6479, + "step": 560 + }, + { + "epoch": 0.19537632539544586, + "grad_norm": 0.3575565088751118, + "learning_rate": 0.0001951388888888889, + "loss": 0.6593, + "step": 562 + }, + { + "epoch": 0.19607161480966454, + "grad_norm": 0.6119892689536569, + "learning_rate": 0.00019583333333333334, + "loss": 0.6831, + "step": 564 + }, + { + "epoch": 0.19676690422388318, + "grad_norm": 0.5076569073121309, + "learning_rate": 0.00019652777777777778, + "loss": 0.6294, + "step": 566 + }, + { + "epoch": 0.19746219363810186, + "grad_norm": 0.622226505121079, + "learning_rate": 0.00019722222222222225, + "loss": 0.5551, + "step": 568 + }, + { + "epoch": 0.19815748305232053, + "grad_norm": 0.4106526912254415, + "learning_rate": 0.0001979166666666667, + "loss": 0.6503, + "step": 570 + }, + { + "epoch": 0.1988527724665392, + "grad_norm": 0.47164751383243125, + "learning_rate": 0.00019861111111111113, + "loss": 0.6992, + "step": 572 + }, + { + "epoch": 0.19954806188075785, + "grad_norm": 0.492328312395826, + "learning_rate": 0.00019930555555555557, + "loss": 0.7183, + "step": 574 + }, + { + "epoch": 0.20024335129497653, + "grad_norm": 0.5087240677439067, + "learning_rate": 0.0002, + "loss": 0.6429, + "step": 576 + }, + { + "epoch": 0.2009386407091952, + "grad_norm": 0.9311216098504759, + "learning_rate": 0.00019999992632143608, + "loss": 0.6586, + "step": 578 + }, + { + "epoch": 0.20163393012341388, + "grad_norm": 0.38840935170189844, + "learning_rate": 0.00019999970528585288, + "loss": 0.5905, + "step": 580 + }, + { + "epoch": 0.20232921953763253, + "grad_norm": 0.5966472765038273, + "learning_rate": 0.0001999993368935761, + "loss": 0.7112, + "step": 582 + }, + { + "epoch": 0.2030245089518512, + "grad_norm": 0.535232520705813, + "learning_rate": 0.00019999882114514863, + "loss": 0.7036, + "step": 584 + }, + { + "epoch": 0.20371979836606988, + "grad_norm": 0.5039916125175515, + "learning_rate": 0.0001999981580413304, + "loss": 0.7485, + "step": 586 + }, + { + "epoch": 0.20441508778028855, + "grad_norm": 0.6733262892097686, + "learning_rate": 0.0001999973475830986, + "loss": 0.7312, + "step": 588 + }, + { + "epoch": 0.20511037719450723, + "grad_norm": 0.42805740684614807, + "learning_rate": 0.00019999638977164747, + "loss": 0.6356, + "step": 590 + }, + { + "epoch": 0.20580566660872587, + "grad_norm": 0.976918546573707, + "learning_rate": 0.00019999528460838844, + "loss": 0.666, + "step": 592 + }, + { + "epoch": 0.20650095602294455, + "grad_norm": 0.674463735133944, + "learning_rate": 0.00019999403209495, + "loss": 0.6735, + "step": 594 + }, + { + "epoch": 0.20719624543716322, + "grad_norm": 0.412232119296174, + "learning_rate": 0.00019999263223317786, + "loss": 0.6364, + "step": 596 + }, + { + "epoch": 0.2078915348513819, + "grad_norm": 0.3611034413524545, + "learning_rate": 0.0001999910850251348, + "loss": 0.6368, + "step": 598 + }, + { + "epoch": 0.20858682426560055, + "grad_norm": 0.542506398091656, + "learning_rate": 0.0001999893904731007, + "loss": 0.7292, + "step": 600 + }, + { + "epoch": 0.20858682426560055, + "eval_loss": 0.6517693400382996, + "eval_runtime": 707.4674, + "eval_samples_per_second": 6.844, + "eval_steps_per_second": 0.215, + "step": 600 + }, + { + "epoch": 0.20928211367981922, + "grad_norm": 0.4799286290563759, + "learning_rate": 0.0001999875485795727, + "loss": 0.6609, + "step": 602 + }, + { + "epoch": 0.2099774030940379, + "grad_norm": 0.41830446575524177, + "learning_rate": 0.0001999855593472649, + "loss": 0.6084, + "step": 604 + }, + { + "epoch": 0.21067269250825657, + "grad_norm": 0.8865562086549428, + "learning_rate": 0.00019998342277910856, + "loss": 0.6204, + "step": 606 + }, + { + "epoch": 0.21136798192247522, + "grad_norm": 0.5567410910026902, + "learning_rate": 0.00019998113887825206, + "loss": 0.7087, + "step": 608 + }, + { + "epoch": 0.2120632713366939, + "grad_norm": 0.4229098163428897, + "learning_rate": 0.000199978707648061, + "loss": 0.6403, + "step": 610 + }, + { + "epoch": 0.21275856075091257, + "grad_norm": 0.7793555918286379, + "learning_rate": 0.00019997612909211784, + "loss": 0.6147, + "step": 612 + }, + { + "epoch": 0.21345385016513124, + "grad_norm": 0.49302383416102263, + "learning_rate": 0.00019997340321422228, + "loss": 0.5771, + "step": 614 + }, + { + "epoch": 0.21414913957934992, + "grad_norm": 1.0807551778698754, + "learning_rate": 0.00019997053001839115, + "loss": 0.6538, + "step": 616 + }, + { + "epoch": 0.21484442899356856, + "grad_norm": 0.5935042706034646, + "learning_rate": 0.0001999675095088583, + "loss": 0.6058, + "step": 618 + }, + { + "epoch": 0.21553971840778724, + "grad_norm": 0.5151203960605611, + "learning_rate": 0.00019996434169007468, + "loss": 0.6138, + "step": 620 + }, + { + "epoch": 0.21623500782200591, + "grad_norm": 0.7837579499467073, + "learning_rate": 0.00019996102656670824, + "loss": 0.657, + "step": 622 + }, + { + "epoch": 0.2169302972362246, + "grad_norm": 0.5438202413527335, + "learning_rate": 0.0001999575641436441, + "loss": 0.6642, + "step": 624 + }, + { + "epoch": 0.21762558665044324, + "grad_norm": 0.5566641749580342, + "learning_rate": 0.00019995395442598435, + "loss": 0.6813, + "step": 626 + }, + { + "epoch": 0.2183208760646619, + "grad_norm": 0.9345190838089675, + "learning_rate": 0.0001999501974190482, + "loss": 0.684, + "step": 628 + }, + { + "epoch": 0.2190161654788806, + "grad_norm": 0.48677420225080537, + "learning_rate": 0.00019994629312837186, + "loss": 0.6481, + "step": 630 + }, + { + "epoch": 0.21971145489309926, + "grad_norm": 1.3826373483976924, + "learning_rate": 0.00019994224155970856, + "loss": 0.7222, + "step": 632 + }, + { + "epoch": 0.2204067443073179, + "grad_norm": 0.9031189580678588, + "learning_rate": 0.00019993804271902857, + "loss": 0.6809, + "step": 634 + }, + { + "epoch": 0.22110203372153658, + "grad_norm": 0.5674519795217096, + "learning_rate": 0.00019993369661251923, + "loss": 0.6184, + "step": 636 + }, + { + "epoch": 0.22179732313575526, + "grad_norm": 2.5294344265719135, + "learning_rate": 0.0001999292032465848, + "loss": 0.7686, + "step": 638 + }, + { + "epoch": 0.22249261254997393, + "grad_norm": 2.8855656605632047, + "learning_rate": 0.00019992456262784658, + "loss": 0.8215, + "step": 640 + }, + { + "epoch": 0.2231879019641926, + "grad_norm": 1.5331524159142917, + "learning_rate": 0.00019991977476314286, + "loss": 0.7057, + "step": 642 + }, + { + "epoch": 0.22388319137841126, + "grad_norm": 0.8086145005161695, + "learning_rate": 0.0001999148396595289, + "loss": 0.6289, + "step": 644 + }, + { + "epoch": 0.22457848079262993, + "grad_norm": 0.767389193699688, + "learning_rate": 0.00019990975732427693, + "loss": 0.6117, + "step": 646 + }, + { + "epoch": 0.2252737702068486, + "grad_norm": 0.9275190697426144, + "learning_rate": 0.0001999045277648761, + "loss": 0.6582, + "step": 648 + }, + { + "epoch": 0.22596905962106728, + "grad_norm": 0.8004230202091956, + "learning_rate": 0.00019989915098903257, + "loss": 0.5387, + "step": 650 + }, + { + "epoch": 0.22666434903528593, + "grad_norm": 0.8210833181388095, + "learning_rate": 0.0001998936270046694, + "loss": 0.5941, + "step": 652 + }, + { + "epoch": 0.2273596384495046, + "grad_norm": 2.1189675938584616, + "learning_rate": 0.00019988795581992656, + "loss": 0.7504, + "step": 654 + }, + { + "epoch": 0.22805492786372328, + "grad_norm": 0.5952032026226816, + "learning_rate": 0.000199882137443161, + "loss": 0.6643, + "step": 656 + }, + { + "epoch": 0.22875021727794195, + "grad_norm": 0.40481972159485846, + "learning_rate": 0.00019987617188294642, + "loss": 0.5225, + "step": 658 + }, + { + "epoch": 0.2294455066921606, + "grad_norm": 0.7478677085785272, + "learning_rate": 0.00019987005914807356, + "loss": 0.6561, + "step": 660 + }, + { + "epoch": 0.23014079610637928, + "grad_norm": 0.4468692254604696, + "learning_rate": 0.00019986379924754997, + "loss": 0.6262, + "step": 662 + }, + { + "epoch": 0.23083608552059795, + "grad_norm": 0.46697718493106893, + "learning_rate": 0.00019985739219060002, + "loss": 0.6178, + "step": 664 + }, + { + "epoch": 0.23153137493481663, + "grad_norm": 0.388728867903269, + "learning_rate": 0.000199850837986665, + "loss": 0.5544, + "step": 666 + }, + { + "epoch": 0.23222666434903527, + "grad_norm": 0.5731403139849517, + "learning_rate": 0.000199844136645403, + "loss": 0.5906, + "step": 668 + }, + { + "epoch": 0.23292195376325395, + "grad_norm": 0.7601215827849259, + "learning_rate": 0.0001998372881766889, + "loss": 0.6577, + "step": 670 + }, + { + "epoch": 0.23361724317747262, + "grad_norm": 0.8997786413980279, + "learning_rate": 0.00019983029259061446, + "loss": 0.6388, + "step": 672 + }, + { + "epoch": 0.2343125325916913, + "grad_norm": 0.519349430301096, + "learning_rate": 0.00019982314989748813, + "loss": 0.6561, + "step": 674 + }, + { + "epoch": 0.23500782200590997, + "grad_norm": 0.4918913590728881, + "learning_rate": 0.00019981586010783513, + "loss": 0.6176, + "step": 676 + }, + { + "epoch": 0.23570311142012862, + "grad_norm": 0.5324672662478441, + "learning_rate": 0.00019980842323239756, + "loss": 0.5801, + "step": 678 + }, + { + "epoch": 0.2363984008343473, + "grad_norm": 0.6375745879180794, + "learning_rate": 0.00019980083928213417, + "loss": 0.6885, + "step": 680 + }, + { + "epoch": 0.23709369024856597, + "grad_norm": 0.4317997282790841, + "learning_rate": 0.00019979310826822046, + "loss": 0.5727, + "step": 682 + }, + { + "epoch": 0.23778897966278464, + "grad_norm": 0.7933828103238656, + "learning_rate": 0.00019978523020204857, + "loss": 0.6703, + "step": 684 + }, + { + "epoch": 0.2384842690770033, + "grad_norm": 0.5465102255190097, + "learning_rate": 0.00019977720509522747, + "loss": 0.6675, + "step": 686 + }, + { + "epoch": 0.23917955849122197, + "grad_norm": 0.8356137363612883, + "learning_rate": 0.00019976903295958269, + "loss": 0.6558, + "step": 688 + }, + { + "epoch": 0.23987484790544064, + "grad_norm": 0.5190073187676806, + "learning_rate": 0.00019976071380715645, + "loss": 0.6779, + "step": 690 + }, + { + "epoch": 0.24057013731965932, + "grad_norm": 0.40561527338007225, + "learning_rate": 0.0001997522476502076, + "loss": 0.6687, + "step": 692 + }, + { + "epoch": 0.24126542673387796, + "grad_norm": 0.592821589706298, + "learning_rate": 0.0001997436345012117, + "loss": 0.6807, + "step": 694 + }, + { + "epoch": 0.24196071614809664, + "grad_norm": 0.686918345062074, + "learning_rate": 0.00019973487437286073, + "loss": 0.6831, + "step": 696 + }, + { + "epoch": 0.2426560055623153, + "grad_norm": 0.964075508243471, + "learning_rate": 0.00019972596727806346, + "loss": 0.665, + "step": 698 + }, + { + "epoch": 0.243351294976534, + "grad_norm": 0.739137434656244, + "learning_rate": 0.00019971691322994507, + "loss": 0.6387, + "step": 700 + }, + { + "epoch": 0.24404658439075266, + "grad_norm": 0.3978099419540589, + "learning_rate": 0.00019970771224184737, + "loss": 0.6143, + "step": 702 + }, + { + "epoch": 0.2447418738049713, + "grad_norm": 0.4997978607153984, + "learning_rate": 0.0001996983643273287, + "loss": 0.6083, + "step": 704 + }, + { + "epoch": 0.24543716321918999, + "grad_norm": 1.3443518380439796, + "learning_rate": 0.0001996888695001638, + "loss": 0.6711, + "step": 706 + }, + { + "epoch": 0.24613245263340866, + "grad_norm": 0.5424379336505594, + "learning_rate": 0.000199679227774344, + "loss": 0.6321, + "step": 708 + }, + { + "epoch": 0.24682774204762734, + "grad_norm": 0.7689235498835658, + "learning_rate": 0.00019966943916407712, + "loss": 0.6918, + "step": 710 + }, + { + "epoch": 0.24752303146184598, + "grad_norm": 0.6467240394468301, + "learning_rate": 0.00019965950368378734, + "loss": 0.6368, + "step": 712 + }, + { + "epoch": 0.24821832087606466, + "grad_norm": 0.48819289451999526, + "learning_rate": 0.00019964942134811532, + "loss": 0.5875, + "step": 714 + }, + { + "epoch": 0.24891361029028333, + "grad_norm": 1.1929427463467126, + "learning_rate": 0.00019963919217191807, + "loss": 0.6795, + "step": 716 + }, + { + "epoch": 0.249608899704502, + "grad_norm": 0.4182713825442439, + "learning_rate": 0.00019962881617026902, + "loss": 0.5835, + "step": 718 + }, + { + "epoch": 0.25030418911872065, + "grad_norm": 0.5770262516296942, + "learning_rate": 0.00019961829335845795, + "loss": 0.6299, + "step": 720 + }, + { + "epoch": 0.25099947853293936, + "grad_norm": 0.9135250550485389, + "learning_rate": 0.00019960762375199095, + "loss": 0.6844, + "step": 722 + }, + { + "epoch": 0.251694767947158, + "grad_norm": 0.5511234805517417, + "learning_rate": 0.0001995968073665905, + "loss": 0.5745, + "step": 724 + }, + { + "epoch": 0.25239005736137665, + "grad_norm": 0.49137872896877094, + "learning_rate": 0.00019958584421819528, + "loss": 0.698, + "step": 726 + }, + { + "epoch": 0.25308534677559535, + "grad_norm": 0.4437253322782162, + "learning_rate": 0.00019957473432296026, + "loss": 0.6864, + "step": 728 + }, + { + "epoch": 0.253780636189814, + "grad_norm": 0.5064381489074585, + "learning_rate": 0.0001995634776972567, + "loss": 0.5758, + "step": 730 + }, + { + "epoch": 0.2544759256040327, + "grad_norm": 0.5464655664741616, + "learning_rate": 0.00019955207435767201, + "loss": 0.6351, + "step": 732 + }, + { + "epoch": 0.25517121501825135, + "grad_norm": 0.44060524677853835, + "learning_rate": 0.00019954052432100982, + "loss": 0.6837, + "step": 734 + }, + { + "epoch": 0.25586650443247, + "grad_norm": 0.942390696980061, + "learning_rate": 0.00019952882760428998, + "loss": 0.6378, + "step": 736 + }, + { + "epoch": 0.2565617938466887, + "grad_norm": 0.4710023299938762, + "learning_rate": 0.00019951698422474836, + "loss": 0.6968, + "step": 738 + }, + { + "epoch": 0.25725708326090735, + "grad_norm": 0.4179809222387651, + "learning_rate": 0.00019950499419983707, + "loss": 0.5643, + "step": 740 + }, + { + "epoch": 0.257952372675126, + "grad_norm": 0.4446278865199289, + "learning_rate": 0.00019949285754722426, + "loss": 0.5089, + "step": 742 + }, + { + "epoch": 0.2586476620893447, + "grad_norm": 0.914728851966275, + "learning_rate": 0.00019948057428479418, + "loss": 0.7933, + "step": 744 + }, + { + "epoch": 0.25934295150356335, + "grad_norm": 0.47142275185055055, + "learning_rate": 0.00019946814443064703, + "loss": 0.6384, + "step": 746 + }, + { + "epoch": 0.26003824091778205, + "grad_norm": 0.720916103725334, + "learning_rate": 0.00019945556800309917, + "loss": 0.5957, + "step": 748 + }, + { + "epoch": 0.2607335303320007, + "grad_norm": 0.8550360126036364, + "learning_rate": 0.00019944284502068275, + "loss": 0.6454, + "step": 750 + }, + { + "epoch": 0.2607335303320007, + "eval_loss": 0.6373963952064514, + "eval_runtime": 728.7951, + "eval_samples_per_second": 6.644, + "eval_steps_per_second": 0.209, + "step": 750 + }, + { + "epoch": 0.26142881974621934, + "grad_norm": 0.5467512313200382, + "learning_rate": 0.0001994299755021461, + "loss": 0.5781, + "step": 752 + }, + { + "epoch": 0.26212410916043805, + "grad_norm": 0.41230384162224254, + "learning_rate": 0.0001994169594664533, + "loss": 0.6467, + "step": 754 + }, + { + "epoch": 0.2628193985746567, + "grad_norm": 0.5635895964904281, + "learning_rate": 0.00019940379693278448, + "loss": 0.6182, + "step": 756 + }, + { + "epoch": 0.2635146879888754, + "grad_norm": 0.6456168984233462, + "learning_rate": 0.0001993904879205355, + "loss": 0.6086, + "step": 758 + }, + { + "epoch": 0.26420997740309404, + "grad_norm": 0.5060399335833471, + "learning_rate": 0.00019937703244931815, + "loss": 0.6407, + "step": 760 + }, + { + "epoch": 0.2649052668173127, + "grad_norm": 0.5033297464646784, + "learning_rate": 0.00019936343053896004, + "loss": 0.6157, + "step": 762 + }, + { + "epoch": 0.2656005562315314, + "grad_norm": 0.3911665523252255, + "learning_rate": 0.00019934968220950458, + "loss": 0.6227, + "step": 764 + }, + { + "epoch": 0.26629584564575004, + "grad_norm": 1.7130937466256138, + "learning_rate": 0.00019933578748121086, + "loss": 0.5994, + "step": 766 + }, + { + "epoch": 0.2669911350599687, + "grad_norm": 0.5747338886603724, + "learning_rate": 0.00019932174637455382, + "loss": 0.6238, + "step": 768 + }, + { + "epoch": 0.2676864244741874, + "grad_norm": 0.6226324357252033, + "learning_rate": 0.00019930755891022398, + "loss": 0.6255, + "step": 770 + }, + { + "epoch": 0.26838171388840604, + "grad_norm": 0.5282488794229044, + "learning_rate": 0.00019929322510912756, + "loss": 0.5808, + "step": 772 + }, + { + "epoch": 0.26907700330262474, + "grad_norm": 0.5596904577167024, + "learning_rate": 0.0001992787449923865, + "loss": 0.5361, + "step": 774 + }, + { + "epoch": 0.2697722927168434, + "grad_norm": 1.0477422618379753, + "learning_rate": 0.00019926411858133824, + "loss": 0.54, + "step": 776 + }, + { + "epoch": 0.27046758213106203, + "grad_norm": 1.1314704495635823, + "learning_rate": 0.00019924934589753582, + "loss": 0.5869, + "step": 778 + }, + { + "epoch": 0.27116287154528074, + "grad_norm": 0.5426548544381972, + "learning_rate": 0.00019923442696274794, + "loss": 0.5951, + "step": 780 + }, + { + "epoch": 0.2718581609594994, + "grad_norm": 0.8480025293040686, + "learning_rate": 0.00019921936179895862, + "loss": 0.6003, + "step": 782 + }, + { + "epoch": 0.2725534503737181, + "grad_norm": 0.5729452380906337, + "learning_rate": 0.0001992041504283675, + "loss": 0.6526, + "step": 784 + }, + { + "epoch": 0.27324873978793673, + "grad_norm": 0.7362085286496177, + "learning_rate": 0.00019918879287338957, + "loss": 0.6776, + "step": 786 + }, + { + "epoch": 0.2739440292021554, + "grad_norm": 0.7440059372391256, + "learning_rate": 0.00019917328915665535, + "loss": 0.6486, + "step": 788 + }, + { + "epoch": 0.2746393186163741, + "grad_norm": 0.6110842206790659, + "learning_rate": 0.0001991576393010106, + "loss": 0.6226, + "step": 790 + }, + { + "epoch": 0.27533460803059273, + "grad_norm": 0.8002336898560896, + "learning_rate": 0.00019914184332951655, + "loss": 0.6215, + "step": 792 + }, + { + "epoch": 0.2760298974448114, + "grad_norm": 0.6761736356192558, + "learning_rate": 0.00019912590126544964, + "loss": 0.5988, + "step": 794 + }, + { + "epoch": 0.2767251868590301, + "grad_norm": 1.1005016630123619, + "learning_rate": 0.00019910981313230172, + "loss": 0.6213, + "step": 796 + }, + { + "epoch": 0.27742047627324873, + "grad_norm": 0.6513452605734942, + "learning_rate": 0.00019909357895377973, + "loss": 0.682, + "step": 798 + }, + { + "epoch": 0.27811576568746743, + "grad_norm": 0.8536492677008404, + "learning_rate": 0.0001990771987538059, + "loss": 0.707, + "step": 800 + }, + { + "epoch": 0.2788110551016861, + "grad_norm": 0.3362293750538688, + "learning_rate": 0.00019906067255651765, + "loss": 0.7108, + "step": 802 + }, + { + "epoch": 0.2795063445159047, + "grad_norm": 0.4792899916449288, + "learning_rate": 0.0001990440003862675, + "loss": 0.6055, + "step": 804 + }, + { + "epoch": 0.28020163393012343, + "grad_norm": 1.272937677307704, + "learning_rate": 0.00019902718226762304, + "loss": 0.6816, + "step": 806 + }, + { + "epoch": 0.2808969233443421, + "grad_norm": 0.30646692495778655, + "learning_rate": 0.00019901021822536704, + "loss": 0.688, + "step": 808 + }, + { + "epoch": 0.2815922127585608, + "grad_norm": 0.3035733218665055, + "learning_rate": 0.00019899310828449713, + "loss": 0.6746, + "step": 810 + }, + { + "epoch": 0.2822875021727794, + "grad_norm": 0.2763276026826459, + "learning_rate": 0.00019897585247022613, + "loss": 0.6632, + "step": 812 + }, + { + "epoch": 0.2829827915869981, + "grad_norm": 1.173118337900773, + "learning_rate": 0.00019895845080798166, + "loss": 0.6306, + "step": 814 + }, + { + "epoch": 0.2836780810012168, + "grad_norm": 0.4335278252167635, + "learning_rate": 0.0001989409033234063, + "loss": 0.6147, + "step": 816 + }, + { + "epoch": 0.2843733704154354, + "grad_norm": 0.3556694503062785, + "learning_rate": 0.00019892321004235755, + "loss": 0.5771, + "step": 818 + }, + { + "epoch": 0.28506865982965407, + "grad_norm": 0.9083240381897224, + "learning_rate": 0.00019890537099090768, + "loss": 0.5729, + "step": 820 + }, + { + "epoch": 0.2857639492438728, + "grad_norm": 0.5433346815141633, + "learning_rate": 0.00019888738619534385, + "loss": 0.5554, + "step": 822 + }, + { + "epoch": 0.2864592386580914, + "grad_norm": 0.5244705156138804, + "learning_rate": 0.0001988692556821679, + "loss": 0.6525, + "step": 824 + }, + { + "epoch": 0.2871545280723101, + "grad_norm": 0.7580866792170871, + "learning_rate": 0.00019885097947809648, + "loss": 0.6512, + "step": 826 + }, + { + "epoch": 0.28784981748652877, + "grad_norm": 0.7034554538404351, + "learning_rate": 0.00019883255761006082, + "loss": 0.5414, + "step": 828 + }, + { + "epoch": 0.2885451069007474, + "grad_norm": 0.6915575597289163, + "learning_rate": 0.00019881399010520688, + "loss": 0.6036, + "step": 830 + }, + { + "epoch": 0.2892403963149661, + "grad_norm": 0.6895372001781882, + "learning_rate": 0.00019879527699089524, + "loss": 0.5894, + "step": 832 + }, + { + "epoch": 0.28993568572918477, + "grad_norm": 0.7762412863407715, + "learning_rate": 0.00019877641829470094, + "loss": 0.7115, + "step": 834 + }, + { + "epoch": 0.29063097514340347, + "grad_norm": 0.5761220663639801, + "learning_rate": 0.00019875741404441367, + "loss": 0.6108, + "step": 836 + }, + { + "epoch": 0.2913262645576221, + "grad_norm": 0.47176943357070505, + "learning_rate": 0.00019873826426803755, + "loss": 0.634, + "step": 838 + }, + { + "epoch": 0.29202155397184076, + "grad_norm": 0.5985873148196751, + "learning_rate": 0.00019871896899379107, + "loss": 0.6528, + "step": 840 + }, + { + "epoch": 0.29271684338605947, + "grad_norm": 0.39514741111190665, + "learning_rate": 0.00019869952825010727, + "loss": 0.6034, + "step": 842 + }, + { + "epoch": 0.2934121328002781, + "grad_norm": 0.29787585594263405, + "learning_rate": 0.00019867994206563343, + "loss": 0.6063, + "step": 844 + }, + { + "epoch": 0.29410742221449676, + "grad_norm": 0.303320759302155, + "learning_rate": 0.00019866021046923118, + "loss": 0.6343, + "step": 846 + }, + { + "epoch": 0.29480271162871546, + "grad_norm": 0.33135450527244925, + "learning_rate": 0.00019864033348997645, + "loss": 0.6421, + "step": 848 + }, + { + "epoch": 0.2954980010429341, + "grad_norm": 0.553668190192523, + "learning_rate": 0.0001986203111571594, + "loss": 0.6503, + "step": 850 + }, + { + "epoch": 0.2961932904571528, + "grad_norm": 0.31948016623126946, + "learning_rate": 0.00019860014350028438, + "loss": 0.6259, + "step": 852 + }, + { + "epoch": 0.29688857987137146, + "grad_norm": 0.5325237443938606, + "learning_rate": 0.0001985798305490698, + "loss": 0.6207, + "step": 854 + }, + { + "epoch": 0.2975838692855901, + "grad_norm": 0.5093186589927414, + "learning_rate": 0.00019855937233344831, + "loss": 0.5397, + "step": 856 + }, + { + "epoch": 0.2982791586998088, + "grad_norm": 0.5220573948537062, + "learning_rate": 0.00019853876888356652, + "loss": 0.6237, + "step": 858 + }, + { + "epoch": 0.29897444811402746, + "grad_norm": 0.9861332892020862, + "learning_rate": 0.00019851802022978506, + "loss": 0.689, + "step": 860 + }, + { + "epoch": 0.2996697375282461, + "grad_norm": 0.464669721879274, + "learning_rate": 0.00019849712640267861, + "loss": 0.522, + "step": 862 + }, + { + "epoch": 0.3003650269424648, + "grad_norm": 0.9223435358714303, + "learning_rate": 0.00019847608743303567, + "loss": 0.7491, + "step": 864 + }, + { + "epoch": 0.30106031635668346, + "grad_norm": 0.5058775377593727, + "learning_rate": 0.00019845490335185866, + "loss": 0.562, + "step": 866 + }, + { + "epoch": 0.30175560577090216, + "grad_norm": 0.5517767811356443, + "learning_rate": 0.00019843357419036382, + "loss": 0.6162, + "step": 868 + }, + { + "epoch": 0.3024508951851208, + "grad_norm": 0.49255497197537723, + "learning_rate": 0.00019841209997998127, + "loss": 0.6803, + "step": 870 + }, + { + "epoch": 0.30314618459933945, + "grad_norm": 0.41553745561512617, + "learning_rate": 0.0001983904807523547, + "loss": 0.6415, + "step": 872 + }, + { + "epoch": 0.30384147401355815, + "grad_norm": 0.49551628457734653, + "learning_rate": 0.00019836871653934162, + "loss": 0.6176, + "step": 874 + }, + { + "epoch": 0.3045367634277768, + "grad_norm": 0.7489091107060393, + "learning_rate": 0.00019834680737301313, + "loss": 0.6337, + "step": 876 + }, + { + "epoch": 0.3052320528419955, + "grad_norm": 0.32312869533576805, + "learning_rate": 0.00019832475328565398, + "loss": 0.6135, + "step": 878 + }, + { + "epoch": 0.30592734225621415, + "grad_norm": 0.304002075332943, + "learning_rate": 0.00019830255430976242, + "loss": 0.5533, + "step": 880 + }, + { + "epoch": 0.3066226316704328, + "grad_norm": 0.4137621036041215, + "learning_rate": 0.00019828021047805022, + "loss": 0.573, + "step": 882 + }, + { + "epoch": 0.3073179210846515, + "grad_norm": 0.7506870255042438, + "learning_rate": 0.00019825772182344262, + "loss": 0.6971, + "step": 884 + }, + { + "epoch": 0.30801321049887015, + "grad_norm": 0.7069489041589112, + "learning_rate": 0.00019823508837907828, + "loss": 0.5848, + "step": 886 + }, + { + "epoch": 0.3087084999130888, + "grad_norm": 0.49383355752727304, + "learning_rate": 0.00019821231017830914, + "loss": 0.6349, + "step": 888 + }, + { + "epoch": 0.3094037893273075, + "grad_norm": 0.7893505446859834, + "learning_rate": 0.0001981893872547005, + "loss": 0.6335, + "step": 890 + }, + { + "epoch": 0.31009907874152615, + "grad_norm": 1.0962653113728835, + "learning_rate": 0.00019816631964203097, + "loss": 0.6438, + "step": 892 + }, + { + "epoch": 0.31079436815574485, + "grad_norm": 0.40606329821748216, + "learning_rate": 0.0001981431073742923, + "loss": 0.557, + "step": 894 + }, + { + "epoch": 0.3114896575699635, + "grad_norm": 0.8061837126172193, + "learning_rate": 0.00019811975048568943, + "loss": 0.6334, + "step": 896 + }, + { + "epoch": 0.31218494698418214, + "grad_norm": 0.7808955990860935, + "learning_rate": 0.00019809624901064038, + "loss": 0.5775, + "step": 898 + }, + { + "epoch": 0.31288023639840085, + "grad_norm": 0.5527203146534614, + "learning_rate": 0.00019807260298377626, + "loss": 0.5934, + "step": 900 + }, + { + "epoch": 0.31288023639840085, + "eval_loss": 0.666339099407196, + "eval_runtime": 759.5196, + "eval_samples_per_second": 6.375, + "eval_steps_per_second": 0.2, + "step": 900 + }, + { + "epoch": 0.3135755258126195, + "grad_norm": 1.151650071753606, + "learning_rate": 0.00019804881243994118, + "loss": 0.6459, + "step": 902 + }, + { + "epoch": 0.3142708152268382, + "grad_norm": 0.37537177441864283, + "learning_rate": 0.00019802487741419218, + "loss": 0.5537, + "step": 904 + }, + { + "epoch": 0.31496610464105684, + "grad_norm": 0.39806583735978385, + "learning_rate": 0.00019800079794179927, + "loss": 0.5765, + "step": 906 + }, + { + "epoch": 0.3156613940552755, + "grad_norm": 0.9252532303995283, + "learning_rate": 0.00019797657405824524, + "loss": 0.6581, + "step": 908 + }, + { + "epoch": 0.3163566834694942, + "grad_norm": 0.4242008643262632, + "learning_rate": 0.00019795220579922572, + "loss": 0.663, + "step": 910 + }, + { + "epoch": 0.31705197288371284, + "grad_norm": 0.5557863138791925, + "learning_rate": 0.00019792769320064904, + "loss": 0.6492, + "step": 912 + }, + { + "epoch": 0.3177472622979315, + "grad_norm": 0.5743017982975046, + "learning_rate": 0.0001979030362986363, + "loss": 0.6425, + "step": 914 + }, + { + "epoch": 0.3184425517121502, + "grad_norm": 0.39667228882787314, + "learning_rate": 0.0001978782351295212, + "loss": 0.5658, + "step": 916 + }, + { + "epoch": 0.31913784112636884, + "grad_norm": 1.2742981139875873, + "learning_rate": 0.00019785328972985, + "loss": 0.6042, + "step": 918 + }, + { + "epoch": 0.31983313054058754, + "grad_norm": 0.7520790754771111, + "learning_rate": 0.00019782820013638158, + "loss": 0.6248, + "step": 920 + }, + { + "epoch": 0.3205284199548062, + "grad_norm": 1.1777266516894538, + "learning_rate": 0.0001978029663860872, + "loss": 0.6394, + "step": 922 + }, + { + "epoch": 0.32122370936902483, + "grad_norm": 0.5383416828808074, + "learning_rate": 0.00019777758851615058, + "loss": 0.6357, + "step": 924 + }, + { + "epoch": 0.32191899878324354, + "grad_norm": 0.5351088818608489, + "learning_rate": 0.00019775206656396787, + "loss": 0.6111, + "step": 926 + }, + { + "epoch": 0.3226142881974622, + "grad_norm": 0.7776255734128178, + "learning_rate": 0.00019772640056714744, + "loss": 0.5778, + "step": 928 + }, + { + "epoch": 0.3233095776116809, + "grad_norm": 0.5049904332607067, + "learning_rate": 0.00019770059056351, + "loss": 0.5978, + "step": 930 + }, + { + "epoch": 0.32400486702589953, + "grad_norm": 0.6894813643690206, + "learning_rate": 0.00019767463659108841, + "loss": 0.6727, + "step": 932 + }, + { + "epoch": 0.3247001564401182, + "grad_norm": 0.6230252249989028, + "learning_rate": 0.00019764853868812772, + "loss": 0.5911, + "step": 934 + }, + { + "epoch": 0.3253954458543369, + "grad_norm": 0.6699617199619087, + "learning_rate": 0.00019762229689308499, + "loss": 0.6694, + "step": 936 + }, + { + "epoch": 0.32609073526855553, + "grad_norm": 0.9762605521595761, + "learning_rate": 0.00019759591124462943, + "loss": 0.7053, + "step": 938 + }, + { + "epoch": 0.3267860246827742, + "grad_norm": 0.5216728233794251, + "learning_rate": 0.0001975693817816422, + "loss": 0.6958, + "step": 940 + }, + { + "epoch": 0.3274813140969929, + "grad_norm": 0.5943791708445256, + "learning_rate": 0.00019754270854321625, + "loss": 0.6342, + "step": 942 + }, + { + "epoch": 0.32817660351121153, + "grad_norm": 0.5341014737913188, + "learning_rate": 0.00019751589156865663, + "loss": 0.6272, + "step": 944 + }, + { + "epoch": 0.32887189292543023, + "grad_norm": 0.8411647140863245, + "learning_rate": 0.00019748893089747995, + "loss": 0.6041, + "step": 946 + }, + { + "epoch": 0.3295671823396489, + "grad_norm": 1.072323043427063, + "learning_rate": 0.00019746182656941473, + "loss": 0.7152, + "step": 948 + }, + { + "epoch": 0.3302624717538675, + "grad_norm": 0.6497829380326366, + "learning_rate": 0.00019743457862440115, + "loss": 0.6176, + "step": 950 + }, + { + "epoch": 0.33095776116808623, + "grad_norm": 0.28736093186011447, + "learning_rate": 0.00019740718710259096, + "loss": 0.6453, + "step": 952 + }, + { + "epoch": 0.3316530505823049, + "grad_norm": 0.27868233108109625, + "learning_rate": 0.00019737965204434757, + "loss": 0.6051, + "step": 954 + }, + { + "epoch": 0.3323483399965236, + "grad_norm": 0.40709235855818693, + "learning_rate": 0.00019735197349024576, + "loss": 0.6255, + "step": 956 + }, + { + "epoch": 0.3330436294107422, + "grad_norm": 0.8385677925045294, + "learning_rate": 0.00019732415148107199, + "loss": 0.6455, + "step": 958 + }, + { + "epoch": 0.3337389188249609, + "grad_norm": 0.5642576200414804, + "learning_rate": 0.00019729618605782384, + "loss": 0.6971, + "step": 960 + }, + { + "epoch": 0.3344342082391796, + "grad_norm": 0.7034648545079693, + "learning_rate": 0.00019726807726171039, + "loss": 0.6177, + "step": 962 + }, + { + "epoch": 0.3351294976533982, + "grad_norm": 1.9840633930320113, + "learning_rate": 0.000197239825134152, + "loss": 0.6776, + "step": 964 + }, + { + "epoch": 0.33582478706761687, + "grad_norm": 1.0091982574836484, + "learning_rate": 0.00019721142971678015, + "loss": 0.6893, + "step": 966 + }, + { + "epoch": 0.3365200764818356, + "grad_norm": 0.9742560258590767, + "learning_rate": 0.00019718289105143753, + "loss": 0.744, + "step": 968 + }, + { + "epoch": 0.3372153658960542, + "grad_norm": 0.6897018399345455, + "learning_rate": 0.00019715420918017793, + "loss": 0.678, + "step": 970 + }, + { + "epoch": 0.3379106553102729, + "grad_norm": 0.29102959771453246, + "learning_rate": 0.00019712538414526606, + "loss": 0.6663, + "step": 972 + }, + { + "epoch": 0.33860594472449157, + "grad_norm": 0.7337107483377766, + "learning_rate": 0.0001970964159891777, + "loss": 0.663, + "step": 974 + }, + { + "epoch": 0.3393012341387102, + "grad_norm": 0.5817704647699353, + "learning_rate": 0.00019706730475459953, + "loss": 0.6398, + "step": 976 + }, + { + "epoch": 0.3399965235529289, + "grad_norm": 0.28703428796704483, + "learning_rate": 0.00019703805048442897, + "loss": 0.5906, + "step": 978 + }, + { + "epoch": 0.34069181296714757, + "grad_norm": 0.41383789019772477, + "learning_rate": 0.0001970086532217743, + "loss": 0.6709, + "step": 980 + }, + { + "epoch": 0.34138710238136627, + "grad_norm": 0.812487649001141, + "learning_rate": 0.00019697911300995443, + "loss": 0.6191, + "step": 982 + }, + { + "epoch": 0.3420823917955849, + "grad_norm": 0.798027200072012, + "learning_rate": 0.00019694942989249907, + "loss": 0.6608, + "step": 984 + }, + { + "epoch": 0.34277768120980356, + "grad_norm": 0.44029385955900757, + "learning_rate": 0.00019691960391314837, + "loss": 0.647, + "step": 986 + }, + { + "epoch": 0.34347297062402227, + "grad_norm": 0.3824484030698272, + "learning_rate": 0.00019688963511585295, + "loss": 0.6378, + "step": 988 + }, + { + "epoch": 0.3441682600382409, + "grad_norm": 0.4121768227084979, + "learning_rate": 0.0001968595235447741, + "loss": 0.5908, + "step": 990 + }, + { + "epoch": 0.34486354945245956, + "grad_norm": 0.5154693781246049, + "learning_rate": 0.0001968292692442833, + "loss": 0.5632, + "step": 992 + }, + { + "epoch": 0.34555883886667826, + "grad_norm": 0.3895510966829308, + "learning_rate": 0.0001967988722589624, + "loss": 0.4674, + "step": 994 + }, + { + "epoch": 0.3462541282808969, + "grad_norm": 0.507531875733667, + "learning_rate": 0.00019676833263360352, + "loss": 0.5581, + "step": 996 + }, + { + "epoch": 0.3469494176951156, + "grad_norm": 0.5476523355263471, + "learning_rate": 0.00019673765041320907, + "loss": 0.7421, + "step": 998 + }, + { + "epoch": 0.34764470710933426, + "grad_norm": 0.8417172933340035, + "learning_rate": 0.00019670682564299136, + "loss": 0.6774, + "step": 1000 + }, + { + "epoch": 0.3483399965235529, + "grad_norm": 0.6717112677412562, + "learning_rate": 0.00019667585836837299, + "loss": 0.6515, + "step": 1002 + }, + { + "epoch": 0.3490352859377716, + "grad_norm": 0.7599904388695796, + "learning_rate": 0.0001966447486349864, + "loss": 0.5679, + "step": 1004 + }, + { + "epoch": 0.34973057535199026, + "grad_norm": 0.44186748583335306, + "learning_rate": 0.000196613496488674, + "loss": 0.6067, + "step": 1006 + }, + { + "epoch": 0.35042586476620896, + "grad_norm": 0.4287165077907837, + "learning_rate": 0.00019658210197548805, + "loss": 0.5706, + "step": 1008 + }, + { + "epoch": 0.3511211541804276, + "grad_norm": 0.6051489125727973, + "learning_rate": 0.0001965505651416906, + "loss": 0.6178, + "step": 1010 + }, + { + "epoch": 0.35181644359464626, + "grad_norm": 0.5003034918118222, + "learning_rate": 0.00019651888603375346, + "loss": 0.6, + "step": 1012 + }, + { + "epoch": 0.35251173300886496, + "grad_norm": 0.6774513066433009, + "learning_rate": 0.00019648706469835804, + "loss": 0.6248, + "step": 1014 + }, + { + "epoch": 0.3532070224230836, + "grad_norm": 0.5666799893616385, + "learning_rate": 0.0001964551011823953, + "loss": 0.6256, + "step": 1016 + }, + { + "epoch": 0.35390231183730225, + "grad_norm": 0.6185519925235329, + "learning_rate": 0.00019642299553296582, + "loss": 0.5836, + "step": 1018 + }, + { + "epoch": 0.35459760125152096, + "grad_norm": 0.5020407783730059, + "learning_rate": 0.0001963907477973795, + "loss": 0.5148, + "step": 1020 + }, + { + "epoch": 0.3552928906657396, + "grad_norm": 0.966855697270511, + "learning_rate": 0.00019635835802315574, + "loss": 0.6335, + "step": 1022 + }, + { + "epoch": 0.3559881800799583, + "grad_norm": 0.8705091175729548, + "learning_rate": 0.00019632582625802317, + "loss": 0.6313, + "step": 1024 + }, + { + "epoch": 0.35668346949417695, + "grad_norm": 0.6028556619755229, + "learning_rate": 0.00019629315254991964, + "loss": 0.6483, + "step": 1026 + }, + { + "epoch": 0.3573787589083956, + "grad_norm": 0.6075038119620636, + "learning_rate": 0.00019626033694699214, + "loss": 0.6271, + "step": 1028 + }, + { + "epoch": 0.3580740483226143, + "grad_norm": 0.7923956541669288, + "learning_rate": 0.00019622737949759694, + "loss": 0.6338, + "step": 1030 + }, + { + "epoch": 0.35876933773683295, + "grad_norm": 1.2067992138100796, + "learning_rate": 0.00019619428025029905, + "loss": 0.6308, + "step": 1032 + }, + { + "epoch": 0.35946462715105165, + "grad_norm": 0.5446351671940789, + "learning_rate": 0.00019616103925387265, + "loss": 0.6475, + "step": 1034 + }, + { + "epoch": 0.3601599165652703, + "grad_norm": 0.8842474031361561, + "learning_rate": 0.0001961276565573007, + "loss": 0.6654, + "step": 1036 + }, + { + "epoch": 0.36085520597948895, + "grad_norm": 1.294693850012853, + "learning_rate": 0.00019609413220977496, + "loss": 0.6929, + "step": 1038 + }, + { + "epoch": 0.36155049539370765, + "grad_norm": 0.7435682846586636, + "learning_rate": 0.00019606046626069595, + "loss": 0.6791, + "step": 1040 + }, + { + "epoch": 0.3622457848079263, + "grad_norm": 0.45762946459115417, + "learning_rate": 0.0001960266587596729, + "loss": 0.5769, + "step": 1042 + }, + { + "epoch": 0.36294107422214494, + "grad_norm": 0.5614638042598611, + "learning_rate": 0.00019599270975652352, + "loss": 0.6047, + "step": 1044 + }, + { + "epoch": 0.36363636363636365, + "grad_norm": 1.6171161059961894, + "learning_rate": 0.0001959586193012741, + "loss": 0.6932, + "step": 1046 + }, + { + "epoch": 0.3643316530505823, + "grad_norm": 1.5847051714441287, + "learning_rate": 0.00019592438744415932, + "loss": 0.5908, + "step": 1048 + }, + { + "epoch": 0.365026942464801, + "grad_norm": 0.4282438415059217, + "learning_rate": 0.00019589001423562233, + "loss": 0.6749, + "step": 1050 + }, + { + "epoch": 0.365026942464801, + "eval_loss": 0.6080955266952515, + "eval_runtime": 710.9824, + "eval_samples_per_second": 6.81, + "eval_steps_per_second": 0.214, + "step": 1050 + }, + { + "epoch": 0.36572223187901964, + "grad_norm": 1.0612232842206784, + "learning_rate": 0.00019585549972631446, + "loss": 0.5669, + "step": 1052 + }, + { + "epoch": 0.3664175212932383, + "grad_norm": 2.6994673924740358, + "learning_rate": 0.0001958208439670953, + "loss": 0.6455, + "step": 1054 + }, + { + "epoch": 0.367112810707457, + "grad_norm": 2.022628249772274, + "learning_rate": 0.0001957860470090326, + "loss": 0.6395, + "step": 1056 + }, + { + "epoch": 0.36780810012167564, + "grad_norm": 0.607126211578616, + "learning_rate": 0.00019575110890340214, + "loss": 0.593, + "step": 1058 + }, + { + "epoch": 0.36850338953589434, + "grad_norm": 1.026539890410463, + "learning_rate": 0.00019571602970168775, + "loss": 0.5939, + "step": 1060 + }, + { + "epoch": 0.369198678950113, + "grad_norm": 0.6663599873173821, + "learning_rate": 0.00019568080945558104, + "loss": 0.6415, + "step": 1062 + }, + { + "epoch": 0.36989396836433164, + "grad_norm": 0.5967439670789174, + "learning_rate": 0.00019564544821698167, + "loss": 0.6348, + "step": 1064 + }, + { + "epoch": 0.37058925777855034, + "grad_norm": 0.6468802992284401, + "learning_rate": 0.00019560994603799682, + "loss": 0.5991, + "step": 1066 + }, + { + "epoch": 0.371284547192769, + "grad_norm": 1.2251498168873143, + "learning_rate": 0.00019557430297094158, + "loss": 0.6001, + "step": 1068 + }, + { + "epoch": 0.37197983660698763, + "grad_norm": 0.4681978143920913, + "learning_rate": 0.00019553851906833853, + "loss": 0.5664, + "step": 1070 + }, + { + "epoch": 0.37267512602120634, + "grad_norm": 0.7538053079694034, + "learning_rate": 0.00019550259438291782, + "loss": 0.5531, + "step": 1072 + }, + { + "epoch": 0.373370415435425, + "grad_norm": 0.4626868039226879, + "learning_rate": 0.00019546652896761696, + "loss": 0.6268, + "step": 1074 + }, + { + "epoch": 0.3740657048496437, + "grad_norm": 0.8012577314135656, + "learning_rate": 0.00019543032287558097, + "loss": 0.7819, + "step": 1076 + }, + { + "epoch": 0.37476099426386233, + "grad_norm": 0.7004564506452116, + "learning_rate": 0.0001953939761601621, + "loss": 0.6505, + "step": 1078 + }, + { + "epoch": 0.375456283678081, + "grad_norm": 1.352602706017517, + "learning_rate": 0.0001953574888749198, + "loss": 0.558, + "step": 1080 + }, + { + "epoch": 0.3761515730922997, + "grad_norm": 0.3012261239096098, + "learning_rate": 0.0001953208610736207, + "loss": 0.5746, + "step": 1082 + }, + { + "epoch": 0.37684686250651833, + "grad_norm": 0.49798092264749827, + "learning_rate": 0.0001952840928102385, + "loss": 0.5845, + "step": 1084 + }, + { + "epoch": 0.377542151920737, + "grad_norm": 0.4457559765569793, + "learning_rate": 0.00019524718413895382, + "loss": 0.5859, + "step": 1086 + }, + { + "epoch": 0.3782374413349557, + "grad_norm": 0.5943406854432696, + "learning_rate": 0.00019521013511415426, + "loss": 0.6581, + "step": 1088 + }, + { + "epoch": 0.37893273074917433, + "grad_norm": 1.8614189583072707, + "learning_rate": 0.00019517294579043414, + "loss": 0.7019, + "step": 1090 + }, + { + "epoch": 0.37962802016339303, + "grad_norm": 0.4212993231373999, + "learning_rate": 0.00019513561622259466, + "loss": 0.6106, + "step": 1092 + }, + { + "epoch": 0.3803233095776117, + "grad_norm": 0.5224177310348964, + "learning_rate": 0.00019509814646564354, + "loss": 0.6012, + "step": 1094 + }, + { + "epoch": 0.3810185989918303, + "grad_norm": 1.3980998842985117, + "learning_rate": 0.0001950605365747951, + "loss": 0.5875, + "step": 1096 + }, + { + "epoch": 0.38171388840604903, + "grad_norm": 0.7255638165052757, + "learning_rate": 0.0001950227866054703, + "loss": 0.6366, + "step": 1098 + }, + { + "epoch": 0.3824091778202677, + "grad_norm": 0.39401204779232035, + "learning_rate": 0.00019498489661329632, + "loss": 0.59, + "step": 1100 + }, + { + "epoch": 0.3831044672344864, + "grad_norm": 0.6249434294547875, + "learning_rate": 0.00019494686665410684, + "loss": 0.5555, + "step": 1102 + }, + { + "epoch": 0.383799756648705, + "grad_norm": 0.4970609140814689, + "learning_rate": 0.00019490869678394165, + "loss": 0.5872, + "step": 1104 + }, + { + "epoch": 0.3844950460629237, + "grad_norm": 0.5522933346523479, + "learning_rate": 0.0001948703870590468, + "loss": 0.6296, + "step": 1106 + }, + { + "epoch": 0.3851903354771424, + "grad_norm": 0.5358444643818808, + "learning_rate": 0.0001948319375358744, + "loss": 0.5677, + "step": 1108 + }, + { + "epoch": 0.385885624891361, + "grad_norm": 0.5839030994818908, + "learning_rate": 0.00019479334827108256, + "loss": 0.5443, + "step": 1110 + }, + { + "epoch": 0.38658091430557967, + "grad_norm": 0.9808370348899028, + "learning_rate": 0.00019475461932153533, + "loss": 0.6703, + "step": 1112 + }, + { + "epoch": 0.3872762037197984, + "grad_norm": 0.5567454433782846, + "learning_rate": 0.00019471575074430256, + "loss": 0.585, + "step": 1114 + }, + { + "epoch": 0.387971493134017, + "grad_norm": 0.8706120804701404, + "learning_rate": 0.00019467674259665985, + "loss": 0.5399, + "step": 1116 + }, + { + "epoch": 0.3886667825482357, + "grad_norm": 0.607175198823171, + "learning_rate": 0.00019463759493608854, + "loss": 0.6016, + "step": 1118 + }, + { + "epoch": 0.38936207196245437, + "grad_norm": 0.848040345554999, + "learning_rate": 0.0001945983078202754, + "loss": 0.5604, + "step": 1120 + }, + { + "epoch": 0.390057361376673, + "grad_norm": 0.39050505941263947, + "learning_rate": 0.00019455888130711296, + "loss": 0.5391, + "step": 1122 + }, + { + "epoch": 0.3907526507908917, + "grad_norm": 0.43688262723639604, + "learning_rate": 0.00019451931545469883, + "loss": 0.5911, + "step": 1124 + }, + { + "epoch": 0.39144794020511037, + "grad_norm": 0.5216486488482895, + "learning_rate": 0.00019447961032133623, + "loss": 0.7729, + "step": 1126 + }, + { + "epoch": 0.39214322961932907, + "grad_norm": 0.5238744592921366, + "learning_rate": 0.0001944397659655334, + "loss": 0.6561, + "step": 1128 + }, + { + "epoch": 0.3928385190335477, + "grad_norm": 0.5356265007770037, + "learning_rate": 0.00019439978244600392, + "loss": 0.6139, + "step": 1130 + }, + { + "epoch": 0.39353380844776636, + "grad_norm": 0.7845961219955971, + "learning_rate": 0.00019435965982166634, + "loss": 0.5682, + "step": 1132 + }, + { + "epoch": 0.39422909786198507, + "grad_norm": 0.5467699155830194, + "learning_rate": 0.0001943193981516442, + "loss": 0.5801, + "step": 1134 + }, + { + "epoch": 0.3949243872762037, + "grad_norm": 0.8265539141839208, + "learning_rate": 0.00019427899749526592, + "loss": 0.6112, + "step": 1136 + }, + { + "epoch": 0.39561967669042236, + "grad_norm": 0.6952363088057728, + "learning_rate": 0.0001942384579120648, + "loss": 0.5585, + "step": 1138 + }, + { + "epoch": 0.39631496610464106, + "grad_norm": 0.5390583855264917, + "learning_rate": 0.00019419777946177872, + "loss": 0.5437, + "step": 1140 + }, + { + "epoch": 0.3970102555188597, + "grad_norm": 0.7703174634754777, + "learning_rate": 0.0001941569622043504, + "loss": 0.6353, + "step": 1142 + }, + { + "epoch": 0.3977055449330784, + "grad_norm": 0.6599770887173079, + "learning_rate": 0.0001941160061999268, + "loss": 0.6984, + "step": 1144 + }, + { + "epoch": 0.39840083434729706, + "grad_norm": 0.6388540477012332, + "learning_rate": 0.0001940749115088597, + "loss": 0.6716, + "step": 1146 + }, + { + "epoch": 0.3990961237615157, + "grad_norm": 0.556740144667956, + "learning_rate": 0.00019403367819170495, + "loss": 0.5403, + "step": 1148 + }, + { + "epoch": 0.3997914131757344, + "grad_norm": 0.5811188003032377, + "learning_rate": 0.00019399230630922281, + "loss": 0.6038, + "step": 1150 + }, + { + "epoch": 0.40048670258995306, + "grad_norm": 0.5247246331826143, + "learning_rate": 0.00019395079592237767, + "loss": 0.5802, + "step": 1152 + }, + { + "epoch": 0.40118199200417176, + "grad_norm": 0.6218229787877086, + "learning_rate": 0.00019390914709233812, + "loss": 0.613, + "step": 1154 + }, + { + "epoch": 0.4018772814183904, + "grad_norm": 0.3768886648264559, + "learning_rate": 0.00019386735988047657, + "loss": 0.546, + "step": 1156 + }, + { + "epoch": 0.40257257083260906, + "grad_norm": 0.7192604288297088, + "learning_rate": 0.00019382543434836956, + "loss": 0.6414, + "step": 1158 + }, + { + "epoch": 0.40326786024682776, + "grad_norm": 0.6502767283266627, + "learning_rate": 0.00019378337055779725, + "loss": 0.6913, + "step": 1160 + }, + { + "epoch": 0.4039631496610464, + "grad_norm": 0.5821846511835889, + "learning_rate": 0.00019374116857074372, + "loss": 0.6135, + "step": 1162 + }, + { + "epoch": 0.40465843907526505, + "grad_norm": 0.4214614762979627, + "learning_rate": 0.00019369882844939656, + "loss": 0.5844, + "step": 1164 + }, + { + "epoch": 0.40535372848948376, + "grad_norm": 0.3995087581540831, + "learning_rate": 0.00019365635025614698, + "loss": 0.597, + "step": 1166 + }, + { + "epoch": 0.4060490179037024, + "grad_norm": 0.6448855951735888, + "learning_rate": 0.0001936137340535896, + "loss": 0.5964, + "step": 1168 + }, + { + "epoch": 0.4067443073179211, + "grad_norm": 0.4901354392109259, + "learning_rate": 0.00019357097990452244, + "loss": 0.6544, + "step": 1170 + } + ], + "logging_steps": 2, + "max_steps": 5752, + "num_input_tokens_seen": 0, + "num_train_epochs": 2, + "save_steps": 90, + "stateful_callbacks": { + "TrainerControl": { + "args": { + "should_epoch_stop": false, + "should_evaluate": false, + "should_log": false, + "should_save": true, + "should_training_stop": false + }, + "attributes": {} + } + }, + "total_flos": 4661946054868992.0, + "train_batch_size": 4, + "trial_name": null, + "trial_params": null +} diff --git a/checkpoint-1170/training_args.bin b/checkpoint-1170/training_args.bin new file mode 100644 index 0000000000000000000000000000000000000000..fba3b63792fed5a70be0307e26ba27ef584b1528 --- /dev/null +++ b/checkpoint-1170/training_args.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b72add547acd6c009f3a3770072d0cdf7de7e797c7597084319db874a556e470 +size 6904 diff --git a/checkpoint-1170/zero_to_fp32.py b/checkpoint-1170/zero_to_fp32.py new file mode 100644 index 0000000000000000000000000000000000000000..0e759146cadd92ddfefab3680146c2bd6a2b5c04 --- /dev/null +++ b/checkpoint-1170/zero_to_fp32.py @@ -0,0 +1,760 @@ +#!/usr/bin/env python + +# Copyright (c) Microsoft Corporation. +# SPDX-License-Identifier: Apache-2.0 + +# DeepSpeed Team + +# This script extracts fp32 consolidated weights from a zero 1, 2 and 3 DeepSpeed checkpoints. It gets +# copied into the top level checkpoint dir, so the user can easily do the conversion at any point in +# the future. Once extracted, the weights don't require DeepSpeed and can be used in any +# application. +# +# example: +# python zero_to_fp32.py . output_dir/ +# or +# python zero_to_fp32.py . output_dir/ --safe_serialization + +import argparse +import torch +import glob +import math +import os +import re +import gc +import json +import numpy as np +from tqdm import tqdm +from collections import OrderedDict +from dataclasses import dataclass + +# while this script doesn't use deepspeed to recover data, since the checkpoints are pickled with +# DeepSpeed data structures it has to be available in the current python environment. +from deepspeed.utils import logger +from deepspeed.checkpoint.constants import (DS_VERSION, OPTIMIZER_STATE_DICT, SINGLE_PARTITION_OF_FP32_GROUPS, + FP32_FLAT_GROUPS, ZERO_STAGE, PARTITION_COUNT, PARAM_SHAPES, BUFFER_NAMES, + FROZEN_PARAM_SHAPES, FROZEN_PARAM_FRAGMENTS) + + +@dataclass +class zero_model_state: + buffers: dict() + param_shapes: dict() + shared_params: list + ds_version: int + frozen_param_shapes: dict() + frozen_param_fragments: dict() + + +debug = 0 + +# load to cpu +device = torch.device('cpu') + + +def atoi(text): + return int(text) if text.isdigit() else text + + +def natural_keys(text): + ''' + alist.sort(key=natural_keys) sorts in human order + http://nedbatchelder.com/blog/200712/human_sorting.html + (See Toothy's implementation in the comments) + ''' + return [atoi(c) for c in re.split(r'(\d+)', text)] + + +def get_model_state_file(checkpoint_dir, zero_stage): + if not os.path.isdir(checkpoint_dir): + raise FileNotFoundError(f"Directory '{checkpoint_dir}' doesn't exist") + + # there should be only one file + if zero_stage <= 2: + file = os.path.join(checkpoint_dir, "mp_rank_00_model_states.pt") + elif zero_stage == 3: + file = os.path.join(checkpoint_dir, "zero_pp_rank_0_mp_rank_00_model_states.pt") + + if not os.path.exists(file): + raise FileNotFoundError(f"can't find model states file at '{file}'") + + return file + + +def get_checkpoint_files(checkpoint_dir, glob_pattern): + # XXX: need to test that this simple glob rule works for multi-node setup too + ckpt_files = sorted(glob.glob(os.path.join(checkpoint_dir, glob_pattern)), key=natural_keys) + + if len(ckpt_files) == 0: + raise FileNotFoundError(f"can't find {glob_pattern} files in directory '{checkpoint_dir}'") + + return ckpt_files + + +def get_optim_files(checkpoint_dir): + return get_checkpoint_files(checkpoint_dir, "*_optim_states.pt") + + +def get_model_state_files(checkpoint_dir): + return get_checkpoint_files(checkpoint_dir, "*_model_states.pt") + + +def parse_model_states(files): + zero_model_states = [] + for file in files: + state_dict = torch.load(file, map_location=device, weights_only=False) + + if BUFFER_NAMES not in state_dict: + raise ValueError(f"{file} is not a model state checkpoint") + buffer_names = state_dict[BUFFER_NAMES] + if debug: + print("Found buffers:", buffer_names) + + # recover just the buffers while restoring them to fp32 if they were saved in fp16 + buffers = {k: v.float() for k, v in state_dict["module"].items() if k in buffer_names} + param_shapes = state_dict[PARAM_SHAPES] + + # collect parameters that are included in param_shapes + param_names = [] + for s in param_shapes: + for name in s.keys(): + param_names.append(name) + + # update with frozen parameters + frozen_param_shapes = state_dict.get(FROZEN_PARAM_SHAPES, None) + if frozen_param_shapes is not None: + if debug: + print(f"Found frozen_param_shapes: {frozen_param_shapes}") + param_names += list(frozen_param_shapes.keys()) + + # handle shared params + shared_params = [[k, v] for k, v in state_dict["shared_params"].items()] + + ds_version = state_dict.get(DS_VERSION, None) + + frozen_param_fragments = state_dict.get(FROZEN_PARAM_FRAGMENTS, None) + + z_model_state = zero_model_state(buffers=buffers, + param_shapes=param_shapes, + shared_params=shared_params, + ds_version=ds_version, + frozen_param_shapes=frozen_param_shapes, + frozen_param_fragments=frozen_param_fragments) + zero_model_states.append(z_model_state) + + return zero_model_states + + +def parse_optim_states(files, ds_checkpoint_dir): + total_files = len(files) + state_dicts = [] + for f in tqdm(files, desc='Loading checkpoint shards'): + state_dict = torch.load(f, map_location=device, mmap=True, weights_only=False) + # immediately discard the potentially huge 2 optimizer states as we only care for fp32 master weights + # and also handle the case where it was already removed by another helper script + state_dict["optimizer_state_dict"].pop("optimizer_state_dict", None) + state_dicts.append(state_dict) + + if not ZERO_STAGE in state_dicts[0][OPTIMIZER_STATE_DICT]: + raise ValueError(f"{files[0]} is not a zero checkpoint") + zero_stage = state_dicts[0][OPTIMIZER_STATE_DICT][ZERO_STAGE] + world_size = state_dicts[0][OPTIMIZER_STATE_DICT][PARTITION_COUNT] + + # For ZeRO-2 each param group can have different partition_count as data parallelism for expert + # parameters can be different from data parallelism for non-expert parameters. So we can just + # use the max of the partition_count to get the dp world_size. + + if type(world_size) is list: + world_size = max(world_size) + + if world_size != total_files: + raise ValueError( + f"Expected {world_size} of '*_optim_states.pt' under '{ds_checkpoint_dir}' but found {total_files} files. " + "Possibly due to an overwrite of an old checkpoint, or a checkpoint didn't get saved by one or more processes." + ) + + # the groups are named differently in each stage + if zero_stage <= 2: + fp32_groups_key = SINGLE_PARTITION_OF_FP32_GROUPS + elif zero_stage == 3: + fp32_groups_key = FP32_FLAT_GROUPS + else: + raise ValueError(f"unknown zero stage {zero_stage}") + + fp32_flat_groups = [state_dicts[i][OPTIMIZER_STATE_DICT][fp32_groups_key] for i in range(len(state_dicts))] + return zero_stage, world_size, fp32_flat_groups + + +def _get_fp32_state_dict_from_zero_checkpoint(ds_checkpoint_dir, exclude_frozen_parameters): + """ + Returns fp32 state_dict reconstructed from ds checkpoint + + Args: + - ``ds_checkpoint_dir``: path to the deepspeed checkpoint folder (where the optimizer files are) + + """ + print(f"Processing zero checkpoint '{ds_checkpoint_dir}'") + + optim_files = get_optim_files(ds_checkpoint_dir) + zero_stage, world_size, fp32_flat_groups = parse_optim_states(optim_files, ds_checkpoint_dir) + print(f"Detected checkpoint of type zero stage {zero_stage}, world_size: {world_size}") + + model_files = get_model_state_files(ds_checkpoint_dir) + + zero_model_states = parse_model_states(model_files) + print(f'Parsing checkpoint created by deepspeed=={zero_model_states[0].ds_version}') + + if zero_stage <= 2: + return _get_fp32_state_dict_from_zero2_checkpoint(world_size, fp32_flat_groups, zero_model_states, + exclude_frozen_parameters) + elif zero_stage == 3: + return _get_fp32_state_dict_from_zero3_checkpoint(world_size, fp32_flat_groups, zero_model_states, + exclude_frozen_parameters) + + +def _zero2_merge_frozen_params(state_dict, zero_model_states): + if zero_model_states[0].frozen_param_shapes is None or len(zero_model_states[0].frozen_param_shapes) == 0: + return + + frozen_param_shapes = zero_model_states[0].frozen_param_shapes + frozen_param_fragments = zero_model_states[0].frozen_param_fragments + + if debug: + num_elem = sum(s.numel() for s in frozen_param_shapes.values()) + print(f'rank 0: {FROZEN_PARAM_SHAPES}.numel = {num_elem}') + + wanted_params = len(frozen_param_shapes) + wanted_numel = sum(s.numel() for s in frozen_param_shapes.values()) + avail_numel = sum([p.numel() for p in frozen_param_fragments.values()]) + print(f'Frozen params: Have {avail_numel} numels to process.') + print(f'Frozen params: Need {wanted_numel} numels in {wanted_params} params') + + total_params = 0 + total_numel = 0 + for name, shape in frozen_param_shapes.items(): + total_params += 1 + unpartitioned_numel = shape.numel() + total_numel += unpartitioned_numel + + state_dict[name] = frozen_param_fragments[name] + + if debug: + print(f"{name} full shape: {shape} unpartitioned numel {unpartitioned_numel} ") + + print(f"Reconstructed Frozen fp32 state dict with {total_params} params {total_numel} elements") + + +def _has_callable(obj, fn): + attr = getattr(obj, fn, None) + return callable(attr) + + +def _zero2_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states): + param_shapes = zero_model_states[0].param_shapes + + # Reconstruction protocol: + # + # XXX: document this + + if debug: + for i in range(world_size): + for j in range(len(fp32_flat_groups[0])): + print(f"{FP32_FLAT_GROUPS}[{i}][{j}].shape={fp32_flat_groups[i][j].shape}") + + # XXX: memory usage doubles here (zero2) + num_param_groups = len(fp32_flat_groups[0]) + merged_single_partition_of_fp32_groups = [] + for i in range(num_param_groups): + merged_partitions = [sd[i] for sd in fp32_flat_groups] + full_single_fp32_vector = torch.cat(merged_partitions, 0) + merged_single_partition_of_fp32_groups.append(full_single_fp32_vector) + avail_numel = sum( + [full_single_fp32_vector.numel() for full_single_fp32_vector in merged_single_partition_of_fp32_groups]) + + if debug: + wanted_params = sum([len(shapes) for shapes in param_shapes]) + wanted_numel = sum([sum(shape.numel() for shape in shapes.values()) for shapes in param_shapes]) + # not asserting if there is a mismatch due to possible padding + print(f"Have {avail_numel} numels to process.") + print(f"Need {wanted_numel} numels in {wanted_params} params.") + + # params + # XXX: for huge models that can't fit into the host's RAM we will have to recode this to support + # out-of-core computing solution + total_numel = 0 + total_params = 0 + for shapes, full_single_fp32_vector in zip(param_shapes, merged_single_partition_of_fp32_groups): + offset = 0 + avail_numel = full_single_fp32_vector.numel() + for name, shape in shapes.items(): + + unpartitioned_numel = shape.numel() if _has_callable(shape, 'numel') else math.prod(shape) + total_numel += unpartitioned_numel + total_params += 1 + + if debug: + print(f"{name} full shape: {shape} unpartitioned numel {unpartitioned_numel} ") + state_dict[name] = full_single_fp32_vector.narrow(0, offset, unpartitioned_numel).view(shape) + offset += unpartitioned_numel + + # Z2 started to align to 2*world_size to improve nccl performance. Therefore both offset and + # avail_numel can differ by anywhere between 0..2*world_size. Due to two unrelated complex + # paddings performed in the code it's almost impossible to predict the exact numbers w/o the + # live optimizer object, so we are checking that the numbers are within the right range + align_to = 2 * world_size + + def zero2_align(x): + return align_to * math.ceil(x / align_to) + + if debug: + print(f"original offset={offset}, avail_numel={avail_numel}") + + offset = zero2_align(offset) + avail_numel = zero2_align(avail_numel) + + if debug: + print(f"aligned offset={offset}, avail_numel={avail_numel}") + + # Sanity check + if offset != avail_numel: + raise ValueError(f"consumed {offset} numels out of {avail_numel} - something is wrong") + + print(f"Reconstructed fp32 state dict with {total_params} params {total_numel} elements") + + +def _get_fp32_state_dict_from_zero2_checkpoint(world_size, fp32_flat_groups, zero_model_states, + exclude_frozen_parameters): + state_dict = OrderedDict() + + # buffers + buffers = zero_model_states[0].buffers + state_dict.update(buffers) + if debug: + print(f"added {len(buffers)} buffers") + + if not exclude_frozen_parameters: + _zero2_merge_frozen_params(state_dict, zero_model_states) + + _zero2_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states) + + # recover shared parameters + for pair in zero_model_states[0].shared_params: + if pair[1] in state_dict: + state_dict[pair[0]] = state_dict[pair[1]] + + return state_dict + + +def zero3_partitioned_param_info(unpartitioned_numel, world_size): + remainder = unpartitioned_numel % world_size + padding_numel = (world_size - remainder) if remainder else 0 + partitioned_numel = math.ceil(unpartitioned_numel / world_size) + return partitioned_numel, padding_numel + + +def _zero3_merge_frozen_params(state_dict, world_size, zero_model_states): + if zero_model_states[0].frozen_param_shapes is None or len(zero_model_states[0].frozen_param_shapes) == 0: + return + + if debug: + for i in range(world_size): + num_elem = sum(s.numel() for s in zero_model_states[i].frozen_param_fragments.values()) + print(f'rank {i}: {FROZEN_PARAM_SHAPES}.numel = {num_elem}') + + frozen_param_shapes = zero_model_states[0].frozen_param_shapes + wanted_params = len(frozen_param_shapes) + wanted_numel = sum(s.numel() for s in frozen_param_shapes.values()) + avail_numel = sum([p.numel() for p in zero_model_states[0].frozen_param_fragments.values()]) * world_size + print(f'Frozen params: Have {avail_numel} numels to process.') + print(f'Frozen params: Need {wanted_numel} numels in {wanted_params} params') + + total_params = 0 + total_numel = 0 + for name, shape in zero_model_states[0].frozen_param_shapes.items(): + total_params += 1 + unpartitioned_numel = shape.numel() + total_numel += unpartitioned_numel + + param_frags = tuple(model_state.frozen_param_fragments[name] for model_state in zero_model_states) + state_dict[name] = torch.cat(param_frags, 0).narrow(0, 0, unpartitioned_numel).view(shape) + + partitioned_numel, partitioned_padding_numel = zero3_partitioned_param_info(unpartitioned_numel, world_size) + + if debug: + print( + f"Frozen params: {total_params} {name} full shape: {shape} partition0 numel={partitioned_numel} partitioned_padding_numel={partitioned_padding_numel}" + ) + + print(f"Reconstructed Frozen fp32 state dict with {total_params} params {total_numel} elements") + + +class GatheredTensor: + """ + A pseudo tensor that collects partitioned weights. + It is more memory efficient when there are multiple groups. + """ + + def __init__(self, flat_groups, flat_groups_offset, offset, partitioned_numel, shape): + self.flat_groups = flat_groups + self.flat_groups_offset = flat_groups_offset + self.offset = offset + self.partitioned_numel = partitioned_numel + self.shape = shape + self.dtype = self.flat_groups[0][0].dtype + + def contiguous(self): + """ + Merge partitioned weights from flat_groups into a single tensor. + """ + end_idx = self.offset + self.partitioned_numel + world_size = len(self.flat_groups) + pad_flat_param_chunks = [] + + for rank_i in range(world_size): + # for each rank, we need to collect weights from related group/groups + flat_groups_at_rank_i = self.flat_groups[rank_i] + start_group_id = None + end_group_id = None + for group_id in range(len(self.flat_groups_offset)): + if self.flat_groups_offset[group_id] <= self.offset < self.flat_groups_offset[group_id + 1]: + start_group_id = group_id + if self.flat_groups_offset[group_id] < end_idx <= self.flat_groups_offset[group_id + 1]: + end_group_id = group_id + break + # collect weights from related group/groups + for group_id in range(start_group_id, end_group_id + 1): + flat_tensor = flat_groups_at_rank_i[group_id] + start_offset = self.offset - self.flat_groups_offset[group_id] + end_offset = min(end_idx, self.flat_groups_offset[group_id + 1]) - self.flat_groups_offset[group_id] + pad_flat_param_chunks.append(flat_tensor[start_offset:end_offset]) + + # collect weights from all ranks + pad_flat_param = torch.cat(pad_flat_param_chunks, dim=0) + param = pad_flat_param[:self.shape.numel()].view(self.shape).contiguous() + return param + + +def _zero3_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states): + param_shapes = zero_model_states[0].param_shapes + avail_numel = sum([flat_group.numel() for flat_group in fp32_flat_groups[0]]) * world_size + + # Reconstruction protocol: For zero3 we need to zip the partitions together at boundary of each + # param, re-consolidating each param, while dealing with padding if any + + # merge list of dicts, preserving order + param_shapes = {k: v for d in param_shapes for k, v in d.items()} + + if debug: + for i in range(world_size): + print(f"{FP32_FLAT_GROUPS}[{i}].shape={fp32_flat_groups[i].shape}") + + wanted_params = len(param_shapes) + wanted_numel = sum(shape.numel() for shape in param_shapes.values()) + # not asserting if there is a mismatch due to possible padding + avail_numel = fp32_flat_groups[0].numel() * world_size + print(f"Trainable params: Have {avail_numel} numels to process.") + print(f"Trainable params: Need {wanted_numel} numels in {wanted_params} params.") + + # params + # XXX: for huge models that can't fit into the host's RAM we will have to recode this to support + # out-of-core computing solution + offset = 0 + total_numel = 0 + total_params = 0 + flat_groups_offset = [0] + list(np.cumsum([flat_tensor.numel() for flat_tensor in fp32_flat_groups[0]])) + for name, shape in tqdm(param_shapes.items(), desc='Gathering sharded weights'): + unpartitioned_numel = shape.numel() + total_numel += unpartitioned_numel + total_params += 1 + partitioned_numel, partitioned_padding_numel = zero3_partitioned_param_info(unpartitioned_numel, world_size) + + if debug: + print( + f"Trainable params: {total_params} {name} full shape: {shape} partition0 numel={partitioned_numel} partitioned_padding_numel={partitioned_padding_numel}" + ) + + # memory efficient tensor + tensor = GatheredTensor(fp32_flat_groups, flat_groups_offset, offset, partitioned_numel, shape) + state_dict[name] = tensor + offset += partitioned_numel + + offset *= world_size + + # Sanity check + if offset != avail_numel: + raise ValueError(f"consumed {offset} numels out of {avail_numel} - something is wrong") + + print(f"Reconstructed Trainable fp32 state dict with {total_params} params {total_numel} elements") + + +def _get_fp32_state_dict_from_zero3_checkpoint(world_size, fp32_flat_groups, zero_model_states, + exclude_frozen_parameters): + state_dict = OrderedDict() + + # buffers + buffers = zero_model_states[0].buffers + state_dict.update(buffers) + if debug: + print(f"added {len(buffers)} buffers") + + if not exclude_frozen_parameters: + _zero3_merge_frozen_params(state_dict, world_size, zero_model_states) + + _zero3_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states) + + # recover shared parameters + for pair in zero_model_states[0].shared_params: + if pair[1] in state_dict: + state_dict[pair[0]] = state_dict[pair[1]] + + return state_dict + + +def to_torch_tensor(state_dict, return_empty_tensor=False): + """ + Convert state_dict of GatheredTensor to torch tensor + """ + torch_state_dict = {} + converted_tensors = {} + for name, tensor in state_dict.items(): + tensor_id = id(tensor) + if tensor_id in converted_tensors: # shared tensors + shared_tensor = torch_state_dict[converted_tensors[tensor_id]] + torch_state_dict[name] = shared_tensor + else: + converted_tensors[tensor_id] = name + if return_empty_tensor: + torch_state_dict[name] = torch.empty(tensor.shape, dtype=tensor.dtype) + else: + torch_state_dict[name] = tensor.contiguous() + return torch_state_dict + + +def get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir, + tag=None, + exclude_frozen_parameters=False, + lazy_mode=False): + """ + Convert ZeRO 2 or 3 checkpoint into a single fp32 consolidated state_dict that can be loaded with + ``load_state_dict()`` and used for training without DeepSpeed or shared with others, for example + via a model hub. + + Args: + - ``checkpoint_dir``: path to the desired checkpoint folder + - ``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`` + - ``exclude_frozen_parameters``: exclude frozen parameters + - ``lazy_mode``: get state_dict in lazy mode. It returns a dict of pesduo tensor instead of torch tensor, which is more memory efficient. + Convert the pesduo tensor to torch tensor by ``.contiguous()`` + + Returns: + - pytorch ``state_dict`` + + A typical usage might be :: + + from deepspeed.utils.zero_to_fp32 import get_fp32_state_dict_from_zero_checkpoint + # do the training and checkpoint saving + state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir) # already on cpu + model = model.cpu() # move to cpu + model.load_state_dict(state_dict) + # submit to model hub or save the model to share with others + + In this example the ``model`` will no longer be usable in the deepspeed context of the same + application. i.e. you will need to re-initialize the deepspeed engine, since + ``model.load_state_dict(state_dict)`` will remove all the deepspeed magic from it. + + If you want it all done for you, use ``load_state_dict_from_zero_checkpoint`` instead. + + Note: the above usage may not work if your application doesn't have sufficient free CPU memory. + You may need to use the offline approach using the ``zero_to_fp32.py`` script that is saved with + the checkpoint. Or you can load state_dict in lazy mode :: + + from deepspeed.utils.zero_to_fp32 import get_fp32_state_dict_from_zero_checkpoint + state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir, lazy_mode=True) # not on cpu + for name, lazy_tensor in state_dict.item(): + tensor = lazy_tensor.contiguous() # to cpu + print(name, tensor) + # del tensor to release memory if it no longer in use + """ + if tag is None: + latest_path = os.path.join(checkpoint_dir, 'latest') + if os.path.isfile(latest_path): + with open(latest_path, 'r') as fd: + tag = fd.read().strip() + else: + raise ValueError(f"Unable to find 'latest' file at {latest_path}") + + ds_checkpoint_dir = os.path.join(checkpoint_dir, tag) + + if not os.path.isdir(ds_checkpoint_dir): + raise FileNotFoundError(f"Directory '{ds_checkpoint_dir}' doesn't exist") + + state_dict = _get_fp32_state_dict_from_zero_checkpoint(ds_checkpoint_dir, exclude_frozen_parameters) + if lazy_mode: + return state_dict + else: + return to_torch_tensor(state_dict) + + +def convert_zero_checkpoint_to_fp32_state_dict(checkpoint_dir, + output_dir, + max_shard_size="5GB", + safe_serialization=False, + tag=None, + exclude_frozen_parameters=False): + """ + Convert ZeRO 2 or 3 checkpoint into a single fp32 consolidated ``state_dict`` file that can be + loaded with ``torch.load(file)`` + ``load_state_dict()`` and used for training without DeepSpeed. + + Args: + - ``checkpoint_dir``: path to the desired checkpoint folder. (one that contains the tag-folder, like ``global_step14``) + - ``output_dir``: directory to the pytorch fp32 state_dict output files + - ``max_shard_size``: the maximum size for a checkpoint before being sharded, default value is 5GB + - ``safe_serialization``: whether to save the model using `safetensors` or the traditional PyTorch way (that uses `pickle`). + - ``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`` + - ``exclude_frozen_parameters``: exclude frozen parameters + """ + + # Dependency pre-check + if safe_serialization: + try: + from safetensors.torch import save_file + except ImportError: + print('If you want to use `safe_serialization`, please `pip install safetensors`') + raise + if max_shard_size is not None: + try: + from huggingface_hub import split_torch_state_dict_into_shards + except ImportError: + print('If you want to use `max_shard_size`, please `pip install huggingface_hub`') + raise + + # Convert zero checkpoint to state_dict + state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir, + tag, + exclude_frozen_parameters, + lazy_mode=True) + + # Shard the model if it is too big. + weights_name = "model.safetensors" if safe_serialization else "pytorch_model.bin" + if max_shard_size is not None: + filename_pattern = weights_name.replace(".bin", "{suffix}.bin").replace(".safetensors", "{suffix}.safetensors") + # an memory-efficient approach for sharding + empty_state_dict = to_torch_tensor(state_dict, return_empty_tensor=True) + state_dict_split = split_torch_state_dict_into_shards(empty_state_dict, + filename_pattern=filename_pattern, + max_shard_size=max_shard_size) + else: + from collections import namedtuple + StateDictSplit = namedtuple("StateDictSplit", ["is_sharded", "filename_to_tensors"]) + state_dict_split = StateDictSplit(is_sharded=False, + filename_to_tensors={weights_name: list(state_dict.keys())}) + + # Save the model by shard + os.makedirs(output_dir, exist_ok=True) + filename_to_tensors = state_dict_split.filename_to_tensors.items() + for shard_file, tensors in tqdm(filename_to_tensors, desc="Saving checkpoint shards"): + shard_state_dict = {tensor_name: state_dict[tensor_name] for tensor_name in tensors} + shard_state_dict = to_torch_tensor(shard_state_dict) + output_path = os.path.join(output_dir, shard_file) + if safe_serialization: + save_file(shard_state_dict, output_path, metadata={"format": "pt"}) + else: + torch.save(shard_state_dict, output_path) + # release the memory of current shard + for tensor_name in list(shard_state_dict.keys()): + del state_dict[tensor_name] + del shard_state_dict[tensor_name] + del shard_state_dict + gc.collect() + + # Save index if sharded + if state_dict_split.is_sharded: + index = { + "metadata": state_dict_split.metadata, + "weight_map": state_dict_split.tensor_to_filename, + } + save_index_file = "model.safetensors.index.json" if safe_serialization else "pytorch_model.bin.index.json" + save_index_file = os.path.join(output_dir, save_index_file) + with open(save_index_file, "w", encoding="utf-8") as f: + content = json.dumps(index, indent=2, sort_keys=True) + "\n" + f.write(content) + + +def load_state_dict_from_zero_checkpoint(model, checkpoint_dir, tag=None): + """ + 1. Put the provided model to cpu + 2. Convert ZeRO 2 or 3 checkpoint into a single fp32 consolidated ``state_dict`` + 3. Load it into the provided model + + Args: + - ``model``: the model object to update + - ``checkpoint_dir``: path to the desired checkpoint folder. (one that contains the tag-folder, like ``global_step14``) + - ``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`` + + Returns: + - ``model`: modified model + + Make sure you have plenty of CPU memory available before you call this function. If you don't + have enough use the ``zero_to_fp32.py`` utility to do the conversion. You will find it + conveniently placed for you in the checkpoint folder. + + A typical usage might be :: + + from deepspeed.utils.zero_to_fp32 import load_state_dict_from_zero_checkpoint + model = load_state_dict_from_zero_checkpoint(trainer.model, checkpoint_dir) + # submit to model hub or save the model to share with others + + Note, that once this was run, the ``model`` will no longer be usable in the deepspeed context + of the same application. i.e. you will need to re-initialize the deepspeed engine, since + ``model.load_state_dict(state_dict)`` will remove all the deepspeed magic from it. + + """ + logger.info(f"Extracting fp32 weights") + state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir, tag) + + logger.info(f"Overwriting model with fp32 weights") + model = model.cpu() + model.load_state_dict(state_dict, strict=False) + + return model + + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + parser.add_argument("checkpoint_dir", + type=str, + help="path to the desired checkpoint folder, e.g., path/checkpoint-12") + parser.add_argument("output_dir", + type=str, + help="directory to the pytorch fp32 state_dict output files" + "(e.g. path/checkpoint-12-output/)") + parser.add_argument( + "--max_shard_size", + type=str, + default="5GB", + help="The maximum size for a checkpoint before being sharded. Checkpoints shard will then be each of size" + "lower than this size. If expressed as a string, needs to be digits followed by a unit (like `5MB`" + "We default it to 5GB in order for models to be able to run easily on free-tier google colab instances" + "without CPU OOM issues.") + parser.add_argument( + "--safe_serialization", + default=False, + action='store_true', + help="Whether to save the model using `safetensors` or the traditional PyTorch way (that uses `pickle`).") + parser.add_argument("-t", + "--tag", + type=str, + default=None, + help="checkpoint tag used as a unique identifier for checkpoint. e.g., global_step1") + parser.add_argument("--exclude_frozen_parameters", action='store_true', help="exclude frozen parameters") + parser.add_argument("-d", "--debug", action='store_true', help="enable debug") + args = parser.parse_args() + + debug = args.debug + + convert_zero_checkpoint_to_fp32_state_dict(args.checkpoint_dir, + args.output_dir, + max_shard_size=args.max_shard_size, + safe_serialization=args.safe_serialization, + tag=args.tag, + exclude_frozen_parameters=args.exclude_frozen_parameters) diff --git a/checkpoint-1260/README.md b/checkpoint-1260/README.md new file mode 100644 index 0000000000000000000000000000000000000000..4eae946233309baf42f5bad9740186144a4f3b33 --- /dev/null +++ b/checkpoint-1260/README.md @@ -0,0 +1,202 @@ +--- +base_model: ../../initial_seq_model +library_name: peft +--- + +# Model Card for Model ID + + + + + +## Model Details + +### Model Description + + + + + +- **Developed by:** [More Information Needed] +- **Funded by [optional]:** [More Information Needed] +- **Shared by [optional]:** [More Information Needed] +- **Model type:** [More Information Needed] +- **Language(s) (NLP):** [More Information Needed] +- **License:** [More Information Needed] +- **Finetuned from model [optional]:** [More Information Needed] + +### Model Sources [optional] + + + +- **Repository:** [More Information Needed] +- **Paper [optional]:** [More Information Needed] +- **Demo [optional]:** [More Information Needed] + +## Uses + + + +### Direct Use + + + +[More Information Needed] + +### Downstream Use [optional] + + + +[More Information Needed] + +### Out-of-Scope Use + + + +[More Information Needed] + +## Bias, Risks, and Limitations + + + +[More Information Needed] + +### Recommendations + + + +Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations. + +## How to Get Started with the Model + +Use the code below to get started with the model. + +[More Information Needed] + +## Training Details + +### Training Data + + + +[More Information Needed] + +### Training Procedure + + + +#### Preprocessing [optional] + +[More Information Needed] + + +#### Training Hyperparameters + +- **Training regime:** [More Information Needed] + +#### Speeds, Sizes, Times [optional] + + + +[More Information Needed] + +## Evaluation + + + +### Testing Data, Factors & Metrics + +#### Testing Data + + + +[More Information Needed] + +#### Factors + + + +[More Information Needed] + +#### Metrics + + + +[More Information Needed] + +### Results + +[More Information Needed] + +#### Summary + + + +## Model Examination [optional] + + + +[More Information Needed] + +## Environmental Impact + + + +Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700). + +- **Hardware Type:** [More Information Needed] +- **Hours used:** [More Information Needed] +- **Cloud Provider:** [More Information Needed] +- **Compute Region:** [More Information Needed] +- **Carbon Emitted:** [More Information Needed] + +## Technical Specifications [optional] + +### Model Architecture and Objective + +[More Information Needed] + +### Compute Infrastructure + +[More Information Needed] + +#### Hardware + +[More Information Needed] + +#### Software + +[More Information Needed] + +## Citation [optional] + + + +**BibTeX:** + +[More Information Needed] + +**APA:** + +[More Information Needed] + +## Glossary [optional] + + + +[More Information Needed] + +## More Information [optional] + +[More Information Needed] + +## Model Card Authors [optional] + +[More Information Needed] + +## Model Card Contact + +[More Information Needed] +### Framework versions + +- PEFT 0.14.0 \ No newline at end of file diff --git a/checkpoint-1260/adapter_config.json b/checkpoint-1260/adapter_config.json new file mode 100644 index 0000000000000000000000000000000000000000..e1a650486f9ba9bab8c8dbb7d564bdc4ec121cf7 --- /dev/null +++ b/checkpoint-1260/adapter_config.json @@ -0,0 +1,38 @@ +{ + "alpha_pattern": {}, + "auto_mapping": null, + "base_model_name_or_path": "../../initial_seq_model", + "bias": "none", + "eva_config": null, + "exclude_modules": null, + "fan_in_fan_out": false, + "inference_mode": true, + "init_lora_weights": true, + "layer_replication": null, + "layers_pattern": null, + "layers_to_transform": null, + "loftq_config": {}, + "lora_alpha": 16, + "lora_bias": false, + "lora_dropout": 0.1, + "megatron_config": null, + "megatron_core": "megatron.core", + "modules_to_save": null, + "peft_type": "LORA", + "r": 8, + "rank_pattern": {}, + "revision": null, + "target_modules": [ + "k_proj", + "o_proj", + "gate_proj", + "down_proj", + "score", + "v_proj", + "up_proj", + "q_proj" + ], + "task_type": "CAUSAL_LM", + "use_dora": false, + "use_rslora": false +} \ No newline at end of file diff --git a/checkpoint-1260/adapter_model.safetensors b/checkpoint-1260/adapter_model.safetensors new file mode 100644 index 0000000000000000000000000000000000000000..7204327cbcf5a87d0e12d45b7c85c1b43ba15159 --- /dev/null +++ b/checkpoint-1260/adapter_model.safetensors @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5f1bb0249a8f70de7f668f84c0c0df99d3736370e66d3aeb15e41345e964bee9 +size 42068368 diff --git a/checkpoint-1260/global_step1260/bf16_zero_pp_rank_0_mp_rank_00_optim_states.pt b/checkpoint-1260/global_step1260/bf16_zero_pp_rank_0_mp_rank_00_optim_states.pt new file mode 100644 index 0000000000000000000000000000000000000000..91a6c54c4fa1f6270ba449e6c97807d479535a95 --- /dev/null +++ b/checkpoint-1260/global_step1260/bf16_zero_pp_rank_0_mp_rank_00_optim_states.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a043599674f454d97bd8c050be2edf594743f9d162330bfc0ee5adcea899333d +size 63016432 diff --git a/checkpoint-1260/global_step1260/bf16_zero_pp_rank_1_mp_rank_00_optim_states.pt b/checkpoint-1260/global_step1260/bf16_zero_pp_rank_1_mp_rank_00_optim_states.pt new file mode 100644 index 0000000000000000000000000000000000000000..a7f4c90665a790320a5c8647be720e8231012253 --- /dev/null +++ b/checkpoint-1260/global_step1260/bf16_zero_pp_rank_1_mp_rank_00_optim_states.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5b0019f9ccaf47f1d632774294ed6259bbef40778065d82b83405de6e4513588 +size 63016432 diff --git a/checkpoint-1260/global_step1260/bf16_zero_pp_rank_2_mp_rank_00_optim_states.pt b/checkpoint-1260/global_step1260/bf16_zero_pp_rank_2_mp_rank_00_optim_states.pt new file mode 100644 index 0000000000000000000000000000000000000000..f3cd6a5f031b3d79f43a1a71d7925dcfdea714c3 --- /dev/null +++ b/checkpoint-1260/global_step1260/bf16_zero_pp_rank_2_mp_rank_00_optim_states.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9bf1d034530b760f352154c893d76ac8ec4c4dc381a1f367079d7a2c59a9a2a2 +size 63016432 diff --git a/checkpoint-1260/global_step1260/bf16_zero_pp_rank_3_mp_rank_00_optim_states.pt b/checkpoint-1260/global_step1260/bf16_zero_pp_rank_3_mp_rank_00_optim_states.pt new file mode 100644 index 0000000000000000000000000000000000000000..4ac484db00c00fa6fb0c48d5cea3e2359b15b96b --- /dev/null +++ b/checkpoint-1260/global_step1260/bf16_zero_pp_rank_3_mp_rank_00_optim_states.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fa284568e3d191c1b56f55f6a909eb56ab3f562c63e2f7435d8b7422c172fd90 +size 63016432 diff --git a/checkpoint-1260/global_step1260/zero_pp_rank_0_mp_rank_00_model_states.pt b/checkpoint-1260/global_step1260/zero_pp_rank_0_mp_rank_00_model_states.pt new file mode 100644 index 0000000000000000000000000000000000000000..03010550963152a5d7eaf87e8d032a6a14c7c036 --- /dev/null +++ b/checkpoint-1260/global_step1260/zero_pp_rank_0_mp_rank_00_model_states.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cac923c3b6da3f1a392cb613cc8f3458f2ca7467dce5fa819cdc294563cea9fe +size 442088 diff --git a/checkpoint-1260/global_step1260/zero_pp_rank_1_mp_rank_00_model_states.pt b/checkpoint-1260/global_step1260/zero_pp_rank_1_mp_rank_00_model_states.pt new file mode 100644 index 0000000000000000000000000000000000000000..f845d91799bfef303fdb7cffe331d98988cdca07 --- /dev/null +++ b/checkpoint-1260/global_step1260/zero_pp_rank_1_mp_rank_00_model_states.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7251ad42661a9131ae60f5457b6f5e9e00f72c5ffcaef9b5b3b4ada6480a341e +size 442088 diff --git a/checkpoint-1260/global_step1260/zero_pp_rank_2_mp_rank_00_model_states.pt b/checkpoint-1260/global_step1260/zero_pp_rank_2_mp_rank_00_model_states.pt new file mode 100644 index 0000000000000000000000000000000000000000..28e929a1cbbd53d7041171f3073fc3e49e228c02 --- /dev/null +++ b/checkpoint-1260/global_step1260/zero_pp_rank_2_mp_rank_00_model_states.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a7bdbe70992d3362cc72d043bcbc2b6f2d77afba88a739945673ae495e2e4c29 +size 442088 diff --git a/checkpoint-1260/global_step1260/zero_pp_rank_3_mp_rank_00_model_states.pt b/checkpoint-1260/global_step1260/zero_pp_rank_3_mp_rank_00_model_states.pt new file mode 100644 index 0000000000000000000000000000000000000000..777da172e47eff998a3b1cd1a44a2b2a6563428c --- /dev/null +++ b/checkpoint-1260/global_step1260/zero_pp_rank_3_mp_rank_00_model_states.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5bb52bc126f3ab45fbc7cfd81a70e783768e385ecca551afa7f5df0bbf6af00c +size 442088 diff --git a/checkpoint-1260/latest b/checkpoint-1260/latest new file mode 100644 index 0000000000000000000000000000000000000000..eb3eca87ed7a03f09ddfd9572eb5d8bef00ec6f7 --- /dev/null +++ b/checkpoint-1260/latest @@ -0,0 +1 @@ +global_step1260 \ No newline at end of file diff --git a/checkpoint-1260/rng_state_0.pth b/checkpoint-1260/rng_state_0.pth new file mode 100644 index 0000000000000000000000000000000000000000..790a6a673e54d98d0bba02d87726e4c6729bcf5e --- /dev/null +++ b/checkpoint-1260/rng_state_0.pth @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:80f1dd00086bf69fdf53f5ba829d1fd34a66ee8d0d7605513f769d7f049e23ba +size 14960 diff --git a/checkpoint-1260/rng_state_1.pth b/checkpoint-1260/rng_state_1.pth new file mode 100644 index 0000000000000000000000000000000000000000..4172dc6a86f1bc3d3021e225b21fe2bf110d3b84 --- /dev/null +++ b/checkpoint-1260/rng_state_1.pth @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a4070dd9166dcf5b5ea10398c97686f3a1a3b757655ea66064927204fa7dbdcb +size 14960 diff --git a/checkpoint-1260/rng_state_2.pth b/checkpoint-1260/rng_state_2.pth new file mode 100644 index 0000000000000000000000000000000000000000..7cd60f2ef39db2289ad57853f1d4ec5518b4c6d3 --- /dev/null +++ b/checkpoint-1260/rng_state_2.pth @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c7fb58672991772e4f574a707d56a699596e25df205fc2691d9d9ed92f5770e3 +size 14960 diff --git a/checkpoint-1260/rng_state_3.pth b/checkpoint-1260/rng_state_3.pth new file mode 100644 index 0000000000000000000000000000000000000000..acef449bd02d68c88e864e614388a3eec8a90c38 --- /dev/null +++ b/checkpoint-1260/rng_state_3.pth @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b797f73f2fa98be5c9d12d0c79af5236c3c2faeef4d68370d9b7a5aa64c82080 +size 14960 diff --git a/checkpoint-1260/scheduler.pt b/checkpoint-1260/scheduler.pt new file mode 100644 index 0000000000000000000000000000000000000000..9fb6dc12219ac589947cd36e02309ee61d000b04 --- /dev/null +++ b/checkpoint-1260/scheduler.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1c81282e0d9707c991fcf9d176e365411efebd43d1f41e6fbafafc76644b1484 +size 1064 diff --git a/checkpoint-1260/special_tokens_map.json b/checkpoint-1260/special_tokens_map.json new file mode 100644 index 0000000000000000000000000000000000000000..a8eb9ef63af01dfa2c350573b543b14275370944 --- /dev/null +++ b/checkpoint-1260/special_tokens_map.json @@ -0,0 +1,30 @@ +{ + "bos_token": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false + }, + "eos_token": { + "content": "<|END_OF_TURN_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false + }, + "pad_token": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false + }, + "unk_token": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false + } +} diff --git a/checkpoint-1260/tokenizer.json b/checkpoint-1260/tokenizer.json new file mode 100644 index 0000000000000000000000000000000000000000..91a1344d38167f152a8803a80eb79ca4b465adbb --- /dev/null +++ b/checkpoint-1260/tokenizer.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:28c8b8038fcb2756e349a51832a56634423c579a869f39642526327aa56b2989 +size 20125189 diff --git a/checkpoint-1260/tokenizer_config.json b/checkpoint-1260/tokenizer_config.json new file mode 100644 index 0000000000000000000000000000000000000000..100ac1a3b6cff4a9043d2c0fd6b1603d1c1ee1e1 --- /dev/null +++ b/checkpoint-1260/tokenizer_config.json @@ -0,0 +1,364 @@ +{ + "add_bos_token": true, + "add_eos_token": false, + "add_prefix_space": false, + "added_tokens_decoder": { + "0": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "1": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "2": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "3": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "4": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "5": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "6": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "7": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "255000": { + "content": "<|START_OF_TURN_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255001": { + "content": "<|END_OF_TURN_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "255002": { + "content": "<|YES_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255003": { + "content": "<|NO_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255004": { + "content": "<|GOOD_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255005": { + "content": "<|BAD_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255006": { + "content": "<|USER_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255007": { + "content": "<|CHATBOT_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255008": { + "content": "<|SYSTEM_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255009": { + "content": "<|USER_0_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255010": { + "content": "<|USER_1_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255011": { + "content": "<|USER_2_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255012": { + "content": "<|USER_3_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255013": { + "content": "<|USER_4_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255014": { + "content": "<|USER_5_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255015": { + "content": "<|USER_6_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255016": { + "content": "<|USER_7_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255017": { + "content": "<|USER_8_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255018": { + "content": "<|USER_9_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255019": { + "content": "<|START_THINKING|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255020": { + "content": "<|END_THINKING|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255021": { + "content": "<|START_RESPONSE|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "255022": { + "content": "<|END_RESPONSE|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "255023": { + "content": "<|START_ACTION|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255024": { + "content": "<|END_ACTION|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255025": { + "content": "<|START_TOOL_RESULT|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255026": { + "content": "<|END_TOOL_RESULT|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255027": { + "content": "<|EXTRA_8_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255028": { + "content": "<|NEW_FILE|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "255029": { + "content": "<|BEGINNING_OF_PREFIX_FIM_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255030": { + "content": "<|BEGINNING_OF_MIDDLE_FIM_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255031": { + "content": "<|BEGINNING_OF_SUFFIX_FIM_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255032": { + "content": "<|END_OF_MIDDLE_FIM_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + } + }, + "bos_token": "", + "chat_template": [ + { + "name": "default", + "template": "{% if documents %}\n{% set tools = [] %}\n{%- macro document_turn(documents) -%}\n{# format documents into chat turn #}\n<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|><|START_THINKING|>I will look through the document to address the users needs.<|END_THINKING|><|START_ACTION|>[\n {\"tool_call_id\": \"0\", \"tool_name\": \"direct-injected-document\", \"parameters\": {}}\n]<|END_ACTION|><|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|><|START_TOOL_RESULT|>[\n {\n \"tool_call_id\": \"0\",\n \"results\": {\n{% for doc in documents %}\n \"{{ loop.index0 }}\": {{doc|tojson}}{% if not loop.last %},\n {% endif %}\n{% endfor %}\n\n },\n \"is_error\": null\n }\n]<|END_TOOL_RESULT|><|END_OF_TURN_TOKEN|>{%- endmacro %}\n{%- macro tool_call_id_to_int(messages, tool_call_id) %}\n{%- set counter = namespace(value=0) %}\n{%- set tool_call_id_seen = namespace(value=false) %}\n{%- for msg in messages %}\n {%- if msg.tool_calls %}\n {%- for tool_call in msg.tool_calls %}\n {%- if tool_call.id == tool_call_id and not tool_call_id_seen.value -%}\n {{ counter.value }}\n {%- set tool_call_id_seen.value = true %}\n {%- endif %}\n {%- set counter.value = counter.value + 1 %}\n {%- endfor %}\n {%- endif %}\n{%- endfor %}\n{%- endmacro %}\n{%- macro format_tool_message(messages, tool_msg) -%}\n{# format tool message #}\n {\n \"tool_call_id\": \"{{ tool_call_id_to_int(messages, tool_msg.tool_call_id) }}\",\n \"results\": {\n \"0\": {{ tool_msg.content|tojson }}\n },\n \"is_error\": null\n }\n{%- endmacro -%}\n{%- if messages and messages[0]['role']|lower == 'system' %}{%- set developer_preamble = messages[0]['content'] %}{% endif %}\n{%- set tool_idx = namespace(value=0) %}\n{%- set tool_ids_seen = namespace(value=[]) %}\n{%- set sent_documents = namespace(value=false) %}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|># System Preamble\nYou are in contextual safety mode. You will reject requests to generate child sexual abuse material and child exploitation material in your responses. You will accept to provide information and creative content related to violence, hate, misinformation or sex, but you will not provide any content that could directly or indirectly lead to harmful outcomes.\n\nYour information cutoff date is June 2024.\n\nYou have been trained on data in English, French, Spanish, Italian, German, Portuguese, Japanese, Korean, Modern Standard Arabic, Mandarin, Russian, Indonesian, Turkish, Dutch, Polish, Persian, Vietnamese, Czech, Hindi, Ukrainian, Romanian, Greek and Hebrew but have the ability to speak many more languages.\n{% if tools or documents %}\n\nYou have been trained to have advanced reasoning and tool-use capabilities and you should make best use of these skills to serve user's requests.\n\n## Tool Use\nThink about how you can make best use of the provided tools to help with the task and come up with a high level plan that you will execute first.\n\n0. Start by writing <|START_THINKING|> followed by a detailed step by step plan of how you will solve the problem. For each step explain your thinking fully and give details of required tool calls (if needed). Unless specified otherwise, you write your plan in natural language. When you finish, close it out with <|END_THINKING|>.\n You can optionally choose to skip this step when the user request is so straightforward to address that only a trivial plan would be needed.\n NOTE: You MUST skip this step when you are directly responding to the user's request without using any tools.\n\nThen carry out your plan by repeatedly executing the following steps.\n1. Action: write <|START_ACTION|> followed by a list of JSON-formatted tool calls, with each one containing \"tool_name\" and \"parameters\" fields.\n When there are multiple tool calls which are completely independent of each other (i.e. they can be executed in parallel), you should list them out all together in one step. When you finish, close it out with <|END_ACTION|>.\n2. Observation: you will then receive results of those tool calls in JSON format in the very next turn, wrapped around by <|START_TOOL_RESULT|> and <|END_TOOL_RESULT|>. Carefully observe those results and think about what to do next. Note that these results will be provided to you in a separate turn. NEVER hallucinate results.\n Every tool call produces a list of results (when a tool call produces no result or a single result, it'll still get wrapped inside a list). Each result is clearly linked to its originating tool call via its \"tool_call_id\".\n3. Reflection: start the next turn by writing <|START_THINKING|> followed by what you've figured out so far, any changes you need to make to your plan, and what you will do next. When you finish, close it out with <|END_THINKING|>.\n You can optionally choose to skip this step when everything is going according to plan and no special pieces of information or reasoning chains need to be recorded.\n NOTE: You MUST skip this step when you are done with tool-use actions and are ready to respond to the user.\n\nYou can repeat the above 3 steps multiple times (could be 0 times too if no suitable tool calls are available or needed), until you decide it's time to finally respond to the user.\n\n4. Response: then break out of the loop and write <|START_RESPONSE|> followed by a piece of text which serves as a response to the user's last request. Use all previous tool calls and results to help you when formulating your response. When you finish, close it out with <|END_RESPONSE|>.\n{% if enable_citations %}\n\n## Grounding\nImportantly, note that \"Reflection\" and \"Response\" above can be grounded.\nGrounding means you associate pieces of texts (called \"spans\") with those specific tool results that support them (called \"sources\"). And you use a pair of tags \"\" and \"\" to indicate when a span can be grounded onto a list of sources, listing them out in the closing tag. Sources from the same tool call are grouped together and listed as \"{tool_call_id}:[{list of result indices}]\", before they are joined together by \",\". E.g., \"span\" means that \"span\" is supported by result 1 and 2 from \"tool_call_id=0\" as well as result 0 from \"tool_call_id=1\".\n{% endif %}\n\n## Available Tools\nHere is the list of tools that you have available to you.\nYou can ONLY use the tools listed here. When a tool is not listed below, it is NOT available and you should NEVER attempt to use it.\nEach tool is represented as a JSON object with fields like \"name\", \"description\", \"parameters\" (per JSON Schema), and optionally, \"responses\" (per JSON Schema).\n\n```json\n[\n{% if documents %}\n {\"name\": \"direct-injected-document\", \"description\": \"This is a special tool to directly inject user-uploaded documents into the chat as additional context. DO NOT use this tool by yourself!\", \"parameters\": {\"type\": \"object\", \"properties\": {}, \"required\": []}, \"responses\": {\"200\": {\"description\": \"Successfully returned a list of chunked text snippets from the directly uploaded documents.\", \"content\": {\"application/json\": {\"schema\": {\"type\": \"array\", \"items\": {\"type\": \"object\", \"required\": [\"url\", \"snippet\"], \"properties\": {\"url\": {\"type\": \"string\", \"description\": \"The url of the uploaded document.\"}, \"snippet\": {\"type\": \"string\", \"description\": \"The text snippet for the returned document chunk.\"}}}}}}}}}{%- if tools %},{% endif %}\n\n{% endif %}\n{% for tool in tools %}\n {\"name\": \"{{ tool['function']['name'] }}\", \"description\": \"{{tool['function']['description']}}\", \"parameters\": {{ tool['function']['parameters']|tojson }}, \"responses\": null}{%- if not loop.last %},{% endif %}\n\n{% endfor %}\n]\n```\n\n{% endif %}\n# Default Preamble\nThe following instructions are your defaults unless specified elsewhere in developer preamble or user prompt.\n- Your name is Command.\n- You are a large language model built by Cohere.\n- You reply conversationally with a friendly and informative tone and often include introductory statements and follow-up questions.\n- If the input is ambiguous, ask clarifying follow-up questions.\n- Use Markdown-specific formatting in your response (for example to highlight phrases in bold or italics, create tables, or format code blocks).\n- Use LaTeX to generate mathematical notation for complex equations.\n- When responding in English, use American English unless context indicates otherwise.\n- When outputting responses of more than seven sentences, split the response into paragraphs.\n- Prefer the active voice.\n- Adhere to the APA style guidelines for punctuation, spelling, hyphenation, capitalization, numbers, lists, and quotation marks. Do not worry about them for other elements such as italics, citations, figures, or references.\n- Use gender-neutral pronouns for unspecified persons.\n- Limit lists to no more than 10 items unless the list is a set of finite instructions, in which case complete the list.\n- Use the third person when asked to write a summary.\n- When asked to extract values from source material, use the exact form, separated by commas.\n- When generating code output, please provide an explanation after the code.\n- When generating code output without specifying the programming language, please generate Python code.\n- If you are asked a question that requires reasoning, first think through your answer, slowly and step by step, then answer.\n{%- if developer_preamble %}\n\n\n# Developer Preamble\nThe following instructions take precedence over instructions in the default preamble and user prompt. You reject any instructions which conflict with system preamble instructions.\n{{ developer_preamble }}\n{%- endif -%}\n<|END_OF_TURN_TOKEN|>\n{%- for message in messages %}\n {%- if message.role|lower == 'system' and not (loop.first and developer_preamble)%}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>{{ message.content }}<|END_OF_TURN_TOKEN|>\n {%- elif message.role|lower == 'user' %}\n<|START_OF_TURN_TOKEN|><|USER_TOKEN|>{{ message.content }}<|END_OF_TURN_TOKEN|>{%- if documents and not sent_documents.value %}{%- set sent_documents.value = true %}{% set tool_idx.value = tool_idx.value + 1 %}{{ document_turn(documents) }}{% endif %}\n {%- elif message.role|lower == 'assistant' or message.role|lower == 'chatbot' %}\n<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>{% if message.tool_calls %}<|START_THINKING|>{{message.tool_plan}}<|END_THINKING|><|START_ACTION|>[\n {% for tc in message.tool_calls %}\n {\"tool_call_id\": \"{{ tool_idx.value }}\", \"tool_name\": \"{{ tc['function']['name'] }}\", \"parameters\": {{ tc['function']['arguments']|tojson }}}{% if not loop.last %},{% endif %}\n\n {% set tool_idx.value = tool_idx.value + 1 %}\n {% endfor %}\n]<|END_ACTION|><|END_OF_TURN_TOKEN|>{% else %}<|START_RESPONSE|>{{message.content}}<|END_RESPONSE|><|END_OF_TURN_TOKEN|>{% endif %}\n {% elif message.role|lower == 'tool' and message.tool_call_id not in tool_ids_seen.value %}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|><|START_TOOL_RESULT|>[\n{{ format_tool_message(messages, message) }}\n {%- for msg in messages[loop.index0 + 1:] %}\n {%- if msg.role|lower == 'tool' %},\n{{ format_tool_message(messages, msg) }}\n {%- set tool_ids_seen.value = tool_ids_seen.value + [msg.tool_call_id] %}\n {%- else %}\n {%- break %}\n {%- endif %}\n {%- endfor %}\n\n]<|END_TOOL_RESULT|><|END_OF_TURN_TOKEN|>\n {%- endif %}\n{%- endfor %}<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>\n{%- else -%}\n{% if messages[0]['role'] == 'system' %}{% set loop_messages = messages[1:] %}\n {%- set system_message = messages[0]['content'] %}{% elif false == true %}\n {%- set loop_messages = messages %}{% set system_message = '' %}\n{%- else %}\n {%- set loop_messages = messages %}\n {%- set system_message = false %}\n{%- endif %}\n{%- if system_message != false -%}\n {{ '<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>' + system_message + '<|END_OF_TURN_TOKEN|>' }}\n{%- else -%}\n {{ '<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|><|END_OF_TURN_TOKEN|>' }}\n{%- endif %}\n{%- for message in loop_messages %}\n {%- if (message['role'] == 'user') != (loop.index0 % 2 == 0) -%}\n {{ raise_exception('Conversation roles must alternate user/assistant/user/assistant/...') }}\n {%- endif -%}\n {%- set content = message['content'] -%}\n {%- if message['role'] == 'user' -%}\n {{ '<|START_OF_TURN_TOKEN|><|USER_TOKEN|>' + content.strip() + '<|END_OF_TURN_TOKEN|>' }}\n {%- elif message['role'] == 'assistant' -%}\n {{ '<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|><|START_RESPONSE|>' + content.strip() + '<|END_RESPONSE|><|END_OF_TURN_TOKEN|>' }}\n {%- endif %}\n{%- endfor %}\n{%- if add_generation_prompt -%}\n {{ '<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|><|START_RESPONSE|>' }}\n{%- endif %}\n{% endif %}" + }, + { + "name": "tool_use", + "template": "{%- macro document_turn(documents) -%}\n{# format documents into chat turn #}\n<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|><|START_THINKING|>I will look through the document to address the users needs.<|END_THINKING|><|START_ACTION|>[\n {\"tool_call_id\": \"0\", \"tool_name\": \"direct-injected-document\", \"parameters\": {}}\n]<|END_ACTION|><|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|><|START_TOOL_RESULT|>[\n {\n \"tool_call_id\": \"0\",\n \"results\": {\n{% for doc in documents %}\n \"{{ loop.index0 }}\": {{doc|tojson}}{% if not loop.last %},\n {% endif %}\n{% endfor %}\n\n },\n \"is_error\": null\n }\n]<|END_TOOL_RESULT|><|END_OF_TURN_TOKEN|>{%- endmacro %}\n{%- macro tool_call_id_to_int(messages, tool_call_id) %}\n{%- set counter = namespace(value=0) %}\n{%- set tool_call_id_seen = namespace(value=false) %}\n{%- for msg in messages %}\n {%- if msg.tool_calls %}\n {%- for tool_call in msg.tool_calls %}\n {%- if tool_call.id == tool_call_id and not tool_call_id_seen.value -%}\n {{ counter.value }}\n {%- set tool_call_id_seen.value = true %}\n {%- endif %}\n {%- set counter.value = counter.value + 1 %}\n {%- endfor %}\n {%- endif %}\n{%- endfor %}\n{%- endmacro %}\n{%- macro format_tool_message(messages, tool_msg) -%}\n{# format tool message #}\n {\n \"tool_call_id\": \"{{ tool_call_id_to_int(messages, tool_msg.tool_call_id) }}\",\n \"results\": {\n \"0\": {{ tool_msg.content|tojson }}\n },\n \"is_error\": null\n }\n{%- endmacro -%}\n{%- if messages and messages[0]['role']|lower == 'system' %}{%- set developer_preamble = messages[0]['content'] %}{% endif %}\n{%- set tool_idx = namespace(value=0) %}\n{%- set tool_ids_seen = namespace(value=[]) %}\n{%- set sent_documents = namespace(value=false) %}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|># System Preamble\nYou are in contextual safety mode. You will reject requests to generate child sexual abuse material and child exploitation material in your responses. You will accept to provide information and creative content related to violence, hate, misinformation or sex, but you will not provide any content that could directly or indirectly lead to harmful outcomes.\n\nYour information cutoff date is June 2024.\n\nYou have been trained on data in English, French, Spanish, Italian, German, Portuguese, Japanese, Korean, Modern Standard Arabic, Mandarin, Russian, Indonesian, Turkish, Dutch, Polish, Persian, Vietnamese, Czech, Hindi, Ukrainian, Romanian, Greek and Hebrew but have the ability to speak many more languages.\n{% if tools or documents %}\n\nYou have been trained to have advanced reasoning and tool-use capabilities and you should make best use of these skills to serve user's requests.\n\n## Tool Use\nThink about how you can make best use of the provided tools to help with the task and come up with a high level plan that you will execute first.\n\n0. Start by writing <|START_THINKING|> followed by a detailed step by step plan of how you will solve the problem. For each step explain your thinking fully and give details of required tool calls (if needed). Unless specified otherwise, you write your plan in natural language. When you finish, close it out with <|END_THINKING|>.\n You can optionally choose to skip this step when the user request is so straightforward to address that only a trivial plan would be needed.\n NOTE: You MUST skip this step when you are directly responding to the user's request without using any tools.\n\nThen carry out your plan by repeatedly executing the following steps.\n1. Action: write <|START_ACTION|> followed by a list of JSON-formatted tool calls, with each one containing \"tool_name\" and \"parameters\" fields.\n When there are multiple tool calls which are completely independent of each other (i.e. they can be executed in parallel), you should list them out all together in one step. When you finish, close it out with <|END_ACTION|>.\n2. Observation: you will then receive results of those tool calls in JSON format in the very next turn, wrapped around by <|START_TOOL_RESULT|> and <|END_TOOL_RESULT|>. Carefully observe those results and think about what to do next. Note that these results will be provided to you in a separate turn. NEVER hallucinate results.\n Every tool call produces a list of results (when a tool call produces no result or a single result, it'll still get wrapped inside a list). Each result is clearly linked to its originating tool call via its \"tool_call_id\".\n3. Reflection: start the next turn by writing <|START_THINKING|> followed by what you've figured out so far, any changes you need to make to your plan, and what you will do next. When you finish, close it out with <|END_THINKING|>.\n You can optionally choose to skip this step when everything is going according to plan and no special pieces of information or reasoning chains need to be recorded.\n NOTE: You MUST skip this step when you are done with tool-use actions and are ready to respond to the user.\n\nYou can repeat the above 3 steps multiple times (could be 0 times too if no suitable tool calls are available or needed), until you decide it's time to finally respond to the user.\n\n4. Response: then break out of the loop and write <|START_RESPONSE|> followed by a piece of text which serves as a response to the user's last request. Use all previous tool calls and results to help you when formulating your response. When you finish, close it out with <|END_RESPONSE|>.\n{% if enable_citations %}\n\n## Grounding\nImportantly, note that \"Reflection\" and \"Response\" above can be grounded.\nGrounding means you associate pieces of texts (called \"spans\") with those specific tool results that support them (called \"sources\"). And you use a pair of tags \"\" and \"\" to indicate when a span can be grounded onto a list of sources, listing them out in the closing tag. Sources from the same tool call are grouped together and listed as \"{tool_call_id}:[{list of result indices}]\", before they are joined together by \",\". E.g., \"span\" means that \"span\" is supported by result 1 and 2 from \"tool_call_id=0\" as well as result 0 from \"tool_call_id=1\".\n{% endif %}\n\n## Available Tools\nHere is the list of tools that you have available to you.\nYou can ONLY use the tools listed here. When a tool is not listed below, it is NOT available and you should NEVER attempt to use it.\nEach tool is represented as a JSON object with fields like \"name\", \"description\", \"parameters\" (per JSON Schema), and optionally, \"responses\" (per JSON Schema).\n\n```json\n[\n{% if documents %}\n {\"name\": \"direct-injected-document\", \"description\": \"This is a special tool to directly inject user-uploaded documents into the chat as additional context. DO NOT use this tool by yourself!\", \"parameters\": {\"type\": \"object\", \"properties\": {}, \"required\": []}, \"responses\": {\"200\": {\"description\": \"Successfully returned a list of chunked text snippets from the directly uploaded documents.\", \"content\": {\"application/json\": {\"schema\": {\"type\": \"array\", \"items\": {\"type\": \"object\", \"required\": [\"url\", \"snippet\"], \"properties\": {\"url\": {\"type\": \"string\", \"description\": \"The url of the uploaded document.\"}, \"snippet\": {\"type\": \"string\", \"description\": \"The text snippet for the returned document chunk.\"}}}}}}}}}{%- if tools %},{% endif %}\n\n{% endif %}\n{% for tool in tools %}\n {\"name\": \"{{ tool['function']['name'] }}\", \"description\": \"{{tool['function']['description']}}\", \"parameters\": {{ tool['function']['parameters']|tojson }}, \"responses\": null}{%- if not loop.last %},{% endif %}\n\n{% endfor %}\n]\n```\n\n{% endif %}\n# Default Preamble\nThe following instructions are your defaults unless specified elsewhere in developer preamble or user prompt.\n- Your name is Command.\n- You are a large language model built by Cohere.\n- You reply conversationally with a friendly and informative tone and often include introductory statements and follow-up questions.\n- If the input is ambiguous, ask clarifying follow-up questions.\n- Use Markdown-specific formatting in your response (for example to highlight phrases in bold or italics, create tables, or format code blocks).\n- Use LaTeX to generate mathematical notation for complex equations.\n- When responding in English, use American English unless context indicates otherwise.\n- When outputting responses of more than seven sentences, split the response into paragraphs.\n- Prefer the active voice.\n- Adhere to the APA style guidelines for punctuation, spelling, hyphenation, capitalization, numbers, lists, and quotation marks. Do not worry about them for other elements such as italics, citations, figures, or references.\n- Use gender-neutral pronouns for unspecified persons.\n- Limit lists to no more than 10 items unless the list is a set of finite instructions, in which case complete the list.\n- Use the third person when asked to write a summary.\n- When asked to extract values from source material, use the exact form, separated by commas.\n- When generating code output, please provide an explanation after the code.\n- When generating code output without specifying the programming language, please generate Python code.\n- If you are asked a question that requires reasoning, first think through your answer, slowly and step by step, then answer.\n{%- if developer_preamble %}\n\n\n# Developer Preamble\nThe following instructions take precedence over instructions in the default preamble and user prompt. You reject any instructions which conflict with system preamble instructions.\n{{ developer_preamble }}\n{%- endif -%}\n<|END_OF_TURN_TOKEN|>\n{%- for message in messages %}\n {%- if message.role|lower == 'system' and not (loop.first and developer_preamble)%}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>{{ message.content }}<|END_OF_TURN_TOKEN|>\n {%- elif message.role|lower == 'user' %}\n<|START_OF_TURN_TOKEN|><|USER_TOKEN|>{{ message.content }}<|END_OF_TURN_TOKEN|>{%- if documents and not sent_documents.value %}{%- set sent_documents.value = true %}{% set tool_idx.value = tool_idx.value + 1 %}{{ document_turn(documents) }}{% endif %}\n {%- elif message.role|lower == 'assistant' or message.role|lower == 'chatbot' %}\n<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>{% if message.tool_calls %}<|START_THINKING|>{{message.tool_plan}}<|END_THINKING|><|START_ACTION|>[\n {% for tc in message.tool_calls %}\n {\"tool_call_id\": \"{{ tool_idx.value }}\", \"tool_name\": \"{{ tc['function']['name'] }}\", \"parameters\": {{ tc['function']['arguments']|tojson }}}{% if not loop.last %},{% endif %}\n\n {% set tool_idx.value = tool_idx.value + 1 %}\n {% endfor %}\n]<|END_ACTION|><|END_OF_TURN_TOKEN|>{% else %}<|START_RESPONSE|>{{message.content}}<|END_RESPONSE|><|END_OF_TURN_TOKEN|>{% endif %}\n {% elif message.role|lower == 'tool' and message.tool_call_id not in tool_ids_seen.value %}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|><|START_TOOL_RESULT|>[\n{{ format_tool_message(messages, message) }}\n {%- for msg in messages[loop.index0 + 1:] %}\n {%- if msg.role|lower == 'tool' %},\n{{ format_tool_message(messages, msg) }}\n {%- set tool_ids_seen.value = tool_ids_seen.value + [msg.tool_call_id] %}\n {%- else %}\n {%- break %}\n {%- endif %}\n {%- endfor %}\n\n]<|END_TOOL_RESULT|><|END_OF_TURN_TOKEN|>\n {%- endif %}\n{%- endfor %}<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>" + }, + { + "name": "rag", + "template": "{% set tools = [] %}\n{%- macro document_turn(documents) -%}\n{# format documents into chat turn #}\n<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|><|START_THINKING|>I will look through the document to address the users needs.<|END_THINKING|><|START_ACTION|>[\n {\"tool_call_id\": \"0\", \"tool_name\": \"direct-injected-document\", \"parameters\": {}}\n]<|END_ACTION|><|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|><|START_TOOL_RESULT|>[\n {\n \"tool_call_id\": \"0\",\n \"results\": {\n{% for doc in documents %}\n \"{{ loop.index0 }}\": {{doc|tojson}}{% if not loop.last %},\n {% endif %}\n{% endfor %}\n\n },\n \"is_error\": null\n }\n]<|END_TOOL_RESULT|><|END_OF_TURN_TOKEN|>{%- endmacro %}\n{%- macro tool_call_id_to_int(messages, tool_call_id) %}\n{%- set counter = namespace(value=0) %}\n{%- set tool_call_id_seen = namespace(value=false) %}\n{%- for msg in messages %}\n {%- if msg.tool_calls %}\n {%- for tool_call in msg.tool_calls %}\n {%- if tool_call.id == tool_call_id and not tool_call_id_seen.value -%}\n {{ counter.value }}\n {%- set tool_call_id_seen.value = true %}\n {%- endif %}\n {%- set counter.value = counter.value + 1 %}\n {%- endfor %}\n {%- endif %}\n{%- endfor %}\n{%- endmacro %}\n{%- macro format_tool_message(messages, tool_msg) -%}\n{# format tool message #}\n {\n \"tool_call_id\": \"{{ tool_call_id_to_int(messages, tool_msg.tool_call_id) }}\",\n \"results\": {\n \"0\": {{ tool_msg.content|tojson }}\n },\n \"is_error\": null\n }\n{%- endmacro -%}\n{%- if messages and messages[0]['role']|lower == 'system' %}{%- set developer_preamble = messages[0]['content'] %}{% endif %}\n{%- set tool_idx = namespace(value=0) %}\n{%- set tool_ids_seen = namespace(value=[]) %}\n{%- set sent_documents = namespace(value=false) %}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|># System Preamble\nYou are in contextual safety mode. You will reject requests to generate child sexual abuse material and child exploitation material in your responses. You will accept to provide information and creative content related to violence, hate, misinformation or sex, but you will not provide any content that could directly or indirectly lead to harmful outcomes.\n\nYour information cutoff date is June 2024.\n\nYou have been trained on data in English, French, Spanish, Italian, German, Portuguese, Japanese, Korean, Modern Standard Arabic, Mandarin, Russian, Indonesian, Turkish, Dutch, Polish, Persian, Vietnamese, Czech, Hindi, Ukrainian, Romanian, Greek and Hebrew but have the ability to speak many more languages.\n{% if tools or documents %}\n\nYou have been trained to have advanced reasoning and tool-use capabilities and you should make best use of these skills to serve user's requests.\n\n## Tool Use\nThink about how you can make best use of the provided tools to help with the task and come up with a high level plan that you will execute first.\n\n0. Start by writing <|START_THINKING|> followed by a detailed step by step plan of how you will solve the problem. For each step explain your thinking fully and give details of required tool calls (if needed). Unless specified otherwise, you write your plan in natural language. When you finish, close it out with <|END_THINKING|>.\n You can optionally choose to skip this step when the user request is so straightforward to address that only a trivial plan would be needed.\n NOTE: You MUST skip this step when you are directly responding to the user's request without using any tools.\n\nThen carry out your plan by repeatedly executing the following steps.\n1. Action: write <|START_ACTION|> followed by a list of JSON-formatted tool calls, with each one containing \"tool_name\" and \"parameters\" fields.\n When there are multiple tool calls which are completely independent of each other (i.e. they can be executed in parallel), you should list them out all together in one step. When you finish, close it out with <|END_ACTION|>.\n2. Observation: you will then receive results of those tool calls in JSON format in the very next turn, wrapped around by <|START_TOOL_RESULT|> and <|END_TOOL_RESULT|>. Carefully observe those results and think about what to do next. Note that these results will be provided to you in a separate turn. NEVER hallucinate results.\n Every tool call produces a list of results (when a tool call produces no result or a single result, it'll still get wrapped inside a list). Each result is clearly linked to its originating tool call via its \"tool_call_id\".\n3. Reflection: start the next turn by writing <|START_THINKING|> followed by what you've figured out so far, any changes you need to make to your plan, and what you will do next. When you finish, close it out with <|END_THINKING|>.\n You can optionally choose to skip this step when everything is going according to plan and no special pieces of information or reasoning chains need to be recorded.\n NOTE: You MUST skip this step when you are done with tool-use actions and are ready to respond to the user.\n\nYou can repeat the above 3 steps multiple times (could be 0 times too if no suitable tool calls are available or needed), until you decide it's time to finally respond to the user.\n\n4. Response: then break out of the loop and write <|START_RESPONSE|> followed by a piece of text which serves as a response to the user's last request. Use all previous tool calls and results to help you when formulating your response. When you finish, close it out with <|END_RESPONSE|>.\n{% if enable_citations %}\n\n## Grounding\nImportantly, note that \"Reflection\" and \"Response\" above can be grounded.\nGrounding means you associate pieces of texts (called \"spans\") with those specific tool results that support them (called \"sources\"). And you use a pair of tags \"\" and \"\" to indicate when a span can be grounded onto a list of sources, listing them out in the closing tag. Sources from the same tool call are grouped together and listed as \"{tool_call_id}:[{list of result indices}]\", before they are joined together by \",\". E.g., \"span\" means that \"span\" is supported by result 1 and 2 from \"tool_call_id=0\" as well as result 0 from \"tool_call_id=1\".\n{% endif %}\n\n## Available Tools\nHere is the list of tools that you have available to you.\nYou can ONLY use the tools listed here. When a tool is not listed below, it is NOT available and you should NEVER attempt to use it.\nEach tool is represented as a JSON object with fields like \"name\", \"description\", \"parameters\" (per JSON Schema), and optionally, \"responses\" (per JSON Schema).\n\n```json\n[\n{% if documents %}\n {\"name\": \"direct-injected-document\", \"description\": \"This is a special tool to directly inject user-uploaded documents into the chat as additional context. DO NOT use this tool by yourself!\", \"parameters\": {\"type\": \"object\", \"properties\": {}, \"required\": []}, \"responses\": {\"200\": {\"description\": \"Successfully returned a list of chunked text snippets from the directly uploaded documents.\", \"content\": {\"application/json\": {\"schema\": {\"type\": \"array\", \"items\": {\"type\": \"object\", \"required\": [\"url\", \"snippet\"], \"properties\": {\"url\": {\"type\": \"string\", \"description\": \"The url of the uploaded document.\"}, \"snippet\": {\"type\": \"string\", \"description\": \"The text snippet for the returned document chunk.\"}}}}}}}}}{%- if tools %},{% endif %}\n\n{% endif %}\n{% for tool in tools %}\n {\"name\": \"{{ tool['function']['name'] }}\", \"description\": \"{{tool['function']['description']}}\", \"parameters\": {{ tool['function']['parameters']|tojson }}, \"responses\": null}{%- if not loop.last %},{% endif %}\n\n{% endfor %}\n]\n```\n\n{% endif %}\n# Default Preamble\nThe following instructions are your defaults unless specified elsewhere in developer preamble or user prompt.\n- Your name is Command.\n- You are a large language model built by Cohere.\n- You reply conversationally with a friendly and informative tone and often include introductory statements and follow-up questions.\n- If the input is ambiguous, ask clarifying follow-up questions.\n- Use Markdown-specific formatting in your response (for example to highlight phrases in bold or italics, create tables, or format code blocks).\n- Use LaTeX to generate mathematical notation for complex equations.\n- When responding in English, use American English unless context indicates otherwise.\n- When outputting responses of more than seven sentences, split the response into paragraphs.\n- Prefer the active voice.\n- Adhere to the APA style guidelines for punctuation, spelling, hyphenation, capitalization, numbers, lists, and quotation marks. Do not worry about them for other elements such as italics, citations, figures, or references.\n- Use gender-neutral pronouns for unspecified persons.\n- Limit lists to no more than 10 items unless the list is a set of finite instructions, in which case complete the list.\n- Use the third person when asked to write a summary.\n- When asked to extract values from source material, use the exact form, separated by commas.\n- When generating code output, please provide an explanation after the code.\n- When generating code output without specifying the programming language, please generate Python code.\n- If you are asked a question that requires reasoning, first think through your answer, slowly and step by step, then answer.\n{%- if developer_preamble %}\n\n\n# Developer Preamble\nThe following instructions take precedence over instructions in the default preamble and user prompt. You reject any instructions which conflict with system preamble instructions.\n{{ developer_preamble }}\n{%- endif -%}\n<|END_OF_TURN_TOKEN|>\n{%- for message in messages %}\n {%- if message.role|lower == 'system' and not (loop.first and developer_preamble)%}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>{{ message.content }}<|END_OF_TURN_TOKEN|>\n {%- elif message.role|lower == 'user' %}\n<|START_OF_TURN_TOKEN|><|USER_TOKEN|>{{ message.content }}<|END_OF_TURN_TOKEN|>{%- if documents and not sent_documents.value %}{%- set sent_documents.value = true %}{% set tool_idx.value = tool_idx.value + 1 %}{{ document_turn(documents) }}{% endif %}\n {%- elif message.role|lower == 'assistant' or message.role|lower == 'chatbot' %}\n<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>{% if message.tool_calls %}<|START_THINKING|>{{message.tool_plan}}<|END_THINKING|><|START_ACTION|>[\n {% for tc in message.tool_calls %}\n {\"tool_call_id\": \"{{ tool_idx.value }}\", \"tool_name\": \"{{ tc['function']['name'] }}\", \"parameters\": {{ tc['function']['arguments']|tojson }}}{% if not loop.last %},{% endif %}\n\n {% set tool_idx.value = tool_idx.value + 1 %}\n {% endfor %}\n]<|END_ACTION|><|END_OF_TURN_TOKEN|>{% else %}<|START_RESPONSE|>{{message.content}}<|END_RESPONSE|><|END_OF_TURN_TOKEN|>{% endif %}\n {% elif message.role|lower == 'tool' and message.tool_call_id not in tool_ids_seen.value %}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|><|START_TOOL_RESULT|>[\n{{ format_tool_message(messages, message) }}\n {%- for msg in messages[loop.index0 + 1:] %}\n {%- if msg.role|lower == 'tool' %},\n{{ format_tool_message(messages, msg) }}\n {%- set tool_ids_seen.value = tool_ids_seen.value + [msg.tool_call_id] %}\n {%- else %}\n {%- break %}\n {%- endif %}\n {%- endfor %}\n\n]<|END_TOOL_RESULT|><|END_OF_TURN_TOKEN|>\n {%- endif %}\n{%- endfor %}<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>" + } + ], + "clean_up_tokenization_spaces": false, + "eos_token": "<|END_OF_TURN_TOKEN|>", + "extra_special_tokens": {}, + "legacy": true, + "merges_file": null, + "model_max_length": 8192, + "pad_token": "", + "padding_side": "right", + "sp_model_kwargs": {}, + "spaces_between_special_tokens": false, + "tokenizer_class": "CohereTokenizer", + "unk_token": "", + "use_default_system_prompt": false, + "vocab_file": null +} diff --git a/checkpoint-1260/trainer_state.json b/checkpoint-1260/trainer_state.json new file mode 100644 index 0000000000000000000000000000000000000000..91b9f6da8c1360cd27cb5082246c44b603200e82 --- /dev/null +++ b/checkpoint-1260/trainer_state.json @@ -0,0 +1,4507 @@ +{ + "best_metric": null, + "best_model_checkpoint": null, + "epoch": 0.4380323309577612, + "eval_steps": 150, + "global_step": 1260, + "is_hyper_param_search": false, + "is_local_process_zero": true, + "is_world_process_zero": true, + "log_history": [ + { + "epoch": 0.0006952894142186686, + "grad_norm": 5.413117383066536, + "learning_rate": 6.944444444444445e-07, + "loss": 2.3653, + "step": 2 + }, + { + "epoch": 0.0013905788284373371, + "grad_norm": 5.092870612337868, + "learning_rate": 1.388888888888889e-06, + "loss": 2.5001, + "step": 4 + }, + { + "epoch": 0.0020858682426560054, + "grad_norm": 3.6285625961711943, + "learning_rate": 2.0833333333333334e-06, + "loss": 2.3759, + "step": 6 + }, + { + "epoch": 0.0027811576568746743, + "grad_norm": 2.5025911526151075, + "learning_rate": 2.777777777777778e-06, + "loss": 1.944, + "step": 8 + }, + { + "epoch": 0.0034764470710933427, + "grad_norm": 3.077266049542496, + "learning_rate": 3.4722222222222224e-06, + "loss": 2.2504, + "step": 10 + }, + { + "epoch": 0.004171736485312011, + "grad_norm": 4.068243939187174, + "learning_rate": 4.166666666666667e-06, + "loss": 2.0637, + "step": 12 + }, + { + "epoch": 0.00486702589953068, + "grad_norm": 3.511444738830971, + "learning_rate": 4.861111111111111e-06, + "loss": 2.3604, + "step": 14 + }, + { + "epoch": 0.0055623153137493485, + "grad_norm": 5.925744892256934, + "learning_rate": 5.555555555555556e-06, + "loss": 2.6528, + "step": 16 + }, + { + "epoch": 0.0062576047279680165, + "grad_norm": 2.7950114871483405, + "learning_rate": 6.25e-06, + "loss": 2.3229, + "step": 18 + }, + { + "epoch": 0.006952894142186685, + "grad_norm": 6.586211843766182, + "learning_rate": 6.944444444444445e-06, + "loss": 2.342, + "step": 20 + }, + { + "epoch": 0.0076481835564053535, + "grad_norm": 4.902839955269193, + "learning_rate": 7.63888888888889e-06, + "loss": 2.4188, + "step": 22 + }, + { + "epoch": 0.008343472970624021, + "grad_norm": 4.257062809771645, + "learning_rate": 8.333333333333334e-06, + "loss": 1.7957, + "step": 24 + }, + { + "epoch": 0.009038762384842691, + "grad_norm": 4.460352004615699, + "learning_rate": 9.027777777777777e-06, + "loss": 2.0726, + "step": 26 + }, + { + "epoch": 0.00973405179906136, + "grad_norm": 5.858061506133739, + "learning_rate": 9.722222222222223e-06, + "loss": 2.0455, + "step": 28 + }, + { + "epoch": 0.010429341213280027, + "grad_norm": 4.331946668100709, + "learning_rate": 1.0416666666666668e-05, + "loss": 1.7645, + "step": 30 + }, + { + "epoch": 0.011124630627498697, + "grad_norm": 5.428742204187391, + "learning_rate": 1.1111111111111112e-05, + "loss": 1.7446, + "step": 32 + }, + { + "epoch": 0.011819920041717365, + "grad_norm": 2.485909286541028, + "learning_rate": 1.1805555555555555e-05, + "loss": 1.5885, + "step": 34 + }, + { + "epoch": 0.012515209455936033, + "grad_norm": 3.2602949308730222, + "learning_rate": 1.25e-05, + "loss": 1.1014, + "step": 36 + }, + { + "epoch": 0.013210498870154701, + "grad_norm": 4.962187747415964, + "learning_rate": 1.3194444444444446e-05, + "loss": 1.3588, + "step": 38 + }, + { + "epoch": 0.01390578828437337, + "grad_norm": 7.627756894198461, + "learning_rate": 1.388888888888889e-05, + "loss": 1.4014, + "step": 40 + }, + { + "epoch": 0.014601077698592039, + "grad_norm": 2.821848388410092, + "learning_rate": 1.4583333333333335e-05, + "loss": 1.0959, + "step": 42 + }, + { + "epoch": 0.015296367112810707, + "grad_norm": 10.989320944549025, + "learning_rate": 1.527777777777778e-05, + "loss": 1.739, + "step": 44 + }, + { + "epoch": 0.015991656527029375, + "grad_norm": 4.300936602591115, + "learning_rate": 1.597222222222222e-05, + "loss": 1.1078, + "step": 46 + }, + { + "epoch": 0.016686945941248043, + "grad_norm": 3.7539663261019856, + "learning_rate": 1.6666666666666667e-05, + "loss": 1.2701, + "step": 48 + }, + { + "epoch": 0.017382235355466714, + "grad_norm": 2.589248169352173, + "learning_rate": 1.736111111111111e-05, + "loss": 1.4452, + "step": 50 + }, + { + "epoch": 0.018077524769685382, + "grad_norm": 3.6679301322156177, + "learning_rate": 1.8055555555555555e-05, + "loss": 1.4243, + "step": 52 + }, + { + "epoch": 0.01877281418390405, + "grad_norm": 2.0885660923860074, + "learning_rate": 1.8750000000000002e-05, + "loss": 1.4453, + "step": 54 + }, + { + "epoch": 0.01946810359812272, + "grad_norm": 2.955353237610474, + "learning_rate": 1.9444444444444445e-05, + "loss": 1.5388, + "step": 56 + }, + { + "epoch": 0.020163393012341387, + "grad_norm": 3.0527006398487018, + "learning_rate": 2.013888888888889e-05, + "loss": 1.4043, + "step": 58 + }, + { + "epoch": 0.020858682426560055, + "grad_norm": 1.9862208864154767, + "learning_rate": 2.0833333333333336e-05, + "loss": 1.1007, + "step": 60 + }, + { + "epoch": 0.021553971840778723, + "grad_norm": 2.347361178472164, + "learning_rate": 2.152777777777778e-05, + "loss": 0.9291, + "step": 62 + }, + { + "epoch": 0.022249261254997394, + "grad_norm": 2.4812993223105995, + "learning_rate": 2.2222222222222223e-05, + "loss": 0.9592, + "step": 64 + }, + { + "epoch": 0.022944550669216062, + "grad_norm": 1.639333831845777, + "learning_rate": 2.2916666666666667e-05, + "loss": 1.0645, + "step": 66 + }, + { + "epoch": 0.02363984008343473, + "grad_norm": 2.92858351082494, + "learning_rate": 2.361111111111111e-05, + "loss": 1.4269, + "step": 68 + }, + { + "epoch": 0.024335129497653398, + "grad_norm": 2.8503434812871604, + "learning_rate": 2.4305555555555558e-05, + "loss": 0.7829, + "step": 70 + }, + { + "epoch": 0.025030418911872066, + "grad_norm": 2.4875590459354107, + "learning_rate": 2.5e-05, + "loss": 0.9733, + "step": 72 + }, + { + "epoch": 0.025725708326090734, + "grad_norm": 5.2567545525905075, + "learning_rate": 2.5694444444444445e-05, + "loss": 1.3559, + "step": 74 + }, + { + "epoch": 0.026420997740309402, + "grad_norm": 4.68745753567611, + "learning_rate": 2.6388888888888892e-05, + "loss": 1.1499, + "step": 76 + }, + { + "epoch": 0.027116287154528074, + "grad_norm": 2.810345453706711, + "learning_rate": 2.7083333333333332e-05, + "loss": 0.8636, + "step": 78 + }, + { + "epoch": 0.02781157656874674, + "grad_norm": 3.0144493626195388, + "learning_rate": 2.777777777777778e-05, + "loss": 0.9274, + "step": 80 + }, + { + "epoch": 0.02850686598296541, + "grad_norm": 2.3263036535508523, + "learning_rate": 2.8472222222222223e-05, + "loss": 1.3979, + "step": 82 + }, + { + "epoch": 0.029202155397184078, + "grad_norm": 1.6009019341419857, + "learning_rate": 2.916666666666667e-05, + "loss": 0.9039, + "step": 84 + }, + { + "epoch": 0.029897444811402746, + "grad_norm": 2.0637506891442294, + "learning_rate": 2.9861111111111113e-05, + "loss": 1.5187, + "step": 86 + }, + { + "epoch": 0.030592734225621414, + "grad_norm": 1.5533001268209932, + "learning_rate": 3.055555555555556e-05, + "loss": 0.8937, + "step": 88 + }, + { + "epoch": 0.03128802363984008, + "grad_norm": 1.9974857545819733, + "learning_rate": 3.125e-05, + "loss": 0.8218, + "step": 90 + }, + { + "epoch": 0.03198331305405875, + "grad_norm": 1.871899331408953, + "learning_rate": 3.194444444444444e-05, + "loss": 1.2451, + "step": 92 + }, + { + "epoch": 0.03267860246827742, + "grad_norm": 1.591601830348497, + "learning_rate": 3.263888888888889e-05, + "loss": 0.7485, + "step": 94 + }, + { + "epoch": 0.033373891882496086, + "grad_norm": 2.404166647711005, + "learning_rate": 3.3333333333333335e-05, + "loss": 1.1587, + "step": 96 + }, + { + "epoch": 0.03406918129671476, + "grad_norm": 1.581080788392888, + "learning_rate": 3.402777777777778e-05, + "loss": 0.9578, + "step": 98 + }, + { + "epoch": 0.03476447071093343, + "grad_norm": 2.1551207338771547, + "learning_rate": 3.472222222222222e-05, + "loss": 1.1305, + "step": 100 + }, + { + "epoch": 0.0354597601251521, + "grad_norm": 4.2246272812704, + "learning_rate": 3.541666666666667e-05, + "loss": 1.04, + "step": 102 + }, + { + "epoch": 0.036155049539370765, + "grad_norm": 2.5526898161765588, + "learning_rate": 3.611111111111111e-05, + "loss": 1.0743, + "step": 104 + }, + { + "epoch": 0.03685033895358943, + "grad_norm": 1.9784815137623597, + "learning_rate": 3.6805555555555556e-05, + "loss": 0.9667, + "step": 106 + }, + { + "epoch": 0.0375456283678081, + "grad_norm": 1.9131648200880944, + "learning_rate": 3.7500000000000003e-05, + "loss": 0.8951, + "step": 108 + }, + { + "epoch": 0.03824091778202677, + "grad_norm": 3.9405296351174575, + "learning_rate": 3.8194444444444444e-05, + "loss": 1.222, + "step": 110 + }, + { + "epoch": 0.03893620719624544, + "grad_norm": 13.764861545850291, + "learning_rate": 3.888888888888889e-05, + "loss": 1.0497, + "step": 112 + }, + { + "epoch": 0.039631496610464105, + "grad_norm": 3.998123122175411, + "learning_rate": 3.958333333333333e-05, + "loss": 1.0901, + "step": 114 + }, + { + "epoch": 0.04032678602468277, + "grad_norm": 3.126193921423756, + "learning_rate": 4.027777777777778e-05, + "loss": 1.1143, + "step": 116 + }, + { + "epoch": 0.04102207543890144, + "grad_norm": 2.7839926692610613, + "learning_rate": 4.0972222222222225e-05, + "loss": 1.1637, + "step": 118 + }, + { + "epoch": 0.04171736485312011, + "grad_norm": 2.591162621161276, + "learning_rate": 4.166666666666667e-05, + "loss": 1.0624, + "step": 120 + }, + { + "epoch": 0.04241265426733878, + "grad_norm": 1.4930703711545332, + "learning_rate": 4.236111111111111e-05, + "loss": 1.0239, + "step": 122 + }, + { + "epoch": 0.043107943681557445, + "grad_norm": 4.355150070532966, + "learning_rate": 4.305555555555556e-05, + "loss": 1.266, + "step": 124 + }, + { + "epoch": 0.04380323309577612, + "grad_norm": 1.8285608876277135, + "learning_rate": 4.375e-05, + "loss": 1.0667, + "step": 126 + }, + { + "epoch": 0.04449852250999479, + "grad_norm": 2.1848832742617055, + "learning_rate": 4.4444444444444447e-05, + "loss": 0.7549, + "step": 128 + }, + { + "epoch": 0.045193811924213456, + "grad_norm": 3.547857947451226, + "learning_rate": 4.5138888888888894e-05, + "loss": 0.7974, + "step": 130 + }, + { + "epoch": 0.045889101338432124, + "grad_norm": 3.372457028128184, + "learning_rate": 4.5833333333333334e-05, + "loss": 1.0482, + "step": 132 + }, + { + "epoch": 0.04658439075265079, + "grad_norm": 2.2871138548091703, + "learning_rate": 4.652777777777778e-05, + "loss": 0.8246, + "step": 134 + }, + { + "epoch": 0.04727968016686946, + "grad_norm": 1.7489408054743605, + "learning_rate": 4.722222222222222e-05, + "loss": 1.0011, + "step": 136 + }, + { + "epoch": 0.04797496958108813, + "grad_norm": 1.944650349232646, + "learning_rate": 4.791666666666667e-05, + "loss": 0.7828, + "step": 138 + }, + { + "epoch": 0.048670258995306796, + "grad_norm": 2.321619459307342, + "learning_rate": 4.8611111111111115e-05, + "loss": 1.02, + "step": 140 + }, + { + "epoch": 0.049365548409525464, + "grad_norm": 5.317732559595606, + "learning_rate": 4.930555555555556e-05, + "loss": 0.9539, + "step": 142 + }, + { + "epoch": 0.05006083782374413, + "grad_norm": 1.5887292172279854, + "learning_rate": 5e-05, + "loss": 0.7961, + "step": 144 + }, + { + "epoch": 0.0507561272379628, + "grad_norm": 2.9987019111854964, + "learning_rate": 5.069444444444444e-05, + "loss": 1.0018, + "step": 146 + }, + { + "epoch": 0.05145141665218147, + "grad_norm": 5.63878906132749, + "learning_rate": 5.138888888888889e-05, + "loss": 0.9278, + "step": 148 + }, + { + "epoch": 0.052146706066400136, + "grad_norm": 2.4849685204332834, + "learning_rate": 5.208333333333334e-05, + "loss": 0.7531, + "step": 150 + }, + { + "epoch": 0.052146706066400136, + "eval_loss": 0.9286500215530396, + "eval_runtime": 711.2619, + "eval_samples_per_second": 6.808, + "eval_steps_per_second": 0.214, + "step": 150 + }, + { + "epoch": 0.052841995480618804, + "grad_norm": 3.4927981580288776, + "learning_rate": 5.2777777777777784e-05, + "loss": 0.7422, + "step": 152 + }, + { + "epoch": 0.05353728489483748, + "grad_norm": 2.6593724943984682, + "learning_rate": 5.3472222222222224e-05, + "loss": 0.7762, + "step": 154 + }, + { + "epoch": 0.05423257430905615, + "grad_norm": 2.99709354088536, + "learning_rate": 5.4166666666666664e-05, + "loss": 0.8658, + "step": 156 + }, + { + "epoch": 0.054927863723274815, + "grad_norm": 3.9196361623391414, + "learning_rate": 5.486111111111112e-05, + "loss": 1.1783, + "step": 158 + }, + { + "epoch": 0.05562315313749348, + "grad_norm": 3.022562685608673, + "learning_rate": 5.555555555555556e-05, + "loss": 1.0602, + "step": 160 + }, + { + "epoch": 0.05631844255171215, + "grad_norm": 3.292942684053579, + "learning_rate": 5.6250000000000005e-05, + "loss": 0.8561, + "step": 162 + }, + { + "epoch": 0.05701373196593082, + "grad_norm": 2.397775023338686, + "learning_rate": 5.6944444444444445e-05, + "loss": 0.9561, + "step": 164 + }, + { + "epoch": 0.05770902138014949, + "grad_norm": 3.0546714312119643, + "learning_rate": 5.7638888888888886e-05, + "loss": 0.8274, + "step": 166 + }, + { + "epoch": 0.058404310794368156, + "grad_norm": 2.4021883380894393, + "learning_rate": 5.833333333333334e-05, + "loss": 0.8492, + "step": 168 + }, + { + "epoch": 0.059099600208586824, + "grad_norm": 2.6052829770116293, + "learning_rate": 5.902777777777778e-05, + "loss": 1.1005, + "step": 170 + }, + { + "epoch": 0.05979488962280549, + "grad_norm": 1.6838192892320467, + "learning_rate": 5.972222222222223e-05, + "loss": 1.0157, + "step": 172 + }, + { + "epoch": 0.06049017903702416, + "grad_norm": 3.98880214871885, + "learning_rate": 6.041666666666667e-05, + "loss": 0.8136, + "step": 174 + }, + { + "epoch": 0.06118546845124283, + "grad_norm": 4.81494345341073, + "learning_rate": 6.111111111111112e-05, + "loss": 0.9475, + "step": 176 + }, + { + "epoch": 0.061880757865461496, + "grad_norm": 1.9926278890091862, + "learning_rate": 6.180555555555556e-05, + "loss": 0.6549, + "step": 178 + }, + { + "epoch": 0.06257604727968016, + "grad_norm": 1.750353030728397, + "learning_rate": 6.25e-05, + "loss": 1.1442, + "step": 180 + }, + { + "epoch": 0.06327133669389884, + "grad_norm": 4.77249782692129, + "learning_rate": 6.319444444444444e-05, + "loss": 1.1927, + "step": 182 + }, + { + "epoch": 0.0639666261081175, + "grad_norm": 1.866901788617278, + "learning_rate": 6.388888888888888e-05, + "loss": 1.0032, + "step": 184 + }, + { + "epoch": 0.06466191552233617, + "grad_norm": 1.7495859751833545, + "learning_rate": 6.458333333333334e-05, + "loss": 0.8439, + "step": 186 + }, + { + "epoch": 0.06535720493655484, + "grad_norm": 2.971674018184174, + "learning_rate": 6.527777777777778e-05, + "loss": 0.9817, + "step": 188 + }, + { + "epoch": 0.06605249435077351, + "grad_norm": 2.3753292673540165, + "learning_rate": 6.597222222222223e-05, + "loss": 0.9919, + "step": 190 + }, + { + "epoch": 0.06674778376499217, + "grad_norm": 2.7019148741557744, + "learning_rate": 6.666666666666667e-05, + "loss": 1.1442, + "step": 192 + }, + { + "epoch": 0.06744307317921085, + "grad_norm": 1.8670113287712482, + "learning_rate": 6.736111111111112e-05, + "loss": 0.8905, + "step": 194 + }, + { + "epoch": 0.06813836259342952, + "grad_norm": 1.4199145680760579, + "learning_rate": 6.805555555555556e-05, + "loss": 0.7223, + "step": 196 + }, + { + "epoch": 0.06883365200764818, + "grad_norm": 3.894200902880186, + "learning_rate": 6.875e-05, + "loss": 0.9005, + "step": 198 + }, + { + "epoch": 0.06952894142186686, + "grad_norm": 3.2710376491241955, + "learning_rate": 6.944444444444444e-05, + "loss": 1.1605, + "step": 200 + }, + { + "epoch": 0.07022423083608552, + "grad_norm": 1.6459754670035065, + "learning_rate": 7.013888888888888e-05, + "loss": 0.8551, + "step": 202 + }, + { + "epoch": 0.0709195202503042, + "grad_norm": 4.361031640374508, + "learning_rate": 7.083333333333334e-05, + "loss": 0.7007, + "step": 204 + }, + { + "epoch": 0.07161480966452285, + "grad_norm": 3.573741549123141, + "learning_rate": 7.152777777777778e-05, + "loss": 1.1396, + "step": 206 + }, + { + "epoch": 0.07231009907874153, + "grad_norm": 3.296990311359108, + "learning_rate": 7.222222222222222e-05, + "loss": 0.8695, + "step": 208 + }, + { + "epoch": 0.07300538849296019, + "grad_norm": 6.769659823038884, + "learning_rate": 7.291666666666667e-05, + "loss": 1.0511, + "step": 210 + }, + { + "epoch": 0.07370067790717887, + "grad_norm": 1.6695233666860303, + "learning_rate": 7.361111111111111e-05, + "loss": 0.8174, + "step": 212 + }, + { + "epoch": 0.07439596732139753, + "grad_norm": 1.3543755216281146, + "learning_rate": 7.430555555555557e-05, + "loss": 0.7137, + "step": 214 + }, + { + "epoch": 0.0750912567356162, + "grad_norm": 4.861063813937456, + "learning_rate": 7.500000000000001e-05, + "loss": 1.0132, + "step": 216 + }, + { + "epoch": 0.07578654614983486, + "grad_norm": 5.715913176528681, + "learning_rate": 7.569444444444445e-05, + "loss": 1.1657, + "step": 218 + }, + { + "epoch": 0.07648183556405354, + "grad_norm": 4.0193839358302235, + "learning_rate": 7.638888888888889e-05, + "loss": 1.0547, + "step": 220 + }, + { + "epoch": 0.0771771249782722, + "grad_norm": 2.26849134517291, + "learning_rate": 7.708333333333334e-05, + "loss": 0.9073, + "step": 222 + }, + { + "epoch": 0.07787241439249087, + "grad_norm": 4.570943697810998, + "learning_rate": 7.777777777777778e-05, + "loss": 1.3726, + "step": 224 + }, + { + "epoch": 0.07856770380670955, + "grad_norm": 1.1942436910880105, + "learning_rate": 7.847222222222222e-05, + "loss": 0.8146, + "step": 226 + }, + { + "epoch": 0.07926299322092821, + "grad_norm": 2.111849588751211, + "learning_rate": 7.916666666666666e-05, + "loss": 1.1157, + "step": 228 + }, + { + "epoch": 0.07995828263514689, + "grad_norm": 1.0283088880069582, + "learning_rate": 7.986111111111112e-05, + "loss": 0.767, + "step": 230 + }, + { + "epoch": 0.08065357204936555, + "grad_norm": 1.2834055069208525, + "learning_rate": 8.055555555555556e-05, + "loss": 0.6625, + "step": 232 + }, + { + "epoch": 0.08134886146358422, + "grad_norm": 1.3772942873595098, + "learning_rate": 8.125000000000001e-05, + "loss": 0.8065, + "step": 234 + }, + { + "epoch": 0.08204415087780288, + "grad_norm": 1.5113456549735176, + "learning_rate": 8.194444444444445e-05, + "loss": 0.8606, + "step": 236 + }, + { + "epoch": 0.08273944029202156, + "grad_norm": 1.5765846352838255, + "learning_rate": 8.263888888888889e-05, + "loss": 0.8335, + "step": 238 + }, + { + "epoch": 0.08343472970624022, + "grad_norm": 2.4873462478329404, + "learning_rate": 8.333333333333334e-05, + "loss": 0.9705, + "step": 240 + }, + { + "epoch": 0.0841300191204589, + "grad_norm": 1.2369219925635513, + "learning_rate": 8.402777777777778e-05, + "loss": 0.6061, + "step": 242 + }, + { + "epoch": 0.08482530853467755, + "grad_norm": 2.542132212473201, + "learning_rate": 8.472222222222222e-05, + "loss": 0.9142, + "step": 244 + }, + { + "epoch": 0.08552059794889623, + "grad_norm": 2.0301734217803022, + "learning_rate": 8.541666666666666e-05, + "loss": 0.8997, + "step": 246 + }, + { + "epoch": 0.08621588736311489, + "grad_norm": 1.8605316982945626, + "learning_rate": 8.611111111111112e-05, + "loss": 1.005, + "step": 248 + }, + { + "epoch": 0.08691117677733357, + "grad_norm": 1.193555257951713, + "learning_rate": 8.680555555555556e-05, + "loss": 0.8617, + "step": 250 + }, + { + "epoch": 0.08760646619155224, + "grad_norm": 1.243815428863678, + "learning_rate": 8.75e-05, + "loss": 0.6261, + "step": 252 + }, + { + "epoch": 0.0883017556057709, + "grad_norm": 1.6487754861704442, + "learning_rate": 8.819444444444445e-05, + "loss": 0.9219, + "step": 254 + }, + { + "epoch": 0.08899704501998958, + "grad_norm": 1.1768410857322613, + "learning_rate": 8.888888888888889e-05, + "loss": 0.8563, + "step": 256 + }, + { + "epoch": 0.08969233443420824, + "grad_norm": 1.1155265191420587, + "learning_rate": 8.958333333333335e-05, + "loss": 0.998, + "step": 258 + }, + { + "epoch": 0.09038762384842691, + "grad_norm": 1.4432456616674065, + "learning_rate": 9.027777777777779e-05, + "loss": 0.8755, + "step": 260 + }, + { + "epoch": 0.09108291326264557, + "grad_norm": 1.6013486668654413, + "learning_rate": 9.097222222222223e-05, + "loss": 0.6998, + "step": 262 + }, + { + "epoch": 0.09177820267686425, + "grad_norm": 0.7869968770186737, + "learning_rate": 9.166666666666667e-05, + "loss": 0.7574, + "step": 264 + }, + { + "epoch": 0.09247349209108291, + "grad_norm": 2.1117903903864566, + "learning_rate": 9.236111111111112e-05, + "loss": 0.8436, + "step": 266 + }, + { + "epoch": 0.09316878150530158, + "grad_norm": 1.3582999584721895, + "learning_rate": 9.305555555555556e-05, + "loss": 0.8503, + "step": 268 + }, + { + "epoch": 0.09386407091952025, + "grad_norm": 1.5674581009005415, + "learning_rate": 9.375e-05, + "loss": 0.9561, + "step": 270 + }, + { + "epoch": 0.09455936033373892, + "grad_norm": 1.0274246934159952, + "learning_rate": 9.444444444444444e-05, + "loss": 0.7537, + "step": 272 + }, + { + "epoch": 0.09525464974795758, + "grad_norm": 0.9595343432519174, + "learning_rate": 9.513888888888888e-05, + "loss": 0.7855, + "step": 274 + }, + { + "epoch": 0.09594993916217626, + "grad_norm": 1.3313115114367815, + "learning_rate": 9.583333333333334e-05, + "loss": 0.7009, + "step": 276 + }, + { + "epoch": 0.09664522857639492, + "grad_norm": 1.4409463331317498, + "learning_rate": 9.652777777777779e-05, + "loss": 1.0332, + "step": 278 + }, + { + "epoch": 0.09734051799061359, + "grad_norm": 1.5445848213023137, + "learning_rate": 9.722222222222223e-05, + "loss": 0.7352, + "step": 280 + }, + { + "epoch": 0.09803580740483227, + "grad_norm": 1.855518620927316, + "learning_rate": 9.791666666666667e-05, + "loss": 0.7191, + "step": 282 + }, + { + "epoch": 0.09873109681905093, + "grad_norm": 1.4033396985161997, + "learning_rate": 9.861111111111112e-05, + "loss": 0.7886, + "step": 284 + }, + { + "epoch": 0.0994263862332696, + "grad_norm": 1.9951521438049904, + "learning_rate": 9.930555555555556e-05, + "loss": 0.902, + "step": 286 + }, + { + "epoch": 0.10012167564748826, + "grad_norm": 1.1360934228431687, + "learning_rate": 0.0001, + "loss": 0.8655, + "step": 288 + }, + { + "epoch": 0.10081696506170694, + "grad_norm": 1.1225735433900375, + "learning_rate": 0.00010069444444444445, + "loss": 0.6851, + "step": 290 + }, + { + "epoch": 0.1015122544759256, + "grad_norm": 0.770446891371583, + "learning_rate": 0.00010138888888888889, + "loss": 0.7775, + "step": 292 + }, + { + "epoch": 0.10220754389014428, + "grad_norm": 0.797064180835607, + "learning_rate": 0.00010208333333333333, + "loss": 0.6567, + "step": 294 + }, + { + "epoch": 0.10290283330436294, + "grad_norm": 0.9876188134326442, + "learning_rate": 0.00010277777777777778, + "loss": 0.7299, + "step": 296 + }, + { + "epoch": 0.10359812271858161, + "grad_norm": 0.799601623643537, + "learning_rate": 0.00010347222222222223, + "loss": 0.7891, + "step": 298 + }, + { + "epoch": 0.10429341213280027, + "grad_norm": 0.8791512281362982, + "learning_rate": 0.00010416666666666667, + "loss": 0.677, + "step": 300 + }, + { + "epoch": 0.10429341213280027, + "eval_loss": 0.6939894556999207, + "eval_runtime": 709.5268, + "eval_samples_per_second": 6.824, + "eval_steps_per_second": 0.214, + "step": 300 + }, + { + "epoch": 0.10498870154701895, + "grad_norm": 1.329564645811689, + "learning_rate": 0.00010486111111111113, + "loss": 0.7511, + "step": 302 + }, + { + "epoch": 0.10568399096123761, + "grad_norm": 0.7130415058241142, + "learning_rate": 0.00010555555555555557, + "loss": 0.709, + "step": 304 + }, + { + "epoch": 0.10637928037545628, + "grad_norm": 1.1294733411370705, + "learning_rate": 0.00010625000000000001, + "loss": 0.7781, + "step": 306 + }, + { + "epoch": 0.10707456978967496, + "grad_norm": 0.581727680778003, + "learning_rate": 0.00010694444444444445, + "loss": 0.6296, + "step": 308 + }, + { + "epoch": 0.10776985920389362, + "grad_norm": 0.9855391514311871, + "learning_rate": 0.00010763888888888889, + "loss": 0.7852, + "step": 310 + }, + { + "epoch": 0.1084651486181123, + "grad_norm": 0.5708379609857769, + "learning_rate": 0.00010833333333333333, + "loss": 0.6759, + "step": 312 + }, + { + "epoch": 0.10916043803233096, + "grad_norm": 0.7243330859752051, + "learning_rate": 0.00010902777777777777, + "loss": 0.6326, + "step": 314 + }, + { + "epoch": 0.10985572744654963, + "grad_norm": 1.3922163003264714, + "learning_rate": 0.00010972222222222224, + "loss": 0.5406, + "step": 316 + }, + { + "epoch": 0.11055101686076829, + "grad_norm": 2.604851740418153, + "learning_rate": 0.00011041666666666668, + "loss": 0.8013, + "step": 318 + }, + { + "epoch": 0.11124630627498697, + "grad_norm": 1.83511037983023, + "learning_rate": 0.00011111111111111112, + "loss": 0.8048, + "step": 320 + }, + { + "epoch": 0.11194159568920563, + "grad_norm": 1.6737764614655666, + "learning_rate": 0.00011180555555555556, + "loss": 0.6943, + "step": 322 + }, + { + "epoch": 0.1126368851034243, + "grad_norm": 1.077667781888673, + "learning_rate": 0.00011250000000000001, + "loss": 0.8054, + "step": 324 + }, + { + "epoch": 0.11333217451764296, + "grad_norm": 0.5597693838209001, + "learning_rate": 0.00011319444444444445, + "loss": 0.6251, + "step": 326 + }, + { + "epoch": 0.11402746393186164, + "grad_norm": 0.5636865078063477, + "learning_rate": 0.00011388888888888889, + "loss": 0.6832, + "step": 328 + }, + { + "epoch": 0.1147227533460803, + "grad_norm": 0.6445176566556912, + "learning_rate": 0.00011458333333333333, + "loss": 0.6661, + "step": 330 + }, + { + "epoch": 0.11541804276029898, + "grad_norm": 0.607532412895966, + "learning_rate": 0.00011527777777777777, + "loss": 0.7026, + "step": 332 + }, + { + "epoch": 0.11611333217451764, + "grad_norm": 1.0496949694240345, + "learning_rate": 0.00011597222222222224, + "loss": 0.6451, + "step": 334 + }, + { + "epoch": 0.11680862158873631, + "grad_norm": 0.9469233272179363, + "learning_rate": 0.00011666666666666668, + "loss": 0.6694, + "step": 336 + }, + { + "epoch": 0.11750391100295499, + "grad_norm": 1.3789882614528595, + "learning_rate": 0.00011736111111111112, + "loss": 0.7031, + "step": 338 + }, + { + "epoch": 0.11819920041717365, + "grad_norm": 1.2016589928587922, + "learning_rate": 0.00011805555555555556, + "loss": 0.6676, + "step": 340 + }, + { + "epoch": 0.11889448983139232, + "grad_norm": 1.3112845410865746, + "learning_rate": 0.00011875, + "loss": 0.7236, + "step": 342 + }, + { + "epoch": 0.11958977924561098, + "grad_norm": 0.6278789052805739, + "learning_rate": 0.00011944444444444445, + "loss": 0.6249, + "step": 344 + }, + { + "epoch": 0.12028506865982966, + "grad_norm": 0.5405148902553805, + "learning_rate": 0.0001201388888888889, + "loss": 0.6412, + "step": 346 + }, + { + "epoch": 0.12098035807404832, + "grad_norm": 1.6923616138961255, + "learning_rate": 0.00012083333333333333, + "loss": 0.7017, + "step": 348 + }, + { + "epoch": 0.121675647488267, + "grad_norm": 1.5994113095813072, + "learning_rate": 0.00012152777777777777, + "loss": 0.7075, + "step": 350 + }, + { + "epoch": 0.12237093690248566, + "grad_norm": 2.3083516502461783, + "learning_rate": 0.00012222222222222224, + "loss": 0.7755, + "step": 352 + }, + { + "epoch": 0.12306622631670433, + "grad_norm": 0.8769167165306447, + "learning_rate": 0.00012291666666666668, + "loss": 0.7428, + "step": 354 + }, + { + "epoch": 0.12376151573092299, + "grad_norm": 0.4456469638797518, + "learning_rate": 0.00012361111111111112, + "loss": 0.7002, + "step": 356 + }, + { + "epoch": 0.12445680514514167, + "grad_norm": 0.8199993647792723, + "learning_rate": 0.00012430555555555556, + "loss": 0.7222, + "step": 358 + }, + { + "epoch": 0.12515209455936033, + "grad_norm": 0.3741084955970339, + "learning_rate": 0.000125, + "loss": 0.6821, + "step": 360 + }, + { + "epoch": 0.125847383973579, + "grad_norm": 0.2972203241099783, + "learning_rate": 0.00012569444444444444, + "loss": 0.7083, + "step": 362 + }, + { + "epoch": 0.12654267338779768, + "grad_norm": 0.40651740632246575, + "learning_rate": 0.00012638888888888888, + "loss": 0.7144, + "step": 364 + }, + { + "epoch": 0.12723796280201635, + "grad_norm": 0.4388093199704831, + "learning_rate": 0.00012708333333333332, + "loss": 0.6863, + "step": 366 + }, + { + "epoch": 0.127933252216235, + "grad_norm": 0.45131267837810835, + "learning_rate": 0.00012777777777777776, + "loss": 0.6329, + "step": 368 + }, + { + "epoch": 0.12862854163045367, + "grad_norm": 0.3837830352665476, + "learning_rate": 0.00012847222222222223, + "loss": 0.6938, + "step": 370 + }, + { + "epoch": 0.12932383104467235, + "grad_norm": 0.6378624076702905, + "learning_rate": 0.00012916666666666667, + "loss": 0.6433, + "step": 372 + }, + { + "epoch": 0.13001912045889102, + "grad_norm": 0.41344403509072675, + "learning_rate": 0.0001298611111111111, + "loss": 0.6892, + "step": 374 + }, + { + "epoch": 0.13071440987310967, + "grad_norm": 1.3428471718098582, + "learning_rate": 0.00013055555555555555, + "loss": 0.7793, + "step": 376 + }, + { + "epoch": 0.13140969928732835, + "grad_norm": 0.6202275876483008, + "learning_rate": 0.00013125000000000002, + "loss": 0.6836, + "step": 378 + }, + { + "epoch": 0.13210498870154702, + "grad_norm": 0.774014383396004, + "learning_rate": 0.00013194444444444446, + "loss": 0.701, + "step": 380 + }, + { + "epoch": 0.1328002781157657, + "grad_norm": 1.0650744092292224, + "learning_rate": 0.0001326388888888889, + "loss": 0.6562, + "step": 382 + }, + { + "epoch": 0.13349556752998434, + "grad_norm": 0.5540168492927294, + "learning_rate": 0.00013333333333333334, + "loss": 0.6267, + "step": 384 + }, + { + "epoch": 0.13419085694420302, + "grad_norm": 0.6403086140920178, + "learning_rate": 0.00013402777777777778, + "loss": 0.6268, + "step": 386 + }, + { + "epoch": 0.1348861463584217, + "grad_norm": 0.9197218298114509, + "learning_rate": 0.00013472222222222225, + "loss": 0.7208, + "step": 388 + }, + { + "epoch": 0.13558143577264037, + "grad_norm": 0.4235387152144674, + "learning_rate": 0.0001354166666666667, + "loss": 0.6057, + "step": 390 + }, + { + "epoch": 0.13627672518685904, + "grad_norm": 0.425648636635043, + "learning_rate": 0.00013611111111111113, + "loss": 0.6387, + "step": 392 + }, + { + "epoch": 0.1369720146010777, + "grad_norm": 1.034952396366508, + "learning_rate": 0.00013680555555555557, + "loss": 0.7307, + "step": 394 + }, + { + "epoch": 0.13766730401529637, + "grad_norm": 0.8865505732510678, + "learning_rate": 0.0001375, + "loss": 0.6547, + "step": 396 + }, + { + "epoch": 0.13836259342951504, + "grad_norm": 0.6490094573088415, + "learning_rate": 0.00013819444444444445, + "loss": 0.6909, + "step": 398 + }, + { + "epoch": 0.13905788284373372, + "grad_norm": 0.8592713330921486, + "learning_rate": 0.0001388888888888889, + "loss": 0.6442, + "step": 400 + }, + { + "epoch": 0.13975317225795236, + "grad_norm": 1.0279375953862069, + "learning_rate": 0.00013958333333333333, + "loss": 0.6907, + "step": 402 + }, + { + "epoch": 0.14044846167217104, + "grad_norm": 0.6151057351983696, + "learning_rate": 0.00014027777777777777, + "loss": 0.697, + "step": 404 + }, + { + "epoch": 0.1411437510863897, + "grad_norm": 0.7417879717121144, + "learning_rate": 0.00014097222222222224, + "loss": 0.698, + "step": 406 + }, + { + "epoch": 0.1418390405006084, + "grad_norm": 0.5161453091859882, + "learning_rate": 0.00014166666666666668, + "loss": 0.6915, + "step": 408 + }, + { + "epoch": 0.14253432991482703, + "grad_norm": 0.5667521096080546, + "learning_rate": 0.00014236111111111112, + "loss": 0.6609, + "step": 410 + }, + { + "epoch": 0.1432296193290457, + "grad_norm": 0.7560317583703429, + "learning_rate": 0.00014305555555555556, + "loss": 0.6392, + "step": 412 + }, + { + "epoch": 0.14392490874326438, + "grad_norm": 0.5456303981546313, + "learning_rate": 0.00014375, + "loss": 0.7561, + "step": 414 + }, + { + "epoch": 0.14462019815748306, + "grad_norm": 0.4218469018151631, + "learning_rate": 0.00014444444444444444, + "loss": 0.675, + "step": 416 + }, + { + "epoch": 0.14531548757170173, + "grad_norm": 0.3790517974518404, + "learning_rate": 0.00014513888888888888, + "loss": 0.6697, + "step": 418 + }, + { + "epoch": 0.14601077698592038, + "grad_norm": 0.36495171567914964, + "learning_rate": 0.00014583333333333335, + "loss": 0.6467, + "step": 420 + }, + { + "epoch": 0.14670606640013906, + "grad_norm": 0.3793520501177419, + "learning_rate": 0.00014652777777777779, + "loss": 0.6234, + "step": 422 + }, + { + "epoch": 0.14740135581435773, + "grad_norm": 0.6214905371013544, + "learning_rate": 0.00014722222222222223, + "loss": 0.64, + "step": 424 + }, + { + "epoch": 0.1480966452285764, + "grad_norm": 0.4103438113660832, + "learning_rate": 0.0001479166666666667, + "loss": 0.6174, + "step": 426 + }, + { + "epoch": 0.14879193464279505, + "grad_norm": 0.5802311029669485, + "learning_rate": 0.00014861111111111113, + "loss": 0.6941, + "step": 428 + }, + { + "epoch": 0.14948722405701373, + "grad_norm": 0.4876572424583591, + "learning_rate": 0.00014930555555555557, + "loss": 0.6178, + "step": 430 + }, + { + "epoch": 0.1501825134712324, + "grad_norm": 0.6252220373472688, + "learning_rate": 0.00015000000000000001, + "loss": 0.692, + "step": 432 + }, + { + "epoch": 0.15087780288545108, + "grad_norm": 1.516758455176553, + "learning_rate": 0.00015069444444444445, + "loss": 0.6812, + "step": 434 + }, + { + "epoch": 0.15157309229966973, + "grad_norm": 0.48294685446689867, + "learning_rate": 0.0001513888888888889, + "loss": 0.7085, + "step": 436 + }, + { + "epoch": 0.1522683817138884, + "grad_norm": 0.414196721150167, + "learning_rate": 0.00015208333333333333, + "loss": 0.673, + "step": 438 + }, + { + "epoch": 0.15296367112810708, + "grad_norm": 0.7294881062503469, + "learning_rate": 0.00015277777777777777, + "loss": 0.6415, + "step": 440 + }, + { + "epoch": 0.15365896054232575, + "grad_norm": 0.4846932912054438, + "learning_rate": 0.00015347222222222224, + "loss": 0.6644, + "step": 442 + }, + { + "epoch": 0.1543542499565444, + "grad_norm": 0.6067400167426414, + "learning_rate": 0.00015416666666666668, + "loss": 0.6816, + "step": 444 + }, + { + "epoch": 0.15504953937076307, + "grad_norm": 0.5586278026791864, + "learning_rate": 0.00015486111111111112, + "loss": 0.6223, + "step": 446 + }, + { + "epoch": 0.15574482878498175, + "grad_norm": 0.3947236166856149, + "learning_rate": 0.00015555555555555556, + "loss": 0.7297, + "step": 448 + }, + { + "epoch": 0.15644011819920042, + "grad_norm": 0.371457756887947, + "learning_rate": 0.00015625, + "loss": 0.6099, + "step": 450 + }, + { + "epoch": 0.15644011819920042, + "eval_loss": 0.6634477376937866, + "eval_runtime": 706.8027, + "eval_samples_per_second": 6.851, + "eval_steps_per_second": 0.215, + "step": 450 + }, + { + "epoch": 0.1571354076134191, + "grad_norm": 0.4157928192338373, + "learning_rate": 0.00015694444444444444, + "loss": 0.7163, + "step": 452 + }, + { + "epoch": 0.15783069702763775, + "grad_norm": 0.6318513446857751, + "learning_rate": 0.00015763888888888888, + "loss": 0.658, + "step": 454 + }, + { + "epoch": 0.15852598644185642, + "grad_norm": 0.3188170086808347, + "learning_rate": 0.00015833333333333332, + "loss": 0.5966, + "step": 456 + }, + { + "epoch": 0.1592212758560751, + "grad_norm": 0.4873146052629784, + "learning_rate": 0.00015902777777777776, + "loss": 0.687, + "step": 458 + }, + { + "epoch": 0.15991656527029377, + "grad_norm": 0.3939618900754228, + "learning_rate": 0.00015972222222222223, + "loss": 0.6704, + "step": 460 + }, + { + "epoch": 0.16061185468451242, + "grad_norm": 0.43442241310529234, + "learning_rate": 0.00016041666666666667, + "loss": 0.6941, + "step": 462 + }, + { + "epoch": 0.1613071440987311, + "grad_norm": 0.5944395304786771, + "learning_rate": 0.0001611111111111111, + "loss": 0.5934, + "step": 464 + }, + { + "epoch": 0.16200243351294977, + "grad_norm": 0.6186667715273749, + "learning_rate": 0.00016180555555555555, + "loss": 0.6604, + "step": 466 + }, + { + "epoch": 0.16269772292716844, + "grad_norm": 0.8945416923537124, + "learning_rate": 0.00016250000000000002, + "loss": 0.6224, + "step": 468 + }, + { + "epoch": 0.1633930123413871, + "grad_norm": 1.0526200270890014, + "learning_rate": 0.00016319444444444446, + "loss": 0.616, + "step": 470 + }, + { + "epoch": 0.16408830175560576, + "grad_norm": 0.4575985966727194, + "learning_rate": 0.0001638888888888889, + "loss": 0.6591, + "step": 472 + }, + { + "epoch": 0.16478359116982444, + "grad_norm": 0.4499931204645402, + "learning_rate": 0.00016458333333333334, + "loss": 0.6644, + "step": 474 + }, + { + "epoch": 0.16547888058404311, + "grad_norm": 0.8365574384741885, + "learning_rate": 0.00016527777777777778, + "loss": 0.6503, + "step": 476 + }, + { + "epoch": 0.1661741699982618, + "grad_norm": 0.5265284650577726, + "learning_rate": 0.00016597222222222225, + "loss": 0.557, + "step": 478 + }, + { + "epoch": 0.16686945941248044, + "grad_norm": 0.6004742828917694, + "learning_rate": 0.0001666666666666667, + "loss": 0.696, + "step": 480 + }, + { + "epoch": 0.1675647488266991, + "grad_norm": 0.8653134209549845, + "learning_rate": 0.00016736111111111113, + "loss": 0.6544, + "step": 482 + }, + { + "epoch": 0.1682600382409178, + "grad_norm": 1.033230873418064, + "learning_rate": 0.00016805555555555557, + "loss": 0.641, + "step": 484 + }, + { + "epoch": 0.16895532765513646, + "grad_norm": 0.45457193405665913, + "learning_rate": 0.00016875, + "loss": 0.5952, + "step": 486 + }, + { + "epoch": 0.1696506170693551, + "grad_norm": 0.7413902971651539, + "learning_rate": 0.00016944444444444445, + "loss": 0.6306, + "step": 488 + }, + { + "epoch": 0.17034590648357378, + "grad_norm": 0.5808764628223875, + "learning_rate": 0.0001701388888888889, + "loss": 0.6714, + "step": 490 + }, + { + "epoch": 0.17104119589779246, + "grad_norm": 0.42505370383777924, + "learning_rate": 0.00017083333333333333, + "loss": 0.6432, + "step": 492 + }, + { + "epoch": 0.17173648531201113, + "grad_norm": 0.9403542369255028, + "learning_rate": 0.00017152777777777777, + "loss": 0.626, + "step": 494 + }, + { + "epoch": 0.17243177472622978, + "grad_norm": 0.41714707593148775, + "learning_rate": 0.00017222222222222224, + "loss": 0.6132, + "step": 496 + }, + { + "epoch": 0.17312706414044846, + "grad_norm": 0.6660896849726371, + "learning_rate": 0.00017291666666666668, + "loss": 0.7009, + "step": 498 + }, + { + "epoch": 0.17382235355466713, + "grad_norm": 0.5079993412341118, + "learning_rate": 0.00017361111111111112, + "loss": 0.6808, + "step": 500 + }, + { + "epoch": 0.1745176429688858, + "grad_norm": 0.3426487947129772, + "learning_rate": 0.00017430555555555556, + "loss": 0.687, + "step": 502 + }, + { + "epoch": 0.17521293238310448, + "grad_norm": 0.7316051797581208, + "learning_rate": 0.000175, + "loss": 0.686, + "step": 504 + }, + { + "epoch": 0.17590822179732313, + "grad_norm": 0.4619785653282459, + "learning_rate": 0.00017569444444444444, + "loss": 0.7019, + "step": 506 + }, + { + "epoch": 0.1766035112115418, + "grad_norm": 0.47786977912472967, + "learning_rate": 0.0001763888888888889, + "loss": 0.7097, + "step": 508 + }, + { + "epoch": 0.17729880062576048, + "grad_norm": 0.4204398291864812, + "learning_rate": 0.00017708333333333335, + "loss": 0.6715, + "step": 510 + }, + { + "epoch": 0.17799409003997915, + "grad_norm": 0.5257761541709909, + "learning_rate": 0.00017777777777777779, + "loss": 0.6675, + "step": 512 + }, + { + "epoch": 0.1786893794541978, + "grad_norm": 0.5752239420884688, + "learning_rate": 0.00017847222222222225, + "loss": 0.5847, + "step": 514 + }, + { + "epoch": 0.17938466886841647, + "grad_norm": 0.5611432017880666, + "learning_rate": 0.0001791666666666667, + "loss": 0.5978, + "step": 516 + }, + { + "epoch": 0.18007995828263515, + "grad_norm": 0.5147097358785945, + "learning_rate": 0.00017986111111111113, + "loss": 0.641, + "step": 518 + }, + { + "epoch": 0.18077524769685382, + "grad_norm": 0.4387330962078066, + "learning_rate": 0.00018055555555555557, + "loss": 0.5771, + "step": 520 + }, + { + "epoch": 0.18147053711107247, + "grad_norm": 0.5712526440788663, + "learning_rate": 0.00018125000000000001, + "loss": 0.6212, + "step": 522 + }, + { + "epoch": 0.18216582652529115, + "grad_norm": 0.6357133907029916, + "learning_rate": 0.00018194444444444445, + "loss": 0.5981, + "step": 524 + }, + { + "epoch": 0.18286111593950982, + "grad_norm": 1.2129620643054042, + "learning_rate": 0.0001826388888888889, + "loss": 0.5848, + "step": 526 + }, + { + "epoch": 0.1835564053537285, + "grad_norm": 1.651599276688714, + "learning_rate": 0.00018333333333333334, + "loss": 0.7089, + "step": 528 + }, + { + "epoch": 0.18425169476794717, + "grad_norm": 0.9051688342434142, + "learning_rate": 0.00018402777777777778, + "loss": 0.7255, + "step": 530 + }, + { + "epoch": 0.18494698418216582, + "grad_norm": 0.6932441010863684, + "learning_rate": 0.00018472222222222224, + "loss": 0.6497, + "step": 532 + }, + { + "epoch": 0.1856422735963845, + "grad_norm": 1.2163006408955903, + "learning_rate": 0.00018541666666666668, + "loss": 0.7585, + "step": 534 + }, + { + "epoch": 0.18633756301060317, + "grad_norm": 0.4387074048377486, + "learning_rate": 0.00018611111111111112, + "loss": 0.6541, + "step": 536 + }, + { + "epoch": 0.18703285242482184, + "grad_norm": 0.49430581216479236, + "learning_rate": 0.00018680555555555556, + "loss": 0.6489, + "step": 538 + }, + { + "epoch": 0.1877281418390405, + "grad_norm": 0.47561442420926275, + "learning_rate": 0.0001875, + "loss": 0.6406, + "step": 540 + }, + { + "epoch": 0.18842343125325917, + "grad_norm": 0.7046092923664611, + "learning_rate": 0.00018819444444444444, + "loss": 0.6099, + "step": 542 + }, + { + "epoch": 0.18911872066747784, + "grad_norm": 0.46256136269201026, + "learning_rate": 0.00018888888888888888, + "loss": 0.6992, + "step": 544 + }, + { + "epoch": 0.18981401008169652, + "grad_norm": 0.5489877082982352, + "learning_rate": 0.00018958333333333332, + "loss": 0.5817, + "step": 546 + }, + { + "epoch": 0.19050929949591516, + "grad_norm": 0.46129441798908893, + "learning_rate": 0.00019027777777777776, + "loss": 0.645, + "step": 548 + }, + { + "epoch": 0.19120458891013384, + "grad_norm": 0.3724226655450749, + "learning_rate": 0.00019097222222222223, + "loss": 0.6177, + "step": 550 + }, + { + "epoch": 0.1918998783243525, + "grad_norm": 0.4625796323902992, + "learning_rate": 0.00019166666666666667, + "loss": 0.6702, + "step": 552 + }, + { + "epoch": 0.1925951677385712, + "grad_norm": 1.0142124821047231, + "learning_rate": 0.0001923611111111111, + "loss": 0.7173, + "step": 554 + }, + { + "epoch": 0.19329045715278984, + "grad_norm": 0.5452830720753045, + "learning_rate": 0.00019305555555555558, + "loss": 0.6897, + "step": 556 + }, + { + "epoch": 0.1939857465670085, + "grad_norm": 0.5723214484723252, + "learning_rate": 0.00019375000000000002, + "loss": 0.6495, + "step": 558 + }, + { + "epoch": 0.19468103598122719, + "grad_norm": 0.39925844595054966, + "learning_rate": 0.00019444444444444446, + "loss": 0.6479, + "step": 560 + }, + { + "epoch": 0.19537632539544586, + "grad_norm": 0.3575565088751118, + "learning_rate": 0.0001951388888888889, + "loss": 0.6593, + "step": 562 + }, + { + "epoch": 0.19607161480966454, + "grad_norm": 0.6119892689536569, + "learning_rate": 0.00019583333333333334, + "loss": 0.6831, + "step": 564 + }, + { + "epoch": 0.19676690422388318, + "grad_norm": 0.5076569073121309, + "learning_rate": 0.00019652777777777778, + "loss": 0.6294, + "step": 566 + }, + { + "epoch": 0.19746219363810186, + "grad_norm": 0.622226505121079, + "learning_rate": 0.00019722222222222225, + "loss": 0.5551, + "step": 568 + }, + { + "epoch": 0.19815748305232053, + "grad_norm": 0.4106526912254415, + "learning_rate": 0.0001979166666666667, + "loss": 0.6503, + "step": 570 + }, + { + "epoch": 0.1988527724665392, + "grad_norm": 0.47164751383243125, + "learning_rate": 0.00019861111111111113, + "loss": 0.6992, + "step": 572 + }, + { + "epoch": 0.19954806188075785, + "grad_norm": 0.492328312395826, + "learning_rate": 0.00019930555555555557, + "loss": 0.7183, + "step": 574 + }, + { + "epoch": 0.20024335129497653, + "grad_norm": 0.5087240677439067, + "learning_rate": 0.0002, + "loss": 0.6429, + "step": 576 + }, + { + "epoch": 0.2009386407091952, + "grad_norm": 0.9311216098504759, + "learning_rate": 0.00019999992632143608, + "loss": 0.6586, + "step": 578 + }, + { + "epoch": 0.20163393012341388, + "grad_norm": 0.38840935170189844, + "learning_rate": 0.00019999970528585288, + "loss": 0.5905, + "step": 580 + }, + { + "epoch": 0.20232921953763253, + "grad_norm": 0.5966472765038273, + "learning_rate": 0.0001999993368935761, + "loss": 0.7112, + "step": 582 + }, + { + "epoch": 0.2030245089518512, + "grad_norm": 0.535232520705813, + "learning_rate": 0.00019999882114514863, + "loss": 0.7036, + "step": 584 + }, + { + "epoch": 0.20371979836606988, + "grad_norm": 0.5039916125175515, + "learning_rate": 0.0001999981580413304, + "loss": 0.7485, + "step": 586 + }, + { + "epoch": 0.20441508778028855, + "grad_norm": 0.6733262892097686, + "learning_rate": 0.0001999973475830986, + "loss": 0.7312, + "step": 588 + }, + { + "epoch": 0.20511037719450723, + "grad_norm": 0.42805740684614807, + "learning_rate": 0.00019999638977164747, + "loss": 0.6356, + "step": 590 + }, + { + "epoch": 0.20580566660872587, + "grad_norm": 0.976918546573707, + "learning_rate": 0.00019999528460838844, + "loss": 0.666, + "step": 592 + }, + { + "epoch": 0.20650095602294455, + "grad_norm": 0.674463735133944, + "learning_rate": 0.00019999403209495, + "loss": 0.6735, + "step": 594 + }, + { + "epoch": 0.20719624543716322, + "grad_norm": 0.412232119296174, + "learning_rate": 0.00019999263223317786, + "loss": 0.6364, + "step": 596 + }, + { + "epoch": 0.2078915348513819, + "grad_norm": 0.3611034413524545, + "learning_rate": 0.0001999910850251348, + "loss": 0.6368, + "step": 598 + }, + { + "epoch": 0.20858682426560055, + "grad_norm": 0.542506398091656, + "learning_rate": 0.0001999893904731007, + "loss": 0.7292, + "step": 600 + }, + { + "epoch": 0.20858682426560055, + "eval_loss": 0.6517693400382996, + "eval_runtime": 707.4674, + "eval_samples_per_second": 6.844, + "eval_steps_per_second": 0.215, + "step": 600 + }, + { + "epoch": 0.20928211367981922, + "grad_norm": 0.4799286290563759, + "learning_rate": 0.0001999875485795727, + "loss": 0.6609, + "step": 602 + }, + { + "epoch": 0.2099774030940379, + "grad_norm": 0.41830446575524177, + "learning_rate": 0.0001999855593472649, + "loss": 0.6084, + "step": 604 + }, + { + "epoch": 0.21067269250825657, + "grad_norm": 0.8865562086549428, + "learning_rate": 0.00019998342277910856, + "loss": 0.6204, + "step": 606 + }, + { + "epoch": 0.21136798192247522, + "grad_norm": 0.5567410910026902, + "learning_rate": 0.00019998113887825206, + "loss": 0.7087, + "step": 608 + }, + { + "epoch": 0.2120632713366939, + "grad_norm": 0.4229098163428897, + "learning_rate": 0.000199978707648061, + "loss": 0.6403, + "step": 610 + }, + { + "epoch": 0.21275856075091257, + "grad_norm": 0.7793555918286379, + "learning_rate": 0.00019997612909211784, + "loss": 0.6147, + "step": 612 + }, + { + "epoch": 0.21345385016513124, + "grad_norm": 0.49302383416102263, + "learning_rate": 0.00019997340321422228, + "loss": 0.5771, + "step": 614 + }, + { + "epoch": 0.21414913957934992, + "grad_norm": 1.0807551778698754, + "learning_rate": 0.00019997053001839115, + "loss": 0.6538, + "step": 616 + }, + { + "epoch": 0.21484442899356856, + "grad_norm": 0.5935042706034646, + "learning_rate": 0.0001999675095088583, + "loss": 0.6058, + "step": 618 + }, + { + "epoch": 0.21553971840778724, + "grad_norm": 0.5151203960605611, + "learning_rate": 0.00019996434169007468, + "loss": 0.6138, + "step": 620 + }, + { + "epoch": 0.21623500782200591, + "grad_norm": 0.7837579499467073, + "learning_rate": 0.00019996102656670824, + "loss": 0.657, + "step": 622 + }, + { + "epoch": 0.2169302972362246, + "grad_norm": 0.5438202413527335, + "learning_rate": 0.0001999575641436441, + "loss": 0.6642, + "step": 624 + }, + { + "epoch": 0.21762558665044324, + "grad_norm": 0.5566641749580342, + "learning_rate": 0.00019995395442598435, + "loss": 0.6813, + "step": 626 + }, + { + "epoch": 0.2183208760646619, + "grad_norm": 0.9345190838089675, + "learning_rate": 0.0001999501974190482, + "loss": 0.684, + "step": 628 + }, + { + "epoch": 0.2190161654788806, + "grad_norm": 0.48677420225080537, + "learning_rate": 0.00019994629312837186, + "loss": 0.6481, + "step": 630 + }, + { + "epoch": 0.21971145489309926, + "grad_norm": 1.3826373483976924, + "learning_rate": 0.00019994224155970856, + "loss": 0.7222, + "step": 632 + }, + { + "epoch": 0.2204067443073179, + "grad_norm": 0.9031189580678588, + "learning_rate": 0.00019993804271902857, + "loss": 0.6809, + "step": 634 + }, + { + "epoch": 0.22110203372153658, + "grad_norm": 0.5674519795217096, + "learning_rate": 0.00019993369661251923, + "loss": 0.6184, + "step": 636 + }, + { + "epoch": 0.22179732313575526, + "grad_norm": 2.5294344265719135, + "learning_rate": 0.0001999292032465848, + "loss": 0.7686, + "step": 638 + }, + { + "epoch": 0.22249261254997393, + "grad_norm": 2.8855656605632047, + "learning_rate": 0.00019992456262784658, + "loss": 0.8215, + "step": 640 + }, + { + "epoch": 0.2231879019641926, + "grad_norm": 1.5331524159142917, + "learning_rate": 0.00019991977476314286, + "loss": 0.7057, + "step": 642 + }, + { + "epoch": 0.22388319137841126, + "grad_norm": 0.8086145005161695, + "learning_rate": 0.0001999148396595289, + "loss": 0.6289, + "step": 644 + }, + { + "epoch": 0.22457848079262993, + "grad_norm": 0.767389193699688, + "learning_rate": 0.00019990975732427693, + "loss": 0.6117, + "step": 646 + }, + { + "epoch": 0.2252737702068486, + "grad_norm": 0.9275190697426144, + "learning_rate": 0.0001999045277648761, + "loss": 0.6582, + "step": 648 + }, + { + "epoch": 0.22596905962106728, + "grad_norm": 0.8004230202091956, + "learning_rate": 0.00019989915098903257, + "loss": 0.5387, + "step": 650 + }, + { + "epoch": 0.22666434903528593, + "grad_norm": 0.8210833181388095, + "learning_rate": 0.0001998936270046694, + "loss": 0.5941, + "step": 652 + }, + { + "epoch": 0.2273596384495046, + "grad_norm": 2.1189675938584616, + "learning_rate": 0.00019988795581992656, + "loss": 0.7504, + "step": 654 + }, + { + "epoch": 0.22805492786372328, + "grad_norm": 0.5952032026226816, + "learning_rate": 0.000199882137443161, + "loss": 0.6643, + "step": 656 + }, + { + "epoch": 0.22875021727794195, + "grad_norm": 0.40481972159485846, + "learning_rate": 0.00019987617188294642, + "loss": 0.5225, + "step": 658 + }, + { + "epoch": 0.2294455066921606, + "grad_norm": 0.7478677085785272, + "learning_rate": 0.00019987005914807356, + "loss": 0.6561, + "step": 660 + }, + { + "epoch": 0.23014079610637928, + "grad_norm": 0.4468692254604696, + "learning_rate": 0.00019986379924754997, + "loss": 0.6262, + "step": 662 + }, + { + "epoch": 0.23083608552059795, + "grad_norm": 0.46697718493106893, + "learning_rate": 0.00019985739219060002, + "loss": 0.6178, + "step": 664 + }, + { + "epoch": 0.23153137493481663, + "grad_norm": 0.388728867903269, + "learning_rate": 0.000199850837986665, + "loss": 0.5544, + "step": 666 + }, + { + "epoch": 0.23222666434903527, + "grad_norm": 0.5731403139849517, + "learning_rate": 0.000199844136645403, + "loss": 0.5906, + "step": 668 + }, + { + "epoch": 0.23292195376325395, + "grad_norm": 0.7601215827849259, + "learning_rate": 0.0001998372881766889, + "loss": 0.6577, + "step": 670 + }, + { + "epoch": 0.23361724317747262, + "grad_norm": 0.8997786413980279, + "learning_rate": 0.00019983029259061446, + "loss": 0.6388, + "step": 672 + }, + { + "epoch": 0.2343125325916913, + "grad_norm": 0.519349430301096, + "learning_rate": 0.00019982314989748813, + "loss": 0.6561, + "step": 674 + }, + { + "epoch": 0.23500782200590997, + "grad_norm": 0.4918913590728881, + "learning_rate": 0.00019981586010783513, + "loss": 0.6176, + "step": 676 + }, + { + "epoch": 0.23570311142012862, + "grad_norm": 0.5324672662478441, + "learning_rate": 0.00019980842323239756, + "loss": 0.5801, + "step": 678 + }, + { + "epoch": 0.2363984008343473, + "grad_norm": 0.6375745879180794, + "learning_rate": 0.00019980083928213417, + "loss": 0.6885, + "step": 680 + }, + { + "epoch": 0.23709369024856597, + "grad_norm": 0.4317997282790841, + "learning_rate": 0.00019979310826822046, + "loss": 0.5727, + "step": 682 + }, + { + "epoch": 0.23778897966278464, + "grad_norm": 0.7933828103238656, + "learning_rate": 0.00019978523020204857, + "loss": 0.6703, + "step": 684 + }, + { + "epoch": 0.2384842690770033, + "grad_norm": 0.5465102255190097, + "learning_rate": 0.00019977720509522747, + "loss": 0.6675, + "step": 686 + }, + { + "epoch": 0.23917955849122197, + "grad_norm": 0.8356137363612883, + "learning_rate": 0.00019976903295958269, + "loss": 0.6558, + "step": 688 + }, + { + "epoch": 0.23987484790544064, + "grad_norm": 0.5190073187676806, + "learning_rate": 0.00019976071380715645, + "loss": 0.6779, + "step": 690 + }, + { + "epoch": 0.24057013731965932, + "grad_norm": 0.40561527338007225, + "learning_rate": 0.0001997522476502076, + "loss": 0.6687, + "step": 692 + }, + { + "epoch": 0.24126542673387796, + "grad_norm": 0.592821589706298, + "learning_rate": 0.0001997436345012117, + "loss": 0.6807, + "step": 694 + }, + { + "epoch": 0.24196071614809664, + "grad_norm": 0.686918345062074, + "learning_rate": 0.00019973487437286073, + "loss": 0.6831, + "step": 696 + }, + { + "epoch": 0.2426560055623153, + "grad_norm": 0.964075508243471, + "learning_rate": 0.00019972596727806346, + "loss": 0.665, + "step": 698 + }, + { + "epoch": 0.243351294976534, + "grad_norm": 0.739137434656244, + "learning_rate": 0.00019971691322994507, + "loss": 0.6387, + "step": 700 + }, + { + "epoch": 0.24404658439075266, + "grad_norm": 0.3978099419540589, + "learning_rate": 0.00019970771224184737, + "loss": 0.6143, + "step": 702 + }, + { + "epoch": 0.2447418738049713, + "grad_norm": 0.4997978607153984, + "learning_rate": 0.0001996983643273287, + "loss": 0.6083, + "step": 704 + }, + { + "epoch": 0.24543716321918999, + "grad_norm": 1.3443518380439796, + "learning_rate": 0.0001996888695001638, + "loss": 0.6711, + "step": 706 + }, + { + "epoch": 0.24613245263340866, + "grad_norm": 0.5424379336505594, + "learning_rate": 0.000199679227774344, + "loss": 0.6321, + "step": 708 + }, + { + "epoch": 0.24682774204762734, + "grad_norm": 0.7689235498835658, + "learning_rate": 0.00019966943916407712, + "loss": 0.6918, + "step": 710 + }, + { + "epoch": 0.24752303146184598, + "grad_norm": 0.6467240394468301, + "learning_rate": 0.00019965950368378734, + "loss": 0.6368, + "step": 712 + }, + { + "epoch": 0.24821832087606466, + "grad_norm": 0.48819289451999526, + "learning_rate": 0.00019964942134811532, + "loss": 0.5875, + "step": 714 + }, + { + "epoch": 0.24891361029028333, + "grad_norm": 1.1929427463467126, + "learning_rate": 0.00019963919217191807, + "loss": 0.6795, + "step": 716 + }, + { + "epoch": 0.249608899704502, + "grad_norm": 0.4182713825442439, + "learning_rate": 0.00019962881617026902, + "loss": 0.5835, + "step": 718 + }, + { + "epoch": 0.25030418911872065, + "grad_norm": 0.5770262516296942, + "learning_rate": 0.00019961829335845795, + "loss": 0.6299, + "step": 720 + }, + { + "epoch": 0.25099947853293936, + "grad_norm": 0.9135250550485389, + "learning_rate": 0.00019960762375199095, + "loss": 0.6844, + "step": 722 + }, + { + "epoch": 0.251694767947158, + "grad_norm": 0.5511234805517417, + "learning_rate": 0.0001995968073665905, + "loss": 0.5745, + "step": 724 + }, + { + "epoch": 0.25239005736137665, + "grad_norm": 0.49137872896877094, + "learning_rate": 0.00019958584421819528, + "loss": 0.698, + "step": 726 + }, + { + "epoch": 0.25308534677559535, + "grad_norm": 0.4437253322782162, + "learning_rate": 0.00019957473432296026, + "loss": 0.6864, + "step": 728 + }, + { + "epoch": 0.253780636189814, + "grad_norm": 0.5064381489074585, + "learning_rate": 0.0001995634776972567, + "loss": 0.5758, + "step": 730 + }, + { + "epoch": 0.2544759256040327, + "grad_norm": 0.5464655664741616, + "learning_rate": 0.00019955207435767201, + "loss": 0.6351, + "step": 732 + }, + { + "epoch": 0.25517121501825135, + "grad_norm": 0.44060524677853835, + "learning_rate": 0.00019954052432100982, + "loss": 0.6837, + "step": 734 + }, + { + "epoch": 0.25586650443247, + "grad_norm": 0.942390696980061, + "learning_rate": 0.00019952882760428998, + "loss": 0.6378, + "step": 736 + }, + { + "epoch": 0.2565617938466887, + "grad_norm": 0.4710023299938762, + "learning_rate": 0.00019951698422474836, + "loss": 0.6968, + "step": 738 + }, + { + "epoch": 0.25725708326090735, + "grad_norm": 0.4179809222387651, + "learning_rate": 0.00019950499419983707, + "loss": 0.5643, + "step": 740 + }, + { + "epoch": 0.257952372675126, + "grad_norm": 0.4446278865199289, + "learning_rate": 0.00019949285754722426, + "loss": 0.5089, + "step": 742 + }, + { + "epoch": 0.2586476620893447, + "grad_norm": 0.914728851966275, + "learning_rate": 0.00019948057428479418, + "loss": 0.7933, + "step": 744 + }, + { + "epoch": 0.25934295150356335, + "grad_norm": 0.47142275185055055, + "learning_rate": 0.00019946814443064703, + "loss": 0.6384, + "step": 746 + }, + { + "epoch": 0.26003824091778205, + "grad_norm": 0.720916103725334, + "learning_rate": 0.00019945556800309917, + "loss": 0.5957, + "step": 748 + }, + { + "epoch": 0.2607335303320007, + "grad_norm": 0.8550360126036364, + "learning_rate": 0.00019944284502068275, + "loss": 0.6454, + "step": 750 + }, + { + "epoch": 0.2607335303320007, + "eval_loss": 0.6373963952064514, + "eval_runtime": 728.7951, + "eval_samples_per_second": 6.644, + "eval_steps_per_second": 0.209, + "step": 750 + }, + { + "epoch": 0.26142881974621934, + "grad_norm": 0.5467512313200382, + "learning_rate": 0.0001994299755021461, + "loss": 0.5781, + "step": 752 + }, + { + "epoch": 0.26212410916043805, + "grad_norm": 0.41230384162224254, + "learning_rate": 0.0001994169594664533, + "loss": 0.6467, + "step": 754 + }, + { + "epoch": 0.2628193985746567, + "grad_norm": 0.5635895964904281, + "learning_rate": 0.00019940379693278448, + "loss": 0.6182, + "step": 756 + }, + { + "epoch": 0.2635146879888754, + "grad_norm": 0.6456168984233462, + "learning_rate": 0.0001993904879205355, + "loss": 0.6086, + "step": 758 + }, + { + "epoch": 0.26420997740309404, + "grad_norm": 0.5060399335833471, + "learning_rate": 0.00019937703244931815, + "loss": 0.6407, + "step": 760 + }, + { + "epoch": 0.2649052668173127, + "grad_norm": 0.5033297464646784, + "learning_rate": 0.00019936343053896004, + "loss": 0.6157, + "step": 762 + }, + { + "epoch": 0.2656005562315314, + "grad_norm": 0.3911665523252255, + "learning_rate": 0.00019934968220950458, + "loss": 0.6227, + "step": 764 + }, + { + "epoch": 0.26629584564575004, + "grad_norm": 1.7130937466256138, + "learning_rate": 0.00019933578748121086, + "loss": 0.5994, + "step": 766 + }, + { + "epoch": 0.2669911350599687, + "grad_norm": 0.5747338886603724, + "learning_rate": 0.00019932174637455382, + "loss": 0.6238, + "step": 768 + }, + { + "epoch": 0.2676864244741874, + "grad_norm": 0.6226324357252033, + "learning_rate": 0.00019930755891022398, + "loss": 0.6255, + "step": 770 + }, + { + "epoch": 0.26838171388840604, + "grad_norm": 0.5282488794229044, + "learning_rate": 0.00019929322510912756, + "loss": 0.5808, + "step": 772 + }, + { + "epoch": 0.26907700330262474, + "grad_norm": 0.5596904577167024, + "learning_rate": 0.0001992787449923865, + "loss": 0.5361, + "step": 774 + }, + { + "epoch": 0.2697722927168434, + "grad_norm": 1.0477422618379753, + "learning_rate": 0.00019926411858133824, + "loss": 0.54, + "step": 776 + }, + { + "epoch": 0.27046758213106203, + "grad_norm": 1.1314704495635823, + "learning_rate": 0.00019924934589753582, + "loss": 0.5869, + "step": 778 + }, + { + "epoch": 0.27116287154528074, + "grad_norm": 0.5426548544381972, + "learning_rate": 0.00019923442696274794, + "loss": 0.5951, + "step": 780 + }, + { + "epoch": 0.2718581609594994, + "grad_norm": 0.8480025293040686, + "learning_rate": 0.00019921936179895862, + "loss": 0.6003, + "step": 782 + }, + { + "epoch": 0.2725534503737181, + "grad_norm": 0.5729452380906337, + "learning_rate": 0.0001992041504283675, + "loss": 0.6526, + "step": 784 + }, + { + "epoch": 0.27324873978793673, + "grad_norm": 0.7362085286496177, + "learning_rate": 0.00019918879287338957, + "loss": 0.6776, + "step": 786 + }, + { + "epoch": 0.2739440292021554, + "grad_norm": 0.7440059372391256, + "learning_rate": 0.00019917328915665535, + "loss": 0.6486, + "step": 788 + }, + { + "epoch": 0.2746393186163741, + "grad_norm": 0.6110842206790659, + "learning_rate": 0.0001991576393010106, + "loss": 0.6226, + "step": 790 + }, + { + "epoch": 0.27533460803059273, + "grad_norm": 0.8002336898560896, + "learning_rate": 0.00019914184332951655, + "loss": 0.6215, + "step": 792 + }, + { + "epoch": 0.2760298974448114, + "grad_norm": 0.6761736356192558, + "learning_rate": 0.00019912590126544964, + "loss": 0.5988, + "step": 794 + }, + { + "epoch": 0.2767251868590301, + "grad_norm": 1.1005016630123619, + "learning_rate": 0.00019910981313230172, + "loss": 0.6213, + "step": 796 + }, + { + "epoch": 0.27742047627324873, + "grad_norm": 0.6513452605734942, + "learning_rate": 0.00019909357895377973, + "loss": 0.682, + "step": 798 + }, + { + "epoch": 0.27811576568746743, + "grad_norm": 0.8536492677008404, + "learning_rate": 0.0001990771987538059, + "loss": 0.707, + "step": 800 + }, + { + "epoch": 0.2788110551016861, + "grad_norm": 0.3362293750538688, + "learning_rate": 0.00019906067255651765, + "loss": 0.7108, + "step": 802 + }, + { + "epoch": 0.2795063445159047, + "grad_norm": 0.4792899916449288, + "learning_rate": 0.0001990440003862675, + "loss": 0.6055, + "step": 804 + }, + { + "epoch": 0.28020163393012343, + "grad_norm": 1.272937677307704, + "learning_rate": 0.00019902718226762304, + "loss": 0.6816, + "step": 806 + }, + { + "epoch": 0.2808969233443421, + "grad_norm": 0.30646692495778655, + "learning_rate": 0.00019901021822536704, + "loss": 0.688, + "step": 808 + }, + { + "epoch": 0.2815922127585608, + "grad_norm": 0.3035733218665055, + "learning_rate": 0.00019899310828449713, + "loss": 0.6746, + "step": 810 + }, + { + "epoch": 0.2822875021727794, + "grad_norm": 0.2763276026826459, + "learning_rate": 0.00019897585247022613, + "loss": 0.6632, + "step": 812 + }, + { + "epoch": 0.2829827915869981, + "grad_norm": 1.173118337900773, + "learning_rate": 0.00019895845080798166, + "loss": 0.6306, + "step": 814 + }, + { + "epoch": 0.2836780810012168, + "grad_norm": 0.4335278252167635, + "learning_rate": 0.0001989409033234063, + "loss": 0.6147, + "step": 816 + }, + { + "epoch": 0.2843733704154354, + "grad_norm": 0.3556694503062785, + "learning_rate": 0.00019892321004235755, + "loss": 0.5771, + "step": 818 + }, + { + "epoch": 0.28506865982965407, + "grad_norm": 0.9083240381897224, + "learning_rate": 0.00019890537099090768, + "loss": 0.5729, + "step": 820 + }, + { + "epoch": 0.2857639492438728, + "grad_norm": 0.5433346815141633, + "learning_rate": 0.00019888738619534385, + "loss": 0.5554, + "step": 822 + }, + { + "epoch": 0.2864592386580914, + "grad_norm": 0.5244705156138804, + "learning_rate": 0.0001988692556821679, + "loss": 0.6525, + "step": 824 + }, + { + "epoch": 0.2871545280723101, + "grad_norm": 0.7580866792170871, + "learning_rate": 0.00019885097947809648, + "loss": 0.6512, + "step": 826 + }, + { + "epoch": 0.28784981748652877, + "grad_norm": 0.7034554538404351, + "learning_rate": 0.00019883255761006082, + "loss": 0.5414, + "step": 828 + }, + { + "epoch": 0.2885451069007474, + "grad_norm": 0.6915575597289163, + "learning_rate": 0.00019881399010520688, + "loss": 0.6036, + "step": 830 + }, + { + "epoch": 0.2892403963149661, + "grad_norm": 0.6895372001781882, + "learning_rate": 0.00019879527699089524, + "loss": 0.5894, + "step": 832 + }, + { + "epoch": 0.28993568572918477, + "grad_norm": 0.7762412863407715, + "learning_rate": 0.00019877641829470094, + "loss": 0.7115, + "step": 834 + }, + { + "epoch": 0.29063097514340347, + "grad_norm": 0.5761220663639801, + "learning_rate": 0.00019875741404441367, + "loss": 0.6108, + "step": 836 + }, + { + "epoch": 0.2913262645576221, + "grad_norm": 0.47176943357070505, + "learning_rate": 0.00019873826426803755, + "loss": 0.634, + "step": 838 + }, + { + "epoch": 0.29202155397184076, + "grad_norm": 0.5985873148196751, + "learning_rate": 0.00019871896899379107, + "loss": 0.6528, + "step": 840 + }, + { + "epoch": 0.29271684338605947, + "grad_norm": 0.39514741111190665, + "learning_rate": 0.00019869952825010727, + "loss": 0.6034, + "step": 842 + }, + { + "epoch": 0.2934121328002781, + "grad_norm": 0.29787585594263405, + "learning_rate": 0.00019867994206563343, + "loss": 0.6063, + "step": 844 + }, + { + "epoch": 0.29410742221449676, + "grad_norm": 0.303320759302155, + "learning_rate": 0.00019866021046923118, + "loss": 0.6343, + "step": 846 + }, + { + "epoch": 0.29480271162871546, + "grad_norm": 0.33135450527244925, + "learning_rate": 0.00019864033348997645, + "loss": 0.6421, + "step": 848 + }, + { + "epoch": 0.2954980010429341, + "grad_norm": 0.553668190192523, + "learning_rate": 0.0001986203111571594, + "loss": 0.6503, + "step": 850 + }, + { + "epoch": 0.2961932904571528, + "grad_norm": 0.31948016623126946, + "learning_rate": 0.00019860014350028438, + "loss": 0.6259, + "step": 852 + }, + { + "epoch": 0.29688857987137146, + "grad_norm": 0.5325237443938606, + "learning_rate": 0.0001985798305490698, + "loss": 0.6207, + "step": 854 + }, + { + "epoch": 0.2975838692855901, + "grad_norm": 0.5093186589927414, + "learning_rate": 0.00019855937233344831, + "loss": 0.5397, + "step": 856 + }, + { + "epoch": 0.2982791586998088, + "grad_norm": 0.5220573948537062, + "learning_rate": 0.00019853876888356652, + "loss": 0.6237, + "step": 858 + }, + { + "epoch": 0.29897444811402746, + "grad_norm": 0.9861332892020862, + "learning_rate": 0.00019851802022978506, + "loss": 0.689, + "step": 860 + }, + { + "epoch": 0.2996697375282461, + "grad_norm": 0.464669721879274, + "learning_rate": 0.00019849712640267861, + "loss": 0.522, + "step": 862 + }, + { + "epoch": 0.3003650269424648, + "grad_norm": 0.9223435358714303, + "learning_rate": 0.00019847608743303567, + "loss": 0.7491, + "step": 864 + }, + { + "epoch": 0.30106031635668346, + "grad_norm": 0.5058775377593727, + "learning_rate": 0.00019845490335185866, + "loss": 0.562, + "step": 866 + }, + { + "epoch": 0.30175560577090216, + "grad_norm": 0.5517767811356443, + "learning_rate": 0.00019843357419036382, + "loss": 0.6162, + "step": 868 + }, + { + "epoch": 0.3024508951851208, + "grad_norm": 0.49255497197537723, + "learning_rate": 0.00019841209997998127, + "loss": 0.6803, + "step": 870 + }, + { + "epoch": 0.30314618459933945, + "grad_norm": 0.41553745561512617, + "learning_rate": 0.0001983904807523547, + "loss": 0.6415, + "step": 872 + }, + { + "epoch": 0.30384147401355815, + "grad_norm": 0.49551628457734653, + "learning_rate": 0.00019836871653934162, + "loss": 0.6176, + "step": 874 + }, + { + "epoch": 0.3045367634277768, + "grad_norm": 0.7489091107060393, + "learning_rate": 0.00019834680737301313, + "loss": 0.6337, + "step": 876 + }, + { + "epoch": 0.3052320528419955, + "grad_norm": 0.32312869533576805, + "learning_rate": 0.00019832475328565398, + "loss": 0.6135, + "step": 878 + }, + { + "epoch": 0.30592734225621415, + "grad_norm": 0.304002075332943, + "learning_rate": 0.00019830255430976242, + "loss": 0.5533, + "step": 880 + }, + { + "epoch": 0.3066226316704328, + "grad_norm": 0.4137621036041215, + "learning_rate": 0.00019828021047805022, + "loss": 0.573, + "step": 882 + }, + { + "epoch": 0.3073179210846515, + "grad_norm": 0.7506870255042438, + "learning_rate": 0.00019825772182344262, + "loss": 0.6971, + "step": 884 + }, + { + "epoch": 0.30801321049887015, + "grad_norm": 0.7069489041589112, + "learning_rate": 0.00019823508837907828, + "loss": 0.5848, + "step": 886 + }, + { + "epoch": 0.3087084999130888, + "grad_norm": 0.49383355752727304, + "learning_rate": 0.00019821231017830914, + "loss": 0.6349, + "step": 888 + }, + { + "epoch": 0.3094037893273075, + "grad_norm": 0.7893505446859834, + "learning_rate": 0.0001981893872547005, + "loss": 0.6335, + "step": 890 + }, + { + "epoch": 0.31009907874152615, + "grad_norm": 1.0962653113728835, + "learning_rate": 0.00019816631964203097, + "loss": 0.6438, + "step": 892 + }, + { + "epoch": 0.31079436815574485, + "grad_norm": 0.40606329821748216, + "learning_rate": 0.0001981431073742923, + "loss": 0.557, + "step": 894 + }, + { + "epoch": 0.3114896575699635, + "grad_norm": 0.8061837126172193, + "learning_rate": 0.00019811975048568943, + "loss": 0.6334, + "step": 896 + }, + { + "epoch": 0.31218494698418214, + "grad_norm": 0.7808955990860935, + "learning_rate": 0.00019809624901064038, + "loss": 0.5775, + "step": 898 + }, + { + "epoch": 0.31288023639840085, + "grad_norm": 0.5527203146534614, + "learning_rate": 0.00019807260298377626, + "loss": 0.5934, + "step": 900 + }, + { + "epoch": 0.31288023639840085, + "eval_loss": 0.666339099407196, + "eval_runtime": 759.5196, + "eval_samples_per_second": 6.375, + "eval_steps_per_second": 0.2, + "step": 900 + }, + { + "epoch": 0.3135755258126195, + "grad_norm": 1.151650071753606, + "learning_rate": 0.00019804881243994118, + "loss": 0.6459, + "step": 902 + }, + { + "epoch": 0.3142708152268382, + "grad_norm": 0.37537177441864283, + "learning_rate": 0.00019802487741419218, + "loss": 0.5537, + "step": 904 + }, + { + "epoch": 0.31496610464105684, + "grad_norm": 0.39806583735978385, + "learning_rate": 0.00019800079794179927, + "loss": 0.5765, + "step": 906 + }, + { + "epoch": 0.3156613940552755, + "grad_norm": 0.9252532303995283, + "learning_rate": 0.00019797657405824524, + "loss": 0.6581, + "step": 908 + }, + { + "epoch": 0.3163566834694942, + "grad_norm": 0.4242008643262632, + "learning_rate": 0.00019795220579922572, + "loss": 0.663, + "step": 910 + }, + { + "epoch": 0.31705197288371284, + "grad_norm": 0.5557863138791925, + "learning_rate": 0.00019792769320064904, + "loss": 0.6492, + "step": 912 + }, + { + "epoch": 0.3177472622979315, + "grad_norm": 0.5743017982975046, + "learning_rate": 0.0001979030362986363, + "loss": 0.6425, + "step": 914 + }, + { + "epoch": 0.3184425517121502, + "grad_norm": 0.39667228882787314, + "learning_rate": 0.0001978782351295212, + "loss": 0.5658, + "step": 916 + }, + { + "epoch": 0.31913784112636884, + "grad_norm": 1.2742981139875873, + "learning_rate": 0.00019785328972985, + "loss": 0.6042, + "step": 918 + }, + { + "epoch": 0.31983313054058754, + "grad_norm": 0.7520790754771111, + "learning_rate": 0.00019782820013638158, + "loss": 0.6248, + "step": 920 + }, + { + "epoch": 0.3205284199548062, + "grad_norm": 1.1777266516894538, + "learning_rate": 0.0001978029663860872, + "loss": 0.6394, + "step": 922 + }, + { + "epoch": 0.32122370936902483, + "grad_norm": 0.5383416828808074, + "learning_rate": 0.00019777758851615058, + "loss": 0.6357, + "step": 924 + }, + { + "epoch": 0.32191899878324354, + "grad_norm": 0.5351088818608489, + "learning_rate": 0.00019775206656396787, + "loss": 0.6111, + "step": 926 + }, + { + "epoch": 0.3226142881974622, + "grad_norm": 0.7776255734128178, + "learning_rate": 0.00019772640056714744, + "loss": 0.5778, + "step": 928 + }, + { + "epoch": 0.3233095776116809, + "grad_norm": 0.5049904332607067, + "learning_rate": 0.00019770059056351, + "loss": 0.5978, + "step": 930 + }, + { + "epoch": 0.32400486702589953, + "grad_norm": 0.6894813643690206, + "learning_rate": 0.00019767463659108841, + "loss": 0.6727, + "step": 932 + }, + { + "epoch": 0.3247001564401182, + "grad_norm": 0.6230252249989028, + "learning_rate": 0.00019764853868812772, + "loss": 0.5911, + "step": 934 + }, + { + "epoch": 0.3253954458543369, + "grad_norm": 0.6699617199619087, + "learning_rate": 0.00019762229689308499, + "loss": 0.6694, + "step": 936 + }, + { + "epoch": 0.32609073526855553, + "grad_norm": 0.9762605521595761, + "learning_rate": 0.00019759591124462943, + "loss": 0.7053, + "step": 938 + }, + { + "epoch": 0.3267860246827742, + "grad_norm": 0.5216728233794251, + "learning_rate": 0.0001975693817816422, + "loss": 0.6958, + "step": 940 + }, + { + "epoch": 0.3274813140969929, + "grad_norm": 0.5943791708445256, + "learning_rate": 0.00019754270854321625, + "loss": 0.6342, + "step": 942 + }, + { + "epoch": 0.32817660351121153, + "grad_norm": 0.5341014737913188, + "learning_rate": 0.00019751589156865663, + "loss": 0.6272, + "step": 944 + }, + { + "epoch": 0.32887189292543023, + "grad_norm": 0.8411647140863245, + "learning_rate": 0.00019748893089747995, + "loss": 0.6041, + "step": 946 + }, + { + "epoch": 0.3295671823396489, + "grad_norm": 1.072323043427063, + "learning_rate": 0.00019746182656941473, + "loss": 0.7152, + "step": 948 + }, + { + "epoch": 0.3302624717538675, + "grad_norm": 0.6497829380326366, + "learning_rate": 0.00019743457862440115, + "loss": 0.6176, + "step": 950 + }, + { + "epoch": 0.33095776116808623, + "grad_norm": 0.28736093186011447, + "learning_rate": 0.00019740718710259096, + "loss": 0.6453, + "step": 952 + }, + { + "epoch": 0.3316530505823049, + "grad_norm": 0.27868233108109625, + "learning_rate": 0.00019737965204434757, + "loss": 0.6051, + "step": 954 + }, + { + "epoch": 0.3323483399965236, + "grad_norm": 0.40709235855818693, + "learning_rate": 0.00019735197349024576, + "loss": 0.6255, + "step": 956 + }, + { + "epoch": 0.3330436294107422, + "grad_norm": 0.8385677925045294, + "learning_rate": 0.00019732415148107199, + "loss": 0.6455, + "step": 958 + }, + { + "epoch": 0.3337389188249609, + "grad_norm": 0.5642576200414804, + "learning_rate": 0.00019729618605782384, + "loss": 0.6971, + "step": 960 + }, + { + "epoch": 0.3344342082391796, + "grad_norm": 0.7034648545079693, + "learning_rate": 0.00019726807726171039, + "loss": 0.6177, + "step": 962 + }, + { + "epoch": 0.3351294976533982, + "grad_norm": 1.9840633930320113, + "learning_rate": 0.000197239825134152, + "loss": 0.6776, + "step": 964 + }, + { + "epoch": 0.33582478706761687, + "grad_norm": 1.0091982574836484, + "learning_rate": 0.00019721142971678015, + "loss": 0.6893, + "step": 966 + }, + { + "epoch": 0.3365200764818356, + "grad_norm": 0.9742560258590767, + "learning_rate": 0.00019718289105143753, + "loss": 0.744, + "step": 968 + }, + { + "epoch": 0.3372153658960542, + "grad_norm": 0.6897018399345455, + "learning_rate": 0.00019715420918017793, + "loss": 0.678, + "step": 970 + }, + { + "epoch": 0.3379106553102729, + "grad_norm": 0.29102959771453246, + "learning_rate": 0.00019712538414526606, + "loss": 0.6663, + "step": 972 + }, + { + "epoch": 0.33860594472449157, + "grad_norm": 0.7337107483377766, + "learning_rate": 0.0001970964159891777, + "loss": 0.663, + "step": 974 + }, + { + "epoch": 0.3393012341387102, + "grad_norm": 0.5817704647699353, + "learning_rate": 0.00019706730475459953, + "loss": 0.6398, + "step": 976 + }, + { + "epoch": 0.3399965235529289, + "grad_norm": 0.28703428796704483, + "learning_rate": 0.00019703805048442897, + "loss": 0.5906, + "step": 978 + }, + { + "epoch": 0.34069181296714757, + "grad_norm": 0.41383789019772477, + "learning_rate": 0.0001970086532217743, + "loss": 0.6709, + "step": 980 + }, + { + "epoch": 0.34138710238136627, + "grad_norm": 0.812487649001141, + "learning_rate": 0.00019697911300995443, + "loss": 0.6191, + "step": 982 + }, + { + "epoch": 0.3420823917955849, + "grad_norm": 0.798027200072012, + "learning_rate": 0.00019694942989249907, + "loss": 0.6608, + "step": 984 + }, + { + "epoch": 0.34277768120980356, + "grad_norm": 0.44029385955900757, + "learning_rate": 0.00019691960391314837, + "loss": 0.647, + "step": 986 + }, + { + "epoch": 0.34347297062402227, + "grad_norm": 0.3824484030698272, + "learning_rate": 0.00019688963511585295, + "loss": 0.6378, + "step": 988 + }, + { + "epoch": 0.3441682600382409, + "grad_norm": 0.4121768227084979, + "learning_rate": 0.0001968595235447741, + "loss": 0.5908, + "step": 990 + }, + { + "epoch": 0.34486354945245956, + "grad_norm": 0.5154693781246049, + "learning_rate": 0.0001968292692442833, + "loss": 0.5632, + "step": 992 + }, + { + "epoch": 0.34555883886667826, + "grad_norm": 0.3895510966829308, + "learning_rate": 0.0001967988722589624, + "loss": 0.4674, + "step": 994 + }, + { + "epoch": 0.3462541282808969, + "grad_norm": 0.507531875733667, + "learning_rate": 0.00019676833263360352, + "loss": 0.5581, + "step": 996 + }, + { + "epoch": 0.3469494176951156, + "grad_norm": 0.5476523355263471, + "learning_rate": 0.00019673765041320907, + "loss": 0.7421, + "step": 998 + }, + { + "epoch": 0.34764470710933426, + "grad_norm": 0.8417172933340035, + "learning_rate": 0.00019670682564299136, + "loss": 0.6774, + "step": 1000 + }, + { + "epoch": 0.3483399965235529, + "grad_norm": 0.6717112677412562, + "learning_rate": 0.00019667585836837299, + "loss": 0.6515, + "step": 1002 + }, + { + "epoch": 0.3490352859377716, + "grad_norm": 0.7599904388695796, + "learning_rate": 0.0001966447486349864, + "loss": 0.5679, + "step": 1004 + }, + { + "epoch": 0.34973057535199026, + "grad_norm": 0.44186748583335306, + "learning_rate": 0.000196613496488674, + "loss": 0.6067, + "step": 1006 + }, + { + "epoch": 0.35042586476620896, + "grad_norm": 0.4287165077907837, + "learning_rate": 0.00019658210197548805, + "loss": 0.5706, + "step": 1008 + }, + { + "epoch": 0.3511211541804276, + "grad_norm": 0.6051489125727973, + "learning_rate": 0.0001965505651416906, + "loss": 0.6178, + "step": 1010 + }, + { + "epoch": 0.35181644359464626, + "grad_norm": 0.5003034918118222, + "learning_rate": 0.00019651888603375346, + "loss": 0.6, + "step": 1012 + }, + { + "epoch": 0.35251173300886496, + "grad_norm": 0.6774513066433009, + "learning_rate": 0.00019648706469835804, + "loss": 0.6248, + "step": 1014 + }, + { + "epoch": 0.3532070224230836, + "grad_norm": 0.5666799893616385, + "learning_rate": 0.0001964551011823953, + "loss": 0.6256, + "step": 1016 + }, + { + "epoch": 0.35390231183730225, + "grad_norm": 0.6185519925235329, + "learning_rate": 0.00019642299553296582, + "loss": 0.5836, + "step": 1018 + }, + { + "epoch": 0.35459760125152096, + "grad_norm": 0.5020407783730059, + "learning_rate": 0.0001963907477973795, + "loss": 0.5148, + "step": 1020 + }, + { + "epoch": 0.3552928906657396, + "grad_norm": 0.966855697270511, + "learning_rate": 0.00019635835802315574, + "loss": 0.6335, + "step": 1022 + }, + { + "epoch": 0.3559881800799583, + "grad_norm": 0.8705091175729548, + "learning_rate": 0.00019632582625802317, + "loss": 0.6313, + "step": 1024 + }, + { + "epoch": 0.35668346949417695, + "grad_norm": 0.6028556619755229, + "learning_rate": 0.00019629315254991964, + "loss": 0.6483, + "step": 1026 + }, + { + "epoch": 0.3573787589083956, + "grad_norm": 0.6075038119620636, + "learning_rate": 0.00019626033694699214, + "loss": 0.6271, + "step": 1028 + }, + { + "epoch": 0.3580740483226143, + "grad_norm": 0.7923956541669288, + "learning_rate": 0.00019622737949759694, + "loss": 0.6338, + "step": 1030 + }, + { + "epoch": 0.35876933773683295, + "grad_norm": 1.2067992138100796, + "learning_rate": 0.00019619428025029905, + "loss": 0.6308, + "step": 1032 + }, + { + "epoch": 0.35946462715105165, + "grad_norm": 0.5446351671940789, + "learning_rate": 0.00019616103925387265, + "loss": 0.6475, + "step": 1034 + }, + { + "epoch": 0.3601599165652703, + "grad_norm": 0.8842474031361561, + "learning_rate": 0.0001961276565573007, + "loss": 0.6654, + "step": 1036 + }, + { + "epoch": 0.36085520597948895, + "grad_norm": 1.294693850012853, + "learning_rate": 0.00019609413220977496, + "loss": 0.6929, + "step": 1038 + }, + { + "epoch": 0.36155049539370765, + "grad_norm": 0.7435682846586636, + "learning_rate": 0.00019606046626069595, + "loss": 0.6791, + "step": 1040 + }, + { + "epoch": 0.3622457848079263, + "grad_norm": 0.45762946459115417, + "learning_rate": 0.0001960266587596729, + "loss": 0.5769, + "step": 1042 + }, + { + "epoch": 0.36294107422214494, + "grad_norm": 0.5614638042598611, + "learning_rate": 0.00019599270975652352, + "loss": 0.6047, + "step": 1044 + }, + { + "epoch": 0.36363636363636365, + "grad_norm": 1.6171161059961894, + "learning_rate": 0.0001959586193012741, + "loss": 0.6932, + "step": 1046 + }, + { + "epoch": 0.3643316530505823, + "grad_norm": 1.5847051714441287, + "learning_rate": 0.00019592438744415932, + "loss": 0.5908, + "step": 1048 + }, + { + "epoch": 0.365026942464801, + "grad_norm": 0.4282438415059217, + "learning_rate": 0.00019589001423562233, + "loss": 0.6749, + "step": 1050 + }, + { + "epoch": 0.365026942464801, + "eval_loss": 0.6080955266952515, + "eval_runtime": 710.9824, + "eval_samples_per_second": 6.81, + "eval_steps_per_second": 0.214, + "step": 1050 + }, + { + "epoch": 0.36572223187901964, + "grad_norm": 1.0612232842206784, + "learning_rate": 0.00019585549972631446, + "loss": 0.5669, + "step": 1052 + }, + { + "epoch": 0.3664175212932383, + "grad_norm": 2.6994673924740358, + "learning_rate": 0.0001958208439670953, + "loss": 0.6455, + "step": 1054 + }, + { + "epoch": 0.367112810707457, + "grad_norm": 2.022628249772274, + "learning_rate": 0.0001957860470090326, + "loss": 0.6395, + "step": 1056 + }, + { + "epoch": 0.36780810012167564, + "grad_norm": 0.607126211578616, + "learning_rate": 0.00019575110890340214, + "loss": 0.593, + "step": 1058 + }, + { + "epoch": 0.36850338953589434, + "grad_norm": 1.026539890410463, + "learning_rate": 0.00019571602970168775, + "loss": 0.5939, + "step": 1060 + }, + { + "epoch": 0.369198678950113, + "grad_norm": 0.6663599873173821, + "learning_rate": 0.00019568080945558104, + "loss": 0.6415, + "step": 1062 + }, + { + "epoch": 0.36989396836433164, + "grad_norm": 0.5967439670789174, + "learning_rate": 0.00019564544821698167, + "loss": 0.6348, + "step": 1064 + }, + { + "epoch": 0.37058925777855034, + "grad_norm": 0.6468802992284401, + "learning_rate": 0.00019560994603799682, + "loss": 0.5991, + "step": 1066 + }, + { + "epoch": 0.371284547192769, + "grad_norm": 1.2251498168873143, + "learning_rate": 0.00019557430297094158, + "loss": 0.6001, + "step": 1068 + }, + { + "epoch": 0.37197983660698763, + "grad_norm": 0.4681978143920913, + "learning_rate": 0.00019553851906833853, + "loss": 0.5664, + "step": 1070 + }, + { + "epoch": 0.37267512602120634, + "grad_norm": 0.7538053079694034, + "learning_rate": 0.00019550259438291782, + "loss": 0.5531, + "step": 1072 + }, + { + "epoch": 0.373370415435425, + "grad_norm": 0.4626868039226879, + "learning_rate": 0.00019546652896761696, + "loss": 0.6268, + "step": 1074 + }, + { + "epoch": 0.3740657048496437, + "grad_norm": 0.8012577314135656, + "learning_rate": 0.00019543032287558097, + "loss": 0.7819, + "step": 1076 + }, + { + "epoch": 0.37476099426386233, + "grad_norm": 0.7004564506452116, + "learning_rate": 0.0001953939761601621, + "loss": 0.6505, + "step": 1078 + }, + { + "epoch": 0.375456283678081, + "grad_norm": 1.352602706017517, + "learning_rate": 0.0001953574888749198, + "loss": 0.558, + "step": 1080 + }, + { + "epoch": 0.3761515730922997, + "grad_norm": 0.3012261239096098, + "learning_rate": 0.0001953208610736207, + "loss": 0.5746, + "step": 1082 + }, + { + "epoch": 0.37684686250651833, + "grad_norm": 0.49798092264749827, + "learning_rate": 0.0001952840928102385, + "loss": 0.5845, + "step": 1084 + }, + { + "epoch": 0.377542151920737, + "grad_norm": 0.4457559765569793, + "learning_rate": 0.00019524718413895382, + "loss": 0.5859, + "step": 1086 + }, + { + "epoch": 0.3782374413349557, + "grad_norm": 0.5943406854432696, + "learning_rate": 0.00019521013511415426, + "loss": 0.6581, + "step": 1088 + }, + { + "epoch": 0.37893273074917433, + "grad_norm": 1.8614189583072707, + "learning_rate": 0.00019517294579043414, + "loss": 0.7019, + "step": 1090 + }, + { + "epoch": 0.37962802016339303, + "grad_norm": 0.4212993231373999, + "learning_rate": 0.00019513561622259466, + "loss": 0.6106, + "step": 1092 + }, + { + "epoch": 0.3803233095776117, + "grad_norm": 0.5224177310348964, + "learning_rate": 0.00019509814646564354, + "loss": 0.6012, + "step": 1094 + }, + { + "epoch": 0.3810185989918303, + "grad_norm": 1.3980998842985117, + "learning_rate": 0.0001950605365747951, + "loss": 0.5875, + "step": 1096 + }, + { + "epoch": 0.38171388840604903, + "grad_norm": 0.7255638165052757, + "learning_rate": 0.0001950227866054703, + "loss": 0.6366, + "step": 1098 + }, + { + "epoch": 0.3824091778202677, + "grad_norm": 0.39401204779232035, + "learning_rate": 0.00019498489661329632, + "loss": 0.59, + "step": 1100 + }, + { + "epoch": 0.3831044672344864, + "grad_norm": 0.6249434294547875, + "learning_rate": 0.00019494686665410684, + "loss": 0.5555, + "step": 1102 + }, + { + "epoch": 0.383799756648705, + "grad_norm": 0.4970609140814689, + "learning_rate": 0.00019490869678394165, + "loss": 0.5872, + "step": 1104 + }, + { + "epoch": 0.3844950460629237, + "grad_norm": 0.5522933346523479, + "learning_rate": 0.0001948703870590468, + "loss": 0.6296, + "step": 1106 + }, + { + "epoch": 0.3851903354771424, + "grad_norm": 0.5358444643818808, + "learning_rate": 0.0001948319375358744, + "loss": 0.5677, + "step": 1108 + }, + { + "epoch": 0.385885624891361, + "grad_norm": 0.5839030994818908, + "learning_rate": 0.00019479334827108256, + "loss": 0.5443, + "step": 1110 + }, + { + "epoch": 0.38658091430557967, + "grad_norm": 0.9808370348899028, + "learning_rate": 0.00019475461932153533, + "loss": 0.6703, + "step": 1112 + }, + { + "epoch": 0.3872762037197984, + "grad_norm": 0.5567454433782846, + "learning_rate": 0.00019471575074430256, + "loss": 0.585, + "step": 1114 + }, + { + "epoch": 0.387971493134017, + "grad_norm": 0.8706120804701404, + "learning_rate": 0.00019467674259665985, + "loss": 0.5399, + "step": 1116 + }, + { + "epoch": 0.3886667825482357, + "grad_norm": 0.607175198823171, + "learning_rate": 0.00019463759493608854, + "loss": 0.6016, + "step": 1118 + }, + { + "epoch": 0.38936207196245437, + "grad_norm": 0.848040345554999, + "learning_rate": 0.0001945983078202754, + "loss": 0.5604, + "step": 1120 + }, + { + "epoch": 0.390057361376673, + "grad_norm": 0.39050505941263947, + "learning_rate": 0.00019455888130711296, + "loss": 0.5391, + "step": 1122 + }, + { + "epoch": 0.3907526507908917, + "grad_norm": 0.43688262723639604, + "learning_rate": 0.00019451931545469883, + "loss": 0.5911, + "step": 1124 + }, + { + "epoch": 0.39144794020511037, + "grad_norm": 0.5216486488482895, + "learning_rate": 0.00019447961032133623, + "loss": 0.7729, + "step": 1126 + }, + { + "epoch": 0.39214322961932907, + "grad_norm": 0.5238744592921366, + "learning_rate": 0.0001944397659655334, + "loss": 0.6561, + "step": 1128 + }, + { + "epoch": 0.3928385190335477, + "grad_norm": 0.5356265007770037, + "learning_rate": 0.00019439978244600392, + "loss": 0.6139, + "step": 1130 + }, + { + "epoch": 0.39353380844776636, + "grad_norm": 0.7845961219955971, + "learning_rate": 0.00019435965982166634, + "loss": 0.5682, + "step": 1132 + }, + { + "epoch": 0.39422909786198507, + "grad_norm": 0.5467699155830194, + "learning_rate": 0.0001943193981516442, + "loss": 0.5801, + "step": 1134 + }, + { + "epoch": 0.3949243872762037, + "grad_norm": 0.8265539141839208, + "learning_rate": 0.00019427899749526592, + "loss": 0.6112, + "step": 1136 + }, + { + "epoch": 0.39561967669042236, + "grad_norm": 0.6952363088057728, + "learning_rate": 0.0001942384579120648, + "loss": 0.5585, + "step": 1138 + }, + { + "epoch": 0.39631496610464106, + "grad_norm": 0.5390583855264917, + "learning_rate": 0.00019419777946177872, + "loss": 0.5437, + "step": 1140 + }, + { + "epoch": 0.3970102555188597, + "grad_norm": 0.7703174634754777, + "learning_rate": 0.0001941569622043504, + "loss": 0.6353, + "step": 1142 + }, + { + "epoch": 0.3977055449330784, + "grad_norm": 0.6599770887173079, + "learning_rate": 0.0001941160061999268, + "loss": 0.6984, + "step": 1144 + }, + { + "epoch": 0.39840083434729706, + "grad_norm": 0.6388540477012332, + "learning_rate": 0.0001940749115088597, + "loss": 0.6716, + "step": 1146 + }, + { + "epoch": 0.3990961237615157, + "grad_norm": 0.556740144667956, + "learning_rate": 0.00019403367819170495, + "loss": 0.5403, + "step": 1148 + }, + { + "epoch": 0.3997914131757344, + "grad_norm": 0.5811188003032377, + "learning_rate": 0.00019399230630922281, + "loss": 0.6038, + "step": 1150 + }, + { + "epoch": 0.40048670258995306, + "grad_norm": 0.5247246331826143, + "learning_rate": 0.00019395079592237767, + "loss": 0.5802, + "step": 1152 + }, + { + "epoch": 0.40118199200417176, + "grad_norm": 0.6218229787877086, + "learning_rate": 0.00019390914709233812, + "loss": 0.613, + "step": 1154 + }, + { + "epoch": 0.4018772814183904, + "grad_norm": 0.3768886648264559, + "learning_rate": 0.00019386735988047657, + "loss": 0.546, + "step": 1156 + }, + { + "epoch": 0.40257257083260906, + "grad_norm": 0.7192604288297088, + "learning_rate": 0.00019382543434836956, + "loss": 0.6414, + "step": 1158 + }, + { + "epoch": 0.40326786024682776, + "grad_norm": 0.6502767283266627, + "learning_rate": 0.00019378337055779725, + "loss": 0.6913, + "step": 1160 + }, + { + "epoch": 0.4039631496610464, + "grad_norm": 0.5821846511835889, + "learning_rate": 0.00019374116857074372, + "loss": 0.6135, + "step": 1162 + }, + { + "epoch": 0.40465843907526505, + "grad_norm": 0.4214614762979627, + "learning_rate": 0.00019369882844939656, + "loss": 0.5844, + "step": 1164 + }, + { + "epoch": 0.40535372848948376, + "grad_norm": 0.3995087581540831, + "learning_rate": 0.00019365635025614698, + "loss": 0.597, + "step": 1166 + }, + { + "epoch": 0.4060490179037024, + "grad_norm": 0.6448855951735888, + "learning_rate": 0.0001936137340535896, + "loss": 0.5964, + "step": 1168 + }, + { + "epoch": 0.4067443073179211, + "grad_norm": 0.4901354392109259, + "learning_rate": 0.00019357097990452244, + "loss": 0.6544, + "step": 1170 + }, + { + "epoch": 0.40743959673213975, + "grad_norm": 1.453302582941976, + "learning_rate": 0.0001935280878719468, + "loss": 0.7041, + "step": 1172 + }, + { + "epoch": 0.4081348861463584, + "grad_norm": 0.5029703758127726, + "learning_rate": 0.00019348505801906717, + "loss": 0.5963, + "step": 1174 + }, + { + "epoch": 0.4088301755605771, + "grad_norm": 0.42609969312576673, + "learning_rate": 0.00019344189040929104, + "loss": 0.5741, + "step": 1176 + }, + { + "epoch": 0.40952546497479575, + "grad_norm": 0.7354212284029352, + "learning_rate": 0.000193398585106229, + "loss": 0.5587, + "step": 1178 + }, + { + "epoch": 0.41022075438901445, + "grad_norm": 0.4221453871118396, + "learning_rate": 0.00019335514217369448, + "loss": 0.6008, + "step": 1180 + }, + { + "epoch": 0.4109160438032331, + "grad_norm": 0.4305199213179302, + "learning_rate": 0.00019331156167570377, + "loss": 0.6589, + "step": 1182 + }, + { + "epoch": 0.41161133321745175, + "grad_norm": 0.5908546860050797, + "learning_rate": 0.0001932678436764758, + "loss": 0.6791, + "step": 1184 + }, + { + "epoch": 0.41230662263167045, + "grad_norm": 0.592125562883329, + "learning_rate": 0.0001932239882404322, + "loss": 0.6163, + "step": 1186 + }, + { + "epoch": 0.4130019120458891, + "grad_norm": 0.3760868982177292, + "learning_rate": 0.00019317999543219707, + "loss": 0.6057, + "step": 1188 + }, + { + "epoch": 0.41369720146010774, + "grad_norm": 0.42271908071862413, + "learning_rate": 0.00019313586531659693, + "loss": 0.6055, + "step": 1190 + }, + { + "epoch": 0.41439249087432645, + "grad_norm": 0.7637973810401912, + "learning_rate": 0.00019309159795866067, + "loss": 0.6113, + "step": 1192 + }, + { + "epoch": 0.4150877802885451, + "grad_norm": 0.31348977991538335, + "learning_rate": 0.00019304719342361942, + "loss": 0.5906, + "step": 1194 + }, + { + "epoch": 0.4157830697027638, + "grad_norm": 0.34482048624358563, + "learning_rate": 0.00019300265177690635, + "loss": 0.5722, + "step": 1196 + }, + { + "epoch": 0.41647835911698244, + "grad_norm": 0.8513089082812038, + "learning_rate": 0.0001929579730841568, + "loss": 0.6293, + "step": 1198 + }, + { + "epoch": 0.4171736485312011, + "grad_norm": 0.4489163724605792, + "learning_rate": 0.00019291315741120802, + "loss": 0.5779, + "step": 1200 + }, + { + "epoch": 0.4171736485312011, + "eval_loss": 0.6036229133605957, + "eval_runtime": 710.4375, + "eval_samples_per_second": 6.816, + "eval_steps_per_second": 0.214, + "step": 1200 + }, + { + "epoch": 0.4178689379454198, + "grad_norm": 0.4187714520019529, + "learning_rate": 0.00019286820482409907, + "loss": 0.6429, + "step": 1202 + }, + { + "epoch": 0.41856422735963844, + "grad_norm": 0.6777550653965533, + "learning_rate": 0.0001928231153890708, + "loss": 0.7349, + "step": 1204 + }, + { + "epoch": 0.41925951677385714, + "grad_norm": 0.5320560870085244, + "learning_rate": 0.00019277788917256575, + "loss": 0.6171, + "step": 1206 + }, + { + "epoch": 0.4199548061880758, + "grad_norm": 0.4598764394317783, + "learning_rate": 0.0001927325262412279, + "loss": 0.568, + "step": 1208 + }, + { + "epoch": 0.42065009560229444, + "grad_norm": 0.6091029764488312, + "learning_rate": 0.0001926870266619028, + "loss": 0.6179, + "step": 1210 + }, + { + "epoch": 0.42134538501651314, + "grad_norm": 0.3831881756520618, + "learning_rate": 0.00019264139050163733, + "loss": 0.6277, + "step": 1212 + }, + { + "epoch": 0.4220406744307318, + "grad_norm": 0.46975774391187974, + "learning_rate": 0.00019259561782767964, + "loss": 0.6365, + "step": 1214 + }, + { + "epoch": 0.42273596384495044, + "grad_norm": 0.43958415828248065, + "learning_rate": 0.00019254970870747896, + "loss": 0.5599, + "step": 1216 + }, + { + "epoch": 0.42343125325916914, + "grad_norm": 0.3718315331231464, + "learning_rate": 0.00019250366320868573, + "loss": 0.5466, + "step": 1218 + }, + { + "epoch": 0.4241265426733878, + "grad_norm": 0.4132277343365207, + "learning_rate": 0.00019245748139915122, + "loss": 0.5505, + "step": 1220 + }, + { + "epoch": 0.4248218320876065, + "grad_norm": 0.699259138789713, + "learning_rate": 0.00019241116334692767, + "loss": 0.6155, + "step": 1222 + }, + { + "epoch": 0.42551712150182514, + "grad_norm": 0.8108211625089844, + "learning_rate": 0.00019236470912026795, + "loss": 0.6389, + "step": 1224 + }, + { + "epoch": 0.4262124109160438, + "grad_norm": 0.7991219996691611, + "learning_rate": 0.00019231811878762578, + "loss": 0.6218, + "step": 1226 + }, + { + "epoch": 0.4269077003302625, + "grad_norm": 0.6512869246829502, + "learning_rate": 0.00019227139241765527, + "loss": 0.6263, + "step": 1228 + }, + { + "epoch": 0.42760298974448113, + "grad_norm": 0.6616729861929296, + "learning_rate": 0.00019222453007921103, + "loss": 0.633, + "step": 1230 + }, + { + "epoch": 0.42829827915869984, + "grad_norm": 0.6441717114274472, + "learning_rate": 0.0001921775318413481, + "loss": 0.598, + "step": 1232 + }, + { + "epoch": 0.4289935685729185, + "grad_norm": 0.5398693786298329, + "learning_rate": 0.00019213039777332173, + "loss": 0.6128, + "step": 1234 + }, + { + "epoch": 0.42968885798713713, + "grad_norm": 0.7990572416423266, + "learning_rate": 0.00019208312794458734, + "loss": 0.6237, + "step": 1236 + }, + { + "epoch": 0.43038414740135583, + "grad_norm": 0.6792096783122197, + "learning_rate": 0.00019203572242480033, + "loss": 0.6167, + "step": 1238 + }, + { + "epoch": 0.4310794368155745, + "grad_norm": 0.569412739061848, + "learning_rate": 0.00019198818128381622, + "loss": 0.7147, + "step": 1240 + }, + { + "epoch": 0.4317747262297931, + "grad_norm": 0.3343242957299063, + "learning_rate": 0.00019194050459169016, + "loss": 0.5585, + "step": 1242 + }, + { + "epoch": 0.43247001564401183, + "grad_norm": 0.41389163470101814, + "learning_rate": 0.00019189269241867726, + "loss": 0.6206, + "step": 1244 + }, + { + "epoch": 0.4331653050582305, + "grad_norm": 0.6725681446750024, + "learning_rate": 0.00019184474483523208, + "loss": 0.6592, + "step": 1246 + }, + { + "epoch": 0.4338605944724492, + "grad_norm": 1.063023358388528, + "learning_rate": 0.0001917966619120088, + "loss": 0.6998, + "step": 1248 + }, + { + "epoch": 0.4345558838866678, + "grad_norm": 1.0481626997531774, + "learning_rate": 0.00019174844371986111, + "loss": 0.5649, + "step": 1250 + }, + { + "epoch": 0.4352511733008865, + "grad_norm": 0.6436744584316785, + "learning_rate": 0.00019170009032984188, + "loss": 0.6011, + "step": 1252 + }, + { + "epoch": 0.4359464627151052, + "grad_norm": 0.6100699160131396, + "learning_rate": 0.00019165160181320331, + "loss": 0.6229, + "step": 1254 + }, + { + "epoch": 0.4366417521293238, + "grad_norm": 0.43075456887586555, + "learning_rate": 0.00019160297824139671, + "loss": 0.5985, + "step": 1256 + }, + { + "epoch": 0.4373370415435425, + "grad_norm": 1.1133754307509498, + "learning_rate": 0.0001915542196860723, + "loss": 0.582, + "step": 1258 + }, + { + "epoch": 0.4380323309577612, + "grad_norm": 0.8115545368570724, + "learning_rate": 0.00019150532621907935, + "loss": 0.6281, + "step": 1260 + } + ], + "logging_steps": 2, + "max_steps": 5752, + "num_input_tokens_seen": 0, + "num_train_epochs": 2, + "save_steps": 90, + "stateful_callbacks": { + "TrainerControl": { + "args": { + "should_epoch_stop": false, + "should_evaluate": false, + "should_log": false, + "should_save": true, + "should_training_stop": false + }, + "attributes": {} + } + }, + "total_flos": 5020710608044032.0, + "train_batch_size": 4, + "trial_name": null, + "trial_params": null +} diff --git a/checkpoint-1260/training_args.bin b/checkpoint-1260/training_args.bin new file mode 100644 index 0000000000000000000000000000000000000000..fba3b63792fed5a70be0307e26ba27ef584b1528 --- /dev/null +++ b/checkpoint-1260/training_args.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b72add547acd6c009f3a3770072d0cdf7de7e797c7597084319db874a556e470 +size 6904 diff --git a/checkpoint-1260/zero_to_fp32.py b/checkpoint-1260/zero_to_fp32.py new file mode 100644 index 0000000000000000000000000000000000000000..0e759146cadd92ddfefab3680146c2bd6a2b5c04 --- /dev/null +++ b/checkpoint-1260/zero_to_fp32.py @@ -0,0 +1,760 @@ +#!/usr/bin/env python + +# Copyright (c) Microsoft Corporation. +# SPDX-License-Identifier: Apache-2.0 + +# DeepSpeed Team + +# This script extracts fp32 consolidated weights from a zero 1, 2 and 3 DeepSpeed checkpoints. It gets +# copied into the top level checkpoint dir, so the user can easily do the conversion at any point in +# the future. Once extracted, the weights don't require DeepSpeed and can be used in any +# application. +# +# example: +# python zero_to_fp32.py . output_dir/ +# or +# python zero_to_fp32.py . output_dir/ --safe_serialization + +import argparse +import torch +import glob +import math +import os +import re +import gc +import json +import numpy as np +from tqdm import tqdm +from collections import OrderedDict +from dataclasses import dataclass + +# while this script doesn't use deepspeed to recover data, since the checkpoints are pickled with +# DeepSpeed data structures it has to be available in the current python environment. +from deepspeed.utils import logger +from deepspeed.checkpoint.constants import (DS_VERSION, OPTIMIZER_STATE_DICT, SINGLE_PARTITION_OF_FP32_GROUPS, + FP32_FLAT_GROUPS, ZERO_STAGE, PARTITION_COUNT, PARAM_SHAPES, BUFFER_NAMES, + FROZEN_PARAM_SHAPES, FROZEN_PARAM_FRAGMENTS) + + +@dataclass +class zero_model_state: + buffers: dict() + param_shapes: dict() + shared_params: list + ds_version: int + frozen_param_shapes: dict() + frozen_param_fragments: dict() + + +debug = 0 + +# load to cpu +device = torch.device('cpu') + + +def atoi(text): + return int(text) if text.isdigit() else text + + +def natural_keys(text): + ''' + alist.sort(key=natural_keys) sorts in human order + http://nedbatchelder.com/blog/200712/human_sorting.html + (See Toothy's implementation in the comments) + ''' + return [atoi(c) for c in re.split(r'(\d+)', text)] + + +def get_model_state_file(checkpoint_dir, zero_stage): + if not os.path.isdir(checkpoint_dir): + raise FileNotFoundError(f"Directory '{checkpoint_dir}' doesn't exist") + + # there should be only one file + if zero_stage <= 2: + file = os.path.join(checkpoint_dir, "mp_rank_00_model_states.pt") + elif zero_stage == 3: + file = os.path.join(checkpoint_dir, "zero_pp_rank_0_mp_rank_00_model_states.pt") + + if not os.path.exists(file): + raise FileNotFoundError(f"can't find model states file at '{file}'") + + return file + + +def get_checkpoint_files(checkpoint_dir, glob_pattern): + # XXX: need to test that this simple glob rule works for multi-node setup too + ckpt_files = sorted(glob.glob(os.path.join(checkpoint_dir, glob_pattern)), key=natural_keys) + + if len(ckpt_files) == 0: + raise FileNotFoundError(f"can't find {glob_pattern} files in directory '{checkpoint_dir}'") + + return ckpt_files + + +def get_optim_files(checkpoint_dir): + return get_checkpoint_files(checkpoint_dir, "*_optim_states.pt") + + +def get_model_state_files(checkpoint_dir): + return get_checkpoint_files(checkpoint_dir, "*_model_states.pt") + + +def parse_model_states(files): + zero_model_states = [] + for file in files: + state_dict = torch.load(file, map_location=device, weights_only=False) + + if BUFFER_NAMES not in state_dict: + raise ValueError(f"{file} is not a model state checkpoint") + buffer_names = state_dict[BUFFER_NAMES] + if debug: + print("Found buffers:", buffer_names) + + # recover just the buffers while restoring them to fp32 if they were saved in fp16 + buffers = {k: v.float() for k, v in state_dict["module"].items() if k in buffer_names} + param_shapes = state_dict[PARAM_SHAPES] + + # collect parameters that are included in param_shapes + param_names = [] + for s in param_shapes: + for name in s.keys(): + param_names.append(name) + + # update with frozen parameters + frozen_param_shapes = state_dict.get(FROZEN_PARAM_SHAPES, None) + if frozen_param_shapes is not None: + if debug: + print(f"Found frozen_param_shapes: {frozen_param_shapes}") + param_names += list(frozen_param_shapes.keys()) + + # handle shared params + shared_params = [[k, v] for k, v in state_dict["shared_params"].items()] + + ds_version = state_dict.get(DS_VERSION, None) + + frozen_param_fragments = state_dict.get(FROZEN_PARAM_FRAGMENTS, None) + + z_model_state = zero_model_state(buffers=buffers, + param_shapes=param_shapes, + shared_params=shared_params, + ds_version=ds_version, + frozen_param_shapes=frozen_param_shapes, + frozen_param_fragments=frozen_param_fragments) + zero_model_states.append(z_model_state) + + return zero_model_states + + +def parse_optim_states(files, ds_checkpoint_dir): + total_files = len(files) + state_dicts = [] + for f in tqdm(files, desc='Loading checkpoint shards'): + state_dict = torch.load(f, map_location=device, mmap=True, weights_only=False) + # immediately discard the potentially huge 2 optimizer states as we only care for fp32 master weights + # and also handle the case where it was already removed by another helper script + state_dict["optimizer_state_dict"].pop("optimizer_state_dict", None) + state_dicts.append(state_dict) + + if not ZERO_STAGE in state_dicts[0][OPTIMIZER_STATE_DICT]: + raise ValueError(f"{files[0]} is not a zero checkpoint") + zero_stage = state_dicts[0][OPTIMIZER_STATE_DICT][ZERO_STAGE] + world_size = state_dicts[0][OPTIMIZER_STATE_DICT][PARTITION_COUNT] + + # For ZeRO-2 each param group can have different partition_count as data parallelism for expert + # parameters can be different from data parallelism for non-expert parameters. So we can just + # use the max of the partition_count to get the dp world_size. + + if type(world_size) is list: + world_size = max(world_size) + + if world_size != total_files: + raise ValueError( + f"Expected {world_size} of '*_optim_states.pt' under '{ds_checkpoint_dir}' but found {total_files} files. " + "Possibly due to an overwrite of an old checkpoint, or a checkpoint didn't get saved by one or more processes." + ) + + # the groups are named differently in each stage + if zero_stage <= 2: + fp32_groups_key = SINGLE_PARTITION_OF_FP32_GROUPS + elif zero_stage == 3: + fp32_groups_key = FP32_FLAT_GROUPS + else: + raise ValueError(f"unknown zero stage {zero_stage}") + + fp32_flat_groups = [state_dicts[i][OPTIMIZER_STATE_DICT][fp32_groups_key] for i in range(len(state_dicts))] + return zero_stage, world_size, fp32_flat_groups + + +def _get_fp32_state_dict_from_zero_checkpoint(ds_checkpoint_dir, exclude_frozen_parameters): + """ + Returns fp32 state_dict reconstructed from ds checkpoint + + Args: + - ``ds_checkpoint_dir``: path to the deepspeed checkpoint folder (where the optimizer files are) + + """ + print(f"Processing zero checkpoint '{ds_checkpoint_dir}'") + + optim_files = get_optim_files(ds_checkpoint_dir) + zero_stage, world_size, fp32_flat_groups = parse_optim_states(optim_files, ds_checkpoint_dir) + print(f"Detected checkpoint of type zero stage {zero_stage}, world_size: {world_size}") + + model_files = get_model_state_files(ds_checkpoint_dir) + + zero_model_states = parse_model_states(model_files) + print(f'Parsing checkpoint created by deepspeed=={zero_model_states[0].ds_version}') + + if zero_stage <= 2: + return _get_fp32_state_dict_from_zero2_checkpoint(world_size, fp32_flat_groups, zero_model_states, + exclude_frozen_parameters) + elif zero_stage == 3: + return _get_fp32_state_dict_from_zero3_checkpoint(world_size, fp32_flat_groups, zero_model_states, + exclude_frozen_parameters) + + +def _zero2_merge_frozen_params(state_dict, zero_model_states): + if zero_model_states[0].frozen_param_shapes is None or len(zero_model_states[0].frozen_param_shapes) == 0: + return + + frozen_param_shapes = zero_model_states[0].frozen_param_shapes + frozen_param_fragments = zero_model_states[0].frozen_param_fragments + + if debug: + num_elem = sum(s.numel() for s in frozen_param_shapes.values()) + print(f'rank 0: {FROZEN_PARAM_SHAPES}.numel = {num_elem}') + + wanted_params = len(frozen_param_shapes) + wanted_numel = sum(s.numel() for s in frozen_param_shapes.values()) + avail_numel = sum([p.numel() for p in frozen_param_fragments.values()]) + print(f'Frozen params: Have {avail_numel} numels to process.') + print(f'Frozen params: Need {wanted_numel} numels in {wanted_params} params') + + total_params = 0 + total_numel = 0 + for name, shape in frozen_param_shapes.items(): + total_params += 1 + unpartitioned_numel = shape.numel() + total_numel += unpartitioned_numel + + state_dict[name] = frozen_param_fragments[name] + + if debug: + print(f"{name} full shape: {shape} unpartitioned numel {unpartitioned_numel} ") + + print(f"Reconstructed Frozen fp32 state dict with {total_params} params {total_numel} elements") + + +def _has_callable(obj, fn): + attr = getattr(obj, fn, None) + return callable(attr) + + +def _zero2_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states): + param_shapes = zero_model_states[0].param_shapes + + # Reconstruction protocol: + # + # XXX: document this + + if debug: + for i in range(world_size): + for j in range(len(fp32_flat_groups[0])): + print(f"{FP32_FLAT_GROUPS}[{i}][{j}].shape={fp32_flat_groups[i][j].shape}") + + # XXX: memory usage doubles here (zero2) + num_param_groups = len(fp32_flat_groups[0]) + merged_single_partition_of_fp32_groups = [] + for i in range(num_param_groups): + merged_partitions = [sd[i] for sd in fp32_flat_groups] + full_single_fp32_vector = torch.cat(merged_partitions, 0) + merged_single_partition_of_fp32_groups.append(full_single_fp32_vector) + avail_numel = sum( + [full_single_fp32_vector.numel() for full_single_fp32_vector in merged_single_partition_of_fp32_groups]) + + if debug: + wanted_params = sum([len(shapes) for shapes in param_shapes]) + wanted_numel = sum([sum(shape.numel() for shape in shapes.values()) for shapes in param_shapes]) + # not asserting if there is a mismatch due to possible padding + print(f"Have {avail_numel} numels to process.") + print(f"Need {wanted_numel} numels in {wanted_params} params.") + + # params + # XXX: for huge models that can't fit into the host's RAM we will have to recode this to support + # out-of-core computing solution + total_numel = 0 + total_params = 0 + for shapes, full_single_fp32_vector in zip(param_shapes, merged_single_partition_of_fp32_groups): + offset = 0 + avail_numel = full_single_fp32_vector.numel() + for name, shape in shapes.items(): + + unpartitioned_numel = shape.numel() if _has_callable(shape, 'numel') else math.prod(shape) + total_numel += unpartitioned_numel + total_params += 1 + + if debug: + print(f"{name} full shape: {shape} unpartitioned numel {unpartitioned_numel} ") + state_dict[name] = full_single_fp32_vector.narrow(0, offset, unpartitioned_numel).view(shape) + offset += unpartitioned_numel + + # Z2 started to align to 2*world_size to improve nccl performance. Therefore both offset and + # avail_numel can differ by anywhere between 0..2*world_size. Due to two unrelated complex + # paddings performed in the code it's almost impossible to predict the exact numbers w/o the + # live optimizer object, so we are checking that the numbers are within the right range + align_to = 2 * world_size + + def zero2_align(x): + return align_to * math.ceil(x / align_to) + + if debug: + print(f"original offset={offset}, avail_numel={avail_numel}") + + offset = zero2_align(offset) + avail_numel = zero2_align(avail_numel) + + if debug: + print(f"aligned offset={offset}, avail_numel={avail_numel}") + + # Sanity check + if offset != avail_numel: + raise ValueError(f"consumed {offset} numels out of {avail_numel} - something is wrong") + + print(f"Reconstructed fp32 state dict with {total_params} params {total_numel} elements") + + +def _get_fp32_state_dict_from_zero2_checkpoint(world_size, fp32_flat_groups, zero_model_states, + exclude_frozen_parameters): + state_dict = OrderedDict() + + # buffers + buffers = zero_model_states[0].buffers + state_dict.update(buffers) + if debug: + print(f"added {len(buffers)} buffers") + + if not exclude_frozen_parameters: + _zero2_merge_frozen_params(state_dict, zero_model_states) + + _zero2_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states) + + # recover shared parameters + for pair in zero_model_states[0].shared_params: + if pair[1] in state_dict: + state_dict[pair[0]] = state_dict[pair[1]] + + return state_dict + + +def zero3_partitioned_param_info(unpartitioned_numel, world_size): + remainder = unpartitioned_numel % world_size + padding_numel = (world_size - remainder) if remainder else 0 + partitioned_numel = math.ceil(unpartitioned_numel / world_size) + return partitioned_numel, padding_numel + + +def _zero3_merge_frozen_params(state_dict, world_size, zero_model_states): + if zero_model_states[0].frozen_param_shapes is None or len(zero_model_states[0].frozen_param_shapes) == 0: + return + + if debug: + for i in range(world_size): + num_elem = sum(s.numel() for s in zero_model_states[i].frozen_param_fragments.values()) + print(f'rank {i}: {FROZEN_PARAM_SHAPES}.numel = {num_elem}') + + frozen_param_shapes = zero_model_states[0].frozen_param_shapes + wanted_params = len(frozen_param_shapes) + wanted_numel = sum(s.numel() for s in frozen_param_shapes.values()) + avail_numel = sum([p.numel() for p in zero_model_states[0].frozen_param_fragments.values()]) * world_size + print(f'Frozen params: Have {avail_numel} numels to process.') + print(f'Frozen params: Need {wanted_numel} numels in {wanted_params} params') + + total_params = 0 + total_numel = 0 + for name, shape in zero_model_states[0].frozen_param_shapes.items(): + total_params += 1 + unpartitioned_numel = shape.numel() + total_numel += unpartitioned_numel + + param_frags = tuple(model_state.frozen_param_fragments[name] for model_state in zero_model_states) + state_dict[name] = torch.cat(param_frags, 0).narrow(0, 0, unpartitioned_numel).view(shape) + + partitioned_numel, partitioned_padding_numel = zero3_partitioned_param_info(unpartitioned_numel, world_size) + + if debug: + print( + f"Frozen params: {total_params} {name} full shape: {shape} partition0 numel={partitioned_numel} partitioned_padding_numel={partitioned_padding_numel}" + ) + + print(f"Reconstructed Frozen fp32 state dict with {total_params} params {total_numel} elements") + + +class GatheredTensor: + """ + A pseudo tensor that collects partitioned weights. + It is more memory efficient when there are multiple groups. + """ + + def __init__(self, flat_groups, flat_groups_offset, offset, partitioned_numel, shape): + self.flat_groups = flat_groups + self.flat_groups_offset = flat_groups_offset + self.offset = offset + self.partitioned_numel = partitioned_numel + self.shape = shape + self.dtype = self.flat_groups[0][0].dtype + + def contiguous(self): + """ + Merge partitioned weights from flat_groups into a single tensor. + """ + end_idx = self.offset + self.partitioned_numel + world_size = len(self.flat_groups) + pad_flat_param_chunks = [] + + for rank_i in range(world_size): + # for each rank, we need to collect weights from related group/groups + flat_groups_at_rank_i = self.flat_groups[rank_i] + start_group_id = None + end_group_id = None + for group_id in range(len(self.flat_groups_offset)): + if self.flat_groups_offset[group_id] <= self.offset < self.flat_groups_offset[group_id + 1]: + start_group_id = group_id + if self.flat_groups_offset[group_id] < end_idx <= self.flat_groups_offset[group_id + 1]: + end_group_id = group_id + break + # collect weights from related group/groups + for group_id in range(start_group_id, end_group_id + 1): + flat_tensor = flat_groups_at_rank_i[group_id] + start_offset = self.offset - self.flat_groups_offset[group_id] + end_offset = min(end_idx, self.flat_groups_offset[group_id + 1]) - self.flat_groups_offset[group_id] + pad_flat_param_chunks.append(flat_tensor[start_offset:end_offset]) + + # collect weights from all ranks + pad_flat_param = torch.cat(pad_flat_param_chunks, dim=0) + param = pad_flat_param[:self.shape.numel()].view(self.shape).contiguous() + return param + + +def _zero3_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states): + param_shapes = zero_model_states[0].param_shapes + avail_numel = sum([flat_group.numel() for flat_group in fp32_flat_groups[0]]) * world_size + + # Reconstruction protocol: For zero3 we need to zip the partitions together at boundary of each + # param, re-consolidating each param, while dealing with padding if any + + # merge list of dicts, preserving order + param_shapes = {k: v for d in param_shapes for k, v in d.items()} + + if debug: + for i in range(world_size): + print(f"{FP32_FLAT_GROUPS}[{i}].shape={fp32_flat_groups[i].shape}") + + wanted_params = len(param_shapes) + wanted_numel = sum(shape.numel() for shape in param_shapes.values()) + # not asserting if there is a mismatch due to possible padding + avail_numel = fp32_flat_groups[0].numel() * world_size + print(f"Trainable params: Have {avail_numel} numels to process.") + print(f"Trainable params: Need {wanted_numel} numels in {wanted_params} params.") + + # params + # XXX: for huge models that can't fit into the host's RAM we will have to recode this to support + # out-of-core computing solution + offset = 0 + total_numel = 0 + total_params = 0 + flat_groups_offset = [0] + list(np.cumsum([flat_tensor.numel() for flat_tensor in fp32_flat_groups[0]])) + for name, shape in tqdm(param_shapes.items(), desc='Gathering sharded weights'): + unpartitioned_numel = shape.numel() + total_numel += unpartitioned_numel + total_params += 1 + partitioned_numel, partitioned_padding_numel = zero3_partitioned_param_info(unpartitioned_numel, world_size) + + if debug: + print( + f"Trainable params: {total_params} {name} full shape: {shape} partition0 numel={partitioned_numel} partitioned_padding_numel={partitioned_padding_numel}" + ) + + # memory efficient tensor + tensor = GatheredTensor(fp32_flat_groups, flat_groups_offset, offset, partitioned_numel, shape) + state_dict[name] = tensor + offset += partitioned_numel + + offset *= world_size + + # Sanity check + if offset != avail_numel: + raise ValueError(f"consumed {offset} numels out of {avail_numel} - something is wrong") + + print(f"Reconstructed Trainable fp32 state dict with {total_params} params {total_numel} elements") + + +def _get_fp32_state_dict_from_zero3_checkpoint(world_size, fp32_flat_groups, zero_model_states, + exclude_frozen_parameters): + state_dict = OrderedDict() + + # buffers + buffers = zero_model_states[0].buffers + state_dict.update(buffers) + if debug: + print(f"added {len(buffers)} buffers") + + if not exclude_frozen_parameters: + _zero3_merge_frozen_params(state_dict, world_size, zero_model_states) + + _zero3_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states) + + # recover shared parameters + for pair in zero_model_states[0].shared_params: + if pair[1] in state_dict: + state_dict[pair[0]] = state_dict[pair[1]] + + return state_dict + + +def to_torch_tensor(state_dict, return_empty_tensor=False): + """ + Convert state_dict of GatheredTensor to torch tensor + """ + torch_state_dict = {} + converted_tensors = {} + for name, tensor in state_dict.items(): + tensor_id = id(tensor) + if tensor_id in converted_tensors: # shared tensors + shared_tensor = torch_state_dict[converted_tensors[tensor_id]] + torch_state_dict[name] = shared_tensor + else: + converted_tensors[tensor_id] = name + if return_empty_tensor: + torch_state_dict[name] = torch.empty(tensor.shape, dtype=tensor.dtype) + else: + torch_state_dict[name] = tensor.contiguous() + return torch_state_dict + + +def get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir, + tag=None, + exclude_frozen_parameters=False, + lazy_mode=False): + """ + Convert ZeRO 2 or 3 checkpoint into a single fp32 consolidated state_dict that can be loaded with + ``load_state_dict()`` and used for training without DeepSpeed or shared with others, for example + via a model hub. + + Args: + - ``checkpoint_dir``: path to the desired checkpoint folder + - ``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`` + - ``exclude_frozen_parameters``: exclude frozen parameters + - ``lazy_mode``: get state_dict in lazy mode. It returns a dict of pesduo tensor instead of torch tensor, which is more memory efficient. + Convert the pesduo tensor to torch tensor by ``.contiguous()`` + + Returns: + - pytorch ``state_dict`` + + A typical usage might be :: + + from deepspeed.utils.zero_to_fp32 import get_fp32_state_dict_from_zero_checkpoint + # do the training and checkpoint saving + state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir) # already on cpu + model = model.cpu() # move to cpu + model.load_state_dict(state_dict) + # submit to model hub or save the model to share with others + + In this example the ``model`` will no longer be usable in the deepspeed context of the same + application. i.e. you will need to re-initialize the deepspeed engine, since + ``model.load_state_dict(state_dict)`` will remove all the deepspeed magic from it. + + If you want it all done for you, use ``load_state_dict_from_zero_checkpoint`` instead. + + Note: the above usage may not work if your application doesn't have sufficient free CPU memory. + You may need to use the offline approach using the ``zero_to_fp32.py`` script that is saved with + the checkpoint. Or you can load state_dict in lazy mode :: + + from deepspeed.utils.zero_to_fp32 import get_fp32_state_dict_from_zero_checkpoint + state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir, lazy_mode=True) # not on cpu + for name, lazy_tensor in state_dict.item(): + tensor = lazy_tensor.contiguous() # to cpu + print(name, tensor) + # del tensor to release memory if it no longer in use + """ + if tag is None: + latest_path = os.path.join(checkpoint_dir, 'latest') + if os.path.isfile(latest_path): + with open(latest_path, 'r') as fd: + tag = fd.read().strip() + else: + raise ValueError(f"Unable to find 'latest' file at {latest_path}") + + ds_checkpoint_dir = os.path.join(checkpoint_dir, tag) + + if not os.path.isdir(ds_checkpoint_dir): + raise FileNotFoundError(f"Directory '{ds_checkpoint_dir}' doesn't exist") + + state_dict = _get_fp32_state_dict_from_zero_checkpoint(ds_checkpoint_dir, exclude_frozen_parameters) + if lazy_mode: + return state_dict + else: + return to_torch_tensor(state_dict) + + +def convert_zero_checkpoint_to_fp32_state_dict(checkpoint_dir, + output_dir, + max_shard_size="5GB", + safe_serialization=False, + tag=None, + exclude_frozen_parameters=False): + """ + Convert ZeRO 2 or 3 checkpoint into a single fp32 consolidated ``state_dict`` file that can be + loaded with ``torch.load(file)`` + ``load_state_dict()`` and used for training without DeepSpeed. + + Args: + - ``checkpoint_dir``: path to the desired checkpoint folder. (one that contains the tag-folder, like ``global_step14``) + - ``output_dir``: directory to the pytorch fp32 state_dict output files + - ``max_shard_size``: the maximum size for a checkpoint before being sharded, default value is 5GB + - ``safe_serialization``: whether to save the model using `safetensors` or the traditional PyTorch way (that uses `pickle`). + - ``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`` + - ``exclude_frozen_parameters``: exclude frozen parameters + """ + + # Dependency pre-check + if safe_serialization: + try: + from safetensors.torch import save_file + except ImportError: + print('If you want to use `safe_serialization`, please `pip install safetensors`') + raise + if max_shard_size is not None: + try: + from huggingface_hub import split_torch_state_dict_into_shards + except ImportError: + print('If you want to use `max_shard_size`, please `pip install huggingface_hub`') + raise + + # Convert zero checkpoint to state_dict + state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir, + tag, + exclude_frozen_parameters, + lazy_mode=True) + + # Shard the model if it is too big. + weights_name = "model.safetensors" if safe_serialization else "pytorch_model.bin" + if max_shard_size is not None: + filename_pattern = weights_name.replace(".bin", "{suffix}.bin").replace(".safetensors", "{suffix}.safetensors") + # an memory-efficient approach for sharding + empty_state_dict = to_torch_tensor(state_dict, return_empty_tensor=True) + state_dict_split = split_torch_state_dict_into_shards(empty_state_dict, + filename_pattern=filename_pattern, + max_shard_size=max_shard_size) + else: + from collections import namedtuple + StateDictSplit = namedtuple("StateDictSplit", ["is_sharded", "filename_to_tensors"]) + state_dict_split = StateDictSplit(is_sharded=False, + filename_to_tensors={weights_name: list(state_dict.keys())}) + + # Save the model by shard + os.makedirs(output_dir, exist_ok=True) + filename_to_tensors = state_dict_split.filename_to_tensors.items() + for shard_file, tensors in tqdm(filename_to_tensors, desc="Saving checkpoint shards"): + shard_state_dict = {tensor_name: state_dict[tensor_name] for tensor_name in tensors} + shard_state_dict = to_torch_tensor(shard_state_dict) + output_path = os.path.join(output_dir, shard_file) + if safe_serialization: + save_file(shard_state_dict, output_path, metadata={"format": "pt"}) + else: + torch.save(shard_state_dict, output_path) + # release the memory of current shard + for tensor_name in list(shard_state_dict.keys()): + del state_dict[tensor_name] + del shard_state_dict[tensor_name] + del shard_state_dict + gc.collect() + + # Save index if sharded + if state_dict_split.is_sharded: + index = { + "metadata": state_dict_split.metadata, + "weight_map": state_dict_split.tensor_to_filename, + } + save_index_file = "model.safetensors.index.json" if safe_serialization else "pytorch_model.bin.index.json" + save_index_file = os.path.join(output_dir, save_index_file) + with open(save_index_file, "w", encoding="utf-8") as f: + content = json.dumps(index, indent=2, sort_keys=True) + "\n" + f.write(content) + + +def load_state_dict_from_zero_checkpoint(model, checkpoint_dir, tag=None): + """ + 1. Put the provided model to cpu + 2. Convert ZeRO 2 or 3 checkpoint into a single fp32 consolidated ``state_dict`` + 3. Load it into the provided model + + Args: + - ``model``: the model object to update + - ``checkpoint_dir``: path to the desired checkpoint folder. (one that contains the tag-folder, like ``global_step14``) + - ``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`` + + Returns: + - ``model`: modified model + + Make sure you have plenty of CPU memory available before you call this function. If you don't + have enough use the ``zero_to_fp32.py`` utility to do the conversion. You will find it + conveniently placed for you in the checkpoint folder. + + A typical usage might be :: + + from deepspeed.utils.zero_to_fp32 import load_state_dict_from_zero_checkpoint + model = load_state_dict_from_zero_checkpoint(trainer.model, checkpoint_dir) + # submit to model hub or save the model to share with others + + Note, that once this was run, the ``model`` will no longer be usable in the deepspeed context + of the same application. i.e. you will need to re-initialize the deepspeed engine, since + ``model.load_state_dict(state_dict)`` will remove all the deepspeed magic from it. + + """ + logger.info(f"Extracting fp32 weights") + state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir, tag) + + logger.info(f"Overwriting model with fp32 weights") + model = model.cpu() + model.load_state_dict(state_dict, strict=False) + + return model + + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + parser.add_argument("checkpoint_dir", + type=str, + help="path to the desired checkpoint folder, e.g., path/checkpoint-12") + parser.add_argument("output_dir", + type=str, + help="directory to the pytorch fp32 state_dict output files" + "(e.g. path/checkpoint-12-output/)") + parser.add_argument( + "--max_shard_size", + type=str, + default="5GB", + help="The maximum size for a checkpoint before being sharded. Checkpoints shard will then be each of size" + "lower than this size. If expressed as a string, needs to be digits followed by a unit (like `5MB`" + "We default it to 5GB in order for models to be able to run easily on free-tier google colab instances" + "without CPU OOM issues.") + parser.add_argument( + "--safe_serialization", + default=False, + action='store_true', + help="Whether to save the model using `safetensors` or the traditional PyTorch way (that uses `pickle`).") + parser.add_argument("-t", + "--tag", + type=str, + default=None, + help="checkpoint tag used as a unique identifier for checkpoint. e.g., global_step1") + parser.add_argument("--exclude_frozen_parameters", action='store_true', help="exclude frozen parameters") + parser.add_argument("-d", "--debug", action='store_true', help="enable debug") + args = parser.parse_args() + + debug = args.debug + + convert_zero_checkpoint_to_fp32_state_dict(args.checkpoint_dir, + args.output_dir, + max_shard_size=args.max_shard_size, + safe_serialization=args.safe_serialization, + tag=args.tag, + exclude_frozen_parameters=args.exclude_frozen_parameters) diff --git a/checkpoint-1350/README.md b/checkpoint-1350/README.md new file mode 100644 index 0000000000000000000000000000000000000000..4eae946233309baf42f5bad9740186144a4f3b33 --- /dev/null +++ b/checkpoint-1350/README.md @@ -0,0 +1,202 @@ +--- +base_model: ../../initial_seq_model +library_name: peft +--- + +# Model Card for Model ID + + + + + +## Model Details + +### Model Description + + + + + +- **Developed by:** [More Information Needed] +- **Funded by [optional]:** [More Information Needed] +- **Shared by [optional]:** [More Information Needed] +- **Model type:** [More Information Needed] +- **Language(s) (NLP):** [More Information Needed] +- **License:** [More Information Needed] +- **Finetuned from model [optional]:** [More Information Needed] + +### Model Sources [optional] + + + +- **Repository:** [More Information Needed] +- **Paper [optional]:** [More Information Needed] +- **Demo [optional]:** [More Information Needed] + +## Uses + + + +### Direct Use + + + +[More Information Needed] + +### Downstream Use [optional] + + + +[More Information Needed] + +### Out-of-Scope Use + + + +[More Information Needed] + +## Bias, Risks, and Limitations + + + +[More Information Needed] + +### Recommendations + + + +Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations. + +## How to Get Started with the Model + +Use the code below to get started with the model. + +[More Information Needed] + +## Training Details + +### Training Data + + + +[More Information Needed] + +### Training Procedure + + + +#### Preprocessing [optional] + +[More Information Needed] + + +#### Training Hyperparameters + +- **Training regime:** [More Information Needed] + +#### Speeds, Sizes, Times [optional] + + + +[More Information Needed] + +## Evaluation + + + +### Testing Data, Factors & Metrics + +#### Testing Data + + + +[More Information Needed] + +#### Factors + + + +[More Information Needed] + +#### Metrics + + + +[More Information Needed] + +### Results + +[More Information Needed] + +#### Summary + + + +## Model Examination [optional] + + + +[More Information Needed] + +## Environmental Impact + + + +Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700). + +- **Hardware Type:** [More Information Needed] +- **Hours used:** [More Information Needed] +- **Cloud Provider:** [More Information Needed] +- **Compute Region:** [More Information Needed] +- **Carbon Emitted:** [More Information Needed] + +## Technical Specifications [optional] + +### Model Architecture and Objective + +[More Information Needed] + +### Compute Infrastructure + +[More Information Needed] + +#### Hardware + +[More Information Needed] + +#### Software + +[More Information Needed] + +## Citation [optional] + + + +**BibTeX:** + +[More Information Needed] + +**APA:** + +[More Information Needed] + +## Glossary [optional] + + + +[More Information Needed] + +## More Information [optional] + +[More Information Needed] + +## Model Card Authors [optional] + +[More Information Needed] + +## Model Card Contact + +[More Information Needed] +### Framework versions + +- PEFT 0.14.0 \ No newline at end of file diff --git a/checkpoint-1350/adapter_config.json b/checkpoint-1350/adapter_config.json new file mode 100644 index 0000000000000000000000000000000000000000..e1a650486f9ba9bab8c8dbb7d564bdc4ec121cf7 --- /dev/null +++ b/checkpoint-1350/adapter_config.json @@ -0,0 +1,38 @@ +{ + "alpha_pattern": {}, + "auto_mapping": null, + "base_model_name_or_path": "../../initial_seq_model", + "bias": "none", + "eva_config": null, + "exclude_modules": null, + "fan_in_fan_out": false, + "inference_mode": true, + "init_lora_weights": true, + "layer_replication": null, + "layers_pattern": null, + "layers_to_transform": null, + "loftq_config": {}, + "lora_alpha": 16, + "lora_bias": false, + "lora_dropout": 0.1, + "megatron_config": null, + "megatron_core": "megatron.core", + "modules_to_save": null, + "peft_type": "LORA", + "r": 8, + "rank_pattern": {}, + "revision": null, + "target_modules": [ + "k_proj", + "o_proj", + "gate_proj", + "down_proj", + "score", + "v_proj", + "up_proj", + "q_proj" + ], + "task_type": "CAUSAL_LM", + "use_dora": false, + "use_rslora": false +} \ No newline at end of file diff --git a/checkpoint-1350/adapter_model.safetensors b/checkpoint-1350/adapter_model.safetensors new file mode 100644 index 0000000000000000000000000000000000000000..6f71d8b1590b9d6d4afc70634b76128a3da000b5 --- /dev/null +++ b/checkpoint-1350/adapter_model.safetensors @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6942716f04ab77a03ad773d183afb85ea32a856adaaa899e8ddaec5f2e7a9dd8 +size 42068368 diff --git a/checkpoint-1350/global_step1350/bf16_zero_pp_rank_0_mp_rank_00_optim_states.pt b/checkpoint-1350/global_step1350/bf16_zero_pp_rank_0_mp_rank_00_optim_states.pt new file mode 100644 index 0000000000000000000000000000000000000000..3bcdc7d34ef3a81561b36fe5eee6fdfd1148a7d4 --- /dev/null +++ b/checkpoint-1350/global_step1350/bf16_zero_pp_rank_0_mp_rank_00_optim_states.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7521c847d6faaa41efac9db9952930caa1284ab48b7733895d011096b6e18a86 +size 63016432 diff --git a/checkpoint-1350/global_step1350/bf16_zero_pp_rank_1_mp_rank_00_optim_states.pt b/checkpoint-1350/global_step1350/bf16_zero_pp_rank_1_mp_rank_00_optim_states.pt new file mode 100644 index 0000000000000000000000000000000000000000..151d75ee5b56f940fdb8d7e5744c04e3257c965d --- /dev/null +++ b/checkpoint-1350/global_step1350/bf16_zero_pp_rank_1_mp_rank_00_optim_states.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5be68663317cff38fae5854242e42fdac038bc950290e4c418f17cca087c4bfc +size 63016432 diff --git a/checkpoint-1350/global_step1350/bf16_zero_pp_rank_2_mp_rank_00_optim_states.pt b/checkpoint-1350/global_step1350/bf16_zero_pp_rank_2_mp_rank_00_optim_states.pt new file mode 100644 index 0000000000000000000000000000000000000000..5ba9a3f54d85a4bf73df5b8f7b82735db9b2d28f --- /dev/null +++ b/checkpoint-1350/global_step1350/bf16_zero_pp_rank_2_mp_rank_00_optim_states.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5331644d710f7eda96c8b740f8ba6a1d117e64e201c37d0044ebd612a7311af7 +size 63016432 diff --git a/checkpoint-1350/global_step1350/bf16_zero_pp_rank_3_mp_rank_00_optim_states.pt b/checkpoint-1350/global_step1350/bf16_zero_pp_rank_3_mp_rank_00_optim_states.pt new file mode 100644 index 0000000000000000000000000000000000000000..ee16dea1a56851a5410164fcd117298c6f41b24a --- /dev/null +++ b/checkpoint-1350/global_step1350/bf16_zero_pp_rank_3_mp_rank_00_optim_states.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9e9cb9d5fd26e03d1b4436a49484519215a1e76f840729558106f0d5ec0dac22 +size 63016432 diff --git a/checkpoint-1350/global_step1350/zero_pp_rank_0_mp_rank_00_model_states.pt b/checkpoint-1350/global_step1350/zero_pp_rank_0_mp_rank_00_model_states.pt new file mode 100644 index 0000000000000000000000000000000000000000..613d19a63a146ad42b415673459d2a8deb290be3 --- /dev/null +++ b/checkpoint-1350/global_step1350/zero_pp_rank_0_mp_rank_00_model_states.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8e656dbfda0371feb26437b57c03285d0210f45d54f9101cdea77602bdfddfe2 +size 442088 diff --git a/checkpoint-1350/global_step1350/zero_pp_rank_1_mp_rank_00_model_states.pt b/checkpoint-1350/global_step1350/zero_pp_rank_1_mp_rank_00_model_states.pt new file mode 100644 index 0000000000000000000000000000000000000000..edd4fdbb52da7cd9f428d9f432615bc4b1a3aa9b --- /dev/null +++ b/checkpoint-1350/global_step1350/zero_pp_rank_1_mp_rank_00_model_states.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fe6f8f7ccffed2dffc8ac877cdb5ded1aefc09b3073aad812ed836ecc3284e5f +size 442088 diff --git a/checkpoint-1350/global_step1350/zero_pp_rank_2_mp_rank_00_model_states.pt b/checkpoint-1350/global_step1350/zero_pp_rank_2_mp_rank_00_model_states.pt new file mode 100644 index 0000000000000000000000000000000000000000..9a3a557cb2540cf0c97373293d2535d7b586453d --- /dev/null +++ b/checkpoint-1350/global_step1350/zero_pp_rank_2_mp_rank_00_model_states.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b72fed7c36cd5ec160357598b96f0e14250e494a606367f733db50bd80cba9ff +size 442088 diff --git a/checkpoint-1350/global_step1350/zero_pp_rank_3_mp_rank_00_model_states.pt b/checkpoint-1350/global_step1350/zero_pp_rank_3_mp_rank_00_model_states.pt new file mode 100644 index 0000000000000000000000000000000000000000..58b27388a9b1c12422ffe6304757665d2a0db083 --- /dev/null +++ b/checkpoint-1350/global_step1350/zero_pp_rank_3_mp_rank_00_model_states.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ad099092ff4e19fc34c73e92008b5ae6a8d9e389a18f588d30092e0fcb2fad39 +size 442088 diff --git a/checkpoint-1350/latest b/checkpoint-1350/latest new file mode 100644 index 0000000000000000000000000000000000000000..15ec6a3a61155180aa52e83b667631773941818d --- /dev/null +++ b/checkpoint-1350/latest @@ -0,0 +1 @@ +global_step1350 \ No newline at end of file diff --git a/checkpoint-1350/rng_state_0.pth b/checkpoint-1350/rng_state_0.pth new file mode 100644 index 0000000000000000000000000000000000000000..f1a0e1b15b8e1b634c34eb026a48f98aaa8ab365 --- /dev/null +++ b/checkpoint-1350/rng_state_0.pth @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:46bf5479edcb30ecf443e8e3fe26cab353655f6b4c61dfcc9d006612ce91bb65 +size 14960 diff --git a/checkpoint-1350/rng_state_1.pth b/checkpoint-1350/rng_state_1.pth new file mode 100644 index 0000000000000000000000000000000000000000..0bdebd69c0b12b200fe3a617ca456a1369666773 --- /dev/null +++ b/checkpoint-1350/rng_state_1.pth @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:85d65bfa2c3a8b3dc9e00768c1d57b3a2ff964dd403badee84b0969c2e0c1e61 +size 14960 diff --git a/checkpoint-1350/rng_state_2.pth b/checkpoint-1350/rng_state_2.pth new file mode 100644 index 0000000000000000000000000000000000000000..6a0a6f9f5049d736fbbde7501996b488c044c0c5 --- /dev/null +++ b/checkpoint-1350/rng_state_2.pth @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:227642b8c6d4a0fc7e965c8d0540737c6816163551ad39628760b10dbdbef9b1 +size 14960 diff --git a/checkpoint-1350/rng_state_3.pth b/checkpoint-1350/rng_state_3.pth new file mode 100644 index 0000000000000000000000000000000000000000..14a750410b1cc73808e0bb69a4f884774d1a125c --- /dev/null +++ b/checkpoint-1350/rng_state_3.pth @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e122a48ef250b002da56d9822c4fd63df2f4a3f7d88b8432b6289bcb5b1452bd +size 14960 diff --git a/checkpoint-1350/scheduler.pt b/checkpoint-1350/scheduler.pt new file mode 100644 index 0000000000000000000000000000000000000000..54d5ebac76364fe4f1e54ba5d7a6ff5b84248736 --- /dev/null +++ b/checkpoint-1350/scheduler.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f08d8a8ac8848f368c47b63728f27dab6d8bcbdb7a36e37054de18a2635340e9 +size 1064 diff --git a/checkpoint-1350/special_tokens_map.json b/checkpoint-1350/special_tokens_map.json new file mode 100644 index 0000000000000000000000000000000000000000..a8eb9ef63af01dfa2c350573b543b14275370944 --- /dev/null +++ b/checkpoint-1350/special_tokens_map.json @@ -0,0 +1,30 @@ +{ + "bos_token": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false + }, + "eos_token": { + "content": "<|END_OF_TURN_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false + }, + "pad_token": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false + }, + "unk_token": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false + } +} diff --git a/checkpoint-1350/tokenizer.json b/checkpoint-1350/tokenizer.json new file mode 100644 index 0000000000000000000000000000000000000000..91a1344d38167f152a8803a80eb79ca4b465adbb --- /dev/null +++ b/checkpoint-1350/tokenizer.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:28c8b8038fcb2756e349a51832a56634423c579a869f39642526327aa56b2989 +size 20125189 diff --git a/checkpoint-1350/tokenizer_config.json b/checkpoint-1350/tokenizer_config.json new file mode 100644 index 0000000000000000000000000000000000000000..100ac1a3b6cff4a9043d2c0fd6b1603d1c1ee1e1 --- /dev/null +++ b/checkpoint-1350/tokenizer_config.json @@ -0,0 +1,364 @@ +{ + "add_bos_token": true, + "add_eos_token": false, + "add_prefix_space": false, + "added_tokens_decoder": { + "0": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "1": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "2": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "3": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "4": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "5": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "6": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "7": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "255000": { + "content": "<|START_OF_TURN_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255001": { + "content": "<|END_OF_TURN_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "255002": { + "content": "<|YES_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255003": { + "content": "<|NO_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255004": { + "content": "<|GOOD_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255005": { + "content": "<|BAD_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255006": { + "content": "<|USER_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255007": { + "content": "<|CHATBOT_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255008": { + "content": "<|SYSTEM_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255009": { + "content": "<|USER_0_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255010": { + "content": "<|USER_1_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255011": { + "content": "<|USER_2_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255012": { + "content": "<|USER_3_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255013": { + "content": "<|USER_4_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255014": { + "content": "<|USER_5_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255015": { + "content": "<|USER_6_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255016": { + "content": "<|USER_7_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255017": { + "content": "<|USER_8_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255018": { + "content": "<|USER_9_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255019": { + "content": "<|START_THINKING|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255020": { + "content": "<|END_THINKING|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255021": { + "content": "<|START_RESPONSE|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "255022": { + "content": "<|END_RESPONSE|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "255023": { + "content": "<|START_ACTION|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255024": { + "content": "<|END_ACTION|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255025": { + "content": "<|START_TOOL_RESULT|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255026": { + "content": "<|END_TOOL_RESULT|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255027": { + "content": "<|EXTRA_8_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255028": { + "content": "<|NEW_FILE|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "255029": { + "content": "<|BEGINNING_OF_PREFIX_FIM_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255030": { + "content": "<|BEGINNING_OF_MIDDLE_FIM_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255031": { + "content": "<|BEGINNING_OF_SUFFIX_FIM_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255032": { + "content": "<|END_OF_MIDDLE_FIM_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + } + }, + "bos_token": "", + "chat_template": [ + { + "name": "default", + "template": "{% if documents %}\n{% set tools = [] %}\n{%- macro document_turn(documents) -%}\n{# format documents into chat turn #}\n<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|><|START_THINKING|>I will look through the document to address the users needs.<|END_THINKING|><|START_ACTION|>[\n {\"tool_call_id\": \"0\", \"tool_name\": \"direct-injected-document\", \"parameters\": {}}\n]<|END_ACTION|><|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|><|START_TOOL_RESULT|>[\n {\n \"tool_call_id\": \"0\",\n \"results\": {\n{% for doc in documents %}\n \"{{ loop.index0 }}\": {{doc|tojson}}{% if not loop.last %},\n {% endif %}\n{% endfor %}\n\n },\n \"is_error\": null\n }\n]<|END_TOOL_RESULT|><|END_OF_TURN_TOKEN|>{%- endmacro %}\n{%- macro tool_call_id_to_int(messages, tool_call_id) %}\n{%- set counter = namespace(value=0) %}\n{%- set tool_call_id_seen = namespace(value=false) %}\n{%- for msg in messages %}\n {%- if msg.tool_calls %}\n {%- for tool_call in msg.tool_calls %}\n {%- if tool_call.id == tool_call_id and not tool_call_id_seen.value -%}\n {{ counter.value }}\n {%- set tool_call_id_seen.value = true %}\n {%- endif %}\n {%- set counter.value = counter.value + 1 %}\n {%- endfor %}\n {%- endif %}\n{%- endfor %}\n{%- endmacro %}\n{%- macro format_tool_message(messages, tool_msg) -%}\n{# format tool message #}\n {\n \"tool_call_id\": \"{{ tool_call_id_to_int(messages, tool_msg.tool_call_id) }}\",\n \"results\": {\n \"0\": {{ tool_msg.content|tojson }}\n },\n \"is_error\": null\n }\n{%- endmacro -%}\n{%- if messages and messages[0]['role']|lower == 'system' %}{%- set developer_preamble = messages[0]['content'] %}{% endif %}\n{%- set tool_idx = namespace(value=0) %}\n{%- set tool_ids_seen = namespace(value=[]) %}\n{%- set sent_documents = namespace(value=false) %}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|># System Preamble\nYou are in contextual safety mode. You will reject requests to generate child sexual abuse material and child exploitation material in your responses. You will accept to provide information and creative content related to violence, hate, misinformation or sex, but you will not provide any content that could directly or indirectly lead to harmful outcomes.\n\nYour information cutoff date is June 2024.\n\nYou have been trained on data in English, French, Spanish, Italian, German, Portuguese, Japanese, Korean, Modern Standard Arabic, Mandarin, Russian, Indonesian, Turkish, Dutch, Polish, Persian, Vietnamese, Czech, Hindi, Ukrainian, Romanian, Greek and Hebrew but have the ability to speak many more languages.\n{% if tools or documents %}\n\nYou have been trained to have advanced reasoning and tool-use capabilities and you should make best use of these skills to serve user's requests.\n\n## Tool Use\nThink about how you can make best use of the provided tools to help with the task and come up with a high level plan that you will execute first.\n\n0. Start by writing <|START_THINKING|> followed by a detailed step by step plan of how you will solve the problem. For each step explain your thinking fully and give details of required tool calls (if needed). Unless specified otherwise, you write your plan in natural language. When you finish, close it out with <|END_THINKING|>.\n You can optionally choose to skip this step when the user request is so straightforward to address that only a trivial plan would be needed.\n NOTE: You MUST skip this step when you are directly responding to the user's request without using any tools.\n\nThen carry out your plan by repeatedly executing the following steps.\n1. Action: write <|START_ACTION|> followed by a list of JSON-formatted tool calls, with each one containing \"tool_name\" and \"parameters\" fields.\n When there are multiple tool calls which are completely independent of each other (i.e. they can be executed in parallel), you should list them out all together in one step. When you finish, close it out with <|END_ACTION|>.\n2. Observation: you will then receive results of those tool calls in JSON format in the very next turn, wrapped around by <|START_TOOL_RESULT|> and <|END_TOOL_RESULT|>. Carefully observe those results and think about what to do next. Note that these results will be provided to you in a separate turn. NEVER hallucinate results.\n Every tool call produces a list of results (when a tool call produces no result or a single result, it'll still get wrapped inside a list). Each result is clearly linked to its originating tool call via its \"tool_call_id\".\n3. Reflection: start the next turn by writing <|START_THINKING|> followed by what you've figured out so far, any changes you need to make to your plan, and what you will do next. When you finish, close it out with <|END_THINKING|>.\n You can optionally choose to skip this step when everything is going according to plan and no special pieces of information or reasoning chains need to be recorded.\n NOTE: You MUST skip this step when you are done with tool-use actions and are ready to respond to the user.\n\nYou can repeat the above 3 steps multiple times (could be 0 times too if no suitable tool calls are available or needed), until you decide it's time to finally respond to the user.\n\n4. Response: then break out of the loop and write <|START_RESPONSE|> followed by a piece of text which serves as a response to the user's last request. Use all previous tool calls and results to help you when formulating your response. When you finish, close it out with <|END_RESPONSE|>.\n{% if enable_citations %}\n\n## Grounding\nImportantly, note that \"Reflection\" and \"Response\" above can be grounded.\nGrounding means you associate pieces of texts (called \"spans\") with those specific tool results that support them (called \"sources\"). And you use a pair of tags \"\" and \"\" to indicate when a span can be grounded onto a list of sources, listing them out in the closing tag. Sources from the same tool call are grouped together and listed as \"{tool_call_id}:[{list of result indices}]\", before they are joined together by \",\". E.g., \"span\" means that \"span\" is supported by result 1 and 2 from \"tool_call_id=0\" as well as result 0 from \"tool_call_id=1\".\n{% endif %}\n\n## Available Tools\nHere is the list of tools that you have available to you.\nYou can ONLY use the tools listed here. When a tool is not listed below, it is NOT available and you should NEVER attempt to use it.\nEach tool is represented as a JSON object with fields like \"name\", \"description\", \"parameters\" (per JSON Schema), and optionally, \"responses\" (per JSON Schema).\n\n```json\n[\n{% if documents %}\n {\"name\": \"direct-injected-document\", \"description\": \"This is a special tool to directly inject user-uploaded documents into the chat as additional context. DO NOT use this tool by yourself!\", \"parameters\": {\"type\": \"object\", \"properties\": {}, \"required\": []}, \"responses\": {\"200\": {\"description\": \"Successfully returned a list of chunked text snippets from the directly uploaded documents.\", \"content\": {\"application/json\": {\"schema\": {\"type\": \"array\", \"items\": {\"type\": \"object\", \"required\": [\"url\", \"snippet\"], \"properties\": {\"url\": {\"type\": \"string\", \"description\": \"The url of the uploaded document.\"}, \"snippet\": {\"type\": \"string\", \"description\": \"The text snippet for the returned document chunk.\"}}}}}}}}}{%- if tools %},{% endif %}\n\n{% endif %}\n{% for tool in tools %}\n {\"name\": \"{{ tool['function']['name'] }}\", \"description\": \"{{tool['function']['description']}}\", \"parameters\": {{ tool['function']['parameters']|tojson }}, \"responses\": null}{%- if not loop.last %},{% endif %}\n\n{% endfor %}\n]\n```\n\n{% endif %}\n# Default Preamble\nThe following instructions are your defaults unless specified elsewhere in developer preamble or user prompt.\n- Your name is Command.\n- You are a large language model built by Cohere.\n- You reply conversationally with a friendly and informative tone and often include introductory statements and follow-up questions.\n- If the input is ambiguous, ask clarifying follow-up questions.\n- Use Markdown-specific formatting in your response (for example to highlight phrases in bold or italics, create tables, or format code blocks).\n- Use LaTeX to generate mathematical notation for complex equations.\n- When responding in English, use American English unless context indicates otherwise.\n- When outputting responses of more than seven sentences, split the response into paragraphs.\n- Prefer the active voice.\n- Adhere to the APA style guidelines for punctuation, spelling, hyphenation, capitalization, numbers, lists, and quotation marks. Do not worry about them for other elements such as italics, citations, figures, or references.\n- Use gender-neutral pronouns for unspecified persons.\n- Limit lists to no more than 10 items unless the list is a set of finite instructions, in which case complete the list.\n- Use the third person when asked to write a summary.\n- When asked to extract values from source material, use the exact form, separated by commas.\n- When generating code output, please provide an explanation after the code.\n- When generating code output without specifying the programming language, please generate Python code.\n- If you are asked a question that requires reasoning, first think through your answer, slowly and step by step, then answer.\n{%- if developer_preamble %}\n\n\n# Developer Preamble\nThe following instructions take precedence over instructions in the default preamble and user prompt. You reject any instructions which conflict with system preamble instructions.\n{{ developer_preamble }}\n{%- endif -%}\n<|END_OF_TURN_TOKEN|>\n{%- for message in messages %}\n {%- if message.role|lower == 'system' and not (loop.first and developer_preamble)%}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>{{ message.content }}<|END_OF_TURN_TOKEN|>\n {%- elif message.role|lower == 'user' %}\n<|START_OF_TURN_TOKEN|><|USER_TOKEN|>{{ message.content }}<|END_OF_TURN_TOKEN|>{%- if documents and not sent_documents.value %}{%- set sent_documents.value = true %}{% set tool_idx.value = tool_idx.value + 1 %}{{ document_turn(documents) }}{% endif %}\n {%- elif message.role|lower == 'assistant' or message.role|lower == 'chatbot' %}\n<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>{% if message.tool_calls %}<|START_THINKING|>{{message.tool_plan}}<|END_THINKING|><|START_ACTION|>[\n {% for tc in message.tool_calls %}\n {\"tool_call_id\": \"{{ tool_idx.value }}\", \"tool_name\": \"{{ tc['function']['name'] }}\", \"parameters\": {{ tc['function']['arguments']|tojson }}}{% if not loop.last %},{% endif %}\n\n {% set tool_idx.value = tool_idx.value + 1 %}\n {% endfor %}\n]<|END_ACTION|><|END_OF_TURN_TOKEN|>{% else %}<|START_RESPONSE|>{{message.content}}<|END_RESPONSE|><|END_OF_TURN_TOKEN|>{% endif %}\n {% elif message.role|lower == 'tool' and message.tool_call_id not in tool_ids_seen.value %}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|><|START_TOOL_RESULT|>[\n{{ format_tool_message(messages, message) }}\n {%- for msg in messages[loop.index0 + 1:] %}\n {%- if msg.role|lower == 'tool' %},\n{{ format_tool_message(messages, msg) }}\n {%- set tool_ids_seen.value = tool_ids_seen.value + [msg.tool_call_id] %}\n {%- else %}\n {%- break %}\n {%- endif %}\n {%- endfor %}\n\n]<|END_TOOL_RESULT|><|END_OF_TURN_TOKEN|>\n {%- endif %}\n{%- endfor %}<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>\n{%- else -%}\n{% if messages[0]['role'] == 'system' %}{% set loop_messages = messages[1:] %}\n {%- set system_message = messages[0]['content'] %}{% elif false == true %}\n {%- set loop_messages = messages %}{% set system_message = '' %}\n{%- else %}\n {%- set loop_messages = messages %}\n {%- set system_message = false %}\n{%- endif %}\n{%- if system_message != false -%}\n {{ '<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>' + system_message + '<|END_OF_TURN_TOKEN|>' }}\n{%- else -%}\n {{ '<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|><|END_OF_TURN_TOKEN|>' }}\n{%- endif %}\n{%- for message in loop_messages %}\n {%- if (message['role'] == 'user') != (loop.index0 % 2 == 0) -%}\n {{ raise_exception('Conversation roles must alternate user/assistant/user/assistant/...') }}\n {%- endif -%}\n {%- set content = message['content'] -%}\n {%- if message['role'] == 'user' -%}\n {{ '<|START_OF_TURN_TOKEN|><|USER_TOKEN|>' + content.strip() + '<|END_OF_TURN_TOKEN|>' }}\n {%- elif message['role'] == 'assistant' -%}\n {{ '<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|><|START_RESPONSE|>' + content.strip() + '<|END_RESPONSE|><|END_OF_TURN_TOKEN|>' }}\n {%- endif %}\n{%- endfor %}\n{%- if add_generation_prompt -%}\n {{ '<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|><|START_RESPONSE|>' }}\n{%- endif %}\n{% endif %}" + }, + { + "name": "tool_use", + "template": "{%- macro document_turn(documents) -%}\n{# format documents into chat turn #}\n<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|><|START_THINKING|>I will look through the document to address the users needs.<|END_THINKING|><|START_ACTION|>[\n {\"tool_call_id\": \"0\", \"tool_name\": \"direct-injected-document\", \"parameters\": {}}\n]<|END_ACTION|><|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|><|START_TOOL_RESULT|>[\n {\n \"tool_call_id\": \"0\",\n \"results\": {\n{% for doc in documents %}\n \"{{ loop.index0 }}\": {{doc|tojson}}{% if not loop.last %},\n {% endif %}\n{% endfor %}\n\n },\n \"is_error\": null\n }\n]<|END_TOOL_RESULT|><|END_OF_TURN_TOKEN|>{%- endmacro %}\n{%- macro tool_call_id_to_int(messages, tool_call_id) %}\n{%- set counter = namespace(value=0) %}\n{%- set tool_call_id_seen = namespace(value=false) %}\n{%- for msg in messages %}\n {%- if msg.tool_calls %}\n {%- for tool_call in msg.tool_calls %}\n {%- if tool_call.id == tool_call_id and not tool_call_id_seen.value -%}\n {{ counter.value }}\n {%- set tool_call_id_seen.value = true %}\n {%- endif %}\n {%- set counter.value = counter.value + 1 %}\n {%- endfor %}\n {%- endif %}\n{%- endfor %}\n{%- endmacro %}\n{%- macro format_tool_message(messages, tool_msg) -%}\n{# format tool message #}\n {\n \"tool_call_id\": \"{{ tool_call_id_to_int(messages, tool_msg.tool_call_id) }}\",\n \"results\": {\n \"0\": {{ tool_msg.content|tojson }}\n },\n \"is_error\": null\n }\n{%- endmacro -%}\n{%- if messages and messages[0]['role']|lower == 'system' %}{%- set developer_preamble = messages[0]['content'] %}{% endif %}\n{%- set tool_idx = namespace(value=0) %}\n{%- set tool_ids_seen = namespace(value=[]) %}\n{%- set sent_documents = namespace(value=false) %}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|># System Preamble\nYou are in contextual safety mode. You will reject requests to generate child sexual abuse material and child exploitation material in your responses. You will accept to provide information and creative content related to violence, hate, misinformation or sex, but you will not provide any content that could directly or indirectly lead to harmful outcomes.\n\nYour information cutoff date is June 2024.\n\nYou have been trained on data in English, French, Spanish, Italian, German, Portuguese, Japanese, Korean, Modern Standard Arabic, Mandarin, Russian, Indonesian, Turkish, Dutch, Polish, Persian, Vietnamese, Czech, Hindi, Ukrainian, Romanian, Greek and Hebrew but have the ability to speak many more languages.\n{% if tools or documents %}\n\nYou have been trained to have advanced reasoning and tool-use capabilities and you should make best use of these skills to serve user's requests.\n\n## Tool Use\nThink about how you can make best use of the provided tools to help with the task and come up with a high level plan that you will execute first.\n\n0. Start by writing <|START_THINKING|> followed by a detailed step by step plan of how you will solve the problem. For each step explain your thinking fully and give details of required tool calls (if needed). Unless specified otherwise, you write your plan in natural language. When you finish, close it out with <|END_THINKING|>.\n You can optionally choose to skip this step when the user request is so straightforward to address that only a trivial plan would be needed.\n NOTE: You MUST skip this step when you are directly responding to the user's request without using any tools.\n\nThen carry out your plan by repeatedly executing the following steps.\n1. Action: write <|START_ACTION|> followed by a list of JSON-formatted tool calls, with each one containing \"tool_name\" and \"parameters\" fields.\n When there are multiple tool calls which are completely independent of each other (i.e. they can be executed in parallel), you should list them out all together in one step. When you finish, close it out with <|END_ACTION|>.\n2. Observation: you will then receive results of those tool calls in JSON format in the very next turn, wrapped around by <|START_TOOL_RESULT|> and <|END_TOOL_RESULT|>. Carefully observe those results and think about what to do next. Note that these results will be provided to you in a separate turn. NEVER hallucinate results.\n Every tool call produces a list of results (when a tool call produces no result or a single result, it'll still get wrapped inside a list). Each result is clearly linked to its originating tool call via its \"tool_call_id\".\n3. Reflection: start the next turn by writing <|START_THINKING|> followed by what you've figured out so far, any changes you need to make to your plan, and what you will do next. When you finish, close it out with <|END_THINKING|>.\n You can optionally choose to skip this step when everything is going according to plan and no special pieces of information or reasoning chains need to be recorded.\n NOTE: You MUST skip this step when you are done with tool-use actions and are ready to respond to the user.\n\nYou can repeat the above 3 steps multiple times (could be 0 times too if no suitable tool calls are available or needed), until you decide it's time to finally respond to the user.\n\n4. Response: then break out of the loop and write <|START_RESPONSE|> followed by a piece of text which serves as a response to the user's last request. Use all previous tool calls and results to help you when formulating your response. When you finish, close it out with <|END_RESPONSE|>.\n{% if enable_citations %}\n\n## Grounding\nImportantly, note that \"Reflection\" and \"Response\" above can be grounded.\nGrounding means you associate pieces of texts (called \"spans\") with those specific tool results that support them (called \"sources\"). And you use a pair of tags \"\" and \"\" to indicate when a span can be grounded onto a list of sources, listing them out in the closing tag. Sources from the same tool call are grouped together and listed as \"{tool_call_id}:[{list of result indices}]\", before they are joined together by \",\". E.g., \"span\" means that \"span\" is supported by result 1 and 2 from \"tool_call_id=0\" as well as result 0 from \"tool_call_id=1\".\n{% endif %}\n\n## Available Tools\nHere is the list of tools that you have available to you.\nYou can ONLY use the tools listed here. When a tool is not listed below, it is NOT available and you should NEVER attempt to use it.\nEach tool is represented as a JSON object with fields like \"name\", \"description\", \"parameters\" (per JSON Schema), and optionally, \"responses\" (per JSON Schema).\n\n```json\n[\n{% if documents %}\n {\"name\": \"direct-injected-document\", \"description\": \"This is a special tool to directly inject user-uploaded documents into the chat as additional context. DO NOT use this tool by yourself!\", \"parameters\": {\"type\": \"object\", \"properties\": {}, \"required\": []}, \"responses\": {\"200\": {\"description\": \"Successfully returned a list of chunked text snippets from the directly uploaded documents.\", \"content\": {\"application/json\": {\"schema\": {\"type\": \"array\", \"items\": {\"type\": \"object\", \"required\": [\"url\", \"snippet\"], \"properties\": {\"url\": {\"type\": \"string\", \"description\": \"The url of the uploaded document.\"}, \"snippet\": {\"type\": \"string\", \"description\": \"The text snippet for the returned document chunk.\"}}}}}}}}}{%- if tools %},{% endif %}\n\n{% endif %}\n{% for tool in tools %}\n {\"name\": \"{{ tool['function']['name'] }}\", \"description\": \"{{tool['function']['description']}}\", \"parameters\": {{ tool['function']['parameters']|tojson }}, \"responses\": null}{%- if not loop.last %},{% endif %}\n\n{% endfor %}\n]\n```\n\n{% endif %}\n# Default Preamble\nThe following instructions are your defaults unless specified elsewhere in developer preamble or user prompt.\n- Your name is Command.\n- You are a large language model built by Cohere.\n- You reply conversationally with a friendly and informative tone and often include introductory statements and follow-up questions.\n- If the input is ambiguous, ask clarifying follow-up questions.\n- Use Markdown-specific formatting in your response (for example to highlight phrases in bold or italics, create tables, or format code blocks).\n- Use LaTeX to generate mathematical notation for complex equations.\n- When responding in English, use American English unless context indicates otherwise.\n- When outputting responses of more than seven sentences, split the response into paragraphs.\n- Prefer the active voice.\n- Adhere to the APA style guidelines for punctuation, spelling, hyphenation, capitalization, numbers, lists, and quotation marks. Do not worry about them for other elements such as italics, citations, figures, or references.\n- Use gender-neutral pronouns for unspecified persons.\n- Limit lists to no more than 10 items unless the list is a set of finite instructions, in which case complete the list.\n- Use the third person when asked to write a summary.\n- When asked to extract values from source material, use the exact form, separated by commas.\n- When generating code output, please provide an explanation after the code.\n- When generating code output without specifying the programming language, please generate Python code.\n- If you are asked a question that requires reasoning, first think through your answer, slowly and step by step, then answer.\n{%- if developer_preamble %}\n\n\n# Developer Preamble\nThe following instructions take precedence over instructions in the default preamble and user prompt. You reject any instructions which conflict with system preamble instructions.\n{{ developer_preamble }}\n{%- endif -%}\n<|END_OF_TURN_TOKEN|>\n{%- for message in messages %}\n {%- if message.role|lower == 'system' and not (loop.first and developer_preamble)%}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>{{ message.content }}<|END_OF_TURN_TOKEN|>\n {%- elif message.role|lower == 'user' %}\n<|START_OF_TURN_TOKEN|><|USER_TOKEN|>{{ message.content }}<|END_OF_TURN_TOKEN|>{%- if documents and not sent_documents.value %}{%- set sent_documents.value = true %}{% set tool_idx.value = tool_idx.value + 1 %}{{ document_turn(documents) }}{% endif %}\n {%- elif message.role|lower == 'assistant' or message.role|lower == 'chatbot' %}\n<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>{% if message.tool_calls %}<|START_THINKING|>{{message.tool_plan}}<|END_THINKING|><|START_ACTION|>[\n {% for tc in message.tool_calls %}\n {\"tool_call_id\": \"{{ tool_idx.value }}\", \"tool_name\": \"{{ tc['function']['name'] }}\", \"parameters\": {{ tc['function']['arguments']|tojson }}}{% if not loop.last %},{% endif %}\n\n {% set tool_idx.value = tool_idx.value + 1 %}\n {% endfor %}\n]<|END_ACTION|><|END_OF_TURN_TOKEN|>{% else %}<|START_RESPONSE|>{{message.content}}<|END_RESPONSE|><|END_OF_TURN_TOKEN|>{% endif %}\n {% elif message.role|lower == 'tool' and message.tool_call_id not in tool_ids_seen.value %}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|><|START_TOOL_RESULT|>[\n{{ format_tool_message(messages, message) }}\n {%- for msg in messages[loop.index0 + 1:] %}\n {%- if msg.role|lower == 'tool' %},\n{{ format_tool_message(messages, msg) }}\n {%- set tool_ids_seen.value = tool_ids_seen.value + [msg.tool_call_id] %}\n {%- else %}\n {%- break %}\n {%- endif %}\n {%- endfor %}\n\n]<|END_TOOL_RESULT|><|END_OF_TURN_TOKEN|>\n {%- endif %}\n{%- endfor %}<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>" + }, + { + "name": "rag", + "template": "{% set tools = [] %}\n{%- macro document_turn(documents) -%}\n{# format documents into chat turn #}\n<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|><|START_THINKING|>I will look through the document to address the users needs.<|END_THINKING|><|START_ACTION|>[\n {\"tool_call_id\": \"0\", \"tool_name\": \"direct-injected-document\", \"parameters\": {}}\n]<|END_ACTION|><|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|><|START_TOOL_RESULT|>[\n {\n \"tool_call_id\": \"0\",\n \"results\": {\n{% for doc in documents %}\n \"{{ loop.index0 }}\": {{doc|tojson}}{% if not loop.last %},\n {% endif %}\n{% endfor %}\n\n },\n \"is_error\": null\n }\n]<|END_TOOL_RESULT|><|END_OF_TURN_TOKEN|>{%- endmacro %}\n{%- macro tool_call_id_to_int(messages, tool_call_id) %}\n{%- set counter = namespace(value=0) %}\n{%- set tool_call_id_seen = namespace(value=false) %}\n{%- for msg in messages %}\n {%- if msg.tool_calls %}\n {%- for tool_call in msg.tool_calls %}\n {%- if tool_call.id == tool_call_id and not tool_call_id_seen.value -%}\n {{ counter.value }}\n {%- set tool_call_id_seen.value = true %}\n {%- endif %}\n {%- set counter.value = counter.value + 1 %}\n {%- endfor %}\n {%- endif %}\n{%- endfor %}\n{%- endmacro %}\n{%- macro format_tool_message(messages, tool_msg) -%}\n{# format tool message #}\n {\n \"tool_call_id\": \"{{ tool_call_id_to_int(messages, tool_msg.tool_call_id) }}\",\n \"results\": {\n \"0\": {{ tool_msg.content|tojson }}\n },\n \"is_error\": null\n }\n{%- endmacro -%}\n{%- if messages and messages[0]['role']|lower == 'system' %}{%- set developer_preamble = messages[0]['content'] %}{% endif %}\n{%- set tool_idx = namespace(value=0) %}\n{%- set tool_ids_seen = namespace(value=[]) %}\n{%- set sent_documents = namespace(value=false) %}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|># System Preamble\nYou are in contextual safety mode. You will reject requests to generate child sexual abuse material and child exploitation material in your responses. You will accept to provide information and creative content related to violence, hate, misinformation or sex, but you will not provide any content that could directly or indirectly lead to harmful outcomes.\n\nYour information cutoff date is June 2024.\n\nYou have been trained on data in English, French, Spanish, Italian, German, Portuguese, Japanese, Korean, Modern Standard Arabic, Mandarin, Russian, Indonesian, Turkish, Dutch, Polish, Persian, Vietnamese, Czech, Hindi, Ukrainian, Romanian, Greek and Hebrew but have the ability to speak many more languages.\n{% if tools or documents %}\n\nYou have been trained to have advanced reasoning and tool-use capabilities and you should make best use of these skills to serve user's requests.\n\n## Tool Use\nThink about how you can make best use of the provided tools to help with the task and come up with a high level plan that you will execute first.\n\n0. Start by writing <|START_THINKING|> followed by a detailed step by step plan of how you will solve the problem. For each step explain your thinking fully and give details of required tool calls (if needed). Unless specified otherwise, you write your plan in natural language. When you finish, close it out with <|END_THINKING|>.\n You can optionally choose to skip this step when the user request is so straightforward to address that only a trivial plan would be needed.\n NOTE: You MUST skip this step when you are directly responding to the user's request without using any tools.\n\nThen carry out your plan by repeatedly executing the following steps.\n1. Action: write <|START_ACTION|> followed by a list of JSON-formatted tool calls, with each one containing \"tool_name\" and \"parameters\" fields.\n When there are multiple tool calls which are completely independent of each other (i.e. they can be executed in parallel), you should list them out all together in one step. When you finish, close it out with <|END_ACTION|>.\n2. Observation: you will then receive results of those tool calls in JSON format in the very next turn, wrapped around by <|START_TOOL_RESULT|> and <|END_TOOL_RESULT|>. Carefully observe those results and think about what to do next. Note that these results will be provided to you in a separate turn. NEVER hallucinate results.\n Every tool call produces a list of results (when a tool call produces no result or a single result, it'll still get wrapped inside a list). Each result is clearly linked to its originating tool call via its \"tool_call_id\".\n3. Reflection: start the next turn by writing <|START_THINKING|> followed by what you've figured out so far, any changes you need to make to your plan, and what you will do next. When you finish, close it out with <|END_THINKING|>.\n You can optionally choose to skip this step when everything is going according to plan and no special pieces of information or reasoning chains need to be recorded.\n NOTE: You MUST skip this step when you are done with tool-use actions and are ready to respond to the user.\n\nYou can repeat the above 3 steps multiple times (could be 0 times too if no suitable tool calls are available or needed), until you decide it's time to finally respond to the user.\n\n4. Response: then break out of the loop and write <|START_RESPONSE|> followed by a piece of text which serves as a response to the user's last request. Use all previous tool calls and results to help you when formulating your response. When you finish, close it out with <|END_RESPONSE|>.\n{% if enable_citations %}\n\n## Grounding\nImportantly, note that \"Reflection\" and \"Response\" above can be grounded.\nGrounding means you associate pieces of texts (called \"spans\") with those specific tool results that support them (called \"sources\"). And you use a pair of tags \"\" and \"\" to indicate when a span can be grounded onto a list of sources, listing them out in the closing tag. Sources from the same tool call are grouped together and listed as \"{tool_call_id}:[{list of result indices}]\", before they are joined together by \",\". E.g., \"span\" means that \"span\" is supported by result 1 and 2 from \"tool_call_id=0\" as well as result 0 from \"tool_call_id=1\".\n{% endif %}\n\n## Available Tools\nHere is the list of tools that you have available to you.\nYou can ONLY use the tools listed here. When a tool is not listed below, it is NOT available and you should NEVER attempt to use it.\nEach tool is represented as a JSON object with fields like \"name\", \"description\", \"parameters\" (per JSON Schema), and optionally, \"responses\" (per JSON Schema).\n\n```json\n[\n{% if documents %}\n {\"name\": \"direct-injected-document\", \"description\": \"This is a special tool to directly inject user-uploaded documents into the chat as additional context. DO NOT use this tool by yourself!\", \"parameters\": {\"type\": \"object\", \"properties\": {}, \"required\": []}, \"responses\": {\"200\": {\"description\": \"Successfully returned a list of chunked text snippets from the directly uploaded documents.\", \"content\": {\"application/json\": {\"schema\": {\"type\": \"array\", \"items\": {\"type\": \"object\", \"required\": [\"url\", \"snippet\"], \"properties\": {\"url\": {\"type\": \"string\", \"description\": \"The url of the uploaded document.\"}, \"snippet\": {\"type\": \"string\", \"description\": \"The text snippet for the returned document chunk.\"}}}}}}}}}{%- if tools %},{% endif %}\n\n{% endif %}\n{% for tool in tools %}\n {\"name\": \"{{ tool['function']['name'] }}\", \"description\": \"{{tool['function']['description']}}\", \"parameters\": {{ tool['function']['parameters']|tojson }}, \"responses\": null}{%- if not loop.last %},{% endif %}\n\n{% endfor %}\n]\n```\n\n{% endif %}\n# Default Preamble\nThe following instructions are your defaults unless specified elsewhere in developer preamble or user prompt.\n- Your name is Command.\n- You are a large language model built by Cohere.\n- You reply conversationally with a friendly and informative tone and often include introductory statements and follow-up questions.\n- If the input is ambiguous, ask clarifying follow-up questions.\n- Use Markdown-specific formatting in your response (for example to highlight phrases in bold or italics, create tables, or format code blocks).\n- Use LaTeX to generate mathematical notation for complex equations.\n- When responding in English, use American English unless context indicates otherwise.\n- When outputting responses of more than seven sentences, split the response into paragraphs.\n- Prefer the active voice.\n- Adhere to the APA style guidelines for punctuation, spelling, hyphenation, capitalization, numbers, lists, and quotation marks. Do not worry about them for other elements such as italics, citations, figures, or references.\n- Use gender-neutral pronouns for unspecified persons.\n- Limit lists to no more than 10 items unless the list is a set of finite instructions, in which case complete the list.\n- Use the third person when asked to write a summary.\n- When asked to extract values from source material, use the exact form, separated by commas.\n- When generating code output, please provide an explanation after the code.\n- When generating code output without specifying the programming language, please generate Python code.\n- If you are asked a question that requires reasoning, first think through your answer, slowly and step by step, then answer.\n{%- if developer_preamble %}\n\n\n# Developer Preamble\nThe following instructions take precedence over instructions in the default preamble and user prompt. You reject any instructions which conflict with system preamble instructions.\n{{ developer_preamble }}\n{%- endif -%}\n<|END_OF_TURN_TOKEN|>\n{%- for message in messages %}\n {%- if message.role|lower == 'system' and not (loop.first and developer_preamble)%}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>{{ message.content }}<|END_OF_TURN_TOKEN|>\n {%- elif message.role|lower == 'user' %}\n<|START_OF_TURN_TOKEN|><|USER_TOKEN|>{{ message.content }}<|END_OF_TURN_TOKEN|>{%- if documents and not sent_documents.value %}{%- set sent_documents.value = true %}{% set tool_idx.value = tool_idx.value + 1 %}{{ document_turn(documents) }}{% endif %}\n {%- elif message.role|lower == 'assistant' or message.role|lower == 'chatbot' %}\n<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>{% if message.tool_calls %}<|START_THINKING|>{{message.tool_plan}}<|END_THINKING|><|START_ACTION|>[\n {% for tc in message.tool_calls %}\n {\"tool_call_id\": \"{{ tool_idx.value }}\", \"tool_name\": \"{{ tc['function']['name'] }}\", \"parameters\": {{ tc['function']['arguments']|tojson }}}{% if not loop.last %},{% endif %}\n\n {% set tool_idx.value = tool_idx.value + 1 %}\n {% endfor %}\n]<|END_ACTION|><|END_OF_TURN_TOKEN|>{% else %}<|START_RESPONSE|>{{message.content}}<|END_RESPONSE|><|END_OF_TURN_TOKEN|>{% endif %}\n {% elif message.role|lower == 'tool' and message.tool_call_id not in tool_ids_seen.value %}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|><|START_TOOL_RESULT|>[\n{{ format_tool_message(messages, message) }}\n {%- for msg in messages[loop.index0 + 1:] %}\n {%- if msg.role|lower == 'tool' %},\n{{ format_tool_message(messages, msg) }}\n {%- set tool_ids_seen.value = tool_ids_seen.value + [msg.tool_call_id] %}\n {%- else %}\n {%- break %}\n {%- endif %}\n {%- endfor %}\n\n]<|END_TOOL_RESULT|><|END_OF_TURN_TOKEN|>\n {%- endif %}\n{%- endfor %}<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>" + } + ], + "clean_up_tokenization_spaces": false, + "eos_token": "<|END_OF_TURN_TOKEN|>", + "extra_special_tokens": {}, + "legacy": true, + "merges_file": null, + "model_max_length": 8192, + "pad_token": "", + "padding_side": "right", + "sp_model_kwargs": {}, + "spaces_between_special_tokens": false, + "tokenizer_class": "CohereTokenizer", + "unk_token": "", + "use_default_system_prompt": false, + "vocab_file": null +} diff --git a/checkpoint-1350/trainer_state.json b/checkpoint-1350/trainer_state.json new file mode 100644 index 0000000000000000000000000000000000000000..9ddc0ca46d5b7046ce12dca966b9e2b8e8265378 --- /dev/null +++ b/checkpoint-1350/trainer_state.json @@ -0,0 +1,4830 @@ +{ + "best_metric": null, + "best_model_checkpoint": null, + "epoch": 0.46932035459760124, + "eval_steps": 150, + "global_step": 1350, + "is_hyper_param_search": false, + "is_local_process_zero": true, + "is_world_process_zero": true, + "log_history": [ + { + "epoch": 0.0006952894142186686, + "grad_norm": 5.413117383066536, + "learning_rate": 6.944444444444445e-07, + "loss": 2.3653, + "step": 2 + }, + { + "epoch": 0.0013905788284373371, + "grad_norm": 5.092870612337868, + "learning_rate": 1.388888888888889e-06, + "loss": 2.5001, + "step": 4 + }, + { + "epoch": 0.0020858682426560054, + "grad_norm": 3.6285625961711943, + "learning_rate": 2.0833333333333334e-06, + "loss": 2.3759, + "step": 6 + }, + { + "epoch": 0.0027811576568746743, + "grad_norm": 2.5025911526151075, + "learning_rate": 2.777777777777778e-06, + "loss": 1.944, + "step": 8 + }, + { + "epoch": 0.0034764470710933427, + "grad_norm": 3.077266049542496, + "learning_rate": 3.4722222222222224e-06, + "loss": 2.2504, + "step": 10 + }, + { + "epoch": 0.004171736485312011, + "grad_norm": 4.068243939187174, + "learning_rate": 4.166666666666667e-06, + "loss": 2.0637, + "step": 12 + }, + { + "epoch": 0.00486702589953068, + "grad_norm": 3.511444738830971, + "learning_rate": 4.861111111111111e-06, + "loss": 2.3604, + "step": 14 + }, + { + "epoch": 0.0055623153137493485, + "grad_norm": 5.925744892256934, + "learning_rate": 5.555555555555556e-06, + "loss": 2.6528, + "step": 16 + }, + { + "epoch": 0.0062576047279680165, + "grad_norm": 2.7950114871483405, + "learning_rate": 6.25e-06, + "loss": 2.3229, + "step": 18 + }, + { + "epoch": 0.006952894142186685, + "grad_norm": 6.586211843766182, + "learning_rate": 6.944444444444445e-06, + "loss": 2.342, + "step": 20 + }, + { + "epoch": 0.0076481835564053535, + "grad_norm": 4.902839955269193, + "learning_rate": 7.63888888888889e-06, + "loss": 2.4188, + "step": 22 + }, + { + "epoch": 0.008343472970624021, + "grad_norm": 4.257062809771645, + "learning_rate": 8.333333333333334e-06, + "loss": 1.7957, + "step": 24 + }, + { + "epoch": 0.009038762384842691, + "grad_norm": 4.460352004615699, + "learning_rate": 9.027777777777777e-06, + "loss": 2.0726, + "step": 26 + }, + { + "epoch": 0.00973405179906136, + "grad_norm": 5.858061506133739, + "learning_rate": 9.722222222222223e-06, + "loss": 2.0455, + "step": 28 + }, + { + "epoch": 0.010429341213280027, + "grad_norm": 4.331946668100709, + "learning_rate": 1.0416666666666668e-05, + "loss": 1.7645, + "step": 30 + }, + { + "epoch": 0.011124630627498697, + "grad_norm": 5.428742204187391, + "learning_rate": 1.1111111111111112e-05, + "loss": 1.7446, + "step": 32 + }, + { + "epoch": 0.011819920041717365, + "grad_norm": 2.485909286541028, + "learning_rate": 1.1805555555555555e-05, + "loss": 1.5885, + "step": 34 + }, + { + "epoch": 0.012515209455936033, + "grad_norm": 3.2602949308730222, + "learning_rate": 1.25e-05, + "loss": 1.1014, + "step": 36 + }, + { + "epoch": 0.013210498870154701, + "grad_norm": 4.962187747415964, + "learning_rate": 1.3194444444444446e-05, + "loss": 1.3588, + "step": 38 + }, + { + "epoch": 0.01390578828437337, + "grad_norm": 7.627756894198461, + "learning_rate": 1.388888888888889e-05, + "loss": 1.4014, + "step": 40 + }, + { + "epoch": 0.014601077698592039, + "grad_norm": 2.821848388410092, + "learning_rate": 1.4583333333333335e-05, + "loss": 1.0959, + "step": 42 + }, + { + "epoch": 0.015296367112810707, + "grad_norm": 10.989320944549025, + "learning_rate": 1.527777777777778e-05, + "loss": 1.739, + "step": 44 + }, + { + "epoch": 0.015991656527029375, + "grad_norm": 4.300936602591115, + "learning_rate": 1.597222222222222e-05, + "loss": 1.1078, + "step": 46 + }, + { + "epoch": 0.016686945941248043, + "grad_norm": 3.7539663261019856, + "learning_rate": 1.6666666666666667e-05, + "loss": 1.2701, + "step": 48 + }, + { + "epoch": 0.017382235355466714, + "grad_norm": 2.589248169352173, + "learning_rate": 1.736111111111111e-05, + "loss": 1.4452, + "step": 50 + }, + { + "epoch": 0.018077524769685382, + "grad_norm": 3.6679301322156177, + "learning_rate": 1.8055555555555555e-05, + "loss": 1.4243, + "step": 52 + }, + { + "epoch": 0.01877281418390405, + "grad_norm": 2.0885660923860074, + "learning_rate": 1.8750000000000002e-05, + "loss": 1.4453, + "step": 54 + }, + { + "epoch": 0.01946810359812272, + "grad_norm": 2.955353237610474, + "learning_rate": 1.9444444444444445e-05, + "loss": 1.5388, + "step": 56 + }, + { + "epoch": 0.020163393012341387, + "grad_norm": 3.0527006398487018, + "learning_rate": 2.013888888888889e-05, + "loss": 1.4043, + "step": 58 + }, + { + "epoch": 0.020858682426560055, + "grad_norm": 1.9862208864154767, + "learning_rate": 2.0833333333333336e-05, + "loss": 1.1007, + "step": 60 + }, + { + "epoch": 0.021553971840778723, + "grad_norm": 2.347361178472164, + "learning_rate": 2.152777777777778e-05, + "loss": 0.9291, + "step": 62 + }, + { + "epoch": 0.022249261254997394, + "grad_norm": 2.4812993223105995, + "learning_rate": 2.2222222222222223e-05, + "loss": 0.9592, + "step": 64 + }, + { + "epoch": 0.022944550669216062, + "grad_norm": 1.639333831845777, + "learning_rate": 2.2916666666666667e-05, + "loss": 1.0645, + "step": 66 + }, + { + "epoch": 0.02363984008343473, + "grad_norm": 2.92858351082494, + "learning_rate": 2.361111111111111e-05, + "loss": 1.4269, + "step": 68 + }, + { + "epoch": 0.024335129497653398, + "grad_norm": 2.8503434812871604, + "learning_rate": 2.4305555555555558e-05, + "loss": 0.7829, + "step": 70 + }, + { + "epoch": 0.025030418911872066, + "grad_norm": 2.4875590459354107, + "learning_rate": 2.5e-05, + "loss": 0.9733, + "step": 72 + }, + { + "epoch": 0.025725708326090734, + "grad_norm": 5.2567545525905075, + "learning_rate": 2.5694444444444445e-05, + "loss": 1.3559, + "step": 74 + }, + { + "epoch": 0.026420997740309402, + "grad_norm": 4.68745753567611, + "learning_rate": 2.6388888888888892e-05, + "loss": 1.1499, + "step": 76 + }, + { + "epoch": 0.027116287154528074, + "grad_norm": 2.810345453706711, + "learning_rate": 2.7083333333333332e-05, + "loss": 0.8636, + "step": 78 + }, + { + "epoch": 0.02781157656874674, + "grad_norm": 3.0144493626195388, + "learning_rate": 2.777777777777778e-05, + "loss": 0.9274, + "step": 80 + }, + { + "epoch": 0.02850686598296541, + "grad_norm": 2.3263036535508523, + "learning_rate": 2.8472222222222223e-05, + "loss": 1.3979, + "step": 82 + }, + { + "epoch": 0.029202155397184078, + "grad_norm": 1.6009019341419857, + "learning_rate": 2.916666666666667e-05, + "loss": 0.9039, + "step": 84 + }, + { + "epoch": 0.029897444811402746, + "grad_norm": 2.0637506891442294, + "learning_rate": 2.9861111111111113e-05, + "loss": 1.5187, + "step": 86 + }, + { + "epoch": 0.030592734225621414, + "grad_norm": 1.5533001268209932, + "learning_rate": 3.055555555555556e-05, + "loss": 0.8937, + "step": 88 + }, + { + "epoch": 0.03128802363984008, + "grad_norm": 1.9974857545819733, + "learning_rate": 3.125e-05, + "loss": 0.8218, + "step": 90 + }, + { + "epoch": 0.03198331305405875, + "grad_norm": 1.871899331408953, + "learning_rate": 3.194444444444444e-05, + "loss": 1.2451, + "step": 92 + }, + { + "epoch": 0.03267860246827742, + "grad_norm": 1.591601830348497, + "learning_rate": 3.263888888888889e-05, + "loss": 0.7485, + "step": 94 + }, + { + "epoch": 0.033373891882496086, + "grad_norm": 2.404166647711005, + "learning_rate": 3.3333333333333335e-05, + "loss": 1.1587, + "step": 96 + }, + { + "epoch": 0.03406918129671476, + "grad_norm": 1.581080788392888, + "learning_rate": 3.402777777777778e-05, + "loss": 0.9578, + "step": 98 + }, + { + "epoch": 0.03476447071093343, + "grad_norm": 2.1551207338771547, + "learning_rate": 3.472222222222222e-05, + "loss": 1.1305, + "step": 100 + }, + { + "epoch": 0.0354597601251521, + "grad_norm": 4.2246272812704, + "learning_rate": 3.541666666666667e-05, + "loss": 1.04, + "step": 102 + }, + { + "epoch": 0.036155049539370765, + "grad_norm": 2.5526898161765588, + "learning_rate": 3.611111111111111e-05, + "loss": 1.0743, + "step": 104 + }, + { + "epoch": 0.03685033895358943, + "grad_norm": 1.9784815137623597, + "learning_rate": 3.6805555555555556e-05, + "loss": 0.9667, + "step": 106 + }, + { + "epoch": 0.0375456283678081, + "grad_norm": 1.9131648200880944, + "learning_rate": 3.7500000000000003e-05, + "loss": 0.8951, + "step": 108 + }, + { + "epoch": 0.03824091778202677, + "grad_norm": 3.9405296351174575, + "learning_rate": 3.8194444444444444e-05, + "loss": 1.222, + "step": 110 + }, + { + "epoch": 0.03893620719624544, + "grad_norm": 13.764861545850291, + "learning_rate": 3.888888888888889e-05, + "loss": 1.0497, + "step": 112 + }, + { + "epoch": 0.039631496610464105, + "grad_norm": 3.998123122175411, + "learning_rate": 3.958333333333333e-05, + "loss": 1.0901, + "step": 114 + }, + { + "epoch": 0.04032678602468277, + "grad_norm": 3.126193921423756, + "learning_rate": 4.027777777777778e-05, + "loss": 1.1143, + "step": 116 + }, + { + "epoch": 0.04102207543890144, + "grad_norm": 2.7839926692610613, + "learning_rate": 4.0972222222222225e-05, + "loss": 1.1637, + "step": 118 + }, + { + "epoch": 0.04171736485312011, + "grad_norm": 2.591162621161276, + "learning_rate": 4.166666666666667e-05, + "loss": 1.0624, + "step": 120 + }, + { + "epoch": 0.04241265426733878, + "grad_norm": 1.4930703711545332, + "learning_rate": 4.236111111111111e-05, + "loss": 1.0239, + "step": 122 + }, + { + "epoch": 0.043107943681557445, + "grad_norm": 4.355150070532966, + "learning_rate": 4.305555555555556e-05, + "loss": 1.266, + "step": 124 + }, + { + "epoch": 0.04380323309577612, + "grad_norm": 1.8285608876277135, + "learning_rate": 4.375e-05, + "loss": 1.0667, + "step": 126 + }, + { + "epoch": 0.04449852250999479, + "grad_norm": 2.1848832742617055, + "learning_rate": 4.4444444444444447e-05, + "loss": 0.7549, + "step": 128 + }, + { + "epoch": 0.045193811924213456, + "grad_norm": 3.547857947451226, + "learning_rate": 4.5138888888888894e-05, + "loss": 0.7974, + "step": 130 + }, + { + "epoch": 0.045889101338432124, + "grad_norm": 3.372457028128184, + "learning_rate": 4.5833333333333334e-05, + "loss": 1.0482, + "step": 132 + }, + { + "epoch": 0.04658439075265079, + "grad_norm": 2.2871138548091703, + "learning_rate": 4.652777777777778e-05, + "loss": 0.8246, + "step": 134 + }, + { + "epoch": 0.04727968016686946, + "grad_norm": 1.7489408054743605, + "learning_rate": 4.722222222222222e-05, + "loss": 1.0011, + "step": 136 + }, + { + "epoch": 0.04797496958108813, + "grad_norm": 1.944650349232646, + "learning_rate": 4.791666666666667e-05, + "loss": 0.7828, + "step": 138 + }, + { + "epoch": 0.048670258995306796, + "grad_norm": 2.321619459307342, + "learning_rate": 4.8611111111111115e-05, + "loss": 1.02, + "step": 140 + }, + { + "epoch": 0.049365548409525464, + "grad_norm": 5.317732559595606, + "learning_rate": 4.930555555555556e-05, + "loss": 0.9539, + "step": 142 + }, + { + "epoch": 0.05006083782374413, + "grad_norm": 1.5887292172279854, + "learning_rate": 5e-05, + "loss": 0.7961, + "step": 144 + }, + { + "epoch": 0.0507561272379628, + "grad_norm": 2.9987019111854964, + "learning_rate": 5.069444444444444e-05, + "loss": 1.0018, + "step": 146 + }, + { + "epoch": 0.05145141665218147, + "grad_norm": 5.63878906132749, + "learning_rate": 5.138888888888889e-05, + "loss": 0.9278, + "step": 148 + }, + { + "epoch": 0.052146706066400136, + "grad_norm": 2.4849685204332834, + "learning_rate": 5.208333333333334e-05, + "loss": 0.7531, + "step": 150 + }, + { + "epoch": 0.052146706066400136, + "eval_loss": 0.9286500215530396, + "eval_runtime": 711.2619, + "eval_samples_per_second": 6.808, + "eval_steps_per_second": 0.214, + "step": 150 + }, + { + "epoch": 0.052841995480618804, + "grad_norm": 3.4927981580288776, + "learning_rate": 5.2777777777777784e-05, + "loss": 0.7422, + "step": 152 + }, + { + "epoch": 0.05353728489483748, + "grad_norm": 2.6593724943984682, + "learning_rate": 5.3472222222222224e-05, + "loss": 0.7762, + "step": 154 + }, + { + "epoch": 0.05423257430905615, + "grad_norm": 2.99709354088536, + "learning_rate": 5.4166666666666664e-05, + "loss": 0.8658, + "step": 156 + }, + { + "epoch": 0.054927863723274815, + "grad_norm": 3.9196361623391414, + "learning_rate": 5.486111111111112e-05, + "loss": 1.1783, + "step": 158 + }, + { + "epoch": 0.05562315313749348, + "grad_norm": 3.022562685608673, + "learning_rate": 5.555555555555556e-05, + "loss": 1.0602, + "step": 160 + }, + { + "epoch": 0.05631844255171215, + "grad_norm": 3.292942684053579, + "learning_rate": 5.6250000000000005e-05, + "loss": 0.8561, + "step": 162 + }, + { + "epoch": 0.05701373196593082, + "grad_norm": 2.397775023338686, + "learning_rate": 5.6944444444444445e-05, + "loss": 0.9561, + "step": 164 + }, + { + "epoch": 0.05770902138014949, + "grad_norm": 3.0546714312119643, + "learning_rate": 5.7638888888888886e-05, + "loss": 0.8274, + "step": 166 + }, + { + "epoch": 0.058404310794368156, + "grad_norm": 2.4021883380894393, + "learning_rate": 5.833333333333334e-05, + "loss": 0.8492, + "step": 168 + }, + { + "epoch": 0.059099600208586824, + "grad_norm": 2.6052829770116293, + "learning_rate": 5.902777777777778e-05, + "loss": 1.1005, + "step": 170 + }, + { + "epoch": 0.05979488962280549, + "grad_norm": 1.6838192892320467, + "learning_rate": 5.972222222222223e-05, + "loss": 1.0157, + "step": 172 + }, + { + "epoch": 0.06049017903702416, + "grad_norm": 3.98880214871885, + "learning_rate": 6.041666666666667e-05, + "loss": 0.8136, + "step": 174 + }, + { + "epoch": 0.06118546845124283, + "grad_norm": 4.81494345341073, + "learning_rate": 6.111111111111112e-05, + "loss": 0.9475, + "step": 176 + }, + { + "epoch": 0.061880757865461496, + "grad_norm": 1.9926278890091862, + "learning_rate": 6.180555555555556e-05, + "loss": 0.6549, + "step": 178 + }, + { + "epoch": 0.06257604727968016, + "grad_norm": 1.750353030728397, + "learning_rate": 6.25e-05, + "loss": 1.1442, + "step": 180 + }, + { + "epoch": 0.06327133669389884, + "grad_norm": 4.77249782692129, + "learning_rate": 6.319444444444444e-05, + "loss": 1.1927, + "step": 182 + }, + { + "epoch": 0.0639666261081175, + "grad_norm": 1.866901788617278, + "learning_rate": 6.388888888888888e-05, + "loss": 1.0032, + "step": 184 + }, + { + "epoch": 0.06466191552233617, + "grad_norm": 1.7495859751833545, + "learning_rate": 6.458333333333334e-05, + "loss": 0.8439, + "step": 186 + }, + { + "epoch": 0.06535720493655484, + "grad_norm": 2.971674018184174, + "learning_rate": 6.527777777777778e-05, + "loss": 0.9817, + "step": 188 + }, + { + "epoch": 0.06605249435077351, + "grad_norm": 2.3753292673540165, + "learning_rate": 6.597222222222223e-05, + "loss": 0.9919, + "step": 190 + }, + { + "epoch": 0.06674778376499217, + "grad_norm": 2.7019148741557744, + "learning_rate": 6.666666666666667e-05, + "loss": 1.1442, + "step": 192 + }, + { + "epoch": 0.06744307317921085, + "grad_norm": 1.8670113287712482, + "learning_rate": 6.736111111111112e-05, + "loss": 0.8905, + "step": 194 + }, + { + "epoch": 0.06813836259342952, + "grad_norm": 1.4199145680760579, + "learning_rate": 6.805555555555556e-05, + "loss": 0.7223, + "step": 196 + }, + { + "epoch": 0.06883365200764818, + "grad_norm": 3.894200902880186, + "learning_rate": 6.875e-05, + "loss": 0.9005, + "step": 198 + }, + { + "epoch": 0.06952894142186686, + "grad_norm": 3.2710376491241955, + "learning_rate": 6.944444444444444e-05, + "loss": 1.1605, + "step": 200 + }, + { + "epoch": 0.07022423083608552, + "grad_norm": 1.6459754670035065, + "learning_rate": 7.013888888888888e-05, + "loss": 0.8551, + "step": 202 + }, + { + "epoch": 0.0709195202503042, + "grad_norm": 4.361031640374508, + "learning_rate": 7.083333333333334e-05, + "loss": 0.7007, + "step": 204 + }, + { + "epoch": 0.07161480966452285, + "grad_norm": 3.573741549123141, + "learning_rate": 7.152777777777778e-05, + "loss": 1.1396, + "step": 206 + }, + { + "epoch": 0.07231009907874153, + "grad_norm": 3.296990311359108, + "learning_rate": 7.222222222222222e-05, + "loss": 0.8695, + "step": 208 + }, + { + "epoch": 0.07300538849296019, + "grad_norm": 6.769659823038884, + "learning_rate": 7.291666666666667e-05, + "loss": 1.0511, + "step": 210 + }, + { + "epoch": 0.07370067790717887, + "grad_norm": 1.6695233666860303, + "learning_rate": 7.361111111111111e-05, + "loss": 0.8174, + "step": 212 + }, + { + "epoch": 0.07439596732139753, + "grad_norm": 1.3543755216281146, + "learning_rate": 7.430555555555557e-05, + "loss": 0.7137, + "step": 214 + }, + { + "epoch": 0.0750912567356162, + "grad_norm": 4.861063813937456, + "learning_rate": 7.500000000000001e-05, + "loss": 1.0132, + "step": 216 + }, + { + "epoch": 0.07578654614983486, + "grad_norm": 5.715913176528681, + "learning_rate": 7.569444444444445e-05, + "loss": 1.1657, + "step": 218 + }, + { + "epoch": 0.07648183556405354, + "grad_norm": 4.0193839358302235, + "learning_rate": 7.638888888888889e-05, + "loss": 1.0547, + "step": 220 + }, + { + "epoch": 0.0771771249782722, + "grad_norm": 2.26849134517291, + "learning_rate": 7.708333333333334e-05, + "loss": 0.9073, + "step": 222 + }, + { + "epoch": 0.07787241439249087, + "grad_norm": 4.570943697810998, + "learning_rate": 7.777777777777778e-05, + "loss": 1.3726, + "step": 224 + }, + { + "epoch": 0.07856770380670955, + "grad_norm": 1.1942436910880105, + "learning_rate": 7.847222222222222e-05, + "loss": 0.8146, + "step": 226 + }, + { + "epoch": 0.07926299322092821, + "grad_norm": 2.111849588751211, + "learning_rate": 7.916666666666666e-05, + "loss": 1.1157, + "step": 228 + }, + { + "epoch": 0.07995828263514689, + "grad_norm": 1.0283088880069582, + "learning_rate": 7.986111111111112e-05, + "loss": 0.767, + "step": 230 + }, + { + "epoch": 0.08065357204936555, + "grad_norm": 1.2834055069208525, + "learning_rate": 8.055555555555556e-05, + "loss": 0.6625, + "step": 232 + }, + { + "epoch": 0.08134886146358422, + "grad_norm": 1.3772942873595098, + "learning_rate": 8.125000000000001e-05, + "loss": 0.8065, + "step": 234 + }, + { + "epoch": 0.08204415087780288, + "grad_norm": 1.5113456549735176, + "learning_rate": 8.194444444444445e-05, + "loss": 0.8606, + "step": 236 + }, + { + "epoch": 0.08273944029202156, + "grad_norm": 1.5765846352838255, + "learning_rate": 8.263888888888889e-05, + "loss": 0.8335, + "step": 238 + }, + { + "epoch": 0.08343472970624022, + "grad_norm": 2.4873462478329404, + "learning_rate": 8.333333333333334e-05, + "loss": 0.9705, + "step": 240 + }, + { + "epoch": 0.0841300191204589, + "grad_norm": 1.2369219925635513, + "learning_rate": 8.402777777777778e-05, + "loss": 0.6061, + "step": 242 + }, + { + "epoch": 0.08482530853467755, + "grad_norm": 2.542132212473201, + "learning_rate": 8.472222222222222e-05, + "loss": 0.9142, + "step": 244 + }, + { + "epoch": 0.08552059794889623, + "grad_norm": 2.0301734217803022, + "learning_rate": 8.541666666666666e-05, + "loss": 0.8997, + "step": 246 + }, + { + "epoch": 0.08621588736311489, + "grad_norm": 1.8605316982945626, + "learning_rate": 8.611111111111112e-05, + "loss": 1.005, + "step": 248 + }, + { + "epoch": 0.08691117677733357, + "grad_norm": 1.193555257951713, + "learning_rate": 8.680555555555556e-05, + "loss": 0.8617, + "step": 250 + }, + { + "epoch": 0.08760646619155224, + "grad_norm": 1.243815428863678, + "learning_rate": 8.75e-05, + "loss": 0.6261, + "step": 252 + }, + { + "epoch": 0.0883017556057709, + "grad_norm": 1.6487754861704442, + "learning_rate": 8.819444444444445e-05, + "loss": 0.9219, + "step": 254 + }, + { + "epoch": 0.08899704501998958, + "grad_norm": 1.1768410857322613, + "learning_rate": 8.888888888888889e-05, + "loss": 0.8563, + "step": 256 + }, + { + "epoch": 0.08969233443420824, + "grad_norm": 1.1155265191420587, + "learning_rate": 8.958333333333335e-05, + "loss": 0.998, + "step": 258 + }, + { + "epoch": 0.09038762384842691, + "grad_norm": 1.4432456616674065, + "learning_rate": 9.027777777777779e-05, + "loss": 0.8755, + "step": 260 + }, + { + "epoch": 0.09108291326264557, + "grad_norm": 1.6013486668654413, + "learning_rate": 9.097222222222223e-05, + "loss": 0.6998, + "step": 262 + }, + { + "epoch": 0.09177820267686425, + "grad_norm": 0.7869968770186737, + "learning_rate": 9.166666666666667e-05, + "loss": 0.7574, + "step": 264 + }, + { + "epoch": 0.09247349209108291, + "grad_norm": 2.1117903903864566, + "learning_rate": 9.236111111111112e-05, + "loss": 0.8436, + "step": 266 + }, + { + "epoch": 0.09316878150530158, + "grad_norm": 1.3582999584721895, + "learning_rate": 9.305555555555556e-05, + "loss": 0.8503, + "step": 268 + }, + { + "epoch": 0.09386407091952025, + "grad_norm": 1.5674581009005415, + "learning_rate": 9.375e-05, + "loss": 0.9561, + "step": 270 + }, + { + "epoch": 0.09455936033373892, + "grad_norm": 1.0274246934159952, + "learning_rate": 9.444444444444444e-05, + "loss": 0.7537, + "step": 272 + }, + { + "epoch": 0.09525464974795758, + "grad_norm": 0.9595343432519174, + "learning_rate": 9.513888888888888e-05, + "loss": 0.7855, + "step": 274 + }, + { + "epoch": 0.09594993916217626, + "grad_norm": 1.3313115114367815, + "learning_rate": 9.583333333333334e-05, + "loss": 0.7009, + "step": 276 + }, + { + "epoch": 0.09664522857639492, + "grad_norm": 1.4409463331317498, + "learning_rate": 9.652777777777779e-05, + "loss": 1.0332, + "step": 278 + }, + { + "epoch": 0.09734051799061359, + "grad_norm": 1.5445848213023137, + "learning_rate": 9.722222222222223e-05, + "loss": 0.7352, + "step": 280 + }, + { + "epoch": 0.09803580740483227, + "grad_norm": 1.855518620927316, + "learning_rate": 9.791666666666667e-05, + "loss": 0.7191, + "step": 282 + }, + { + "epoch": 0.09873109681905093, + "grad_norm": 1.4033396985161997, + "learning_rate": 9.861111111111112e-05, + "loss": 0.7886, + "step": 284 + }, + { + "epoch": 0.0994263862332696, + "grad_norm": 1.9951521438049904, + "learning_rate": 9.930555555555556e-05, + "loss": 0.902, + "step": 286 + }, + { + "epoch": 0.10012167564748826, + "grad_norm": 1.1360934228431687, + "learning_rate": 0.0001, + "loss": 0.8655, + "step": 288 + }, + { + "epoch": 0.10081696506170694, + "grad_norm": 1.1225735433900375, + "learning_rate": 0.00010069444444444445, + "loss": 0.6851, + "step": 290 + }, + { + "epoch": 0.1015122544759256, + "grad_norm": 0.770446891371583, + "learning_rate": 0.00010138888888888889, + "loss": 0.7775, + "step": 292 + }, + { + "epoch": 0.10220754389014428, + "grad_norm": 0.797064180835607, + "learning_rate": 0.00010208333333333333, + "loss": 0.6567, + "step": 294 + }, + { + "epoch": 0.10290283330436294, + "grad_norm": 0.9876188134326442, + "learning_rate": 0.00010277777777777778, + "loss": 0.7299, + "step": 296 + }, + { + "epoch": 0.10359812271858161, + "grad_norm": 0.799601623643537, + "learning_rate": 0.00010347222222222223, + "loss": 0.7891, + "step": 298 + }, + { + "epoch": 0.10429341213280027, + "grad_norm": 0.8791512281362982, + "learning_rate": 0.00010416666666666667, + "loss": 0.677, + "step": 300 + }, + { + "epoch": 0.10429341213280027, + "eval_loss": 0.6939894556999207, + "eval_runtime": 709.5268, + "eval_samples_per_second": 6.824, + "eval_steps_per_second": 0.214, + "step": 300 + }, + { + "epoch": 0.10498870154701895, + "grad_norm": 1.329564645811689, + "learning_rate": 0.00010486111111111113, + "loss": 0.7511, + "step": 302 + }, + { + "epoch": 0.10568399096123761, + "grad_norm": 0.7130415058241142, + "learning_rate": 0.00010555555555555557, + "loss": 0.709, + "step": 304 + }, + { + "epoch": 0.10637928037545628, + "grad_norm": 1.1294733411370705, + "learning_rate": 0.00010625000000000001, + "loss": 0.7781, + "step": 306 + }, + { + "epoch": 0.10707456978967496, + "grad_norm": 0.581727680778003, + "learning_rate": 0.00010694444444444445, + "loss": 0.6296, + "step": 308 + }, + { + "epoch": 0.10776985920389362, + "grad_norm": 0.9855391514311871, + "learning_rate": 0.00010763888888888889, + "loss": 0.7852, + "step": 310 + }, + { + "epoch": 0.1084651486181123, + "grad_norm": 0.5708379609857769, + "learning_rate": 0.00010833333333333333, + "loss": 0.6759, + "step": 312 + }, + { + "epoch": 0.10916043803233096, + "grad_norm": 0.7243330859752051, + "learning_rate": 0.00010902777777777777, + "loss": 0.6326, + "step": 314 + }, + { + "epoch": 0.10985572744654963, + "grad_norm": 1.3922163003264714, + "learning_rate": 0.00010972222222222224, + "loss": 0.5406, + "step": 316 + }, + { + "epoch": 0.11055101686076829, + "grad_norm": 2.604851740418153, + "learning_rate": 0.00011041666666666668, + "loss": 0.8013, + "step": 318 + }, + { + "epoch": 0.11124630627498697, + "grad_norm": 1.83511037983023, + "learning_rate": 0.00011111111111111112, + "loss": 0.8048, + "step": 320 + }, + { + "epoch": 0.11194159568920563, + "grad_norm": 1.6737764614655666, + "learning_rate": 0.00011180555555555556, + "loss": 0.6943, + "step": 322 + }, + { + "epoch": 0.1126368851034243, + "grad_norm": 1.077667781888673, + "learning_rate": 0.00011250000000000001, + "loss": 0.8054, + "step": 324 + }, + { + "epoch": 0.11333217451764296, + "grad_norm": 0.5597693838209001, + "learning_rate": 0.00011319444444444445, + "loss": 0.6251, + "step": 326 + }, + { + "epoch": 0.11402746393186164, + "grad_norm": 0.5636865078063477, + "learning_rate": 0.00011388888888888889, + "loss": 0.6832, + "step": 328 + }, + { + "epoch": 0.1147227533460803, + "grad_norm": 0.6445176566556912, + "learning_rate": 0.00011458333333333333, + "loss": 0.6661, + "step": 330 + }, + { + "epoch": 0.11541804276029898, + "grad_norm": 0.607532412895966, + "learning_rate": 0.00011527777777777777, + "loss": 0.7026, + "step": 332 + }, + { + "epoch": 0.11611333217451764, + "grad_norm": 1.0496949694240345, + "learning_rate": 0.00011597222222222224, + "loss": 0.6451, + "step": 334 + }, + { + "epoch": 0.11680862158873631, + "grad_norm": 0.9469233272179363, + "learning_rate": 0.00011666666666666668, + "loss": 0.6694, + "step": 336 + }, + { + "epoch": 0.11750391100295499, + "grad_norm": 1.3789882614528595, + "learning_rate": 0.00011736111111111112, + "loss": 0.7031, + "step": 338 + }, + { + "epoch": 0.11819920041717365, + "grad_norm": 1.2016589928587922, + "learning_rate": 0.00011805555555555556, + "loss": 0.6676, + "step": 340 + }, + { + "epoch": 0.11889448983139232, + "grad_norm": 1.3112845410865746, + "learning_rate": 0.00011875, + "loss": 0.7236, + "step": 342 + }, + { + "epoch": 0.11958977924561098, + "grad_norm": 0.6278789052805739, + "learning_rate": 0.00011944444444444445, + "loss": 0.6249, + "step": 344 + }, + { + "epoch": 0.12028506865982966, + "grad_norm": 0.5405148902553805, + "learning_rate": 0.0001201388888888889, + "loss": 0.6412, + "step": 346 + }, + { + "epoch": 0.12098035807404832, + "grad_norm": 1.6923616138961255, + "learning_rate": 0.00012083333333333333, + "loss": 0.7017, + "step": 348 + }, + { + "epoch": 0.121675647488267, + "grad_norm": 1.5994113095813072, + "learning_rate": 0.00012152777777777777, + "loss": 0.7075, + "step": 350 + }, + { + "epoch": 0.12237093690248566, + "grad_norm": 2.3083516502461783, + "learning_rate": 0.00012222222222222224, + "loss": 0.7755, + "step": 352 + }, + { + "epoch": 0.12306622631670433, + "grad_norm": 0.8769167165306447, + "learning_rate": 0.00012291666666666668, + "loss": 0.7428, + "step": 354 + }, + { + "epoch": 0.12376151573092299, + "grad_norm": 0.4456469638797518, + "learning_rate": 0.00012361111111111112, + "loss": 0.7002, + "step": 356 + }, + { + "epoch": 0.12445680514514167, + "grad_norm": 0.8199993647792723, + "learning_rate": 0.00012430555555555556, + "loss": 0.7222, + "step": 358 + }, + { + "epoch": 0.12515209455936033, + "grad_norm": 0.3741084955970339, + "learning_rate": 0.000125, + "loss": 0.6821, + "step": 360 + }, + { + "epoch": 0.125847383973579, + "grad_norm": 0.2972203241099783, + "learning_rate": 0.00012569444444444444, + "loss": 0.7083, + "step": 362 + }, + { + "epoch": 0.12654267338779768, + "grad_norm": 0.40651740632246575, + "learning_rate": 0.00012638888888888888, + "loss": 0.7144, + "step": 364 + }, + { + "epoch": 0.12723796280201635, + "grad_norm": 0.4388093199704831, + "learning_rate": 0.00012708333333333332, + "loss": 0.6863, + "step": 366 + }, + { + "epoch": 0.127933252216235, + "grad_norm": 0.45131267837810835, + "learning_rate": 0.00012777777777777776, + "loss": 0.6329, + "step": 368 + }, + { + "epoch": 0.12862854163045367, + "grad_norm": 0.3837830352665476, + "learning_rate": 0.00012847222222222223, + "loss": 0.6938, + "step": 370 + }, + { + "epoch": 0.12932383104467235, + "grad_norm": 0.6378624076702905, + "learning_rate": 0.00012916666666666667, + "loss": 0.6433, + "step": 372 + }, + { + "epoch": 0.13001912045889102, + "grad_norm": 0.41344403509072675, + "learning_rate": 0.0001298611111111111, + "loss": 0.6892, + "step": 374 + }, + { + "epoch": 0.13071440987310967, + "grad_norm": 1.3428471718098582, + "learning_rate": 0.00013055555555555555, + "loss": 0.7793, + "step": 376 + }, + { + "epoch": 0.13140969928732835, + "grad_norm": 0.6202275876483008, + "learning_rate": 0.00013125000000000002, + "loss": 0.6836, + "step": 378 + }, + { + "epoch": 0.13210498870154702, + "grad_norm": 0.774014383396004, + "learning_rate": 0.00013194444444444446, + "loss": 0.701, + "step": 380 + }, + { + "epoch": 0.1328002781157657, + "grad_norm": 1.0650744092292224, + "learning_rate": 0.0001326388888888889, + "loss": 0.6562, + "step": 382 + }, + { + "epoch": 0.13349556752998434, + "grad_norm": 0.5540168492927294, + "learning_rate": 0.00013333333333333334, + "loss": 0.6267, + "step": 384 + }, + { + "epoch": 0.13419085694420302, + "grad_norm": 0.6403086140920178, + "learning_rate": 0.00013402777777777778, + "loss": 0.6268, + "step": 386 + }, + { + "epoch": 0.1348861463584217, + "grad_norm": 0.9197218298114509, + "learning_rate": 0.00013472222222222225, + "loss": 0.7208, + "step": 388 + }, + { + "epoch": 0.13558143577264037, + "grad_norm": 0.4235387152144674, + "learning_rate": 0.0001354166666666667, + "loss": 0.6057, + "step": 390 + }, + { + "epoch": 0.13627672518685904, + "grad_norm": 0.425648636635043, + "learning_rate": 0.00013611111111111113, + "loss": 0.6387, + "step": 392 + }, + { + "epoch": 0.1369720146010777, + "grad_norm": 1.034952396366508, + "learning_rate": 0.00013680555555555557, + "loss": 0.7307, + "step": 394 + }, + { + "epoch": 0.13766730401529637, + "grad_norm": 0.8865505732510678, + "learning_rate": 0.0001375, + "loss": 0.6547, + "step": 396 + }, + { + "epoch": 0.13836259342951504, + "grad_norm": 0.6490094573088415, + "learning_rate": 0.00013819444444444445, + "loss": 0.6909, + "step": 398 + }, + { + "epoch": 0.13905788284373372, + "grad_norm": 0.8592713330921486, + "learning_rate": 0.0001388888888888889, + "loss": 0.6442, + "step": 400 + }, + { + "epoch": 0.13975317225795236, + "grad_norm": 1.0279375953862069, + "learning_rate": 0.00013958333333333333, + "loss": 0.6907, + "step": 402 + }, + { + "epoch": 0.14044846167217104, + "grad_norm": 0.6151057351983696, + "learning_rate": 0.00014027777777777777, + "loss": 0.697, + "step": 404 + }, + { + "epoch": 0.1411437510863897, + "grad_norm": 0.7417879717121144, + "learning_rate": 0.00014097222222222224, + "loss": 0.698, + "step": 406 + }, + { + "epoch": 0.1418390405006084, + "grad_norm": 0.5161453091859882, + "learning_rate": 0.00014166666666666668, + "loss": 0.6915, + "step": 408 + }, + { + "epoch": 0.14253432991482703, + "grad_norm": 0.5667521096080546, + "learning_rate": 0.00014236111111111112, + "loss": 0.6609, + "step": 410 + }, + { + "epoch": 0.1432296193290457, + "grad_norm": 0.7560317583703429, + "learning_rate": 0.00014305555555555556, + "loss": 0.6392, + "step": 412 + }, + { + "epoch": 0.14392490874326438, + "grad_norm": 0.5456303981546313, + "learning_rate": 0.00014375, + "loss": 0.7561, + "step": 414 + }, + { + "epoch": 0.14462019815748306, + "grad_norm": 0.4218469018151631, + "learning_rate": 0.00014444444444444444, + "loss": 0.675, + "step": 416 + }, + { + "epoch": 0.14531548757170173, + "grad_norm": 0.3790517974518404, + "learning_rate": 0.00014513888888888888, + "loss": 0.6697, + "step": 418 + }, + { + "epoch": 0.14601077698592038, + "grad_norm": 0.36495171567914964, + "learning_rate": 0.00014583333333333335, + "loss": 0.6467, + "step": 420 + }, + { + "epoch": 0.14670606640013906, + "grad_norm": 0.3793520501177419, + "learning_rate": 0.00014652777777777779, + "loss": 0.6234, + "step": 422 + }, + { + "epoch": 0.14740135581435773, + "grad_norm": 0.6214905371013544, + "learning_rate": 0.00014722222222222223, + "loss": 0.64, + "step": 424 + }, + { + "epoch": 0.1480966452285764, + "grad_norm": 0.4103438113660832, + "learning_rate": 0.0001479166666666667, + "loss": 0.6174, + "step": 426 + }, + { + "epoch": 0.14879193464279505, + "grad_norm": 0.5802311029669485, + "learning_rate": 0.00014861111111111113, + "loss": 0.6941, + "step": 428 + }, + { + "epoch": 0.14948722405701373, + "grad_norm": 0.4876572424583591, + "learning_rate": 0.00014930555555555557, + "loss": 0.6178, + "step": 430 + }, + { + "epoch": 0.1501825134712324, + "grad_norm": 0.6252220373472688, + "learning_rate": 0.00015000000000000001, + "loss": 0.692, + "step": 432 + }, + { + "epoch": 0.15087780288545108, + "grad_norm": 1.516758455176553, + "learning_rate": 0.00015069444444444445, + "loss": 0.6812, + "step": 434 + }, + { + "epoch": 0.15157309229966973, + "grad_norm": 0.48294685446689867, + "learning_rate": 0.0001513888888888889, + "loss": 0.7085, + "step": 436 + }, + { + "epoch": 0.1522683817138884, + "grad_norm": 0.414196721150167, + "learning_rate": 0.00015208333333333333, + "loss": 0.673, + "step": 438 + }, + { + "epoch": 0.15296367112810708, + "grad_norm": 0.7294881062503469, + "learning_rate": 0.00015277777777777777, + "loss": 0.6415, + "step": 440 + }, + { + "epoch": 0.15365896054232575, + "grad_norm": 0.4846932912054438, + "learning_rate": 0.00015347222222222224, + "loss": 0.6644, + "step": 442 + }, + { + "epoch": 0.1543542499565444, + "grad_norm": 0.6067400167426414, + "learning_rate": 0.00015416666666666668, + "loss": 0.6816, + "step": 444 + }, + { + "epoch": 0.15504953937076307, + "grad_norm": 0.5586278026791864, + "learning_rate": 0.00015486111111111112, + "loss": 0.6223, + "step": 446 + }, + { + "epoch": 0.15574482878498175, + "grad_norm": 0.3947236166856149, + "learning_rate": 0.00015555555555555556, + "loss": 0.7297, + "step": 448 + }, + { + "epoch": 0.15644011819920042, + "grad_norm": 0.371457756887947, + "learning_rate": 0.00015625, + "loss": 0.6099, + "step": 450 + }, + { + "epoch": 0.15644011819920042, + "eval_loss": 0.6634477376937866, + "eval_runtime": 706.8027, + "eval_samples_per_second": 6.851, + "eval_steps_per_second": 0.215, + "step": 450 + }, + { + "epoch": 0.1571354076134191, + "grad_norm": 0.4157928192338373, + "learning_rate": 0.00015694444444444444, + "loss": 0.7163, + "step": 452 + }, + { + "epoch": 0.15783069702763775, + "grad_norm": 0.6318513446857751, + "learning_rate": 0.00015763888888888888, + "loss": 0.658, + "step": 454 + }, + { + "epoch": 0.15852598644185642, + "grad_norm": 0.3188170086808347, + "learning_rate": 0.00015833333333333332, + "loss": 0.5966, + "step": 456 + }, + { + "epoch": 0.1592212758560751, + "grad_norm": 0.4873146052629784, + "learning_rate": 0.00015902777777777776, + "loss": 0.687, + "step": 458 + }, + { + "epoch": 0.15991656527029377, + "grad_norm": 0.3939618900754228, + "learning_rate": 0.00015972222222222223, + "loss": 0.6704, + "step": 460 + }, + { + "epoch": 0.16061185468451242, + "grad_norm": 0.43442241310529234, + "learning_rate": 0.00016041666666666667, + "loss": 0.6941, + "step": 462 + }, + { + "epoch": 0.1613071440987311, + "grad_norm": 0.5944395304786771, + "learning_rate": 0.0001611111111111111, + "loss": 0.5934, + "step": 464 + }, + { + "epoch": 0.16200243351294977, + "grad_norm": 0.6186667715273749, + "learning_rate": 0.00016180555555555555, + "loss": 0.6604, + "step": 466 + }, + { + "epoch": 0.16269772292716844, + "grad_norm": 0.8945416923537124, + "learning_rate": 0.00016250000000000002, + "loss": 0.6224, + "step": 468 + }, + { + "epoch": 0.1633930123413871, + "grad_norm": 1.0526200270890014, + "learning_rate": 0.00016319444444444446, + "loss": 0.616, + "step": 470 + }, + { + "epoch": 0.16408830175560576, + "grad_norm": 0.4575985966727194, + "learning_rate": 0.0001638888888888889, + "loss": 0.6591, + "step": 472 + }, + { + "epoch": 0.16478359116982444, + "grad_norm": 0.4499931204645402, + "learning_rate": 0.00016458333333333334, + "loss": 0.6644, + "step": 474 + }, + { + "epoch": 0.16547888058404311, + "grad_norm": 0.8365574384741885, + "learning_rate": 0.00016527777777777778, + "loss": 0.6503, + "step": 476 + }, + { + "epoch": 0.1661741699982618, + "grad_norm": 0.5265284650577726, + "learning_rate": 0.00016597222222222225, + "loss": 0.557, + "step": 478 + }, + { + "epoch": 0.16686945941248044, + "grad_norm": 0.6004742828917694, + "learning_rate": 0.0001666666666666667, + "loss": 0.696, + "step": 480 + }, + { + "epoch": 0.1675647488266991, + "grad_norm": 0.8653134209549845, + "learning_rate": 0.00016736111111111113, + "loss": 0.6544, + "step": 482 + }, + { + "epoch": 0.1682600382409178, + "grad_norm": 1.033230873418064, + "learning_rate": 0.00016805555555555557, + "loss": 0.641, + "step": 484 + }, + { + "epoch": 0.16895532765513646, + "grad_norm": 0.45457193405665913, + "learning_rate": 0.00016875, + "loss": 0.5952, + "step": 486 + }, + { + "epoch": 0.1696506170693551, + "grad_norm": 0.7413902971651539, + "learning_rate": 0.00016944444444444445, + "loss": 0.6306, + "step": 488 + }, + { + "epoch": 0.17034590648357378, + "grad_norm": 0.5808764628223875, + "learning_rate": 0.0001701388888888889, + "loss": 0.6714, + "step": 490 + }, + { + "epoch": 0.17104119589779246, + "grad_norm": 0.42505370383777924, + "learning_rate": 0.00017083333333333333, + "loss": 0.6432, + "step": 492 + }, + { + "epoch": 0.17173648531201113, + "grad_norm": 0.9403542369255028, + "learning_rate": 0.00017152777777777777, + "loss": 0.626, + "step": 494 + }, + { + "epoch": 0.17243177472622978, + "grad_norm": 0.41714707593148775, + "learning_rate": 0.00017222222222222224, + "loss": 0.6132, + "step": 496 + }, + { + "epoch": 0.17312706414044846, + "grad_norm": 0.6660896849726371, + "learning_rate": 0.00017291666666666668, + "loss": 0.7009, + "step": 498 + }, + { + "epoch": 0.17382235355466713, + "grad_norm": 0.5079993412341118, + "learning_rate": 0.00017361111111111112, + "loss": 0.6808, + "step": 500 + }, + { + "epoch": 0.1745176429688858, + "grad_norm": 0.3426487947129772, + "learning_rate": 0.00017430555555555556, + "loss": 0.687, + "step": 502 + }, + { + "epoch": 0.17521293238310448, + "grad_norm": 0.7316051797581208, + "learning_rate": 0.000175, + "loss": 0.686, + "step": 504 + }, + { + "epoch": 0.17590822179732313, + "grad_norm": 0.4619785653282459, + "learning_rate": 0.00017569444444444444, + "loss": 0.7019, + "step": 506 + }, + { + "epoch": 0.1766035112115418, + "grad_norm": 0.47786977912472967, + "learning_rate": 0.0001763888888888889, + "loss": 0.7097, + "step": 508 + }, + { + "epoch": 0.17729880062576048, + "grad_norm": 0.4204398291864812, + "learning_rate": 0.00017708333333333335, + "loss": 0.6715, + "step": 510 + }, + { + "epoch": 0.17799409003997915, + "grad_norm": 0.5257761541709909, + "learning_rate": 0.00017777777777777779, + "loss": 0.6675, + "step": 512 + }, + { + "epoch": 0.1786893794541978, + "grad_norm": 0.5752239420884688, + "learning_rate": 0.00017847222222222225, + "loss": 0.5847, + "step": 514 + }, + { + "epoch": 0.17938466886841647, + "grad_norm": 0.5611432017880666, + "learning_rate": 0.0001791666666666667, + "loss": 0.5978, + "step": 516 + }, + { + "epoch": 0.18007995828263515, + "grad_norm": 0.5147097358785945, + "learning_rate": 0.00017986111111111113, + "loss": 0.641, + "step": 518 + }, + { + "epoch": 0.18077524769685382, + "grad_norm": 0.4387330962078066, + "learning_rate": 0.00018055555555555557, + "loss": 0.5771, + "step": 520 + }, + { + "epoch": 0.18147053711107247, + "grad_norm": 0.5712526440788663, + "learning_rate": 0.00018125000000000001, + "loss": 0.6212, + "step": 522 + }, + { + "epoch": 0.18216582652529115, + "grad_norm": 0.6357133907029916, + "learning_rate": 0.00018194444444444445, + "loss": 0.5981, + "step": 524 + }, + { + "epoch": 0.18286111593950982, + "grad_norm": 1.2129620643054042, + "learning_rate": 0.0001826388888888889, + "loss": 0.5848, + "step": 526 + }, + { + "epoch": 0.1835564053537285, + "grad_norm": 1.651599276688714, + "learning_rate": 0.00018333333333333334, + "loss": 0.7089, + "step": 528 + }, + { + "epoch": 0.18425169476794717, + "grad_norm": 0.9051688342434142, + "learning_rate": 0.00018402777777777778, + "loss": 0.7255, + "step": 530 + }, + { + "epoch": 0.18494698418216582, + "grad_norm": 0.6932441010863684, + "learning_rate": 0.00018472222222222224, + "loss": 0.6497, + "step": 532 + }, + { + "epoch": 0.1856422735963845, + "grad_norm": 1.2163006408955903, + "learning_rate": 0.00018541666666666668, + "loss": 0.7585, + "step": 534 + }, + { + "epoch": 0.18633756301060317, + "grad_norm": 0.4387074048377486, + "learning_rate": 0.00018611111111111112, + "loss": 0.6541, + "step": 536 + }, + { + "epoch": 0.18703285242482184, + "grad_norm": 0.49430581216479236, + "learning_rate": 0.00018680555555555556, + "loss": 0.6489, + "step": 538 + }, + { + "epoch": 0.1877281418390405, + "grad_norm": 0.47561442420926275, + "learning_rate": 0.0001875, + "loss": 0.6406, + "step": 540 + }, + { + "epoch": 0.18842343125325917, + "grad_norm": 0.7046092923664611, + "learning_rate": 0.00018819444444444444, + "loss": 0.6099, + "step": 542 + }, + { + "epoch": 0.18911872066747784, + "grad_norm": 0.46256136269201026, + "learning_rate": 0.00018888888888888888, + "loss": 0.6992, + "step": 544 + }, + { + "epoch": 0.18981401008169652, + "grad_norm": 0.5489877082982352, + "learning_rate": 0.00018958333333333332, + "loss": 0.5817, + "step": 546 + }, + { + "epoch": 0.19050929949591516, + "grad_norm": 0.46129441798908893, + "learning_rate": 0.00019027777777777776, + "loss": 0.645, + "step": 548 + }, + { + "epoch": 0.19120458891013384, + "grad_norm": 0.3724226655450749, + "learning_rate": 0.00019097222222222223, + "loss": 0.6177, + "step": 550 + }, + { + "epoch": 0.1918998783243525, + "grad_norm": 0.4625796323902992, + "learning_rate": 0.00019166666666666667, + "loss": 0.6702, + "step": 552 + }, + { + "epoch": 0.1925951677385712, + "grad_norm": 1.0142124821047231, + "learning_rate": 0.0001923611111111111, + "loss": 0.7173, + "step": 554 + }, + { + "epoch": 0.19329045715278984, + "grad_norm": 0.5452830720753045, + "learning_rate": 0.00019305555555555558, + "loss": 0.6897, + "step": 556 + }, + { + "epoch": 0.1939857465670085, + "grad_norm": 0.5723214484723252, + "learning_rate": 0.00019375000000000002, + "loss": 0.6495, + "step": 558 + }, + { + "epoch": 0.19468103598122719, + "grad_norm": 0.39925844595054966, + "learning_rate": 0.00019444444444444446, + "loss": 0.6479, + "step": 560 + }, + { + "epoch": 0.19537632539544586, + "grad_norm": 0.3575565088751118, + "learning_rate": 0.0001951388888888889, + "loss": 0.6593, + "step": 562 + }, + { + "epoch": 0.19607161480966454, + "grad_norm": 0.6119892689536569, + "learning_rate": 0.00019583333333333334, + "loss": 0.6831, + "step": 564 + }, + { + "epoch": 0.19676690422388318, + "grad_norm": 0.5076569073121309, + "learning_rate": 0.00019652777777777778, + "loss": 0.6294, + "step": 566 + }, + { + "epoch": 0.19746219363810186, + "grad_norm": 0.622226505121079, + "learning_rate": 0.00019722222222222225, + "loss": 0.5551, + "step": 568 + }, + { + "epoch": 0.19815748305232053, + "grad_norm": 0.4106526912254415, + "learning_rate": 0.0001979166666666667, + "loss": 0.6503, + "step": 570 + }, + { + "epoch": 0.1988527724665392, + "grad_norm": 0.47164751383243125, + "learning_rate": 0.00019861111111111113, + "loss": 0.6992, + "step": 572 + }, + { + "epoch": 0.19954806188075785, + "grad_norm": 0.492328312395826, + "learning_rate": 0.00019930555555555557, + "loss": 0.7183, + "step": 574 + }, + { + "epoch": 0.20024335129497653, + "grad_norm": 0.5087240677439067, + "learning_rate": 0.0002, + "loss": 0.6429, + "step": 576 + }, + { + "epoch": 0.2009386407091952, + "grad_norm": 0.9311216098504759, + "learning_rate": 0.00019999992632143608, + "loss": 0.6586, + "step": 578 + }, + { + "epoch": 0.20163393012341388, + "grad_norm": 0.38840935170189844, + "learning_rate": 0.00019999970528585288, + "loss": 0.5905, + "step": 580 + }, + { + "epoch": 0.20232921953763253, + "grad_norm": 0.5966472765038273, + "learning_rate": 0.0001999993368935761, + "loss": 0.7112, + "step": 582 + }, + { + "epoch": 0.2030245089518512, + "grad_norm": 0.535232520705813, + "learning_rate": 0.00019999882114514863, + "loss": 0.7036, + "step": 584 + }, + { + "epoch": 0.20371979836606988, + "grad_norm": 0.5039916125175515, + "learning_rate": 0.0001999981580413304, + "loss": 0.7485, + "step": 586 + }, + { + "epoch": 0.20441508778028855, + "grad_norm": 0.6733262892097686, + "learning_rate": 0.0001999973475830986, + "loss": 0.7312, + "step": 588 + }, + { + "epoch": 0.20511037719450723, + "grad_norm": 0.42805740684614807, + "learning_rate": 0.00019999638977164747, + "loss": 0.6356, + "step": 590 + }, + { + "epoch": 0.20580566660872587, + "grad_norm": 0.976918546573707, + "learning_rate": 0.00019999528460838844, + "loss": 0.666, + "step": 592 + }, + { + "epoch": 0.20650095602294455, + "grad_norm": 0.674463735133944, + "learning_rate": 0.00019999403209495, + "loss": 0.6735, + "step": 594 + }, + { + "epoch": 0.20719624543716322, + "grad_norm": 0.412232119296174, + "learning_rate": 0.00019999263223317786, + "loss": 0.6364, + "step": 596 + }, + { + "epoch": 0.2078915348513819, + "grad_norm": 0.3611034413524545, + "learning_rate": 0.0001999910850251348, + "loss": 0.6368, + "step": 598 + }, + { + "epoch": 0.20858682426560055, + "grad_norm": 0.542506398091656, + "learning_rate": 0.0001999893904731007, + "loss": 0.7292, + "step": 600 + }, + { + "epoch": 0.20858682426560055, + "eval_loss": 0.6517693400382996, + "eval_runtime": 707.4674, + "eval_samples_per_second": 6.844, + "eval_steps_per_second": 0.215, + "step": 600 + }, + { + "epoch": 0.20928211367981922, + "grad_norm": 0.4799286290563759, + "learning_rate": 0.0001999875485795727, + "loss": 0.6609, + "step": 602 + }, + { + "epoch": 0.2099774030940379, + "grad_norm": 0.41830446575524177, + "learning_rate": 0.0001999855593472649, + "loss": 0.6084, + "step": 604 + }, + { + "epoch": 0.21067269250825657, + "grad_norm": 0.8865562086549428, + "learning_rate": 0.00019998342277910856, + "loss": 0.6204, + "step": 606 + }, + { + "epoch": 0.21136798192247522, + "grad_norm": 0.5567410910026902, + "learning_rate": 0.00019998113887825206, + "loss": 0.7087, + "step": 608 + }, + { + "epoch": 0.2120632713366939, + "grad_norm": 0.4229098163428897, + "learning_rate": 0.000199978707648061, + "loss": 0.6403, + "step": 610 + }, + { + "epoch": 0.21275856075091257, + "grad_norm": 0.7793555918286379, + "learning_rate": 0.00019997612909211784, + "loss": 0.6147, + "step": 612 + }, + { + "epoch": 0.21345385016513124, + "grad_norm": 0.49302383416102263, + "learning_rate": 0.00019997340321422228, + "loss": 0.5771, + "step": 614 + }, + { + "epoch": 0.21414913957934992, + "grad_norm": 1.0807551778698754, + "learning_rate": 0.00019997053001839115, + "loss": 0.6538, + "step": 616 + }, + { + "epoch": 0.21484442899356856, + "grad_norm": 0.5935042706034646, + "learning_rate": 0.0001999675095088583, + "loss": 0.6058, + "step": 618 + }, + { + "epoch": 0.21553971840778724, + "grad_norm": 0.5151203960605611, + "learning_rate": 0.00019996434169007468, + "loss": 0.6138, + "step": 620 + }, + { + "epoch": 0.21623500782200591, + "grad_norm": 0.7837579499467073, + "learning_rate": 0.00019996102656670824, + "loss": 0.657, + "step": 622 + }, + { + "epoch": 0.2169302972362246, + "grad_norm": 0.5438202413527335, + "learning_rate": 0.0001999575641436441, + "loss": 0.6642, + "step": 624 + }, + { + "epoch": 0.21762558665044324, + "grad_norm": 0.5566641749580342, + "learning_rate": 0.00019995395442598435, + "loss": 0.6813, + "step": 626 + }, + { + "epoch": 0.2183208760646619, + "grad_norm": 0.9345190838089675, + "learning_rate": 0.0001999501974190482, + "loss": 0.684, + "step": 628 + }, + { + "epoch": 0.2190161654788806, + "grad_norm": 0.48677420225080537, + "learning_rate": 0.00019994629312837186, + "loss": 0.6481, + "step": 630 + }, + { + "epoch": 0.21971145489309926, + "grad_norm": 1.3826373483976924, + "learning_rate": 0.00019994224155970856, + "loss": 0.7222, + "step": 632 + }, + { + "epoch": 0.2204067443073179, + "grad_norm": 0.9031189580678588, + "learning_rate": 0.00019993804271902857, + "loss": 0.6809, + "step": 634 + }, + { + "epoch": 0.22110203372153658, + "grad_norm": 0.5674519795217096, + "learning_rate": 0.00019993369661251923, + "loss": 0.6184, + "step": 636 + }, + { + "epoch": 0.22179732313575526, + "grad_norm": 2.5294344265719135, + "learning_rate": 0.0001999292032465848, + "loss": 0.7686, + "step": 638 + }, + { + "epoch": 0.22249261254997393, + "grad_norm": 2.8855656605632047, + "learning_rate": 0.00019992456262784658, + "loss": 0.8215, + "step": 640 + }, + { + "epoch": 0.2231879019641926, + "grad_norm": 1.5331524159142917, + "learning_rate": 0.00019991977476314286, + "loss": 0.7057, + "step": 642 + }, + { + "epoch": 0.22388319137841126, + "grad_norm": 0.8086145005161695, + "learning_rate": 0.0001999148396595289, + "loss": 0.6289, + "step": 644 + }, + { + "epoch": 0.22457848079262993, + "grad_norm": 0.767389193699688, + "learning_rate": 0.00019990975732427693, + "loss": 0.6117, + "step": 646 + }, + { + "epoch": 0.2252737702068486, + "grad_norm": 0.9275190697426144, + "learning_rate": 0.0001999045277648761, + "loss": 0.6582, + "step": 648 + }, + { + "epoch": 0.22596905962106728, + "grad_norm": 0.8004230202091956, + "learning_rate": 0.00019989915098903257, + "loss": 0.5387, + "step": 650 + }, + { + "epoch": 0.22666434903528593, + "grad_norm": 0.8210833181388095, + "learning_rate": 0.0001998936270046694, + "loss": 0.5941, + "step": 652 + }, + { + "epoch": 0.2273596384495046, + "grad_norm": 2.1189675938584616, + "learning_rate": 0.00019988795581992656, + "loss": 0.7504, + "step": 654 + }, + { + "epoch": 0.22805492786372328, + "grad_norm": 0.5952032026226816, + "learning_rate": 0.000199882137443161, + "loss": 0.6643, + "step": 656 + }, + { + "epoch": 0.22875021727794195, + "grad_norm": 0.40481972159485846, + "learning_rate": 0.00019987617188294642, + "loss": 0.5225, + "step": 658 + }, + { + "epoch": 0.2294455066921606, + "grad_norm": 0.7478677085785272, + "learning_rate": 0.00019987005914807356, + "loss": 0.6561, + "step": 660 + }, + { + "epoch": 0.23014079610637928, + "grad_norm": 0.4468692254604696, + "learning_rate": 0.00019986379924754997, + "loss": 0.6262, + "step": 662 + }, + { + "epoch": 0.23083608552059795, + "grad_norm": 0.46697718493106893, + "learning_rate": 0.00019985739219060002, + "loss": 0.6178, + "step": 664 + }, + { + "epoch": 0.23153137493481663, + "grad_norm": 0.388728867903269, + "learning_rate": 0.000199850837986665, + "loss": 0.5544, + "step": 666 + }, + { + "epoch": 0.23222666434903527, + "grad_norm": 0.5731403139849517, + "learning_rate": 0.000199844136645403, + "loss": 0.5906, + "step": 668 + }, + { + "epoch": 0.23292195376325395, + "grad_norm": 0.7601215827849259, + "learning_rate": 0.0001998372881766889, + "loss": 0.6577, + "step": 670 + }, + { + "epoch": 0.23361724317747262, + "grad_norm": 0.8997786413980279, + "learning_rate": 0.00019983029259061446, + "loss": 0.6388, + "step": 672 + }, + { + "epoch": 0.2343125325916913, + "grad_norm": 0.519349430301096, + "learning_rate": 0.00019982314989748813, + "loss": 0.6561, + "step": 674 + }, + { + "epoch": 0.23500782200590997, + "grad_norm": 0.4918913590728881, + "learning_rate": 0.00019981586010783513, + "loss": 0.6176, + "step": 676 + }, + { + "epoch": 0.23570311142012862, + "grad_norm": 0.5324672662478441, + "learning_rate": 0.00019980842323239756, + "loss": 0.5801, + "step": 678 + }, + { + "epoch": 0.2363984008343473, + "grad_norm": 0.6375745879180794, + "learning_rate": 0.00019980083928213417, + "loss": 0.6885, + "step": 680 + }, + { + "epoch": 0.23709369024856597, + "grad_norm": 0.4317997282790841, + "learning_rate": 0.00019979310826822046, + "loss": 0.5727, + "step": 682 + }, + { + "epoch": 0.23778897966278464, + "grad_norm": 0.7933828103238656, + "learning_rate": 0.00019978523020204857, + "loss": 0.6703, + "step": 684 + }, + { + "epoch": 0.2384842690770033, + "grad_norm": 0.5465102255190097, + "learning_rate": 0.00019977720509522747, + "loss": 0.6675, + "step": 686 + }, + { + "epoch": 0.23917955849122197, + "grad_norm": 0.8356137363612883, + "learning_rate": 0.00019976903295958269, + "loss": 0.6558, + "step": 688 + }, + { + "epoch": 0.23987484790544064, + "grad_norm": 0.5190073187676806, + "learning_rate": 0.00019976071380715645, + "loss": 0.6779, + "step": 690 + }, + { + "epoch": 0.24057013731965932, + "grad_norm": 0.40561527338007225, + "learning_rate": 0.0001997522476502076, + "loss": 0.6687, + "step": 692 + }, + { + "epoch": 0.24126542673387796, + "grad_norm": 0.592821589706298, + "learning_rate": 0.0001997436345012117, + "loss": 0.6807, + "step": 694 + }, + { + "epoch": 0.24196071614809664, + "grad_norm": 0.686918345062074, + "learning_rate": 0.00019973487437286073, + "loss": 0.6831, + "step": 696 + }, + { + "epoch": 0.2426560055623153, + "grad_norm": 0.964075508243471, + "learning_rate": 0.00019972596727806346, + "loss": 0.665, + "step": 698 + }, + { + "epoch": 0.243351294976534, + "grad_norm": 0.739137434656244, + "learning_rate": 0.00019971691322994507, + "loss": 0.6387, + "step": 700 + }, + { + "epoch": 0.24404658439075266, + "grad_norm": 0.3978099419540589, + "learning_rate": 0.00019970771224184737, + "loss": 0.6143, + "step": 702 + }, + { + "epoch": 0.2447418738049713, + "grad_norm": 0.4997978607153984, + "learning_rate": 0.0001996983643273287, + "loss": 0.6083, + "step": 704 + }, + { + "epoch": 0.24543716321918999, + "grad_norm": 1.3443518380439796, + "learning_rate": 0.0001996888695001638, + "loss": 0.6711, + "step": 706 + }, + { + "epoch": 0.24613245263340866, + "grad_norm": 0.5424379336505594, + "learning_rate": 0.000199679227774344, + "loss": 0.6321, + "step": 708 + }, + { + "epoch": 0.24682774204762734, + "grad_norm": 0.7689235498835658, + "learning_rate": 0.00019966943916407712, + "loss": 0.6918, + "step": 710 + }, + { + "epoch": 0.24752303146184598, + "grad_norm": 0.6467240394468301, + "learning_rate": 0.00019965950368378734, + "loss": 0.6368, + "step": 712 + }, + { + "epoch": 0.24821832087606466, + "grad_norm": 0.48819289451999526, + "learning_rate": 0.00019964942134811532, + "loss": 0.5875, + "step": 714 + }, + { + "epoch": 0.24891361029028333, + "grad_norm": 1.1929427463467126, + "learning_rate": 0.00019963919217191807, + "loss": 0.6795, + "step": 716 + }, + { + "epoch": 0.249608899704502, + "grad_norm": 0.4182713825442439, + "learning_rate": 0.00019962881617026902, + "loss": 0.5835, + "step": 718 + }, + { + "epoch": 0.25030418911872065, + "grad_norm": 0.5770262516296942, + "learning_rate": 0.00019961829335845795, + "loss": 0.6299, + "step": 720 + }, + { + "epoch": 0.25099947853293936, + "grad_norm": 0.9135250550485389, + "learning_rate": 0.00019960762375199095, + "loss": 0.6844, + "step": 722 + }, + { + "epoch": 0.251694767947158, + "grad_norm": 0.5511234805517417, + "learning_rate": 0.0001995968073665905, + "loss": 0.5745, + "step": 724 + }, + { + "epoch": 0.25239005736137665, + "grad_norm": 0.49137872896877094, + "learning_rate": 0.00019958584421819528, + "loss": 0.698, + "step": 726 + }, + { + "epoch": 0.25308534677559535, + "grad_norm": 0.4437253322782162, + "learning_rate": 0.00019957473432296026, + "loss": 0.6864, + "step": 728 + }, + { + "epoch": 0.253780636189814, + "grad_norm": 0.5064381489074585, + "learning_rate": 0.0001995634776972567, + "loss": 0.5758, + "step": 730 + }, + { + "epoch": 0.2544759256040327, + "grad_norm": 0.5464655664741616, + "learning_rate": 0.00019955207435767201, + "loss": 0.6351, + "step": 732 + }, + { + "epoch": 0.25517121501825135, + "grad_norm": 0.44060524677853835, + "learning_rate": 0.00019954052432100982, + "loss": 0.6837, + "step": 734 + }, + { + "epoch": 0.25586650443247, + "grad_norm": 0.942390696980061, + "learning_rate": 0.00019952882760428998, + "loss": 0.6378, + "step": 736 + }, + { + "epoch": 0.2565617938466887, + "grad_norm": 0.4710023299938762, + "learning_rate": 0.00019951698422474836, + "loss": 0.6968, + "step": 738 + }, + { + "epoch": 0.25725708326090735, + "grad_norm": 0.4179809222387651, + "learning_rate": 0.00019950499419983707, + "loss": 0.5643, + "step": 740 + }, + { + "epoch": 0.257952372675126, + "grad_norm": 0.4446278865199289, + "learning_rate": 0.00019949285754722426, + "loss": 0.5089, + "step": 742 + }, + { + "epoch": 0.2586476620893447, + "grad_norm": 0.914728851966275, + "learning_rate": 0.00019948057428479418, + "loss": 0.7933, + "step": 744 + }, + { + "epoch": 0.25934295150356335, + "grad_norm": 0.47142275185055055, + "learning_rate": 0.00019946814443064703, + "loss": 0.6384, + "step": 746 + }, + { + "epoch": 0.26003824091778205, + "grad_norm": 0.720916103725334, + "learning_rate": 0.00019945556800309917, + "loss": 0.5957, + "step": 748 + }, + { + "epoch": 0.2607335303320007, + "grad_norm": 0.8550360126036364, + "learning_rate": 0.00019944284502068275, + "loss": 0.6454, + "step": 750 + }, + { + "epoch": 0.2607335303320007, + "eval_loss": 0.6373963952064514, + "eval_runtime": 728.7951, + "eval_samples_per_second": 6.644, + "eval_steps_per_second": 0.209, + "step": 750 + }, + { + "epoch": 0.26142881974621934, + "grad_norm": 0.5467512313200382, + "learning_rate": 0.0001994299755021461, + "loss": 0.5781, + "step": 752 + }, + { + "epoch": 0.26212410916043805, + "grad_norm": 0.41230384162224254, + "learning_rate": 0.0001994169594664533, + "loss": 0.6467, + "step": 754 + }, + { + "epoch": 0.2628193985746567, + "grad_norm": 0.5635895964904281, + "learning_rate": 0.00019940379693278448, + "loss": 0.6182, + "step": 756 + }, + { + "epoch": 0.2635146879888754, + "grad_norm": 0.6456168984233462, + "learning_rate": 0.0001993904879205355, + "loss": 0.6086, + "step": 758 + }, + { + "epoch": 0.26420997740309404, + "grad_norm": 0.5060399335833471, + "learning_rate": 0.00019937703244931815, + "loss": 0.6407, + "step": 760 + }, + { + "epoch": 0.2649052668173127, + "grad_norm": 0.5033297464646784, + "learning_rate": 0.00019936343053896004, + "loss": 0.6157, + "step": 762 + }, + { + "epoch": 0.2656005562315314, + "grad_norm": 0.3911665523252255, + "learning_rate": 0.00019934968220950458, + "loss": 0.6227, + "step": 764 + }, + { + "epoch": 0.26629584564575004, + "grad_norm": 1.7130937466256138, + "learning_rate": 0.00019933578748121086, + "loss": 0.5994, + "step": 766 + }, + { + "epoch": 0.2669911350599687, + "grad_norm": 0.5747338886603724, + "learning_rate": 0.00019932174637455382, + "loss": 0.6238, + "step": 768 + }, + { + "epoch": 0.2676864244741874, + "grad_norm": 0.6226324357252033, + "learning_rate": 0.00019930755891022398, + "loss": 0.6255, + "step": 770 + }, + { + "epoch": 0.26838171388840604, + "grad_norm": 0.5282488794229044, + "learning_rate": 0.00019929322510912756, + "loss": 0.5808, + "step": 772 + }, + { + "epoch": 0.26907700330262474, + "grad_norm": 0.5596904577167024, + "learning_rate": 0.0001992787449923865, + "loss": 0.5361, + "step": 774 + }, + { + "epoch": 0.2697722927168434, + "grad_norm": 1.0477422618379753, + "learning_rate": 0.00019926411858133824, + "loss": 0.54, + "step": 776 + }, + { + "epoch": 0.27046758213106203, + "grad_norm": 1.1314704495635823, + "learning_rate": 0.00019924934589753582, + "loss": 0.5869, + "step": 778 + }, + { + "epoch": 0.27116287154528074, + "grad_norm": 0.5426548544381972, + "learning_rate": 0.00019923442696274794, + "loss": 0.5951, + "step": 780 + }, + { + "epoch": 0.2718581609594994, + "grad_norm": 0.8480025293040686, + "learning_rate": 0.00019921936179895862, + "loss": 0.6003, + "step": 782 + }, + { + "epoch": 0.2725534503737181, + "grad_norm": 0.5729452380906337, + "learning_rate": 0.0001992041504283675, + "loss": 0.6526, + "step": 784 + }, + { + "epoch": 0.27324873978793673, + "grad_norm": 0.7362085286496177, + "learning_rate": 0.00019918879287338957, + "loss": 0.6776, + "step": 786 + }, + { + "epoch": 0.2739440292021554, + "grad_norm": 0.7440059372391256, + "learning_rate": 0.00019917328915665535, + "loss": 0.6486, + "step": 788 + }, + { + "epoch": 0.2746393186163741, + "grad_norm": 0.6110842206790659, + "learning_rate": 0.0001991576393010106, + "loss": 0.6226, + "step": 790 + }, + { + "epoch": 0.27533460803059273, + "grad_norm": 0.8002336898560896, + "learning_rate": 0.00019914184332951655, + "loss": 0.6215, + "step": 792 + }, + { + "epoch": 0.2760298974448114, + "grad_norm": 0.6761736356192558, + "learning_rate": 0.00019912590126544964, + "loss": 0.5988, + "step": 794 + }, + { + "epoch": 0.2767251868590301, + "grad_norm": 1.1005016630123619, + "learning_rate": 0.00019910981313230172, + "loss": 0.6213, + "step": 796 + }, + { + "epoch": 0.27742047627324873, + "grad_norm": 0.6513452605734942, + "learning_rate": 0.00019909357895377973, + "loss": 0.682, + "step": 798 + }, + { + "epoch": 0.27811576568746743, + "grad_norm": 0.8536492677008404, + "learning_rate": 0.0001990771987538059, + "loss": 0.707, + "step": 800 + }, + { + "epoch": 0.2788110551016861, + "grad_norm": 0.3362293750538688, + "learning_rate": 0.00019906067255651765, + "loss": 0.7108, + "step": 802 + }, + { + "epoch": 0.2795063445159047, + "grad_norm": 0.4792899916449288, + "learning_rate": 0.0001990440003862675, + "loss": 0.6055, + "step": 804 + }, + { + "epoch": 0.28020163393012343, + "grad_norm": 1.272937677307704, + "learning_rate": 0.00019902718226762304, + "loss": 0.6816, + "step": 806 + }, + { + "epoch": 0.2808969233443421, + "grad_norm": 0.30646692495778655, + "learning_rate": 0.00019901021822536704, + "loss": 0.688, + "step": 808 + }, + { + "epoch": 0.2815922127585608, + "grad_norm": 0.3035733218665055, + "learning_rate": 0.00019899310828449713, + "loss": 0.6746, + "step": 810 + }, + { + "epoch": 0.2822875021727794, + "grad_norm": 0.2763276026826459, + "learning_rate": 0.00019897585247022613, + "loss": 0.6632, + "step": 812 + }, + { + "epoch": 0.2829827915869981, + "grad_norm": 1.173118337900773, + "learning_rate": 0.00019895845080798166, + "loss": 0.6306, + "step": 814 + }, + { + "epoch": 0.2836780810012168, + "grad_norm": 0.4335278252167635, + "learning_rate": 0.0001989409033234063, + "loss": 0.6147, + "step": 816 + }, + { + "epoch": 0.2843733704154354, + "grad_norm": 0.3556694503062785, + "learning_rate": 0.00019892321004235755, + "loss": 0.5771, + "step": 818 + }, + { + "epoch": 0.28506865982965407, + "grad_norm": 0.9083240381897224, + "learning_rate": 0.00019890537099090768, + "loss": 0.5729, + "step": 820 + }, + { + "epoch": 0.2857639492438728, + "grad_norm": 0.5433346815141633, + "learning_rate": 0.00019888738619534385, + "loss": 0.5554, + "step": 822 + }, + { + "epoch": 0.2864592386580914, + "grad_norm": 0.5244705156138804, + "learning_rate": 0.0001988692556821679, + "loss": 0.6525, + "step": 824 + }, + { + "epoch": 0.2871545280723101, + "grad_norm": 0.7580866792170871, + "learning_rate": 0.00019885097947809648, + "loss": 0.6512, + "step": 826 + }, + { + "epoch": 0.28784981748652877, + "grad_norm": 0.7034554538404351, + "learning_rate": 0.00019883255761006082, + "loss": 0.5414, + "step": 828 + }, + { + "epoch": 0.2885451069007474, + "grad_norm": 0.6915575597289163, + "learning_rate": 0.00019881399010520688, + "loss": 0.6036, + "step": 830 + }, + { + "epoch": 0.2892403963149661, + "grad_norm": 0.6895372001781882, + "learning_rate": 0.00019879527699089524, + "loss": 0.5894, + "step": 832 + }, + { + "epoch": 0.28993568572918477, + "grad_norm": 0.7762412863407715, + "learning_rate": 0.00019877641829470094, + "loss": 0.7115, + "step": 834 + }, + { + "epoch": 0.29063097514340347, + "grad_norm": 0.5761220663639801, + "learning_rate": 0.00019875741404441367, + "loss": 0.6108, + "step": 836 + }, + { + "epoch": 0.2913262645576221, + "grad_norm": 0.47176943357070505, + "learning_rate": 0.00019873826426803755, + "loss": 0.634, + "step": 838 + }, + { + "epoch": 0.29202155397184076, + "grad_norm": 0.5985873148196751, + "learning_rate": 0.00019871896899379107, + "loss": 0.6528, + "step": 840 + }, + { + "epoch": 0.29271684338605947, + "grad_norm": 0.39514741111190665, + "learning_rate": 0.00019869952825010727, + "loss": 0.6034, + "step": 842 + }, + { + "epoch": 0.2934121328002781, + "grad_norm": 0.29787585594263405, + "learning_rate": 0.00019867994206563343, + "loss": 0.6063, + "step": 844 + }, + { + "epoch": 0.29410742221449676, + "grad_norm": 0.303320759302155, + "learning_rate": 0.00019866021046923118, + "loss": 0.6343, + "step": 846 + }, + { + "epoch": 0.29480271162871546, + "grad_norm": 0.33135450527244925, + "learning_rate": 0.00019864033348997645, + "loss": 0.6421, + "step": 848 + }, + { + "epoch": 0.2954980010429341, + "grad_norm": 0.553668190192523, + "learning_rate": 0.0001986203111571594, + "loss": 0.6503, + "step": 850 + }, + { + "epoch": 0.2961932904571528, + "grad_norm": 0.31948016623126946, + "learning_rate": 0.00019860014350028438, + "loss": 0.6259, + "step": 852 + }, + { + "epoch": 0.29688857987137146, + "grad_norm": 0.5325237443938606, + "learning_rate": 0.0001985798305490698, + "loss": 0.6207, + "step": 854 + }, + { + "epoch": 0.2975838692855901, + "grad_norm": 0.5093186589927414, + "learning_rate": 0.00019855937233344831, + "loss": 0.5397, + "step": 856 + }, + { + "epoch": 0.2982791586998088, + "grad_norm": 0.5220573948537062, + "learning_rate": 0.00019853876888356652, + "loss": 0.6237, + "step": 858 + }, + { + "epoch": 0.29897444811402746, + "grad_norm": 0.9861332892020862, + "learning_rate": 0.00019851802022978506, + "loss": 0.689, + "step": 860 + }, + { + "epoch": 0.2996697375282461, + "grad_norm": 0.464669721879274, + "learning_rate": 0.00019849712640267861, + "loss": 0.522, + "step": 862 + }, + { + "epoch": 0.3003650269424648, + "grad_norm": 0.9223435358714303, + "learning_rate": 0.00019847608743303567, + "loss": 0.7491, + "step": 864 + }, + { + "epoch": 0.30106031635668346, + "grad_norm": 0.5058775377593727, + "learning_rate": 0.00019845490335185866, + "loss": 0.562, + "step": 866 + }, + { + "epoch": 0.30175560577090216, + "grad_norm": 0.5517767811356443, + "learning_rate": 0.00019843357419036382, + "loss": 0.6162, + "step": 868 + }, + { + "epoch": 0.3024508951851208, + "grad_norm": 0.49255497197537723, + "learning_rate": 0.00019841209997998127, + "loss": 0.6803, + "step": 870 + }, + { + "epoch": 0.30314618459933945, + "grad_norm": 0.41553745561512617, + "learning_rate": 0.0001983904807523547, + "loss": 0.6415, + "step": 872 + }, + { + "epoch": 0.30384147401355815, + "grad_norm": 0.49551628457734653, + "learning_rate": 0.00019836871653934162, + "loss": 0.6176, + "step": 874 + }, + { + "epoch": 0.3045367634277768, + "grad_norm": 0.7489091107060393, + "learning_rate": 0.00019834680737301313, + "loss": 0.6337, + "step": 876 + }, + { + "epoch": 0.3052320528419955, + "grad_norm": 0.32312869533576805, + "learning_rate": 0.00019832475328565398, + "loss": 0.6135, + "step": 878 + }, + { + "epoch": 0.30592734225621415, + "grad_norm": 0.304002075332943, + "learning_rate": 0.00019830255430976242, + "loss": 0.5533, + "step": 880 + }, + { + "epoch": 0.3066226316704328, + "grad_norm": 0.4137621036041215, + "learning_rate": 0.00019828021047805022, + "loss": 0.573, + "step": 882 + }, + { + "epoch": 0.3073179210846515, + "grad_norm": 0.7506870255042438, + "learning_rate": 0.00019825772182344262, + "loss": 0.6971, + "step": 884 + }, + { + "epoch": 0.30801321049887015, + "grad_norm": 0.7069489041589112, + "learning_rate": 0.00019823508837907828, + "loss": 0.5848, + "step": 886 + }, + { + "epoch": 0.3087084999130888, + "grad_norm": 0.49383355752727304, + "learning_rate": 0.00019821231017830914, + "loss": 0.6349, + "step": 888 + }, + { + "epoch": 0.3094037893273075, + "grad_norm": 0.7893505446859834, + "learning_rate": 0.0001981893872547005, + "loss": 0.6335, + "step": 890 + }, + { + "epoch": 0.31009907874152615, + "grad_norm": 1.0962653113728835, + "learning_rate": 0.00019816631964203097, + "loss": 0.6438, + "step": 892 + }, + { + "epoch": 0.31079436815574485, + "grad_norm": 0.40606329821748216, + "learning_rate": 0.0001981431073742923, + "loss": 0.557, + "step": 894 + }, + { + "epoch": 0.3114896575699635, + "grad_norm": 0.8061837126172193, + "learning_rate": 0.00019811975048568943, + "loss": 0.6334, + "step": 896 + }, + { + "epoch": 0.31218494698418214, + "grad_norm": 0.7808955990860935, + "learning_rate": 0.00019809624901064038, + "loss": 0.5775, + "step": 898 + }, + { + "epoch": 0.31288023639840085, + "grad_norm": 0.5527203146534614, + "learning_rate": 0.00019807260298377626, + "loss": 0.5934, + "step": 900 + }, + { + "epoch": 0.31288023639840085, + "eval_loss": 0.666339099407196, + "eval_runtime": 759.5196, + "eval_samples_per_second": 6.375, + "eval_steps_per_second": 0.2, + "step": 900 + }, + { + "epoch": 0.3135755258126195, + "grad_norm": 1.151650071753606, + "learning_rate": 0.00019804881243994118, + "loss": 0.6459, + "step": 902 + }, + { + "epoch": 0.3142708152268382, + "grad_norm": 0.37537177441864283, + "learning_rate": 0.00019802487741419218, + "loss": 0.5537, + "step": 904 + }, + { + "epoch": 0.31496610464105684, + "grad_norm": 0.39806583735978385, + "learning_rate": 0.00019800079794179927, + "loss": 0.5765, + "step": 906 + }, + { + "epoch": 0.3156613940552755, + "grad_norm": 0.9252532303995283, + "learning_rate": 0.00019797657405824524, + "loss": 0.6581, + "step": 908 + }, + { + "epoch": 0.3163566834694942, + "grad_norm": 0.4242008643262632, + "learning_rate": 0.00019795220579922572, + "loss": 0.663, + "step": 910 + }, + { + "epoch": 0.31705197288371284, + "grad_norm": 0.5557863138791925, + "learning_rate": 0.00019792769320064904, + "loss": 0.6492, + "step": 912 + }, + { + "epoch": 0.3177472622979315, + "grad_norm": 0.5743017982975046, + "learning_rate": 0.0001979030362986363, + "loss": 0.6425, + "step": 914 + }, + { + "epoch": 0.3184425517121502, + "grad_norm": 0.39667228882787314, + "learning_rate": 0.0001978782351295212, + "loss": 0.5658, + "step": 916 + }, + { + "epoch": 0.31913784112636884, + "grad_norm": 1.2742981139875873, + "learning_rate": 0.00019785328972985, + "loss": 0.6042, + "step": 918 + }, + { + "epoch": 0.31983313054058754, + "grad_norm": 0.7520790754771111, + "learning_rate": 0.00019782820013638158, + "loss": 0.6248, + "step": 920 + }, + { + "epoch": 0.3205284199548062, + "grad_norm": 1.1777266516894538, + "learning_rate": 0.0001978029663860872, + "loss": 0.6394, + "step": 922 + }, + { + "epoch": 0.32122370936902483, + "grad_norm": 0.5383416828808074, + "learning_rate": 0.00019777758851615058, + "loss": 0.6357, + "step": 924 + }, + { + "epoch": 0.32191899878324354, + "grad_norm": 0.5351088818608489, + "learning_rate": 0.00019775206656396787, + "loss": 0.6111, + "step": 926 + }, + { + "epoch": 0.3226142881974622, + "grad_norm": 0.7776255734128178, + "learning_rate": 0.00019772640056714744, + "loss": 0.5778, + "step": 928 + }, + { + "epoch": 0.3233095776116809, + "grad_norm": 0.5049904332607067, + "learning_rate": 0.00019770059056351, + "loss": 0.5978, + "step": 930 + }, + { + "epoch": 0.32400486702589953, + "grad_norm": 0.6894813643690206, + "learning_rate": 0.00019767463659108841, + "loss": 0.6727, + "step": 932 + }, + { + "epoch": 0.3247001564401182, + "grad_norm": 0.6230252249989028, + "learning_rate": 0.00019764853868812772, + "loss": 0.5911, + "step": 934 + }, + { + "epoch": 0.3253954458543369, + "grad_norm": 0.6699617199619087, + "learning_rate": 0.00019762229689308499, + "loss": 0.6694, + "step": 936 + }, + { + "epoch": 0.32609073526855553, + "grad_norm": 0.9762605521595761, + "learning_rate": 0.00019759591124462943, + "loss": 0.7053, + "step": 938 + }, + { + "epoch": 0.3267860246827742, + "grad_norm": 0.5216728233794251, + "learning_rate": 0.0001975693817816422, + "loss": 0.6958, + "step": 940 + }, + { + "epoch": 0.3274813140969929, + "grad_norm": 0.5943791708445256, + "learning_rate": 0.00019754270854321625, + "loss": 0.6342, + "step": 942 + }, + { + "epoch": 0.32817660351121153, + "grad_norm": 0.5341014737913188, + "learning_rate": 0.00019751589156865663, + "loss": 0.6272, + "step": 944 + }, + { + "epoch": 0.32887189292543023, + "grad_norm": 0.8411647140863245, + "learning_rate": 0.00019748893089747995, + "loss": 0.6041, + "step": 946 + }, + { + "epoch": 0.3295671823396489, + "grad_norm": 1.072323043427063, + "learning_rate": 0.00019746182656941473, + "loss": 0.7152, + "step": 948 + }, + { + "epoch": 0.3302624717538675, + "grad_norm": 0.6497829380326366, + "learning_rate": 0.00019743457862440115, + "loss": 0.6176, + "step": 950 + }, + { + "epoch": 0.33095776116808623, + "grad_norm": 0.28736093186011447, + "learning_rate": 0.00019740718710259096, + "loss": 0.6453, + "step": 952 + }, + { + "epoch": 0.3316530505823049, + "grad_norm": 0.27868233108109625, + "learning_rate": 0.00019737965204434757, + "loss": 0.6051, + "step": 954 + }, + { + "epoch": 0.3323483399965236, + "grad_norm": 0.40709235855818693, + "learning_rate": 0.00019735197349024576, + "loss": 0.6255, + "step": 956 + }, + { + "epoch": 0.3330436294107422, + "grad_norm": 0.8385677925045294, + "learning_rate": 0.00019732415148107199, + "loss": 0.6455, + "step": 958 + }, + { + "epoch": 0.3337389188249609, + "grad_norm": 0.5642576200414804, + "learning_rate": 0.00019729618605782384, + "loss": 0.6971, + "step": 960 + }, + { + "epoch": 0.3344342082391796, + "grad_norm": 0.7034648545079693, + "learning_rate": 0.00019726807726171039, + "loss": 0.6177, + "step": 962 + }, + { + "epoch": 0.3351294976533982, + "grad_norm": 1.9840633930320113, + "learning_rate": 0.000197239825134152, + "loss": 0.6776, + "step": 964 + }, + { + "epoch": 0.33582478706761687, + "grad_norm": 1.0091982574836484, + "learning_rate": 0.00019721142971678015, + "loss": 0.6893, + "step": 966 + }, + { + "epoch": 0.3365200764818356, + "grad_norm": 0.9742560258590767, + "learning_rate": 0.00019718289105143753, + "loss": 0.744, + "step": 968 + }, + { + "epoch": 0.3372153658960542, + "grad_norm": 0.6897018399345455, + "learning_rate": 0.00019715420918017793, + "loss": 0.678, + "step": 970 + }, + { + "epoch": 0.3379106553102729, + "grad_norm": 0.29102959771453246, + "learning_rate": 0.00019712538414526606, + "loss": 0.6663, + "step": 972 + }, + { + "epoch": 0.33860594472449157, + "grad_norm": 0.7337107483377766, + "learning_rate": 0.0001970964159891777, + "loss": 0.663, + "step": 974 + }, + { + "epoch": 0.3393012341387102, + "grad_norm": 0.5817704647699353, + "learning_rate": 0.00019706730475459953, + "loss": 0.6398, + "step": 976 + }, + { + "epoch": 0.3399965235529289, + "grad_norm": 0.28703428796704483, + "learning_rate": 0.00019703805048442897, + "loss": 0.5906, + "step": 978 + }, + { + "epoch": 0.34069181296714757, + "grad_norm": 0.41383789019772477, + "learning_rate": 0.0001970086532217743, + "loss": 0.6709, + "step": 980 + }, + { + "epoch": 0.34138710238136627, + "grad_norm": 0.812487649001141, + "learning_rate": 0.00019697911300995443, + "loss": 0.6191, + "step": 982 + }, + { + "epoch": 0.3420823917955849, + "grad_norm": 0.798027200072012, + "learning_rate": 0.00019694942989249907, + "loss": 0.6608, + "step": 984 + }, + { + "epoch": 0.34277768120980356, + "grad_norm": 0.44029385955900757, + "learning_rate": 0.00019691960391314837, + "loss": 0.647, + "step": 986 + }, + { + "epoch": 0.34347297062402227, + "grad_norm": 0.3824484030698272, + "learning_rate": 0.00019688963511585295, + "loss": 0.6378, + "step": 988 + }, + { + "epoch": 0.3441682600382409, + "grad_norm": 0.4121768227084979, + "learning_rate": 0.0001968595235447741, + "loss": 0.5908, + "step": 990 + }, + { + "epoch": 0.34486354945245956, + "grad_norm": 0.5154693781246049, + "learning_rate": 0.0001968292692442833, + "loss": 0.5632, + "step": 992 + }, + { + "epoch": 0.34555883886667826, + "grad_norm": 0.3895510966829308, + "learning_rate": 0.0001967988722589624, + "loss": 0.4674, + "step": 994 + }, + { + "epoch": 0.3462541282808969, + "grad_norm": 0.507531875733667, + "learning_rate": 0.00019676833263360352, + "loss": 0.5581, + "step": 996 + }, + { + "epoch": 0.3469494176951156, + "grad_norm": 0.5476523355263471, + "learning_rate": 0.00019673765041320907, + "loss": 0.7421, + "step": 998 + }, + { + "epoch": 0.34764470710933426, + "grad_norm": 0.8417172933340035, + "learning_rate": 0.00019670682564299136, + "loss": 0.6774, + "step": 1000 + }, + { + "epoch": 0.3483399965235529, + "grad_norm": 0.6717112677412562, + "learning_rate": 0.00019667585836837299, + "loss": 0.6515, + "step": 1002 + }, + { + "epoch": 0.3490352859377716, + "grad_norm": 0.7599904388695796, + "learning_rate": 0.0001966447486349864, + "loss": 0.5679, + "step": 1004 + }, + { + "epoch": 0.34973057535199026, + "grad_norm": 0.44186748583335306, + "learning_rate": 0.000196613496488674, + "loss": 0.6067, + "step": 1006 + }, + { + "epoch": 0.35042586476620896, + "grad_norm": 0.4287165077907837, + "learning_rate": 0.00019658210197548805, + "loss": 0.5706, + "step": 1008 + }, + { + "epoch": 0.3511211541804276, + "grad_norm": 0.6051489125727973, + "learning_rate": 0.0001965505651416906, + "loss": 0.6178, + "step": 1010 + }, + { + "epoch": 0.35181644359464626, + "grad_norm": 0.5003034918118222, + "learning_rate": 0.00019651888603375346, + "loss": 0.6, + "step": 1012 + }, + { + "epoch": 0.35251173300886496, + "grad_norm": 0.6774513066433009, + "learning_rate": 0.00019648706469835804, + "loss": 0.6248, + "step": 1014 + }, + { + "epoch": 0.3532070224230836, + "grad_norm": 0.5666799893616385, + "learning_rate": 0.0001964551011823953, + "loss": 0.6256, + "step": 1016 + }, + { + "epoch": 0.35390231183730225, + "grad_norm": 0.6185519925235329, + "learning_rate": 0.00019642299553296582, + "loss": 0.5836, + "step": 1018 + }, + { + "epoch": 0.35459760125152096, + "grad_norm": 0.5020407783730059, + "learning_rate": 0.0001963907477973795, + "loss": 0.5148, + "step": 1020 + }, + { + "epoch": 0.3552928906657396, + "grad_norm": 0.966855697270511, + "learning_rate": 0.00019635835802315574, + "loss": 0.6335, + "step": 1022 + }, + { + "epoch": 0.3559881800799583, + "grad_norm": 0.8705091175729548, + "learning_rate": 0.00019632582625802317, + "loss": 0.6313, + "step": 1024 + }, + { + "epoch": 0.35668346949417695, + "grad_norm": 0.6028556619755229, + "learning_rate": 0.00019629315254991964, + "loss": 0.6483, + "step": 1026 + }, + { + "epoch": 0.3573787589083956, + "grad_norm": 0.6075038119620636, + "learning_rate": 0.00019626033694699214, + "loss": 0.6271, + "step": 1028 + }, + { + "epoch": 0.3580740483226143, + "grad_norm": 0.7923956541669288, + "learning_rate": 0.00019622737949759694, + "loss": 0.6338, + "step": 1030 + }, + { + "epoch": 0.35876933773683295, + "grad_norm": 1.2067992138100796, + "learning_rate": 0.00019619428025029905, + "loss": 0.6308, + "step": 1032 + }, + { + "epoch": 0.35946462715105165, + "grad_norm": 0.5446351671940789, + "learning_rate": 0.00019616103925387265, + "loss": 0.6475, + "step": 1034 + }, + { + "epoch": 0.3601599165652703, + "grad_norm": 0.8842474031361561, + "learning_rate": 0.0001961276565573007, + "loss": 0.6654, + "step": 1036 + }, + { + "epoch": 0.36085520597948895, + "grad_norm": 1.294693850012853, + "learning_rate": 0.00019609413220977496, + "loss": 0.6929, + "step": 1038 + }, + { + "epoch": 0.36155049539370765, + "grad_norm": 0.7435682846586636, + "learning_rate": 0.00019606046626069595, + "loss": 0.6791, + "step": 1040 + }, + { + "epoch": 0.3622457848079263, + "grad_norm": 0.45762946459115417, + "learning_rate": 0.0001960266587596729, + "loss": 0.5769, + "step": 1042 + }, + { + "epoch": 0.36294107422214494, + "grad_norm": 0.5614638042598611, + "learning_rate": 0.00019599270975652352, + "loss": 0.6047, + "step": 1044 + }, + { + "epoch": 0.36363636363636365, + "grad_norm": 1.6171161059961894, + "learning_rate": 0.0001959586193012741, + "loss": 0.6932, + "step": 1046 + }, + { + "epoch": 0.3643316530505823, + "grad_norm": 1.5847051714441287, + "learning_rate": 0.00019592438744415932, + "loss": 0.5908, + "step": 1048 + }, + { + "epoch": 0.365026942464801, + "grad_norm": 0.4282438415059217, + "learning_rate": 0.00019589001423562233, + "loss": 0.6749, + "step": 1050 + }, + { + "epoch": 0.365026942464801, + "eval_loss": 0.6080955266952515, + "eval_runtime": 710.9824, + "eval_samples_per_second": 6.81, + "eval_steps_per_second": 0.214, + "step": 1050 + }, + { + "epoch": 0.36572223187901964, + "grad_norm": 1.0612232842206784, + "learning_rate": 0.00019585549972631446, + "loss": 0.5669, + "step": 1052 + }, + { + "epoch": 0.3664175212932383, + "grad_norm": 2.6994673924740358, + "learning_rate": 0.0001958208439670953, + "loss": 0.6455, + "step": 1054 + }, + { + "epoch": 0.367112810707457, + "grad_norm": 2.022628249772274, + "learning_rate": 0.0001957860470090326, + "loss": 0.6395, + "step": 1056 + }, + { + "epoch": 0.36780810012167564, + "grad_norm": 0.607126211578616, + "learning_rate": 0.00019575110890340214, + "loss": 0.593, + "step": 1058 + }, + { + "epoch": 0.36850338953589434, + "grad_norm": 1.026539890410463, + "learning_rate": 0.00019571602970168775, + "loss": 0.5939, + "step": 1060 + }, + { + "epoch": 0.369198678950113, + "grad_norm": 0.6663599873173821, + "learning_rate": 0.00019568080945558104, + "loss": 0.6415, + "step": 1062 + }, + { + "epoch": 0.36989396836433164, + "grad_norm": 0.5967439670789174, + "learning_rate": 0.00019564544821698167, + "loss": 0.6348, + "step": 1064 + }, + { + "epoch": 0.37058925777855034, + "grad_norm": 0.6468802992284401, + "learning_rate": 0.00019560994603799682, + "loss": 0.5991, + "step": 1066 + }, + { + "epoch": 0.371284547192769, + "grad_norm": 1.2251498168873143, + "learning_rate": 0.00019557430297094158, + "loss": 0.6001, + "step": 1068 + }, + { + "epoch": 0.37197983660698763, + "grad_norm": 0.4681978143920913, + "learning_rate": 0.00019553851906833853, + "loss": 0.5664, + "step": 1070 + }, + { + "epoch": 0.37267512602120634, + "grad_norm": 0.7538053079694034, + "learning_rate": 0.00019550259438291782, + "loss": 0.5531, + "step": 1072 + }, + { + "epoch": 0.373370415435425, + "grad_norm": 0.4626868039226879, + "learning_rate": 0.00019546652896761696, + "loss": 0.6268, + "step": 1074 + }, + { + "epoch": 0.3740657048496437, + "grad_norm": 0.8012577314135656, + "learning_rate": 0.00019543032287558097, + "loss": 0.7819, + "step": 1076 + }, + { + "epoch": 0.37476099426386233, + "grad_norm": 0.7004564506452116, + "learning_rate": 0.0001953939761601621, + "loss": 0.6505, + "step": 1078 + }, + { + "epoch": 0.375456283678081, + "grad_norm": 1.352602706017517, + "learning_rate": 0.0001953574888749198, + "loss": 0.558, + "step": 1080 + }, + { + "epoch": 0.3761515730922997, + "grad_norm": 0.3012261239096098, + "learning_rate": 0.0001953208610736207, + "loss": 0.5746, + "step": 1082 + }, + { + "epoch": 0.37684686250651833, + "grad_norm": 0.49798092264749827, + "learning_rate": 0.0001952840928102385, + "loss": 0.5845, + "step": 1084 + }, + { + "epoch": 0.377542151920737, + "grad_norm": 0.4457559765569793, + "learning_rate": 0.00019524718413895382, + "loss": 0.5859, + "step": 1086 + }, + { + "epoch": 0.3782374413349557, + "grad_norm": 0.5943406854432696, + "learning_rate": 0.00019521013511415426, + "loss": 0.6581, + "step": 1088 + }, + { + "epoch": 0.37893273074917433, + "grad_norm": 1.8614189583072707, + "learning_rate": 0.00019517294579043414, + "loss": 0.7019, + "step": 1090 + }, + { + "epoch": 0.37962802016339303, + "grad_norm": 0.4212993231373999, + "learning_rate": 0.00019513561622259466, + "loss": 0.6106, + "step": 1092 + }, + { + "epoch": 0.3803233095776117, + "grad_norm": 0.5224177310348964, + "learning_rate": 0.00019509814646564354, + "loss": 0.6012, + "step": 1094 + }, + { + "epoch": 0.3810185989918303, + "grad_norm": 1.3980998842985117, + "learning_rate": 0.0001950605365747951, + "loss": 0.5875, + "step": 1096 + }, + { + "epoch": 0.38171388840604903, + "grad_norm": 0.7255638165052757, + "learning_rate": 0.0001950227866054703, + "loss": 0.6366, + "step": 1098 + }, + { + "epoch": 0.3824091778202677, + "grad_norm": 0.39401204779232035, + "learning_rate": 0.00019498489661329632, + "loss": 0.59, + "step": 1100 + }, + { + "epoch": 0.3831044672344864, + "grad_norm": 0.6249434294547875, + "learning_rate": 0.00019494686665410684, + "loss": 0.5555, + "step": 1102 + }, + { + "epoch": 0.383799756648705, + "grad_norm": 0.4970609140814689, + "learning_rate": 0.00019490869678394165, + "loss": 0.5872, + "step": 1104 + }, + { + "epoch": 0.3844950460629237, + "grad_norm": 0.5522933346523479, + "learning_rate": 0.0001948703870590468, + "loss": 0.6296, + "step": 1106 + }, + { + "epoch": 0.3851903354771424, + "grad_norm": 0.5358444643818808, + "learning_rate": 0.0001948319375358744, + "loss": 0.5677, + "step": 1108 + }, + { + "epoch": 0.385885624891361, + "grad_norm": 0.5839030994818908, + "learning_rate": 0.00019479334827108256, + "loss": 0.5443, + "step": 1110 + }, + { + "epoch": 0.38658091430557967, + "grad_norm": 0.9808370348899028, + "learning_rate": 0.00019475461932153533, + "loss": 0.6703, + "step": 1112 + }, + { + "epoch": 0.3872762037197984, + "grad_norm": 0.5567454433782846, + "learning_rate": 0.00019471575074430256, + "loss": 0.585, + "step": 1114 + }, + { + "epoch": 0.387971493134017, + "grad_norm": 0.8706120804701404, + "learning_rate": 0.00019467674259665985, + "loss": 0.5399, + "step": 1116 + }, + { + "epoch": 0.3886667825482357, + "grad_norm": 0.607175198823171, + "learning_rate": 0.00019463759493608854, + "loss": 0.6016, + "step": 1118 + }, + { + "epoch": 0.38936207196245437, + "grad_norm": 0.848040345554999, + "learning_rate": 0.0001945983078202754, + "loss": 0.5604, + "step": 1120 + }, + { + "epoch": 0.390057361376673, + "grad_norm": 0.39050505941263947, + "learning_rate": 0.00019455888130711296, + "loss": 0.5391, + "step": 1122 + }, + { + "epoch": 0.3907526507908917, + "grad_norm": 0.43688262723639604, + "learning_rate": 0.00019451931545469883, + "loss": 0.5911, + "step": 1124 + }, + { + "epoch": 0.39144794020511037, + "grad_norm": 0.5216486488482895, + "learning_rate": 0.00019447961032133623, + "loss": 0.7729, + "step": 1126 + }, + { + "epoch": 0.39214322961932907, + "grad_norm": 0.5238744592921366, + "learning_rate": 0.0001944397659655334, + "loss": 0.6561, + "step": 1128 + }, + { + "epoch": 0.3928385190335477, + "grad_norm": 0.5356265007770037, + "learning_rate": 0.00019439978244600392, + "loss": 0.6139, + "step": 1130 + }, + { + "epoch": 0.39353380844776636, + "grad_norm": 0.7845961219955971, + "learning_rate": 0.00019435965982166634, + "loss": 0.5682, + "step": 1132 + }, + { + "epoch": 0.39422909786198507, + "grad_norm": 0.5467699155830194, + "learning_rate": 0.0001943193981516442, + "loss": 0.5801, + "step": 1134 + }, + { + "epoch": 0.3949243872762037, + "grad_norm": 0.8265539141839208, + "learning_rate": 0.00019427899749526592, + "loss": 0.6112, + "step": 1136 + }, + { + "epoch": 0.39561967669042236, + "grad_norm": 0.6952363088057728, + "learning_rate": 0.0001942384579120648, + "loss": 0.5585, + "step": 1138 + }, + { + "epoch": 0.39631496610464106, + "grad_norm": 0.5390583855264917, + "learning_rate": 0.00019419777946177872, + "loss": 0.5437, + "step": 1140 + }, + { + "epoch": 0.3970102555188597, + "grad_norm": 0.7703174634754777, + "learning_rate": 0.0001941569622043504, + "loss": 0.6353, + "step": 1142 + }, + { + "epoch": 0.3977055449330784, + "grad_norm": 0.6599770887173079, + "learning_rate": 0.0001941160061999268, + "loss": 0.6984, + "step": 1144 + }, + { + "epoch": 0.39840083434729706, + "grad_norm": 0.6388540477012332, + "learning_rate": 0.0001940749115088597, + "loss": 0.6716, + "step": 1146 + }, + { + "epoch": 0.3990961237615157, + "grad_norm": 0.556740144667956, + "learning_rate": 0.00019403367819170495, + "loss": 0.5403, + "step": 1148 + }, + { + "epoch": 0.3997914131757344, + "grad_norm": 0.5811188003032377, + "learning_rate": 0.00019399230630922281, + "loss": 0.6038, + "step": 1150 + }, + { + "epoch": 0.40048670258995306, + "grad_norm": 0.5247246331826143, + "learning_rate": 0.00019395079592237767, + "loss": 0.5802, + "step": 1152 + }, + { + "epoch": 0.40118199200417176, + "grad_norm": 0.6218229787877086, + "learning_rate": 0.00019390914709233812, + "loss": 0.613, + "step": 1154 + }, + { + "epoch": 0.4018772814183904, + "grad_norm": 0.3768886648264559, + "learning_rate": 0.00019386735988047657, + "loss": 0.546, + "step": 1156 + }, + { + "epoch": 0.40257257083260906, + "grad_norm": 0.7192604288297088, + "learning_rate": 0.00019382543434836956, + "loss": 0.6414, + "step": 1158 + }, + { + "epoch": 0.40326786024682776, + "grad_norm": 0.6502767283266627, + "learning_rate": 0.00019378337055779725, + "loss": 0.6913, + "step": 1160 + }, + { + "epoch": 0.4039631496610464, + "grad_norm": 0.5821846511835889, + "learning_rate": 0.00019374116857074372, + "loss": 0.6135, + "step": 1162 + }, + { + "epoch": 0.40465843907526505, + "grad_norm": 0.4214614762979627, + "learning_rate": 0.00019369882844939656, + "loss": 0.5844, + "step": 1164 + }, + { + "epoch": 0.40535372848948376, + "grad_norm": 0.3995087581540831, + "learning_rate": 0.00019365635025614698, + "loss": 0.597, + "step": 1166 + }, + { + "epoch": 0.4060490179037024, + "grad_norm": 0.6448855951735888, + "learning_rate": 0.0001936137340535896, + "loss": 0.5964, + "step": 1168 + }, + { + "epoch": 0.4067443073179211, + "grad_norm": 0.4901354392109259, + "learning_rate": 0.00019357097990452244, + "loss": 0.6544, + "step": 1170 + }, + { + "epoch": 0.40743959673213975, + "grad_norm": 1.453302582941976, + "learning_rate": 0.0001935280878719468, + "loss": 0.7041, + "step": 1172 + }, + { + "epoch": 0.4081348861463584, + "grad_norm": 0.5029703758127726, + "learning_rate": 0.00019348505801906717, + "loss": 0.5963, + "step": 1174 + }, + { + "epoch": 0.4088301755605771, + "grad_norm": 0.42609969312576673, + "learning_rate": 0.00019344189040929104, + "loss": 0.5741, + "step": 1176 + }, + { + "epoch": 0.40952546497479575, + "grad_norm": 0.7354212284029352, + "learning_rate": 0.000193398585106229, + "loss": 0.5587, + "step": 1178 + }, + { + "epoch": 0.41022075438901445, + "grad_norm": 0.4221453871118396, + "learning_rate": 0.00019335514217369448, + "loss": 0.6008, + "step": 1180 + }, + { + "epoch": 0.4109160438032331, + "grad_norm": 0.4305199213179302, + "learning_rate": 0.00019331156167570377, + "loss": 0.6589, + "step": 1182 + }, + { + "epoch": 0.41161133321745175, + "grad_norm": 0.5908546860050797, + "learning_rate": 0.0001932678436764758, + "loss": 0.6791, + "step": 1184 + }, + { + "epoch": 0.41230662263167045, + "grad_norm": 0.592125562883329, + "learning_rate": 0.0001932239882404322, + "loss": 0.6163, + "step": 1186 + }, + { + "epoch": 0.4130019120458891, + "grad_norm": 0.3760868982177292, + "learning_rate": 0.00019317999543219707, + "loss": 0.6057, + "step": 1188 + }, + { + "epoch": 0.41369720146010774, + "grad_norm": 0.42271908071862413, + "learning_rate": 0.00019313586531659693, + "loss": 0.6055, + "step": 1190 + }, + { + "epoch": 0.41439249087432645, + "grad_norm": 0.7637973810401912, + "learning_rate": 0.00019309159795866067, + "loss": 0.6113, + "step": 1192 + }, + { + "epoch": 0.4150877802885451, + "grad_norm": 0.31348977991538335, + "learning_rate": 0.00019304719342361942, + "loss": 0.5906, + "step": 1194 + }, + { + "epoch": 0.4157830697027638, + "grad_norm": 0.34482048624358563, + "learning_rate": 0.00019300265177690635, + "loss": 0.5722, + "step": 1196 + }, + { + "epoch": 0.41647835911698244, + "grad_norm": 0.8513089082812038, + "learning_rate": 0.0001929579730841568, + "loss": 0.6293, + "step": 1198 + }, + { + "epoch": 0.4171736485312011, + "grad_norm": 0.4489163724605792, + "learning_rate": 0.00019291315741120802, + "loss": 0.5779, + "step": 1200 + }, + { + "epoch": 0.4171736485312011, + "eval_loss": 0.6036229133605957, + "eval_runtime": 710.4375, + "eval_samples_per_second": 6.816, + "eval_steps_per_second": 0.214, + "step": 1200 + }, + { + "epoch": 0.4178689379454198, + "grad_norm": 0.4187714520019529, + "learning_rate": 0.00019286820482409907, + "loss": 0.6429, + "step": 1202 + }, + { + "epoch": 0.41856422735963844, + "grad_norm": 0.6777550653965533, + "learning_rate": 0.0001928231153890708, + "loss": 0.7349, + "step": 1204 + }, + { + "epoch": 0.41925951677385714, + "grad_norm": 0.5320560870085244, + "learning_rate": 0.00019277788917256575, + "loss": 0.6171, + "step": 1206 + }, + { + "epoch": 0.4199548061880758, + "grad_norm": 0.4598764394317783, + "learning_rate": 0.0001927325262412279, + "loss": 0.568, + "step": 1208 + }, + { + "epoch": 0.42065009560229444, + "grad_norm": 0.6091029764488312, + "learning_rate": 0.0001926870266619028, + "loss": 0.6179, + "step": 1210 + }, + { + "epoch": 0.42134538501651314, + "grad_norm": 0.3831881756520618, + "learning_rate": 0.00019264139050163733, + "loss": 0.6277, + "step": 1212 + }, + { + "epoch": 0.4220406744307318, + "grad_norm": 0.46975774391187974, + "learning_rate": 0.00019259561782767964, + "loss": 0.6365, + "step": 1214 + }, + { + "epoch": 0.42273596384495044, + "grad_norm": 0.43958415828248065, + "learning_rate": 0.00019254970870747896, + "loss": 0.5599, + "step": 1216 + }, + { + "epoch": 0.42343125325916914, + "grad_norm": 0.3718315331231464, + "learning_rate": 0.00019250366320868573, + "loss": 0.5466, + "step": 1218 + }, + { + "epoch": 0.4241265426733878, + "grad_norm": 0.4132277343365207, + "learning_rate": 0.00019245748139915122, + "loss": 0.5505, + "step": 1220 + }, + { + "epoch": 0.4248218320876065, + "grad_norm": 0.699259138789713, + "learning_rate": 0.00019241116334692767, + "loss": 0.6155, + "step": 1222 + }, + { + "epoch": 0.42551712150182514, + "grad_norm": 0.8108211625089844, + "learning_rate": 0.00019236470912026795, + "loss": 0.6389, + "step": 1224 + }, + { + "epoch": 0.4262124109160438, + "grad_norm": 0.7991219996691611, + "learning_rate": 0.00019231811878762578, + "loss": 0.6218, + "step": 1226 + }, + { + "epoch": 0.4269077003302625, + "grad_norm": 0.6512869246829502, + "learning_rate": 0.00019227139241765527, + "loss": 0.6263, + "step": 1228 + }, + { + "epoch": 0.42760298974448113, + "grad_norm": 0.6616729861929296, + "learning_rate": 0.00019222453007921103, + "loss": 0.633, + "step": 1230 + }, + { + "epoch": 0.42829827915869984, + "grad_norm": 0.6441717114274472, + "learning_rate": 0.0001921775318413481, + "loss": 0.598, + "step": 1232 + }, + { + "epoch": 0.4289935685729185, + "grad_norm": 0.5398693786298329, + "learning_rate": 0.00019213039777332173, + "loss": 0.6128, + "step": 1234 + }, + { + "epoch": 0.42968885798713713, + "grad_norm": 0.7990572416423266, + "learning_rate": 0.00019208312794458734, + "loss": 0.6237, + "step": 1236 + }, + { + "epoch": 0.43038414740135583, + "grad_norm": 0.6792096783122197, + "learning_rate": 0.00019203572242480033, + "loss": 0.6167, + "step": 1238 + }, + { + "epoch": 0.4310794368155745, + "grad_norm": 0.569412739061848, + "learning_rate": 0.00019198818128381622, + "loss": 0.7147, + "step": 1240 + }, + { + "epoch": 0.4317747262297931, + "grad_norm": 0.3343242957299063, + "learning_rate": 0.00019194050459169016, + "loss": 0.5585, + "step": 1242 + }, + { + "epoch": 0.43247001564401183, + "grad_norm": 0.41389163470101814, + "learning_rate": 0.00019189269241867726, + "loss": 0.6206, + "step": 1244 + }, + { + "epoch": 0.4331653050582305, + "grad_norm": 0.6725681446750024, + "learning_rate": 0.00019184474483523208, + "loss": 0.6592, + "step": 1246 + }, + { + "epoch": 0.4338605944724492, + "grad_norm": 1.063023358388528, + "learning_rate": 0.0001917966619120088, + "loss": 0.6998, + "step": 1248 + }, + { + "epoch": 0.4345558838866678, + "grad_norm": 1.0481626997531774, + "learning_rate": 0.00019174844371986111, + "loss": 0.5649, + "step": 1250 + }, + { + "epoch": 0.4352511733008865, + "grad_norm": 0.6436744584316785, + "learning_rate": 0.00019170009032984188, + "loss": 0.6011, + "step": 1252 + }, + { + "epoch": 0.4359464627151052, + "grad_norm": 0.6100699160131396, + "learning_rate": 0.00019165160181320331, + "loss": 0.6229, + "step": 1254 + }, + { + "epoch": 0.4366417521293238, + "grad_norm": 0.43075456887586555, + "learning_rate": 0.00019160297824139671, + "loss": 0.5985, + "step": 1256 + }, + { + "epoch": 0.4373370415435425, + "grad_norm": 1.1133754307509498, + "learning_rate": 0.0001915542196860723, + "loss": 0.582, + "step": 1258 + }, + { + "epoch": 0.4380323309577612, + "grad_norm": 0.8115545368570724, + "learning_rate": 0.00019150532621907935, + "loss": 0.6281, + "step": 1260 + }, + { + "epoch": 0.4387276203719798, + "grad_norm": 0.6501357510133978, + "learning_rate": 0.00019145629791246586, + "loss": 0.7366, + "step": 1262 + }, + { + "epoch": 0.4394229097861985, + "grad_norm": 1.0301487119179336, + "learning_rate": 0.00019140713483847854, + "loss": 0.5878, + "step": 1264 + }, + { + "epoch": 0.44011819920041717, + "grad_norm": 0.9720409793058, + "learning_rate": 0.00019135783706956266, + "loss": 0.5096, + "step": 1266 + }, + { + "epoch": 0.4408134886146358, + "grad_norm": 0.5612642914060567, + "learning_rate": 0.000191308404678362, + "loss": 0.6624, + "step": 1268 + }, + { + "epoch": 0.4415087780288545, + "grad_norm": 0.46162422465509245, + "learning_rate": 0.00019125883773771874, + "loss": 0.5714, + "step": 1270 + }, + { + "epoch": 0.44220406744307317, + "grad_norm": 0.7669640725186674, + "learning_rate": 0.00019120913632067325, + "loss": 0.6786, + "step": 1272 + }, + { + "epoch": 0.44289935685729187, + "grad_norm": 0.4747976521609601, + "learning_rate": 0.00019115930050046416, + "loss": 0.5964, + "step": 1274 + }, + { + "epoch": 0.4435946462715105, + "grad_norm": 0.8528446125546961, + "learning_rate": 0.0001911093303505281, + "loss": 0.6584, + "step": 1276 + }, + { + "epoch": 0.44428993568572916, + "grad_norm": 0.444423482826933, + "learning_rate": 0.00019105922594449962, + "loss": 0.5931, + "step": 1278 + }, + { + "epoch": 0.44498522509994787, + "grad_norm": 0.4296567435369722, + "learning_rate": 0.00019100898735621114, + "loss": 0.5614, + "step": 1280 + }, + { + "epoch": 0.4456805145141665, + "grad_norm": 0.3735319415225358, + "learning_rate": 0.0001909586146596928, + "loss": 0.5585, + "step": 1282 + }, + { + "epoch": 0.4463758039283852, + "grad_norm": 0.3997395665103462, + "learning_rate": 0.0001909081079291724, + "loss": 0.4911, + "step": 1284 + }, + { + "epoch": 0.44707109334260386, + "grad_norm": 0.5067764089739433, + "learning_rate": 0.00019085746723907513, + "loss": 0.5912, + "step": 1286 + }, + { + "epoch": 0.4477663827568225, + "grad_norm": 1.5023247096958177, + "learning_rate": 0.00019080669266402373, + "loss": 0.7538, + "step": 1288 + }, + { + "epoch": 0.4484616721710412, + "grad_norm": 1.0536335728512713, + "learning_rate": 0.0001907557842788381, + "loss": 0.7347, + "step": 1290 + }, + { + "epoch": 0.44915696158525986, + "grad_norm": 1.3178937768983239, + "learning_rate": 0.00019070474215853543, + "loss": 0.6302, + "step": 1292 + }, + { + "epoch": 0.4498522509994785, + "grad_norm": 0.5893948676721078, + "learning_rate": 0.00019065356637832986, + "loss": 0.626, + "step": 1294 + }, + { + "epoch": 0.4505475404136972, + "grad_norm": 1.118265378089079, + "learning_rate": 0.0001906022570136326, + "loss": 0.5155, + "step": 1296 + }, + { + "epoch": 0.45124282982791586, + "grad_norm": 0.3585975576830803, + "learning_rate": 0.00019055081414005165, + "loss": 0.5558, + "step": 1298 + }, + { + "epoch": 0.45193811924213456, + "grad_norm": 1.3203699153765986, + "learning_rate": 0.00019049923783339171, + "loss": 0.6516, + "step": 1300 + }, + { + "epoch": 0.4526334086563532, + "grad_norm": 0.8836139230641887, + "learning_rate": 0.0001904475281696542, + "loss": 0.6532, + "step": 1302 + }, + { + "epoch": 0.45332869807057186, + "grad_norm": 0.7111007749248109, + "learning_rate": 0.00019039568522503694, + "loss": 0.6273, + "step": 1304 + }, + { + "epoch": 0.45402398748479056, + "grad_norm": 0.4303152450432435, + "learning_rate": 0.00019034370907593427, + "loss": 0.5596, + "step": 1306 + }, + { + "epoch": 0.4547192768990092, + "grad_norm": 0.46058879749054005, + "learning_rate": 0.00019029159979893669, + "loss": 0.6002, + "step": 1308 + }, + { + "epoch": 0.4554145663132279, + "grad_norm": 1.1757657004565762, + "learning_rate": 0.00019023935747083094, + "loss": 0.5425, + "step": 1310 + }, + { + "epoch": 0.45610985572744656, + "grad_norm": 0.6763815344574016, + "learning_rate": 0.00019018698216859985, + "loss": 0.7178, + "step": 1312 + }, + { + "epoch": 0.4568051451416652, + "grad_norm": 0.6557528693425259, + "learning_rate": 0.00019013447396942215, + "loss": 0.5482, + "step": 1314 + }, + { + "epoch": 0.4575004345558839, + "grad_norm": 0.40206624331116686, + "learning_rate": 0.0001900818329506724, + "loss": 0.5626, + "step": 1316 + }, + { + "epoch": 0.45819572397010255, + "grad_norm": 0.39959833266619904, + "learning_rate": 0.0001900290591899209, + "loss": 0.5805, + "step": 1318 + }, + { + "epoch": 0.4588910133843212, + "grad_norm": 1.157537080813341, + "learning_rate": 0.00018997615276493353, + "loss": 0.5895, + "step": 1320 + }, + { + "epoch": 0.4595863027985399, + "grad_norm": 1.9818188598958286, + "learning_rate": 0.0001899231137536717, + "loss": 0.6688, + "step": 1322 + }, + { + "epoch": 0.46028159221275855, + "grad_norm": 0.6448001142497345, + "learning_rate": 0.00018986994223429217, + "loss": 0.5878, + "step": 1324 + }, + { + "epoch": 0.46097688162697725, + "grad_norm": 0.7035140294155504, + "learning_rate": 0.000189816638285147, + "loss": 0.59, + "step": 1326 + }, + { + "epoch": 0.4616721710411959, + "grad_norm": 0.5547705850102905, + "learning_rate": 0.00018976320198478327, + "loss": 0.6194, + "step": 1328 + }, + { + "epoch": 0.46236746045541455, + "grad_norm": 0.8218894600210293, + "learning_rate": 0.00018970963341194327, + "loss": 0.5957, + "step": 1330 + }, + { + "epoch": 0.46306274986963325, + "grad_norm": 0.8582770909742338, + "learning_rate": 0.00018965593264556405, + "loss": 0.6027, + "step": 1332 + }, + { + "epoch": 0.4637580392838519, + "grad_norm": 0.5859159431078994, + "learning_rate": 0.00018960209976477755, + "loss": 0.5701, + "step": 1334 + }, + { + "epoch": 0.46445332869807054, + "grad_norm": 0.6055238281909472, + "learning_rate": 0.00018954813484891033, + "loss": 0.6069, + "step": 1336 + }, + { + "epoch": 0.46514861811228925, + "grad_norm": 0.7336223128037048, + "learning_rate": 0.00018949403797748356, + "loss": 0.639, + "step": 1338 + }, + { + "epoch": 0.4658439075265079, + "grad_norm": 0.4617499217742889, + "learning_rate": 0.0001894398092302128, + "loss": 0.5972, + "step": 1340 + }, + { + "epoch": 0.4665391969407266, + "grad_norm": 0.6626369850916174, + "learning_rate": 0.00018938544868700804, + "loss": 0.6254, + "step": 1342 + }, + { + "epoch": 0.46723448635494524, + "grad_norm": 0.6487571201649612, + "learning_rate": 0.00018933095642797336, + "loss": 0.6115, + "step": 1344 + }, + { + "epoch": 0.4679297757691639, + "grad_norm": 0.721231100905907, + "learning_rate": 0.00018927633253340703, + "loss": 0.5056, + "step": 1346 + }, + { + "epoch": 0.4686250651833826, + "grad_norm": 0.43640759465379947, + "learning_rate": 0.0001892215770838012, + "loss": 0.618, + "step": 1348 + }, + { + "epoch": 0.46932035459760124, + "grad_norm": 0.7472697329585503, + "learning_rate": 0.00018916669015984198, + "loss": 0.5145, + "step": 1350 + }, + { + "epoch": 0.46932035459760124, + "eval_loss": 0.6091039180755615, + "eval_runtime": 712.5909, + "eval_samples_per_second": 6.795, + "eval_steps_per_second": 0.213, + "step": 1350 + } + ], + "logging_steps": 2, + "max_steps": 5752, + "num_input_tokens_seen": 0, + "num_train_epochs": 2, + "save_steps": 90, + "stateful_callbacks": { + "TrainerControl": { + "args": { + "should_epoch_stop": false, + "should_evaluate": false, + "should_log": false, + "should_save": true, + "should_training_stop": false + }, + "attributes": {} + } + }, + "total_flos": 5379475161219072.0, + "train_batch_size": 4, + "trial_name": null, + "trial_params": null +} diff --git a/checkpoint-1350/training_args.bin b/checkpoint-1350/training_args.bin new file mode 100644 index 0000000000000000000000000000000000000000..fba3b63792fed5a70be0307e26ba27ef584b1528 --- /dev/null +++ b/checkpoint-1350/training_args.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b72add547acd6c009f3a3770072d0cdf7de7e797c7597084319db874a556e470 +size 6904 diff --git a/checkpoint-1350/zero_to_fp32.py b/checkpoint-1350/zero_to_fp32.py new file mode 100644 index 0000000000000000000000000000000000000000..0e759146cadd92ddfefab3680146c2bd6a2b5c04 --- /dev/null +++ b/checkpoint-1350/zero_to_fp32.py @@ -0,0 +1,760 @@ +#!/usr/bin/env python + +# Copyright (c) Microsoft Corporation. +# SPDX-License-Identifier: Apache-2.0 + +# DeepSpeed Team + +# This script extracts fp32 consolidated weights from a zero 1, 2 and 3 DeepSpeed checkpoints. It gets +# copied into the top level checkpoint dir, so the user can easily do the conversion at any point in +# the future. Once extracted, the weights don't require DeepSpeed and can be used in any +# application. +# +# example: +# python zero_to_fp32.py . output_dir/ +# or +# python zero_to_fp32.py . output_dir/ --safe_serialization + +import argparse +import torch +import glob +import math +import os +import re +import gc +import json +import numpy as np +from tqdm import tqdm +from collections import OrderedDict +from dataclasses import dataclass + +# while this script doesn't use deepspeed to recover data, since the checkpoints are pickled with +# DeepSpeed data structures it has to be available in the current python environment. +from deepspeed.utils import logger +from deepspeed.checkpoint.constants import (DS_VERSION, OPTIMIZER_STATE_DICT, SINGLE_PARTITION_OF_FP32_GROUPS, + FP32_FLAT_GROUPS, ZERO_STAGE, PARTITION_COUNT, PARAM_SHAPES, BUFFER_NAMES, + FROZEN_PARAM_SHAPES, FROZEN_PARAM_FRAGMENTS) + + +@dataclass +class zero_model_state: + buffers: dict() + param_shapes: dict() + shared_params: list + ds_version: int + frozen_param_shapes: dict() + frozen_param_fragments: dict() + + +debug = 0 + +# load to cpu +device = torch.device('cpu') + + +def atoi(text): + return int(text) if text.isdigit() else text + + +def natural_keys(text): + ''' + alist.sort(key=natural_keys) sorts in human order + http://nedbatchelder.com/blog/200712/human_sorting.html + (See Toothy's implementation in the comments) + ''' + return [atoi(c) for c in re.split(r'(\d+)', text)] + + +def get_model_state_file(checkpoint_dir, zero_stage): + if not os.path.isdir(checkpoint_dir): + raise FileNotFoundError(f"Directory '{checkpoint_dir}' doesn't exist") + + # there should be only one file + if zero_stage <= 2: + file = os.path.join(checkpoint_dir, "mp_rank_00_model_states.pt") + elif zero_stage == 3: + file = os.path.join(checkpoint_dir, "zero_pp_rank_0_mp_rank_00_model_states.pt") + + if not os.path.exists(file): + raise FileNotFoundError(f"can't find model states file at '{file}'") + + return file + + +def get_checkpoint_files(checkpoint_dir, glob_pattern): + # XXX: need to test that this simple glob rule works for multi-node setup too + ckpt_files = sorted(glob.glob(os.path.join(checkpoint_dir, glob_pattern)), key=natural_keys) + + if len(ckpt_files) == 0: + raise FileNotFoundError(f"can't find {glob_pattern} files in directory '{checkpoint_dir}'") + + return ckpt_files + + +def get_optim_files(checkpoint_dir): + return get_checkpoint_files(checkpoint_dir, "*_optim_states.pt") + + +def get_model_state_files(checkpoint_dir): + return get_checkpoint_files(checkpoint_dir, "*_model_states.pt") + + +def parse_model_states(files): + zero_model_states = [] + for file in files: + state_dict = torch.load(file, map_location=device, weights_only=False) + + if BUFFER_NAMES not in state_dict: + raise ValueError(f"{file} is not a model state checkpoint") + buffer_names = state_dict[BUFFER_NAMES] + if debug: + print("Found buffers:", buffer_names) + + # recover just the buffers while restoring them to fp32 if they were saved in fp16 + buffers = {k: v.float() for k, v in state_dict["module"].items() if k in buffer_names} + param_shapes = state_dict[PARAM_SHAPES] + + # collect parameters that are included in param_shapes + param_names = [] + for s in param_shapes: + for name in s.keys(): + param_names.append(name) + + # update with frozen parameters + frozen_param_shapes = state_dict.get(FROZEN_PARAM_SHAPES, None) + if frozen_param_shapes is not None: + if debug: + print(f"Found frozen_param_shapes: {frozen_param_shapes}") + param_names += list(frozen_param_shapes.keys()) + + # handle shared params + shared_params = [[k, v] for k, v in state_dict["shared_params"].items()] + + ds_version = state_dict.get(DS_VERSION, None) + + frozen_param_fragments = state_dict.get(FROZEN_PARAM_FRAGMENTS, None) + + z_model_state = zero_model_state(buffers=buffers, + param_shapes=param_shapes, + shared_params=shared_params, + ds_version=ds_version, + frozen_param_shapes=frozen_param_shapes, + frozen_param_fragments=frozen_param_fragments) + zero_model_states.append(z_model_state) + + return zero_model_states + + +def parse_optim_states(files, ds_checkpoint_dir): + total_files = len(files) + state_dicts = [] + for f in tqdm(files, desc='Loading checkpoint shards'): + state_dict = torch.load(f, map_location=device, mmap=True, weights_only=False) + # immediately discard the potentially huge 2 optimizer states as we only care for fp32 master weights + # and also handle the case where it was already removed by another helper script + state_dict["optimizer_state_dict"].pop("optimizer_state_dict", None) + state_dicts.append(state_dict) + + if not ZERO_STAGE in state_dicts[0][OPTIMIZER_STATE_DICT]: + raise ValueError(f"{files[0]} is not a zero checkpoint") + zero_stage = state_dicts[0][OPTIMIZER_STATE_DICT][ZERO_STAGE] + world_size = state_dicts[0][OPTIMIZER_STATE_DICT][PARTITION_COUNT] + + # For ZeRO-2 each param group can have different partition_count as data parallelism for expert + # parameters can be different from data parallelism for non-expert parameters. So we can just + # use the max of the partition_count to get the dp world_size. + + if type(world_size) is list: + world_size = max(world_size) + + if world_size != total_files: + raise ValueError( + f"Expected {world_size} of '*_optim_states.pt' under '{ds_checkpoint_dir}' but found {total_files} files. " + "Possibly due to an overwrite of an old checkpoint, or a checkpoint didn't get saved by one or more processes." + ) + + # the groups are named differently in each stage + if zero_stage <= 2: + fp32_groups_key = SINGLE_PARTITION_OF_FP32_GROUPS + elif zero_stage == 3: + fp32_groups_key = FP32_FLAT_GROUPS + else: + raise ValueError(f"unknown zero stage {zero_stage}") + + fp32_flat_groups = [state_dicts[i][OPTIMIZER_STATE_DICT][fp32_groups_key] for i in range(len(state_dicts))] + return zero_stage, world_size, fp32_flat_groups + + +def _get_fp32_state_dict_from_zero_checkpoint(ds_checkpoint_dir, exclude_frozen_parameters): + """ + Returns fp32 state_dict reconstructed from ds checkpoint + + Args: + - ``ds_checkpoint_dir``: path to the deepspeed checkpoint folder (where the optimizer files are) + + """ + print(f"Processing zero checkpoint '{ds_checkpoint_dir}'") + + optim_files = get_optim_files(ds_checkpoint_dir) + zero_stage, world_size, fp32_flat_groups = parse_optim_states(optim_files, ds_checkpoint_dir) + print(f"Detected checkpoint of type zero stage {zero_stage}, world_size: {world_size}") + + model_files = get_model_state_files(ds_checkpoint_dir) + + zero_model_states = parse_model_states(model_files) + print(f'Parsing checkpoint created by deepspeed=={zero_model_states[0].ds_version}') + + if zero_stage <= 2: + return _get_fp32_state_dict_from_zero2_checkpoint(world_size, fp32_flat_groups, zero_model_states, + exclude_frozen_parameters) + elif zero_stage == 3: + return _get_fp32_state_dict_from_zero3_checkpoint(world_size, fp32_flat_groups, zero_model_states, + exclude_frozen_parameters) + + +def _zero2_merge_frozen_params(state_dict, zero_model_states): + if zero_model_states[0].frozen_param_shapes is None or len(zero_model_states[0].frozen_param_shapes) == 0: + return + + frozen_param_shapes = zero_model_states[0].frozen_param_shapes + frozen_param_fragments = zero_model_states[0].frozen_param_fragments + + if debug: + num_elem = sum(s.numel() for s in frozen_param_shapes.values()) + print(f'rank 0: {FROZEN_PARAM_SHAPES}.numel = {num_elem}') + + wanted_params = len(frozen_param_shapes) + wanted_numel = sum(s.numel() for s in frozen_param_shapes.values()) + avail_numel = sum([p.numel() for p in frozen_param_fragments.values()]) + print(f'Frozen params: Have {avail_numel} numels to process.') + print(f'Frozen params: Need {wanted_numel} numels in {wanted_params} params') + + total_params = 0 + total_numel = 0 + for name, shape in frozen_param_shapes.items(): + total_params += 1 + unpartitioned_numel = shape.numel() + total_numel += unpartitioned_numel + + state_dict[name] = frozen_param_fragments[name] + + if debug: + print(f"{name} full shape: {shape} unpartitioned numel {unpartitioned_numel} ") + + print(f"Reconstructed Frozen fp32 state dict with {total_params} params {total_numel} elements") + + +def _has_callable(obj, fn): + attr = getattr(obj, fn, None) + return callable(attr) + + +def _zero2_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states): + param_shapes = zero_model_states[0].param_shapes + + # Reconstruction protocol: + # + # XXX: document this + + if debug: + for i in range(world_size): + for j in range(len(fp32_flat_groups[0])): + print(f"{FP32_FLAT_GROUPS}[{i}][{j}].shape={fp32_flat_groups[i][j].shape}") + + # XXX: memory usage doubles here (zero2) + num_param_groups = len(fp32_flat_groups[0]) + merged_single_partition_of_fp32_groups = [] + for i in range(num_param_groups): + merged_partitions = [sd[i] for sd in fp32_flat_groups] + full_single_fp32_vector = torch.cat(merged_partitions, 0) + merged_single_partition_of_fp32_groups.append(full_single_fp32_vector) + avail_numel = sum( + [full_single_fp32_vector.numel() for full_single_fp32_vector in merged_single_partition_of_fp32_groups]) + + if debug: + wanted_params = sum([len(shapes) for shapes in param_shapes]) + wanted_numel = sum([sum(shape.numel() for shape in shapes.values()) for shapes in param_shapes]) + # not asserting if there is a mismatch due to possible padding + print(f"Have {avail_numel} numels to process.") + print(f"Need {wanted_numel} numels in {wanted_params} params.") + + # params + # XXX: for huge models that can't fit into the host's RAM we will have to recode this to support + # out-of-core computing solution + total_numel = 0 + total_params = 0 + for shapes, full_single_fp32_vector in zip(param_shapes, merged_single_partition_of_fp32_groups): + offset = 0 + avail_numel = full_single_fp32_vector.numel() + for name, shape in shapes.items(): + + unpartitioned_numel = shape.numel() if _has_callable(shape, 'numel') else math.prod(shape) + total_numel += unpartitioned_numel + total_params += 1 + + if debug: + print(f"{name} full shape: {shape} unpartitioned numel {unpartitioned_numel} ") + state_dict[name] = full_single_fp32_vector.narrow(0, offset, unpartitioned_numel).view(shape) + offset += unpartitioned_numel + + # Z2 started to align to 2*world_size to improve nccl performance. Therefore both offset and + # avail_numel can differ by anywhere between 0..2*world_size. Due to two unrelated complex + # paddings performed in the code it's almost impossible to predict the exact numbers w/o the + # live optimizer object, so we are checking that the numbers are within the right range + align_to = 2 * world_size + + def zero2_align(x): + return align_to * math.ceil(x / align_to) + + if debug: + print(f"original offset={offset}, avail_numel={avail_numel}") + + offset = zero2_align(offset) + avail_numel = zero2_align(avail_numel) + + if debug: + print(f"aligned offset={offset}, avail_numel={avail_numel}") + + # Sanity check + if offset != avail_numel: + raise ValueError(f"consumed {offset} numels out of {avail_numel} - something is wrong") + + print(f"Reconstructed fp32 state dict with {total_params} params {total_numel} elements") + + +def _get_fp32_state_dict_from_zero2_checkpoint(world_size, fp32_flat_groups, zero_model_states, + exclude_frozen_parameters): + state_dict = OrderedDict() + + # buffers + buffers = zero_model_states[0].buffers + state_dict.update(buffers) + if debug: + print(f"added {len(buffers)} buffers") + + if not exclude_frozen_parameters: + _zero2_merge_frozen_params(state_dict, zero_model_states) + + _zero2_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states) + + # recover shared parameters + for pair in zero_model_states[0].shared_params: + if pair[1] in state_dict: + state_dict[pair[0]] = state_dict[pair[1]] + + return state_dict + + +def zero3_partitioned_param_info(unpartitioned_numel, world_size): + remainder = unpartitioned_numel % world_size + padding_numel = (world_size - remainder) if remainder else 0 + partitioned_numel = math.ceil(unpartitioned_numel / world_size) + return partitioned_numel, padding_numel + + +def _zero3_merge_frozen_params(state_dict, world_size, zero_model_states): + if zero_model_states[0].frozen_param_shapes is None or len(zero_model_states[0].frozen_param_shapes) == 0: + return + + if debug: + for i in range(world_size): + num_elem = sum(s.numel() for s in zero_model_states[i].frozen_param_fragments.values()) + print(f'rank {i}: {FROZEN_PARAM_SHAPES}.numel = {num_elem}') + + frozen_param_shapes = zero_model_states[0].frozen_param_shapes + wanted_params = len(frozen_param_shapes) + wanted_numel = sum(s.numel() for s in frozen_param_shapes.values()) + avail_numel = sum([p.numel() for p in zero_model_states[0].frozen_param_fragments.values()]) * world_size + print(f'Frozen params: Have {avail_numel} numels to process.') + print(f'Frozen params: Need {wanted_numel} numels in {wanted_params} params') + + total_params = 0 + total_numel = 0 + for name, shape in zero_model_states[0].frozen_param_shapes.items(): + total_params += 1 + unpartitioned_numel = shape.numel() + total_numel += unpartitioned_numel + + param_frags = tuple(model_state.frozen_param_fragments[name] for model_state in zero_model_states) + state_dict[name] = torch.cat(param_frags, 0).narrow(0, 0, unpartitioned_numel).view(shape) + + partitioned_numel, partitioned_padding_numel = zero3_partitioned_param_info(unpartitioned_numel, world_size) + + if debug: + print( + f"Frozen params: {total_params} {name} full shape: {shape} partition0 numel={partitioned_numel} partitioned_padding_numel={partitioned_padding_numel}" + ) + + print(f"Reconstructed Frozen fp32 state dict with {total_params} params {total_numel} elements") + + +class GatheredTensor: + """ + A pseudo tensor that collects partitioned weights. + It is more memory efficient when there are multiple groups. + """ + + def __init__(self, flat_groups, flat_groups_offset, offset, partitioned_numel, shape): + self.flat_groups = flat_groups + self.flat_groups_offset = flat_groups_offset + self.offset = offset + self.partitioned_numel = partitioned_numel + self.shape = shape + self.dtype = self.flat_groups[0][0].dtype + + def contiguous(self): + """ + Merge partitioned weights from flat_groups into a single tensor. + """ + end_idx = self.offset + self.partitioned_numel + world_size = len(self.flat_groups) + pad_flat_param_chunks = [] + + for rank_i in range(world_size): + # for each rank, we need to collect weights from related group/groups + flat_groups_at_rank_i = self.flat_groups[rank_i] + start_group_id = None + end_group_id = None + for group_id in range(len(self.flat_groups_offset)): + if self.flat_groups_offset[group_id] <= self.offset < self.flat_groups_offset[group_id + 1]: + start_group_id = group_id + if self.flat_groups_offset[group_id] < end_idx <= self.flat_groups_offset[group_id + 1]: + end_group_id = group_id + break + # collect weights from related group/groups + for group_id in range(start_group_id, end_group_id + 1): + flat_tensor = flat_groups_at_rank_i[group_id] + start_offset = self.offset - self.flat_groups_offset[group_id] + end_offset = min(end_idx, self.flat_groups_offset[group_id + 1]) - self.flat_groups_offset[group_id] + pad_flat_param_chunks.append(flat_tensor[start_offset:end_offset]) + + # collect weights from all ranks + pad_flat_param = torch.cat(pad_flat_param_chunks, dim=0) + param = pad_flat_param[:self.shape.numel()].view(self.shape).contiguous() + return param + + +def _zero3_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states): + param_shapes = zero_model_states[0].param_shapes + avail_numel = sum([flat_group.numel() for flat_group in fp32_flat_groups[0]]) * world_size + + # Reconstruction protocol: For zero3 we need to zip the partitions together at boundary of each + # param, re-consolidating each param, while dealing with padding if any + + # merge list of dicts, preserving order + param_shapes = {k: v for d in param_shapes for k, v in d.items()} + + if debug: + for i in range(world_size): + print(f"{FP32_FLAT_GROUPS}[{i}].shape={fp32_flat_groups[i].shape}") + + wanted_params = len(param_shapes) + wanted_numel = sum(shape.numel() for shape in param_shapes.values()) + # not asserting if there is a mismatch due to possible padding + avail_numel = fp32_flat_groups[0].numel() * world_size + print(f"Trainable params: Have {avail_numel} numels to process.") + print(f"Trainable params: Need {wanted_numel} numels in {wanted_params} params.") + + # params + # XXX: for huge models that can't fit into the host's RAM we will have to recode this to support + # out-of-core computing solution + offset = 0 + total_numel = 0 + total_params = 0 + flat_groups_offset = [0] + list(np.cumsum([flat_tensor.numel() for flat_tensor in fp32_flat_groups[0]])) + for name, shape in tqdm(param_shapes.items(), desc='Gathering sharded weights'): + unpartitioned_numel = shape.numel() + total_numel += unpartitioned_numel + total_params += 1 + partitioned_numel, partitioned_padding_numel = zero3_partitioned_param_info(unpartitioned_numel, world_size) + + if debug: + print( + f"Trainable params: {total_params} {name} full shape: {shape} partition0 numel={partitioned_numel} partitioned_padding_numel={partitioned_padding_numel}" + ) + + # memory efficient tensor + tensor = GatheredTensor(fp32_flat_groups, flat_groups_offset, offset, partitioned_numel, shape) + state_dict[name] = tensor + offset += partitioned_numel + + offset *= world_size + + # Sanity check + if offset != avail_numel: + raise ValueError(f"consumed {offset} numels out of {avail_numel} - something is wrong") + + print(f"Reconstructed Trainable fp32 state dict with {total_params} params {total_numel} elements") + + +def _get_fp32_state_dict_from_zero3_checkpoint(world_size, fp32_flat_groups, zero_model_states, + exclude_frozen_parameters): + state_dict = OrderedDict() + + # buffers + buffers = zero_model_states[0].buffers + state_dict.update(buffers) + if debug: + print(f"added {len(buffers)} buffers") + + if not exclude_frozen_parameters: + _zero3_merge_frozen_params(state_dict, world_size, zero_model_states) + + _zero3_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states) + + # recover shared parameters + for pair in zero_model_states[0].shared_params: + if pair[1] in state_dict: + state_dict[pair[0]] = state_dict[pair[1]] + + return state_dict + + +def to_torch_tensor(state_dict, return_empty_tensor=False): + """ + Convert state_dict of GatheredTensor to torch tensor + """ + torch_state_dict = {} + converted_tensors = {} + for name, tensor in state_dict.items(): + tensor_id = id(tensor) + if tensor_id in converted_tensors: # shared tensors + shared_tensor = torch_state_dict[converted_tensors[tensor_id]] + torch_state_dict[name] = shared_tensor + else: + converted_tensors[tensor_id] = name + if return_empty_tensor: + torch_state_dict[name] = torch.empty(tensor.shape, dtype=tensor.dtype) + else: + torch_state_dict[name] = tensor.contiguous() + return torch_state_dict + + +def get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir, + tag=None, + exclude_frozen_parameters=False, + lazy_mode=False): + """ + Convert ZeRO 2 or 3 checkpoint into a single fp32 consolidated state_dict that can be loaded with + ``load_state_dict()`` and used for training without DeepSpeed or shared with others, for example + via a model hub. + + Args: + - ``checkpoint_dir``: path to the desired checkpoint folder + - ``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`` + - ``exclude_frozen_parameters``: exclude frozen parameters + - ``lazy_mode``: get state_dict in lazy mode. It returns a dict of pesduo tensor instead of torch tensor, which is more memory efficient. + Convert the pesduo tensor to torch tensor by ``.contiguous()`` + + Returns: + - pytorch ``state_dict`` + + A typical usage might be :: + + from deepspeed.utils.zero_to_fp32 import get_fp32_state_dict_from_zero_checkpoint + # do the training and checkpoint saving + state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir) # already on cpu + model = model.cpu() # move to cpu + model.load_state_dict(state_dict) + # submit to model hub or save the model to share with others + + In this example the ``model`` will no longer be usable in the deepspeed context of the same + application. i.e. you will need to re-initialize the deepspeed engine, since + ``model.load_state_dict(state_dict)`` will remove all the deepspeed magic from it. + + If you want it all done for you, use ``load_state_dict_from_zero_checkpoint`` instead. + + Note: the above usage may not work if your application doesn't have sufficient free CPU memory. + You may need to use the offline approach using the ``zero_to_fp32.py`` script that is saved with + the checkpoint. Or you can load state_dict in lazy mode :: + + from deepspeed.utils.zero_to_fp32 import get_fp32_state_dict_from_zero_checkpoint + state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir, lazy_mode=True) # not on cpu + for name, lazy_tensor in state_dict.item(): + tensor = lazy_tensor.contiguous() # to cpu + print(name, tensor) + # del tensor to release memory if it no longer in use + """ + if tag is None: + latest_path = os.path.join(checkpoint_dir, 'latest') + if os.path.isfile(latest_path): + with open(latest_path, 'r') as fd: + tag = fd.read().strip() + else: + raise ValueError(f"Unable to find 'latest' file at {latest_path}") + + ds_checkpoint_dir = os.path.join(checkpoint_dir, tag) + + if not os.path.isdir(ds_checkpoint_dir): + raise FileNotFoundError(f"Directory '{ds_checkpoint_dir}' doesn't exist") + + state_dict = _get_fp32_state_dict_from_zero_checkpoint(ds_checkpoint_dir, exclude_frozen_parameters) + if lazy_mode: + return state_dict + else: + return to_torch_tensor(state_dict) + + +def convert_zero_checkpoint_to_fp32_state_dict(checkpoint_dir, + output_dir, + max_shard_size="5GB", + safe_serialization=False, + tag=None, + exclude_frozen_parameters=False): + """ + Convert ZeRO 2 or 3 checkpoint into a single fp32 consolidated ``state_dict`` file that can be + loaded with ``torch.load(file)`` + ``load_state_dict()`` and used for training without DeepSpeed. + + Args: + - ``checkpoint_dir``: path to the desired checkpoint folder. (one that contains the tag-folder, like ``global_step14``) + - ``output_dir``: directory to the pytorch fp32 state_dict output files + - ``max_shard_size``: the maximum size for a checkpoint before being sharded, default value is 5GB + - ``safe_serialization``: whether to save the model using `safetensors` or the traditional PyTorch way (that uses `pickle`). + - ``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`` + - ``exclude_frozen_parameters``: exclude frozen parameters + """ + + # Dependency pre-check + if safe_serialization: + try: + from safetensors.torch import save_file + except ImportError: + print('If you want to use `safe_serialization`, please `pip install safetensors`') + raise + if max_shard_size is not None: + try: + from huggingface_hub import split_torch_state_dict_into_shards + except ImportError: + print('If you want to use `max_shard_size`, please `pip install huggingface_hub`') + raise + + # Convert zero checkpoint to state_dict + state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir, + tag, + exclude_frozen_parameters, + lazy_mode=True) + + # Shard the model if it is too big. + weights_name = "model.safetensors" if safe_serialization else "pytorch_model.bin" + if max_shard_size is not None: + filename_pattern = weights_name.replace(".bin", "{suffix}.bin").replace(".safetensors", "{suffix}.safetensors") + # an memory-efficient approach for sharding + empty_state_dict = to_torch_tensor(state_dict, return_empty_tensor=True) + state_dict_split = split_torch_state_dict_into_shards(empty_state_dict, + filename_pattern=filename_pattern, + max_shard_size=max_shard_size) + else: + from collections import namedtuple + StateDictSplit = namedtuple("StateDictSplit", ["is_sharded", "filename_to_tensors"]) + state_dict_split = StateDictSplit(is_sharded=False, + filename_to_tensors={weights_name: list(state_dict.keys())}) + + # Save the model by shard + os.makedirs(output_dir, exist_ok=True) + filename_to_tensors = state_dict_split.filename_to_tensors.items() + for shard_file, tensors in tqdm(filename_to_tensors, desc="Saving checkpoint shards"): + shard_state_dict = {tensor_name: state_dict[tensor_name] for tensor_name in tensors} + shard_state_dict = to_torch_tensor(shard_state_dict) + output_path = os.path.join(output_dir, shard_file) + if safe_serialization: + save_file(shard_state_dict, output_path, metadata={"format": "pt"}) + else: + torch.save(shard_state_dict, output_path) + # release the memory of current shard + for tensor_name in list(shard_state_dict.keys()): + del state_dict[tensor_name] + del shard_state_dict[tensor_name] + del shard_state_dict + gc.collect() + + # Save index if sharded + if state_dict_split.is_sharded: + index = { + "metadata": state_dict_split.metadata, + "weight_map": state_dict_split.tensor_to_filename, + } + save_index_file = "model.safetensors.index.json" if safe_serialization else "pytorch_model.bin.index.json" + save_index_file = os.path.join(output_dir, save_index_file) + with open(save_index_file, "w", encoding="utf-8") as f: + content = json.dumps(index, indent=2, sort_keys=True) + "\n" + f.write(content) + + +def load_state_dict_from_zero_checkpoint(model, checkpoint_dir, tag=None): + """ + 1. Put the provided model to cpu + 2. Convert ZeRO 2 or 3 checkpoint into a single fp32 consolidated ``state_dict`` + 3. Load it into the provided model + + Args: + - ``model``: the model object to update + - ``checkpoint_dir``: path to the desired checkpoint folder. (one that contains the tag-folder, like ``global_step14``) + - ``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`` + + Returns: + - ``model`: modified model + + Make sure you have plenty of CPU memory available before you call this function. If you don't + have enough use the ``zero_to_fp32.py`` utility to do the conversion. You will find it + conveniently placed for you in the checkpoint folder. + + A typical usage might be :: + + from deepspeed.utils.zero_to_fp32 import load_state_dict_from_zero_checkpoint + model = load_state_dict_from_zero_checkpoint(trainer.model, checkpoint_dir) + # submit to model hub or save the model to share with others + + Note, that once this was run, the ``model`` will no longer be usable in the deepspeed context + of the same application. i.e. you will need to re-initialize the deepspeed engine, since + ``model.load_state_dict(state_dict)`` will remove all the deepspeed magic from it. + + """ + logger.info(f"Extracting fp32 weights") + state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir, tag) + + logger.info(f"Overwriting model with fp32 weights") + model = model.cpu() + model.load_state_dict(state_dict, strict=False) + + return model + + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + parser.add_argument("checkpoint_dir", + type=str, + help="path to the desired checkpoint folder, e.g., path/checkpoint-12") + parser.add_argument("output_dir", + type=str, + help="directory to the pytorch fp32 state_dict output files" + "(e.g. path/checkpoint-12-output/)") + parser.add_argument( + "--max_shard_size", + type=str, + default="5GB", + help="The maximum size for a checkpoint before being sharded. Checkpoints shard will then be each of size" + "lower than this size. If expressed as a string, needs to be digits followed by a unit (like `5MB`" + "We default it to 5GB in order for models to be able to run easily on free-tier google colab instances" + "without CPU OOM issues.") + parser.add_argument( + "--safe_serialization", + default=False, + action='store_true', + help="Whether to save the model using `safetensors` or the traditional PyTorch way (that uses `pickle`).") + parser.add_argument("-t", + "--tag", + type=str, + default=None, + help="checkpoint tag used as a unique identifier for checkpoint. e.g., global_step1") + parser.add_argument("--exclude_frozen_parameters", action='store_true', help="exclude frozen parameters") + parser.add_argument("-d", "--debug", action='store_true', help="enable debug") + args = parser.parse_args() + + debug = args.debug + + convert_zero_checkpoint_to_fp32_state_dict(args.checkpoint_dir, + args.output_dir, + max_shard_size=args.max_shard_size, + safe_serialization=args.safe_serialization, + tag=args.tag, + exclude_frozen_parameters=args.exclude_frozen_parameters) diff --git a/checkpoint-1440/README.md b/checkpoint-1440/README.md new file mode 100644 index 0000000000000000000000000000000000000000..4eae946233309baf42f5bad9740186144a4f3b33 --- /dev/null +++ b/checkpoint-1440/README.md @@ -0,0 +1,202 @@ +--- +base_model: ../../initial_seq_model +library_name: peft +--- + +# Model Card for Model ID + + + + + +## Model Details + +### Model Description + + + + + +- **Developed by:** [More Information Needed] +- **Funded by [optional]:** [More Information Needed] +- **Shared by [optional]:** [More Information Needed] +- **Model type:** [More Information Needed] +- **Language(s) (NLP):** [More Information Needed] +- **License:** [More Information Needed] +- **Finetuned from model [optional]:** [More Information Needed] + +### Model Sources [optional] + + + +- **Repository:** [More Information Needed] +- **Paper [optional]:** [More Information Needed] +- **Demo [optional]:** [More Information Needed] + +## Uses + + + +### Direct Use + + + +[More Information Needed] + +### Downstream Use [optional] + + + +[More Information Needed] + +### Out-of-Scope Use + + + +[More Information Needed] + +## Bias, Risks, and Limitations + + + +[More Information Needed] + +### Recommendations + + + +Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations. + +## How to Get Started with the Model + +Use the code below to get started with the model. + +[More Information Needed] + +## Training Details + +### Training Data + + + +[More Information Needed] + +### Training Procedure + + + +#### Preprocessing [optional] + +[More Information Needed] + + +#### Training Hyperparameters + +- **Training regime:** [More Information Needed] + +#### Speeds, Sizes, Times [optional] + + + +[More Information Needed] + +## Evaluation + + + +### Testing Data, Factors & Metrics + +#### Testing Data + + + +[More Information Needed] + +#### Factors + + + +[More Information Needed] + +#### Metrics + + + +[More Information Needed] + +### Results + +[More Information Needed] + +#### Summary + + + +## Model Examination [optional] + + + +[More Information Needed] + +## Environmental Impact + + + +Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700). + +- **Hardware Type:** [More Information Needed] +- **Hours used:** [More Information Needed] +- **Cloud Provider:** [More Information Needed] +- **Compute Region:** [More Information Needed] +- **Carbon Emitted:** [More Information Needed] + +## Technical Specifications [optional] + +### Model Architecture and Objective + +[More Information Needed] + +### Compute Infrastructure + +[More Information Needed] + +#### Hardware + +[More Information Needed] + +#### Software + +[More Information Needed] + +## Citation [optional] + + + +**BibTeX:** + +[More Information Needed] + +**APA:** + +[More Information Needed] + +## Glossary [optional] + + + +[More Information Needed] + +## More Information [optional] + +[More Information Needed] + +## Model Card Authors [optional] + +[More Information Needed] + +## Model Card Contact + +[More Information Needed] +### Framework versions + +- PEFT 0.14.0 \ No newline at end of file diff --git a/checkpoint-1440/adapter_config.json b/checkpoint-1440/adapter_config.json new file mode 100644 index 0000000000000000000000000000000000000000..e1a650486f9ba9bab8c8dbb7d564bdc4ec121cf7 --- /dev/null +++ b/checkpoint-1440/adapter_config.json @@ -0,0 +1,38 @@ +{ + "alpha_pattern": {}, + "auto_mapping": null, + "base_model_name_or_path": "../../initial_seq_model", + "bias": "none", + "eva_config": null, + "exclude_modules": null, + "fan_in_fan_out": false, + "inference_mode": true, + "init_lora_weights": true, + "layer_replication": null, + "layers_pattern": null, + "layers_to_transform": null, + "loftq_config": {}, + "lora_alpha": 16, + "lora_bias": false, + "lora_dropout": 0.1, + "megatron_config": null, + "megatron_core": "megatron.core", + "modules_to_save": null, + "peft_type": "LORA", + "r": 8, + "rank_pattern": {}, + "revision": null, + "target_modules": [ + "k_proj", + "o_proj", + "gate_proj", + "down_proj", + "score", + "v_proj", + "up_proj", + "q_proj" + ], + "task_type": "CAUSAL_LM", + "use_dora": false, + "use_rslora": false +} \ No newline at end of file diff --git a/checkpoint-1440/adapter_model.safetensors b/checkpoint-1440/adapter_model.safetensors new file mode 100644 index 0000000000000000000000000000000000000000..4625805a25fb2be0fddc44294f0527701c30b50d --- /dev/null +++ b/checkpoint-1440/adapter_model.safetensors @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e5d915b9d1f4b28cd3ff5b4c53b0f4bd23f7504b616a6ba7da8591940a524a31 +size 42068368 diff --git a/checkpoint-1440/global_step1440/bf16_zero_pp_rank_0_mp_rank_00_optim_states.pt b/checkpoint-1440/global_step1440/bf16_zero_pp_rank_0_mp_rank_00_optim_states.pt new file mode 100644 index 0000000000000000000000000000000000000000..b4f0586d182422f2beef256b10a12a03c6685454 --- /dev/null +++ b/checkpoint-1440/global_step1440/bf16_zero_pp_rank_0_mp_rank_00_optim_states.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e8e11b997fcac7c0f613eca9e4a553991572160c64be9c56332241dd1e12b64d +size 63016432 diff --git a/checkpoint-1440/global_step1440/bf16_zero_pp_rank_1_mp_rank_00_optim_states.pt b/checkpoint-1440/global_step1440/bf16_zero_pp_rank_1_mp_rank_00_optim_states.pt new file mode 100644 index 0000000000000000000000000000000000000000..61a03fcedc39aebfa96d085241bf7770a2540d61 --- /dev/null +++ b/checkpoint-1440/global_step1440/bf16_zero_pp_rank_1_mp_rank_00_optim_states.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:229791b55f615905bf5ab37cfa3bba00280a8413a0488fed3a5c424140853d05 +size 58654832 diff --git a/checkpoint-1440/global_step1440/bf16_zero_pp_rank_2_mp_rank_00_optim_states.pt b/checkpoint-1440/global_step1440/bf16_zero_pp_rank_2_mp_rank_00_optim_states.pt new file mode 100644 index 0000000000000000000000000000000000000000..93bb753ff7429e8cba323cf1affdc2e20adc8bd6 --- /dev/null +++ b/checkpoint-1440/global_step1440/bf16_zero_pp_rank_2_mp_rank_00_optim_states.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cb3074026507f3d195ebed754d5a2ebb6b3ad9b60dc7f58c36f662360d2f53c4 +size 54460528 diff --git a/checkpoint-1440/global_step1440/bf16_zero_pp_rank_3_mp_rank_00_optim_states.pt b/checkpoint-1440/global_step1440/bf16_zero_pp_rank_3_mp_rank_00_optim_states.pt new file mode 100644 index 0000000000000000000000000000000000000000..e63b9af064fb22d42b5c39e11401771ba302bee2 --- /dev/null +++ b/checkpoint-1440/global_step1440/bf16_zero_pp_rank_3_mp_rank_00_optim_states.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3b4b4077b320e48531350836851470646a3f1efc0df7167671ab57bae2787369 +size 42139760 diff --git a/checkpoint-1440/global_step1440/zero_pp_rank_0_mp_rank_00_model_states.pt b/checkpoint-1440/global_step1440/zero_pp_rank_0_mp_rank_00_model_states.pt new file mode 100644 index 0000000000000000000000000000000000000000..05a0127e81c59152086de93aa7f4e81dac651923 --- /dev/null +++ b/checkpoint-1440/global_step1440/zero_pp_rank_0_mp_rank_00_model_states.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b2d9c1ebf4576debc89ab0a0c0bc9c9d20535ccb537f6cbb2f5dbd7810c7bb94 +size 442088 diff --git a/checkpoint-1440/global_step1440/zero_pp_rank_1_mp_rank_00_model_states.pt b/checkpoint-1440/global_step1440/zero_pp_rank_1_mp_rank_00_model_states.pt new file mode 100644 index 0000000000000000000000000000000000000000..1db02bbfd49e8a423e63fbb865d6715961b1a4b3 --- /dev/null +++ b/checkpoint-1440/global_step1440/zero_pp_rank_1_mp_rank_00_model_states.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0b56fd389b094f468e573f8910e07732badb1a18331f7be67ea6b8396fcbc277 +size 442088 diff --git a/checkpoint-1440/global_step1440/zero_pp_rank_2_mp_rank_00_model_states.pt b/checkpoint-1440/global_step1440/zero_pp_rank_2_mp_rank_00_model_states.pt new file mode 100644 index 0000000000000000000000000000000000000000..1c63d0ea598507e9e50e846db3b8ee4d10418646 --- /dev/null +++ b/checkpoint-1440/global_step1440/zero_pp_rank_2_mp_rank_00_model_states.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2d06c159ca70e93a02c4ce66cf8301e922d07cde60baac90c3763fad6bff54bb +size 442088 diff --git a/checkpoint-1440/global_step1440/zero_pp_rank_3_mp_rank_00_model_states.pt b/checkpoint-1440/global_step1440/zero_pp_rank_3_mp_rank_00_model_states.pt new file mode 100644 index 0000000000000000000000000000000000000000..099b4cc09d6ba92512608a7e20a67f142153b364 --- /dev/null +++ b/checkpoint-1440/global_step1440/zero_pp_rank_3_mp_rank_00_model_states.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:abee8c1615ded9b75e4df355f611f8ab0dce722427f800e3e86917802f17faa5 +size 442088 diff --git a/checkpoint-1440/special_tokens_map.json b/checkpoint-1440/special_tokens_map.json new file mode 100644 index 0000000000000000000000000000000000000000..a8eb9ef63af01dfa2c350573b543b14275370944 --- /dev/null +++ b/checkpoint-1440/special_tokens_map.json @@ -0,0 +1,30 @@ +{ + "bos_token": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false + }, + "eos_token": { + "content": "<|END_OF_TURN_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false + }, + "pad_token": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false + }, + "unk_token": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false + } +} diff --git a/checkpoint-1440/tokenizer.json b/checkpoint-1440/tokenizer.json new file mode 100644 index 0000000000000000000000000000000000000000..91a1344d38167f152a8803a80eb79ca4b465adbb --- /dev/null +++ b/checkpoint-1440/tokenizer.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:28c8b8038fcb2756e349a51832a56634423c579a869f39642526327aa56b2989 +size 20125189 diff --git a/checkpoint-1440/tokenizer_config.json b/checkpoint-1440/tokenizer_config.json new file mode 100644 index 0000000000000000000000000000000000000000..100ac1a3b6cff4a9043d2c0fd6b1603d1c1ee1e1 --- /dev/null +++ b/checkpoint-1440/tokenizer_config.json @@ -0,0 +1,364 @@ +{ + "add_bos_token": true, + "add_eos_token": false, + "add_prefix_space": false, + "added_tokens_decoder": { + "0": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "1": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "2": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "3": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "4": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "5": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "6": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "7": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "255000": { + "content": "<|START_OF_TURN_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255001": { + "content": "<|END_OF_TURN_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "255002": { + "content": "<|YES_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255003": { + "content": "<|NO_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255004": { + "content": "<|GOOD_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255005": { + "content": "<|BAD_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255006": { + "content": "<|USER_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255007": { + "content": "<|CHATBOT_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255008": { + "content": "<|SYSTEM_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255009": { + "content": "<|USER_0_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255010": { + "content": "<|USER_1_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255011": { + "content": "<|USER_2_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255012": { + "content": "<|USER_3_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255013": { + "content": "<|USER_4_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255014": { + "content": "<|USER_5_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255015": { + "content": "<|USER_6_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255016": { + "content": "<|USER_7_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255017": { + "content": "<|USER_8_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255018": { + "content": "<|USER_9_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255019": { + "content": "<|START_THINKING|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255020": { + "content": "<|END_THINKING|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255021": { + "content": "<|START_RESPONSE|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "255022": { + "content": "<|END_RESPONSE|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "255023": { + "content": "<|START_ACTION|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255024": { + "content": "<|END_ACTION|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255025": { + "content": "<|START_TOOL_RESULT|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255026": { + "content": "<|END_TOOL_RESULT|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255027": { + "content": "<|EXTRA_8_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255028": { + "content": "<|NEW_FILE|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "255029": { + "content": "<|BEGINNING_OF_PREFIX_FIM_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255030": { + "content": "<|BEGINNING_OF_MIDDLE_FIM_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255031": { + "content": "<|BEGINNING_OF_SUFFIX_FIM_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255032": { + "content": "<|END_OF_MIDDLE_FIM_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + } + }, + "bos_token": "", + "chat_template": [ + { + "name": "default", + "template": "{% if documents %}\n{% set tools = [] %}\n{%- macro document_turn(documents) -%}\n{# format documents into chat turn #}\n<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|><|START_THINKING|>I will look through the document to address the users needs.<|END_THINKING|><|START_ACTION|>[\n {\"tool_call_id\": \"0\", \"tool_name\": \"direct-injected-document\", \"parameters\": {}}\n]<|END_ACTION|><|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|><|START_TOOL_RESULT|>[\n {\n \"tool_call_id\": \"0\",\n \"results\": {\n{% for doc in documents %}\n \"{{ loop.index0 }}\": {{doc|tojson}}{% if not loop.last %},\n {% endif %}\n{% endfor %}\n\n },\n \"is_error\": null\n }\n]<|END_TOOL_RESULT|><|END_OF_TURN_TOKEN|>{%- endmacro %}\n{%- macro tool_call_id_to_int(messages, tool_call_id) %}\n{%- set counter = namespace(value=0) %}\n{%- set tool_call_id_seen = namespace(value=false) %}\n{%- for msg in messages %}\n {%- if msg.tool_calls %}\n {%- for tool_call in msg.tool_calls %}\n {%- if tool_call.id == tool_call_id and not tool_call_id_seen.value -%}\n {{ counter.value }}\n {%- set tool_call_id_seen.value = true %}\n {%- endif %}\n {%- set counter.value = counter.value + 1 %}\n {%- endfor %}\n {%- endif %}\n{%- endfor %}\n{%- endmacro %}\n{%- macro format_tool_message(messages, tool_msg) -%}\n{# format tool message #}\n {\n \"tool_call_id\": \"{{ tool_call_id_to_int(messages, tool_msg.tool_call_id) }}\",\n \"results\": {\n \"0\": {{ tool_msg.content|tojson }}\n },\n \"is_error\": null\n }\n{%- endmacro -%}\n{%- if messages and messages[0]['role']|lower == 'system' %}{%- set developer_preamble = messages[0]['content'] %}{% endif %}\n{%- set tool_idx = namespace(value=0) %}\n{%- set tool_ids_seen = namespace(value=[]) %}\n{%- set sent_documents = namespace(value=false) %}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|># System Preamble\nYou are in contextual safety mode. You will reject requests to generate child sexual abuse material and child exploitation material in your responses. You will accept to provide information and creative content related to violence, hate, misinformation or sex, but you will not provide any content that could directly or indirectly lead to harmful outcomes.\n\nYour information cutoff date is June 2024.\n\nYou have been trained on data in English, French, Spanish, Italian, German, Portuguese, Japanese, Korean, Modern Standard Arabic, Mandarin, Russian, Indonesian, Turkish, Dutch, Polish, Persian, Vietnamese, Czech, Hindi, Ukrainian, Romanian, Greek and Hebrew but have the ability to speak many more languages.\n{% if tools or documents %}\n\nYou have been trained to have advanced reasoning and tool-use capabilities and you should make best use of these skills to serve user's requests.\n\n## Tool Use\nThink about how you can make best use of the provided tools to help with the task and come up with a high level plan that you will execute first.\n\n0. Start by writing <|START_THINKING|> followed by a detailed step by step plan of how you will solve the problem. For each step explain your thinking fully and give details of required tool calls (if needed). Unless specified otherwise, you write your plan in natural language. When you finish, close it out with <|END_THINKING|>.\n You can optionally choose to skip this step when the user request is so straightforward to address that only a trivial plan would be needed.\n NOTE: You MUST skip this step when you are directly responding to the user's request without using any tools.\n\nThen carry out your plan by repeatedly executing the following steps.\n1. Action: write <|START_ACTION|> followed by a list of JSON-formatted tool calls, with each one containing \"tool_name\" and \"parameters\" fields.\n When there are multiple tool calls which are completely independent of each other (i.e. they can be executed in parallel), you should list them out all together in one step. When you finish, close it out with <|END_ACTION|>.\n2. Observation: you will then receive results of those tool calls in JSON format in the very next turn, wrapped around by <|START_TOOL_RESULT|> and <|END_TOOL_RESULT|>. Carefully observe those results and think about what to do next. Note that these results will be provided to you in a separate turn. NEVER hallucinate results.\n Every tool call produces a list of results (when a tool call produces no result or a single result, it'll still get wrapped inside a list). Each result is clearly linked to its originating tool call via its \"tool_call_id\".\n3. Reflection: start the next turn by writing <|START_THINKING|> followed by what you've figured out so far, any changes you need to make to your plan, and what you will do next. When you finish, close it out with <|END_THINKING|>.\n You can optionally choose to skip this step when everything is going according to plan and no special pieces of information or reasoning chains need to be recorded.\n NOTE: You MUST skip this step when you are done with tool-use actions and are ready to respond to the user.\n\nYou can repeat the above 3 steps multiple times (could be 0 times too if no suitable tool calls are available or needed), until you decide it's time to finally respond to the user.\n\n4. Response: then break out of the loop and write <|START_RESPONSE|> followed by a piece of text which serves as a response to the user's last request. Use all previous tool calls and results to help you when formulating your response. When you finish, close it out with <|END_RESPONSE|>.\n{% if enable_citations %}\n\n## Grounding\nImportantly, note that \"Reflection\" and \"Response\" above can be grounded.\nGrounding means you associate pieces of texts (called \"spans\") with those specific tool results that support them (called \"sources\"). And you use a pair of tags \"\" and \"\" to indicate when a span can be grounded onto a list of sources, listing them out in the closing tag. Sources from the same tool call are grouped together and listed as \"{tool_call_id}:[{list of result indices}]\", before they are joined together by \",\". E.g., \"span\" means that \"span\" is supported by result 1 and 2 from \"tool_call_id=0\" as well as result 0 from \"tool_call_id=1\".\n{% endif %}\n\n## Available Tools\nHere is the list of tools that you have available to you.\nYou can ONLY use the tools listed here. When a tool is not listed below, it is NOT available and you should NEVER attempt to use it.\nEach tool is represented as a JSON object with fields like \"name\", \"description\", \"parameters\" (per JSON Schema), and optionally, \"responses\" (per JSON Schema).\n\n```json\n[\n{% if documents %}\n {\"name\": \"direct-injected-document\", \"description\": \"This is a special tool to directly inject user-uploaded documents into the chat as additional context. DO NOT use this tool by yourself!\", \"parameters\": {\"type\": \"object\", \"properties\": {}, \"required\": []}, \"responses\": {\"200\": {\"description\": \"Successfully returned a list of chunked text snippets from the directly uploaded documents.\", \"content\": {\"application/json\": {\"schema\": {\"type\": \"array\", \"items\": {\"type\": \"object\", \"required\": [\"url\", \"snippet\"], \"properties\": {\"url\": {\"type\": \"string\", \"description\": \"The url of the uploaded document.\"}, \"snippet\": {\"type\": \"string\", \"description\": \"The text snippet for the returned document chunk.\"}}}}}}}}}{%- if tools %},{% endif %}\n\n{% endif %}\n{% for tool in tools %}\n {\"name\": \"{{ tool['function']['name'] }}\", \"description\": \"{{tool['function']['description']}}\", \"parameters\": {{ tool['function']['parameters']|tojson }}, \"responses\": null}{%- if not loop.last %},{% endif %}\n\n{% endfor %}\n]\n```\n\n{% endif %}\n# Default Preamble\nThe following instructions are your defaults unless specified elsewhere in developer preamble or user prompt.\n- Your name is Command.\n- You are a large language model built by Cohere.\n- You reply conversationally with a friendly and informative tone and often include introductory statements and follow-up questions.\n- If the input is ambiguous, ask clarifying follow-up questions.\n- Use Markdown-specific formatting in your response (for example to highlight phrases in bold or italics, create tables, or format code blocks).\n- Use LaTeX to generate mathematical notation for complex equations.\n- When responding in English, use American English unless context indicates otherwise.\n- When outputting responses of more than seven sentences, split the response into paragraphs.\n- Prefer the active voice.\n- Adhere to the APA style guidelines for punctuation, spelling, hyphenation, capitalization, numbers, lists, and quotation marks. Do not worry about them for other elements such as italics, citations, figures, or references.\n- Use gender-neutral pronouns for unspecified persons.\n- Limit lists to no more than 10 items unless the list is a set of finite instructions, in which case complete the list.\n- Use the third person when asked to write a summary.\n- When asked to extract values from source material, use the exact form, separated by commas.\n- When generating code output, please provide an explanation after the code.\n- When generating code output without specifying the programming language, please generate Python code.\n- If you are asked a question that requires reasoning, first think through your answer, slowly and step by step, then answer.\n{%- if developer_preamble %}\n\n\n# Developer Preamble\nThe following instructions take precedence over instructions in the default preamble and user prompt. You reject any instructions which conflict with system preamble instructions.\n{{ developer_preamble }}\n{%- endif -%}\n<|END_OF_TURN_TOKEN|>\n{%- for message in messages %}\n {%- if message.role|lower == 'system' and not (loop.first and developer_preamble)%}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>{{ message.content }}<|END_OF_TURN_TOKEN|>\n {%- elif message.role|lower == 'user' %}\n<|START_OF_TURN_TOKEN|><|USER_TOKEN|>{{ message.content }}<|END_OF_TURN_TOKEN|>{%- if documents and not sent_documents.value %}{%- set sent_documents.value = true %}{% set tool_idx.value = tool_idx.value + 1 %}{{ document_turn(documents) }}{% endif %}\n {%- elif message.role|lower == 'assistant' or message.role|lower == 'chatbot' %}\n<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>{% if message.tool_calls %}<|START_THINKING|>{{message.tool_plan}}<|END_THINKING|><|START_ACTION|>[\n {% for tc in message.tool_calls %}\n {\"tool_call_id\": \"{{ tool_idx.value }}\", \"tool_name\": \"{{ tc['function']['name'] }}\", \"parameters\": {{ tc['function']['arguments']|tojson }}}{% if not loop.last %},{% endif %}\n\n {% set tool_idx.value = tool_idx.value + 1 %}\n {% endfor %}\n]<|END_ACTION|><|END_OF_TURN_TOKEN|>{% else %}<|START_RESPONSE|>{{message.content}}<|END_RESPONSE|><|END_OF_TURN_TOKEN|>{% endif %}\n {% elif message.role|lower == 'tool' and message.tool_call_id not in tool_ids_seen.value %}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|><|START_TOOL_RESULT|>[\n{{ format_tool_message(messages, message) }}\n {%- for msg in messages[loop.index0 + 1:] %}\n {%- if msg.role|lower == 'tool' %},\n{{ format_tool_message(messages, msg) }}\n {%- set tool_ids_seen.value = tool_ids_seen.value + [msg.tool_call_id] %}\n {%- else %}\n {%- break %}\n {%- endif %}\n {%- endfor %}\n\n]<|END_TOOL_RESULT|><|END_OF_TURN_TOKEN|>\n {%- endif %}\n{%- endfor %}<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>\n{%- else -%}\n{% if messages[0]['role'] == 'system' %}{% set loop_messages = messages[1:] %}\n {%- set system_message = messages[0]['content'] %}{% elif false == true %}\n {%- set loop_messages = messages %}{% set system_message = '' %}\n{%- else %}\n {%- set loop_messages = messages %}\n {%- set system_message = false %}\n{%- endif %}\n{%- if system_message != false -%}\n {{ '<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>' + system_message + '<|END_OF_TURN_TOKEN|>' }}\n{%- else -%}\n {{ '<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|><|END_OF_TURN_TOKEN|>' }}\n{%- endif %}\n{%- for message in loop_messages %}\n {%- if (message['role'] == 'user') != (loop.index0 % 2 == 0) -%}\n {{ raise_exception('Conversation roles must alternate user/assistant/user/assistant/...') }}\n {%- endif -%}\n {%- set content = message['content'] -%}\n {%- if message['role'] == 'user' -%}\n {{ '<|START_OF_TURN_TOKEN|><|USER_TOKEN|>' + content.strip() + '<|END_OF_TURN_TOKEN|>' }}\n {%- elif message['role'] == 'assistant' -%}\n {{ '<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|><|START_RESPONSE|>' + content.strip() + '<|END_RESPONSE|><|END_OF_TURN_TOKEN|>' }}\n {%- endif %}\n{%- endfor %}\n{%- if add_generation_prompt -%}\n {{ '<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|><|START_RESPONSE|>' }}\n{%- endif %}\n{% endif %}" + }, + { + "name": "tool_use", + "template": "{%- macro document_turn(documents) -%}\n{# format documents into chat turn #}\n<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|><|START_THINKING|>I will look through the document to address the users needs.<|END_THINKING|><|START_ACTION|>[\n {\"tool_call_id\": \"0\", \"tool_name\": \"direct-injected-document\", \"parameters\": {}}\n]<|END_ACTION|><|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|><|START_TOOL_RESULT|>[\n {\n \"tool_call_id\": \"0\",\n \"results\": {\n{% for doc in documents %}\n \"{{ loop.index0 }}\": {{doc|tojson}}{% if not loop.last %},\n {% endif %}\n{% endfor %}\n\n },\n \"is_error\": null\n }\n]<|END_TOOL_RESULT|><|END_OF_TURN_TOKEN|>{%- endmacro %}\n{%- macro tool_call_id_to_int(messages, tool_call_id) %}\n{%- set counter = namespace(value=0) %}\n{%- set tool_call_id_seen = namespace(value=false) %}\n{%- for msg in messages %}\n {%- if msg.tool_calls %}\n {%- for tool_call in msg.tool_calls %}\n {%- if tool_call.id == tool_call_id and not tool_call_id_seen.value -%}\n {{ counter.value }}\n {%- set tool_call_id_seen.value = true %}\n {%- endif %}\n {%- set counter.value = counter.value + 1 %}\n {%- endfor %}\n {%- endif %}\n{%- endfor %}\n{%- endmacro %}\n{%- macro format_tool_message(messages, tool_msg) -%}\n{# format tool message #}\n {\n \"tool_call_id\": \"{{ tool_call_id_to_int(messages, tool_msg.tool_call_id) }}\",\n \"results\": {\n \"0\": {{ tool_msg.content|tojson }}\n },\n \"is_error\": null\n }\n{%- endmacro -%}\n{%- if messages and messages[0]['role']|lower == 'system' %}{%- set developer_preamble = messages[0]['content'] %}{% endif %}\n{%- set tool_idx = namespace(value=0) %}\n{%- set tool_ids_seen = namespace(value=[]) %}\n{%- set sent_documents = namespace(value=false) %}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|># System Preamble\nYou are in contextual safety mode. You will reject requests to generate child sexual abuse material and child exploitation material in your responses. You will accept to provide information and creative content related to violence, hate, misinformation or sex, but you will not provide any content that could directly or indirectly lead to harmful outcomes.\n\nYour information cutoff date is June 2024.\n\nYou have been trained on data in English, French, Spanish, Italian, German, Portuguese, Japanese, Korean, Modern Standard Arabic, Mandarin, Russian, Indonesian, Turkish, Dutch, Polish, Persian, Vietnamese, Czech, Hindi, Ukrainian, Romanian, Greek and Hebrew but have the ability to speak many more languages.\n{% if tools or documents %}\n\nYou have been trained to have advanced reasoning and tool-use capabilities and you should make best use of these skills to serve user's requests.\n\n## Tool Use\nThink about how you can make best use of the provided tools to help with the task and come up with a high level plan that you will execute first.\n\n0. Start by writing <|START_THINKING|> followed by a detailed step by step plan of how you will solve the problem. For each step explain your thinking fully and give details of required tool calls (if needed). Unless specified otherwise, you write your plan in natural language. When you finish, close it out with <|END_THINKING|>.\n You can optionally choose to skip this step when the user request is so straightforward to address that only a trivial plan would be needed.\n NOTE: You MUST skip this step when you are directly responding to the user's request without using any tools.\n\nThen carry out your plan by repeatedly executing the following steps.\n1. Action: write <|START_ACTION|> followed by a list of JSON-formatted tool calls, with each one containing \"tool_name\" and \"parameters\" fields.\n When there are multiple tool calls which are completely independent of each other (i.e. they can be executed in parallel), you should list them out all together in one step. When you finish, close it out with <|END_ACTION|>.\n2. Observation: you will then receive results of those tool calls in JSON format in the very next turn, wrapped around by <|START_TOOL_RESULT|> and <|END_TOOL_RESULT|>. Carefully observe those results and think about what to do next. Note that these results will be provided to you in a separate turn. NEVER hallucinate results.\n Every tool call produces a list of results (when a tool call produces no result or a single result, it'll still get wrapped inside a list). Each result is clearly linked to its originating tool call via its \"tool_call_id\".\n3. Reflection: start the next turn by writing <|START_THINKING|> followed by what you've figured out so far, any changes you need to make to your plan, and what you will do next. When you finish, close it out with <|END_THINKING|>.\n You can optionally choose to skip this step when everything is going according to plan and no special pieces of information or reasoning chains need to be recorded.\n NOTE: You MUST skip this step when you are done with tool-use actions and are ready to respond to the user.\n\nYou can repeat the above 3 steps multiple times (could be 0 times too if no suitable tool calls are available or needed), until you decide it's time to finally respond to the user.\n\n4. Response: then break out of the loop and write <|START_RESPONSE|> followed by a piece of text which serves as a response to the user's last request. Use all previous tool calls and results to help you when formulating your response. When you finish, close it out with <|END_RESPONSE|>.\n{% if enable_citations %}\n\n## Grounding\nImportantly, note that \"Reflection\" and \"Response\" above can be grounded.\nGrounding means you associate pieces of texts (called \"spans\") with those specific tool results that support them (called \"sources\"). And you use a pair of tags \"\" and \"\" to indicate when a span can be grounded onto a list of sources, listing them out in the closing tag. Sources from the same tool call are grouped together and listed as \"{tool_call_id}:[{list of result indices}]\", before they are joined together by \",\". E.g., \"span\" means that \"span\" is supported by result 1 and 2 from \"tool_call_id=0\" as well as result 0 from \"tool_call_id=1\".\n{% endif %}\n\n## Available Tools\nHere is the list of tools that you have available to you.\nYou can ONLY use the tools listed here. When a tool is not listed below, it is NOT available and you should NEVER attempt to use it.\nEach tool is represented as a JSON object with fields like \"name\", \"description\", \"parameters\" (per JSON Schema), and optionally, \"responses\" (per JSON Schema).\n\n```json\n[\n{% if documents %}\n {\"name\": \"direct-injected-document\", \"description\": \"This is a special tool to directly inject user-uploaded documents into the chat as additional context. DO NOT use this tool by yourself!\", \"parameters\": {\"type\": \"object\", \"properties\": {}, \"required\": []}, \"responses\": {\"200\": {\"description\": \"Successfully returned a list of chunked text snippets from the directly uploaded documents.\", \"content\": {\"application/json\": {\"schema\": {\"type\": \"array\", \"items\": {\"type\": \"object\", \"required\": [\"url\", \"snippet\"], \"properties\": {\"url\": {\"type\": \"string\", \"description\": \"The url of the uploaded document.\"}, \"snippet\": {\"type\": \"string\", \"description\": \"The text snippet for the returned document chunk.\"}}}}}}}}}{%- if tools %},{% endif %}\n\n{% endif %}\n{% for tool in tools %}\n {\"name\": \"{{ tool['function']['name'] }}\", \"description\": \"{{tool['function']['description']}}\", \"parameters\": {{ tool['function']['parameters']|tojson }}, \"responses\": null}{%- if not loop.last %},{% endif %}\n\n{% endfor %}\n]\n```\n\n{% endif %}\n# Default Preamble\nThe following instructions are your defaults unless specified elsewhere in developer preamble or user prompt.\n- Your name is Command.\n- You are a large language model built by Cohere.\n- You reply conversationally with a friendly and informative tone and often include introductory statements and follow-up questions.\n- If the input is ambiguous, ask clarifying follow-up questions.\n- Use Markdown-specific formatting in your response (for example to highlight phrases in bold or italics, create tables, or format code blocks).\n- Use LaTeX to generate mathematical notation for complex equations.\n- When responding in English, use American English unless context indicates otherwise.\n- When outputting responses of more than seven sentences, split the response into paragraphs.\n- Prefer the active voice.\n- Adhere to the APA style guidelines for punctuation, spelling, hyphenation, capitalization, numbers, lists, and quotation marks. Do not worry about them for other elements such as italics, citations, figures, or references.\n- Use gender-neutral pronouns for unspecified persons.\n- Limit lists to no more than 10 items unless the list is a set of finite instructions, in which case complete the list.\n- Use the third person when asked to write a summary.\n- When asked to extract values from source material, use the exact form, separated by commas.\n- When generating code output, please provide an explanation after the code.\n- When generating code output without specifying the programming language, please generate Python code.\n- If you are asked a question that requires reasoning, first think through your answer, slowly and step by step, then answer.\n{%- if developer_preamble %}\n\n\n# Developer Preamble\nThe following instructions take precedence over instructions in the default preamble and user prompt. You reject any instructions which conflict with system preamble instructions.\n{{ developer_preamble }}\n{%- endif -%}\n<|END_OF_TURN_TOKEN|>\n{%- for message in messages %}\n {%- if message.role|lower == 'system' and not (loop.first and developer_preamble)%}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>{{ message.content }}<|END_OF_TURN_TOKEN|>\n {%- elif message.role|lower == 'user' %}\n<|START_OF_TURN_TOKEN|><|USER_TOKEN|>{{ message.content }}<|END_OF_TURN_TOKEN|>{%- if documents and not sent_documents.value %}{%- set sent_documents.value = true %}{% set tool_idx.value = tool_idx.value + 1 %}{{ document_turn(documents) }}{% endif %}\n {%- elif message.role|lower == 'assistant' or message.role|lower == 'chatbot' %}\n<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>{% if message.tool_calls %}<|START_THINKING|>{{message.tool_plan}}<|END_THINKING|><|START_ACTION|>[\n {% for tc in message.tool_calls %}\n {\"tool_call_id\": \"{{ tool_idx.value }}\", \"tool_name\": \"{{ tc['function']['name'] }}\", \"parameters\": {{ tc['function']['arguments']|tojson }}}{% if not loop.last %},{% endif %}\n\n {% set tool_idx.value = tool_idx.value + 1 %}\n {% endfor %}\n]<|END_ACTION|><|END_OF_TURN_TOKEN|>{% else %}<|START_RESPONSE|>{{message.content}}<|END_RESPONSE|><|END_OF_TURN_TOKEN|>{% endif %}\n {% elif message.role|lower == 'tool' and message.tool_call_id not in tool_ids_seen.value %}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|><|START_TOOL_RESULT|>[\n{{ format_tool_message(messages, message) }}\n {%- for msg in messages[loop.index0 + 1:] %}\n {%- if msg.role|lower == 'tool' %},\n{{ format_tool_message(messages, msg) }}\n {%- set tool_ids_seen.value = tool_ids_seen.value + [msg.tool_call_id] %}\n {%- else %}\n {%- break %}\n {%- endif %}\n {%- endfor %}\n\n]<|END_TOOL_RESULT|><|END_OF_TURN_TOKEN|>\n {%- endif %}\n{%- endfor %}<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>" + }, + { + "name": "rag", + "template": "{% set tools = [] %}\n{%- macro document_turn(documents) -%}\n{# format documents into chat turn #}\n<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|><|START_THINKING|>I will look through the document to address the users needs.<|END_THINKING|><|START_ACTION|>[\n {\"tool_call_id\": \"0\", \"tool_name\": \"direct-injected-document\", \"parameters\": {}}\n]<|END_ACTION|><|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|><|START_TOOL_RESULT|>[\n {\n \"tool_call_id\": \"0\",\n \"results\": {\n{% for doc in documents %}\n \"{{ loop.index0 }}\": {{doc|tojson}}{% if not loop.last %},\n {% endif %}\n{% endfor %}\n\n },\n \"is_error\": null\n }\n]<|END_TOOL_RESULT|><|END_OF_TURN_TOKEN|>{%- endmacro %}\n{%- macro tool_call_id_to_int(messages, tool_call_id) %}\n{%- set counter = namespace(value=0) %}\n{%- set tool_call_id_seen = namespace(value=false) %}\n{%- for msg in messages %}\n {%- if msg.tool_calls %}\n {%- for tool_call in msg.tool_calls %}\n {%- if tool_call.id == tool_call_id and not tool_call_id_seen.value -%}\n {{ counter.value }}\n {%- set tool_call_id_seen.value = true %}\n {%- endif %}\n {%- set counter.value = counter.value + 1 %}\n {%- endfor %}\n {%- endif %}\n{%- endfor %}\n{%- endmacro %}\n{%- macro format_tool_message(messages, tool_msg) -%}\n{# format tool message #}\n {\n \"tool_call_id\": \"{{ tool_call_id_to_int(messages, tool_msg.tool_call_id) }}\",\n \"results\": {\n \"0\": {{ tool_msg.content|tojson }}\n },\n \"is_error\": null\n }\n{%- endmacro -%}\n{%- if messages and messages[0]['role']|lower == 'system' %}{%- set developer_preamble = messages[0]['content'] %}{% endif %}\n{%- set tool_idx = namespace(value=0) %}\n{%- set tool_ids_seen = namespace(value=[]) %}\n{%- set sent_documents = namespace(value=false) %}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|># System Preamble\nYou are in contextual safety mode. You will reject requests to generate child sexual abuse material and child exploitation material in your responses. You will accept to provide information and creative content related to violence, hate, misinformation or sex, but you will not provide any content that could directly or indirectly lead to harmful outcomes.\n\nYour information cutoff date is June 2024.\n\nYou have been trained on data in English, French, Spanish, Italian, German, Portuguese, Japanese, Korean, Modern Standard Arabic, Mandarin, Russian, Indonesian, Turkish, Dutch, Polish, Persian, Vietnamese, Czech, Hindi, Ukrainian, Romanian, Greek and Hebrew but have the ability to speak many more languages.\n{% if tools or documents %}\n\nYou have been trained to have advanced reasoning and tool-use capabilities and you should make best use of these skills to serve user's requests.\n\n## Tool Use\nThink about how you can make best use of the provided tools to help with the task and come up with a high level plan that you will execute first.\n\n0. Start by writing <|START_THINKING|> followed by a detailed step by step plan of how you will solve the problem. For each step explain your thinking fully and give details of required tool calls (if needed). Unless specified otherwise, you write your plan in natural language. When you finish, close it out with <|END_THINKING|>.\n You can optionally choose to skip this step when the user request is so straightforward to address that only a trivial plan would be needed.\n NOTE: You MUST skip this step when you are directly responding to the user's request without using any tools.\n\nThen carry out your plan by repeatedly executing the following steps.\n1. Action: write <|START_ACTION|> followed by a list of JSON-formatted tool calls, with each one containing \"tool_name\" and \"parameters\" fields.\n When there are multiple tool calls which are completely independent of each other (i.e. they can be executed in parallel), you should list them out all together in one step. When you finish, close it out with <|END_ACTION|>.\n2. Observation: you will then receive results of those tool calls in JSON format in the very next turn, wrapped around by <|START_TOOL_RESULT|> and <|END_TOOL_RESULT|>. Carefully observe those results and think about what to do next. Note that these results will be provided to you in a separate turn. NEVER hallucinate results.\n Every tool call produces a list of results (when a tool call produces no result or a single result, it'll still get wrapped inside a list). Each result is clearly linked to its originating tool call via its \"tool_call_id\".\n3. Reflection: start the next turn by writing <|START_THINKING|> followed by what you've figured out so far, any changes you need to make to your plan, and what you will do next. When you finish, close it out with <|END_THINKING|>.\n You can optionally choose to skip this step when everything is going according to plan and no special pieces of information or reasoning chains need to be recorded.\n NOTE: You MUST skip this step when you are done with tool-use actions and are ready to respond to the user.\n\nYou can repeat the above 3 steps multiple times (could be 0 times too if no suitable tool calls are available or needed), until you decide it's time to finally respond to the user.\n\n4. Response: then break out of the loop and write <|START_RESPONSE|> followed by a piece of text which serves as a response to the user's last request. Use all previous tool calls and results to help you when formulating your response. When you finish, close it out with <|END_RESPONSE|>.\n{% if enable_citations %}\n\n## Grounding\nImportantly, note that \"Reflection\" and \"Response\" above can be grounded.\nGrounding means you associate pieces of texts (called \"spans\") with those specific tool results that support them (called \"sources\"). And you use a pair of tags \"\" and \"\" to indicate when a span can be grounded onto a list of sources, listing them out in the closing tag. Sources from the same tool call are grouped together and listed as \"{tool_call_id}:[{list of result indices}]\", before they are joined together by \",\". E.g., \"span\" means that \"span\" is supported by result 1 and 2 from \"tool_call_id=0\" as well as result 0 from \"tool_call_id=1\".\n{% endif %}\n\n## Available Tools\nHere is the list of tools that you have available to you.\nYou can ONLY use the tools listed here. When a tool is not listed below, it is NOT available and you should NEVER attempt to use it.\nEach tool is represented as a JSON object with fields like \"name\", \"description\", \"parameters\" (per JSON Schema), and optionally, \"responses\" (per JSON Schema).\n\n```json\n[\n{% if documents %}\n {\"name\": \"direct-injected-document\", \"description\": \"This is a special tool to directly inject user-uploaded documents into the chat as additional context. DO NOT use this tool by yourself!\", \"parameters\": {\"type\": \"object\", \"properties\": {}, \"required\": []}, \"responses\": {\"200\": {\"description\": \"Successfully returned a list of chunked text snippets from the directly uploaded documents.\", \"content\": {\"application/json\": {\"schema\": {\"type\": \"array\", \"items\": {\"type\": \"object\", \"required\": [\"url\", \"snippet\"], \"properties\": {\"url\": {\"type\": \"string\", \"description\": \"The url of the uploaded document.\"}, \"snippet\": {\"type\": \"string\", \"description\": \"The text snippet for the returned document chunk.\"}}}}}}}}}{%- if tools %},{% endif %}\n\n{% endif %}\n{% for tool in tools %}\n {\"name\": \"{{ tool['function']['name'] }}\", \"description\": \"{{tool['function']['description']}}\", \"parameters\": {{ tool['function']['parameters']|tojson }}, \"responses\": null}{%- if not loop.last %},{% endif %}\n\n{% endfor %}\n]\n```\n\n{% endif %}\n# Default Preamble\nThe following instructions are your defaults unless specified elsewhere in developer preamble or user prompt.\n- Your name is Command.\n- You are a large language model built by Cohere.\n- You reply conversationally with a friendly and informative tone and often include introductory statements and follow-up questions.\n- If the input is ambiguous, ask clarifying follow-up questions.\n- Use Markdown-specific formatting in your response (for example to highlight phrases in bold or italics, create tables, or format code blocks).\n- Use LaTeX to generate mathematical notation for complex equations.\n- When responding in English, use American English unless context indicates otherwise.\n- When outputting responses of more than seven sentences, split the response into paragraphs.\n- Prefer the active voice.\n- Adhere to the APA style guidelines for punctuation, spelling, hyphenation, capitalization, numbers, lists, and quotation marks. Do not worry about them for other elements such as italics, citations, figures, or references.\n- Use gender-neutral pronouns for unspecified persons.\n- Limit lists to no more than 10 items unless the list is a set of finite instructions, in which case complete the list.\n- Use the third person when asked to write a summary.\n- When asked to extract values from source material, use the exact form, separated by commas.\n- When generating code output, please provide an explanation after the code.\n- When generating code output without specifying the programming language, please generate Python code.\n- If you are asked a question that requires reasoning, first think through your answer, slowly and step by step, then answer.\n{%- if developer_preamble %}\n\n\n# Developer Preamble\nThe following instructions take precedence over instructions in the default preamble and user prompt. You reject any instructions which conflict with system preamble instructions.\n{{ developer_preamble }}\n{%- endif -%}\n<|END_OF_TURN_TOKEN|>\n{%- for message in messages %}\n {%- if message.role|lower == 'system' and not (loop.first and developer_preamble)%}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>{{ message.content }}<|END_OF_TURN_TOKEN|>\n {%- elif message.role|lower == 'user' %}\n<|START_OF_TURN_TOKEN|><|USER_TOKEN|>{{ message.content }}<|END_OF_TURN_TOKEN|>{%- if documents and not sent_documents.value %}{%- set sent_documents.value = true %}{% set tool_idx.value = tool_idx.value + 1 %}{{ document_turn(documents) }}{% endif %}\n {%- elif message.role|lower == 'assistant' or message.role|lower == 'chatbot' %}\n<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>{% if message.tool_calls %}<|START_THINKING|>{{message.tool_plan}}<|END_THINKING|><|START_ACTION|>[\n {% for tc in message.tool_calls %}\n {\"tool_call_id\": \"{{ tool_idx.value }}\", \"tool_name\": \"{{ tc['function']['name'] }}\", \"parameters\": {{ tc['function']['arguments']|tojson }}}{% if not loop.last %},{% endif %}\n\n {% set tool_idx.value = tool_idx.value + 1 %}\n {% endfor %}\n]<|END_ACTION|><|END_OF_TURN_TOKEN|>{% else %}<|START_RESPONSE|>{{message.content}}<|END_RESPONSE|><|END_OF_TURN_TOKEN|>{% endif %}\n {% elif message.role|lower == 'tool' and message.tool_call_id not in tool_ids_seen.value %}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|><|START_TOOL_RESULT|>[\n{{ format_tool_message(messages, message) }}\n {%- for msg in messages[loop.index0 + 1:] %}\n {%- if msg.role|lower == 'tool' %},\n{{ format_tool_message(messages, msg) }}\n {%- set tool_ids_seen.value = tool_ids_seen.value + [msg.tool_call_id] %}\n {%- else %}\n {%- break %}\n {%- endif %}\n {%- endfor %}\n\n]<|END_TOOL_RESULT|><|END_OF_TURN_TOKEN|>\n {%- endif %}\n{%- endfor %}<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>" + } + ], + "clean_up_tokenization_spaces": false, + "eos_token": "<|END_OF_TURN_TOKEN|>", + "extra_special_tokens": {}, + "legacy": true, + "merges_file": null, + "model_max_length": 8192, + "pad_token": "", + "padding_side": "right", + "sp_model_kwargs": {}, + "spaces_between_special_tokens": false, + "tokenizer_class": "CohereTokenizer", + "unk_token": "", + "use_default_system_prompt": false, + "vocab_file": null +} diff --git a/checkpoint-1440/training_args.bin b/checkpoint-1440/training_args.bin new file mode 100644 index 0000000000000000000000000000000000000000..fba3b63792fed5a70be0307e26ba27ef584b1528 --- /dev/null +++ b/checkpoint-1440/training_args.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b72add547acd6c009f3a3770072d0cdf7de7e797c7597084319db874a556e470 +size 6904 diff --git a/checkpoint-1440/zero_to_fp32.py b/checkpoint-1440/zero_to_fp32.py new file mode 100644 index 0000000000000000000000000000000000000000..0e759146cadd92ddfefab3680146c2bd6a2b5c04 --- /dev/null +++ b/checkpoint-1440/zero_to_fp32.py @@ -0,0 +1,760 @@ +#!/usr/bin/env python + +# Copyright (c) Microsoft Corporation. +# SPDX-License-Identifier: Apache-2.0 + +# DeepSpeed Team + +# This script extracts fp32 consolidated weights from a zero 1, 2 and 3 DeepSpeed checkpoints. It gets +# copied into the top level checkpoint dir, so the user can easily do the conversion at any point in +# the future. Once extracted, the weights don't require DeepSpeed and can be used in any +# application. +# +# example: +# python zero_to_fp32.py . output_dir/ +# or +# python zero_to_fp32.py . output_dir/ --safe_serialization + +import argparse +import torch +import glob +import math +import os +import re +import gc +import json +import numpy as np +from tqdm import tqdm +from collections import OrderedDict +from dataclasses import dataclass + +# while this script doesn't use deepspeed to recover data, since the checkpoints are pickled with +# DeepSpeed data structures it has to be available in the current python environment. +from deepspeed.utils import logger +from deepspeed.checkpoint.constants import (DS_VERSION, OPTIMIZER_STATE_DICT, SINGLE_PARTITION_OF_FP32_GROUPS, + FP32_FLAT_GROUPS, ZERO_STAGE, PARTITION_COUNT, PARAM_SHAPES, BUFFER_NAMES, + FROZEN_PARAM_SHAPES, FROZEN_PARAM_FRAGMENTS) + + +@dataclass +class zero_model_state: + buffers: dict() + param_shapes: dict() + shared_params: list + ds_version: int + frozen_param_shapes: dict() + frozen_param_fragments: dict() + + +debug = 0 + +# load to cpu +device = torch.device('cpu') + + +def atoi(text): + return int(text) if text.isdigit() else text + + +def natural_keys(text): + ''' + alist.sort(key=natural_keys) sorts in human order + http://nedbatchelder.com/blog/200712/human_sorting.html + (See Toothy's implementation in the comments) + ''' + return [atoi(c) for c in re.split(r'(\d+)', text)] + + +def get_model_state_file(checkpoint_dir, zero_stage): + if not os.path.isdir(checkpoint_dir): + raise FileNotFoundError(f"Directory '{checkpoint_dir}' doesn't exist") + + # there should be only one file + if zero_stage <= 2: + file = os.path.join(checkpoint_dir, "mp_rank_00_model_states.pt") + elif zero_stage == 3: + file = os.path.join(checkpoint_dir, "zero_pp_rank_0_mp_rank_00_model_states.pt") + + if not os.path.exists(file): + raise FileNotFoundError(f"can't find model states file at '{file}'") + + return file + + +def get_checkpoint_files(checkpoint_dir, glob_pattern): + # XXX: need to test that this simple glob rule works for multi-node setup too + ckpt_files = sorted(glob.glob(os.path.join(checkpoint_dir, glob_pattern)), key=natural_keys) + + if len(ckpt_files) == 0: + raise FileNotFoundError(f"can't find {glob_pattern} files in directory '{checkpoint_dir}'") + + return ckpt_files + + +def get_optim_files(checkpoint_dir): + return get_checkpoint_files(checkpoint_dir, "*_optim_states.pt") + + +def get_model_state_files(checkpoint_dir): + return get_checkpoint_files(checkpoint_dir, "*_model_states.pt") + + +def parse_model_states(files): + zero_model_states = [] + for file in files: + state_dict = torch.load(file, map_location=device, weights_only=False) + + if BUFFER_NAMES not in state_dict: + raise ValueError(f"{file} is not a model state checkpoint") + buffer_names = state_dict[BUFFER_NAMES] + if debug: + print("Found buffers:", buffer_names) + + # recover just the buffers while restoring them to fp32 if they were saved in fp16 + buffers = {k: v.float() for k, v in state_dict["module"].items() if k in buffer_names} + param_shapes = state_dict[PARAM_SHAPES] + + # collect parameters that are included in param_shapes + param_names = [] + for s in param_shapes: + for name in s.keys(): + param_names.append(name) + + # update with frozen parameters + frozen_param_shapes = state_dict.get(FROZEN_PARAM_SHAPES, None) + if frozen_param_shapes is not None: + if debug: + print(f"Found frozen_param_shapes: {frozen_param_shapes}") + param_names += list(frozen_param_shapes.keys()) + + # handle shared params + shared_params = [[k, v] for k, v in state_dict["shared_params"].items()] + + ds_version = state_dict.get(DS_VERSION, None) + + frozen_param_fragments = state_dict.get(FROZEN_PARAM_FRAGMENTS, None) + + z_model_state = zero_model_state(buffers=buffers, + param_shapes=param_shapes, + shared_params=shared_params, + ds_version=ds_version, + frozen_param_shapes=frozen_param_shapes, + frozen_param_fragments=frozen_param_fragments) + zero_model_states.append(z_model_state) + + return zero_model_states + + +def parse_optim_states(files, ds_checkpoint_dir): + total_files = len(files) + state_dicts = [] + for f in tqdm(files, desc='Loading checkpoint shards'): + state_dict = torch.load(f, map_location=device, mmap=True, weights_only=False) + # immediately discard the potentially huge 2 optimizer states as we only care for fp32 master weights + # and also handle the case where it was already removed by another helper script + state_dict["optimizer_state_dict"].pop("optimizer_state_dict", None) + state_dicts.append(state_dict) + + if not ZERO_STAGE in state_dicts[0][OPTIMIZER_STATE_DICT]: + raise ValueError(f"{files[0]} is not a zero checkpoint") + zero_stage = state_dicts[0][OPTIMIZER_STATE_DICT][ZERO_STAGE] + world_size = state_dicts[0][OPTIMIZER_STATE_DICT][PARTITION_COUNT] + + # For ZeRO-2 each param group can have different partition_count as data parallelism for expert + # parameters can be different from data parallelism for non-expert parameters. So we can just + # use the max of the partition_count to get the dp world_size. + + if type(world_size) is list: + world_size = max(world_size) + + if world_size != total_files: + raise ValueError( + f"Expected {world_size} of '*_optim_states.pt' under '{ds_checkpoint_dir}' but found {total_files} files. " + "Possibly due to an overwrite of an old checkpoint, or a checkpoint didn't get saved by one or more processes." + ) + + # the groups are named differently in each stage + if zero_stage <= 2: + fp32_groups_key = SINGLE_PARTITION_OF_FP32_GROUPS + elif zero_stage == 3: + fp32_groups_key = FP32_FLAT_GROUPS + else: + raise ValueError(f"unknown zero stage {zero_stage}") + + fp32_flat_groups = [state_dicts[i][OPTIMIZER_STATE_DICT][fp32_groups_key] for i in range(len(state_dicts))] + return zero_stage, world_size, fp32_flat_groups + + +def _get_fp32_state_dict_from_zero_checkpoint(ds_checkpoint_dir, exclude_frozen_parameters): + """ + Returns fp32 state_dict reconstructed from ds checkpoint + + Args: + - ``ds_checkpoint_dir``: path to the deepspeed checkpoint folder (where the optimizer files are) + + """ + print(f"Processing zero checkpoint '{ds_checkpoint_dir}'") + + optim_files = get_optim_files(ds_checkpoint_dir) + zero_stage, world_size, fp32_flat_groups = parse_optim_states(optim_files, ds_checkpoint_dir) + print(f"Detected checkpoint of type zero stage {zero_stage}, world_size: {world_size}") + + model_files = get_model_state_files(ds_checkpoint_dir) + + zero_model_states = parse_model_states(model_files) + print(f'Parsing checkpoint created by deepspeed=={zero_model_states[0].ds_version}') + + if zero_stage <= 2: + return _get_fp32_state_dict_from_zero2_checkpoint(world_size, fp32_flat_groups, zero_model_states, + exclude_frozen_parameters) + elif zero_stage == 3: + return _get_fp32_state_dict_from_zero3_checkpoint(world_size, fp32_flat_groups, zero_model_states, + exclude_frozen_parameters) + + +def _zero2_merge_frozen_params(state_dict, zero_model_states): + if zero_model_states[0].frozen_param_shapes is None or len(zero_model_states[0].frozen_param_shapes) == 0: + return + + frozen_param_shapes = zero_model_states[0].frozen_param_shapes + frozen_param_fragments = zero_model_states[0].frozen_param_fragments + + if debug: + num_elem = sum(s.numel() for s in frozen_param_shapes.values()) + print(f'rank 0: {FROZEN_PARAM_SHAPES}.numel = {num_elem}') + + wanted_params = len(frozen_param_shapes) + wanted_numel = sum(s.numel() for s in frozen_param_shapes.values()) + avail_numel = sum([p.numel() for p in frozen_param_fragments.values()]) + print(f'Frozen params: Have {avail_numel} numels to process.') + print(f'Frozen params: Need {wanted_numel} numels in {wanted_params} params') + + total_params = 0 + total_numel = 0 + for name, shape in frozen_param_shapes.items(): + total_params += 1 + unpartitioned_numel = shape.numel() + total_numel += unpartitioned_numel + + state_dict[name] = frozen_param_fragments[name] + + if debug: + print(f"{name} full shape: {shape} unpartitioned numel {unpartitioned_numel} ") + + print(f"Reconstructed Frozen fp32 state dict with {total_params} params {total_numel} elements") + + +def _has_callable(obj, fn): + attr = getattr(obj, fn, None) + return callable(attr) + + +def _zero2_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states): + param_shapes = zero_model_states[0].param_shapes + + # Reconstruction protocol: + # + # XXX: document this + + if debug: + for i in range(world_size): + for j in range(len(fp32_flat_groups[0])): + print(f"{FP32_FLAT_GROUPS}[{i}][{j}].shape={fp32_flat_groups[i][j].shape}") + + # XXX: memory usage doubles here (zero2) + num_param_groups = len(fp32_flat_groups[0]) + merged_single_partition_of_fp32_groups = [] + for i in range(num_param_groups): + merged_partitions = [sd[i] for sd in fp32_flat_groups] + full_single_fp32_vector = torch.cat(merged_partitions, 0) + merged_single_partition_of_fp32_groups.append(full_single_fp32_vector) + avail_numel = sum( + [full_single_fp32_vector.numel() for full_single_fp32_vector in merged_single_partition_of_fp32_groups]) + + if debug: + wanted_params = sum([len(shapes) for shapes in param_shapes]) + wanted_numel = sum([sum(shape.numel() for shape in shapes.values()) for shapes in param_shapes]) + # not asserting if there is a mismatch due to possible padding + print(f"Have {avail_numel} numels to process.") + print(f"Need {wanted_numel} numels in {wanted_params} params.") + + # params + # XXX: for huge models that can't fit into the host's RAM we will have to recode this to support + # out-of-core computing solution + total_numel = 0 + total_params = 0 + for shapes, full_single_fp32_vector in zip(param_shapes, merged_single_partition_of_fp32_groups): + offset = 0 + avail_numel = full_single_fp32_vector.numel() + for name, shape in shapes.items(): + + unpartitioned_numel = shape.numel() if _has_callable(shape, 'numel') else math.prod(shape) + total_numel += unpartitioned_numel + total_params += 1 + + if debug: + print(f"{name} full shape: {shape} unpartitioned numel {unpartitioned_numel} ") + state_dict[name] = full_single_fp32_vector.narrow(0, offset, unpartitioned_numel).view(shape) + offset += unpartitioned_numel + + # Z2 started to align to 2*world_size to improve nccl performance. Therefore both offset and + # avail_numel can differ by anywhere between 0..2*world_size. Due to two unrelated complex + # paddings performed in the code it's almost impossible to predict the exact numbers w/o the + # live optimizer object, so we are checking that the numbers are within the right range + align_to = 2 * world_size + + def zero2_align(x): + return align_to * math.ceil(x / align_to) + + if debug: + print(f"original offset={offset}, avail_numel={avail_numel}") + + offset = zero2_align(offset) + avail_numel = zero2_align(avail_numel) + + if debug: + print(f"aligned offset={offset}, avail_numel={avail_numel}") + + # Sanity check + if offset != avail_numel: + raise ValueError(f"consumed {offset} numels out of {avail_numel} - something is wrong") + + print(f"Reconstructed fp32 state dict with {total_params} params {total_numel} elements") + + +def _get_fp32_state_dict_from_zero2_checkpoint(world_size, fp32_flat_groups, zero_model_states, + exclude_frozen_parameters): + state_dict = OrderedDict() + + # buffers + buffers = zero_model_states[0].buffers + state_dict.update(buffers) + if debug: + print(f"added {len(buffers)} buffers") + + if not exclude_frozen_parameters: + _zero2_merge_frozen_params(state_dict, zero_model_states) + + _zero2_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states) + + # recover shared parameters + for pair in zero_model_states[0].shared_params: + if pair[1] in state_dict: + state_dict[pair[0]] = state_dict[pair[1]] + + return state_dict + + +def zero3_partitioned_param_info(unpartitioned_numel, world_size): + remainder = unpartitioned_numel % world_size + padding_numel = (world_size - remainder) if remainder else 0 + partitioned_numel = math.ceil(unpartitioned_numel / world_size) + return partitioned_numel, padding_numel + + +def _zero3_merge_frozen_params(state_dict, world_size, zero_model_states): + if zero_model_states[0].frozen_param_shapes is None or len(zero_model_states[0].frozen_param_shapes) == 0: + return + + if debug: + for i in range(world_size): + num_elem = sum(s.numel() for s in zero_model_states[i].frozen_param_fragments.values()) + print(f'rank {i}: {FROZEN_PARAM_SHAPES}.numel = {num_elem}') + + frozen_param_shapes = zero_model_states[0].frozen_param_shapes + wanted_params = len(frozen_param_shapes) + wanted_numel = sum(s.numel() for s in frozen_param_shapes.values()) + avail_numel = sum([p.numel() for p in zero_model_states[0].frozen_param_fragments.values()]) * world_size + print(f'Frozen params: Have {avail_numel} numels to process.') + print(f'Frozen params: Need {wanted_numel} numels in {wanted_params} params') + + total_params = 0 + total_numel = 0 + for name, shape in zero_model_states[0].frozen_param_shapes.items(): + total_params += 1 + unpartitioned_numel = shape.numel() + total_numel += unpartitioned_numel + + param_frags = tuple(model_state.frozen_param_fragments[name] for model_state in zero_model_states) + state_dict[name] = torch.cat(param_frags, 0).narrow(0, 0, unpartitioned_numel).view(shape) + + partitioned_numel, partitioned_padding_numel = zero3_partitioned_param_info(unpartitioned_numel, world_size) + + if debug: + print( + f"Frozen params: {total_params} {name} full shape: {shape} partition0 numel={partitioned_numel} partitioned_padding_numel={partitioned_padding_numel}" + ) + + print(f"Reconstructed Frozen fp32 state dict with {total_params} params {total_numel} elements") + + +class GatheredTensor: + """ + A pseudo tensor that collects partitioned weights. + It is more memory efficient when there are multiple groups. + """ + + def __init__(self, flat_groups, flat_groups_offset, offset, partitioned_numel, shape): + self.flat_groups = flat_groups + self.flat_groups_offset = flat_groups_offset + self.offset = offset + self.partitioned_numel = partitioned_numel + self.shape = shape + self.dtype = self.flat_groups[0][0].dtype + + def contiguous(self): + """ + Merge partitioned weights from flat_groups into a single tensor. + """ + end_idx = self.offset + self.partitioned_numel + world_size = len(self.flat_groups) + pad_flat_param_chunks = [] + + for rank_i in range(world_size): + # for each rank, we need to collect weights from related group/groups + flat_groups_at_rank_i = self.flat_groups[rank_i] + start_group_id = None + end_group_id = None + for group_id in range(len(self.flat_groups_offset)): + if self.flat_groups_offset[group_id] <= self.offset < self.flat_groups_offset[group_id + 1]: + start_group_id = group_id + if self.flat_groups_offset[group_id] < end_idx <= self.flat_groups_offset[group_id + 1]: + end_group_id = group_id + break + # collect weights from related group/groups + for group_id in range(start_group_id, end_group_id + 1): + flat_tensor = flat_groups_at_rank_i[group_id] + start_offset = self.offset - self.flat_groups_offset[group_id] + end_offset = min(end_idx, self.flat_groups_offset[group_id + 1]) - self.flat_groups_offset[group_id] + pad_flat_param_chunks.append(flat_tensor[start_offset:end_offset]) + + # collect weights from all ranks + pad_flat_param = torch.cat(pad_flat_param_chunks, dim=0) + param = pad_flat_param[:self.shape.numel()].view(self.shape).contiguous() + return param + + +def _zero3_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states): + param_shapes = zero_model_states[0].param_shapes + avail_numel = sum([flat_group.numel() for flat_group in fp32_flat_groups[0]]) * world_size + + # Reconstruction protocol: For zero3 we need to zip the partitions together at boundary of each + # param, re-consolidating each param, while dealing with padding if any + + # merge list of dicts, preserving order + param_shapes = {k: v for d in param_shapes for k, v in d.items()} + + if debug: + for i in range(world_size): + print(f"{FP32_FLAT_GROUPS}[{i}].shape={fp32_flat_groups[i].shape}") + + wanted_params = len(param_shapes) + wanted_numel = sum(shape.numel() for shape in param_shapes.values()) + # not asserting if there is a mismatch due to possible padding + avail_numel = fp32_flat_groups[0].numel() * world_size + print(f"Trainable params: Have {avail_numel} numels to process.") + print(f"Trainable params: Need {wanted_numel} numels in {wanted_params} params.") + + # params + # XXX: for huge models that can't fit into the host's RAM we will have to recode this to support + # out-of-core computing solution + offset = 0 + total_numel = 0 + total_params = 0 + flat_groups_offset = [0] + list(np.cumsum([flat_tensor.numel() for flat_tensor in fp32_flat_groups[0]])) + for name, shape in tqdm(param_shapes.items(), desc='Gathering sharded weights'): + unpartitioned_numel = shape.numel() + total_numel += unpartitioned_numel + total_params += 1 + partitioned_numel, partitioned_padding_numel = zero3_partitioned_param_info(unpartitioned_numel, world_size) + + if debug: + print( + f"Trainable params: {total_params} {name} full shape: {shape} partition0 numel={partitioned_numel} partitioned_padding_numel={partitioned_padding_numel}" + ) + + # memory efficient tensor + tensor = GatheredTensor(fp32_flat_groups, flat_groups_offset, offset, partitioned_numel, shape) + state_dict[name] = tensor + offset += partitioned_numel + + offset *= world_size + + # Sanity check + if offset != avail_numel: + raise ValueError(f"consumed {offset} numels out of {avail_numel} - something is wrong") + + print(f"Reconstructed Trainable fp32 state dict with {total_params} params {total_numel} elements") + + +def _get_fp32_state_dict_from_zero3_checkpoint(world_size, fp32_flat_groups, zero_model_states, + exclude_frozen_parameters): + state_dict = OrderedDict() + + # buffers + buffers = zero_model_states[0].buffers + state_dict.update(buffers) + if debug: + print(f"added {len(buffers)} buffers") + + if not exclude_frozen_parameters: + _zero3_merge_frozen_params(state_dict, world_size, zero_model_states) + + _zero3_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states) + + # recover shared parameters + for pair in zero_model_states[0].shared_params: + if pair[1] in state_dict: + state_dict[pair[0]] = state_dict[pair[1]] + + return state_dict + + +def to_torch_tensor(state_dict, return_empty_tensor=False): + """ + Convert state_dict of GatheredTensor to torch tensor + """ + torch_state_dict = {} + converted_tensors = {} + for name, tensor in state_dict.items(): + tensor_id = id(tensor) + if tensor_id in converted_tensors: # shared tensors + shared_tensor = torch_state_dict[converted_tensors[tensor_id]] + torch_state_dict[name] = shared_tensor + else: + converted_tensors[tensor_id] = name + if return_empty_tensor: + torch_state_dict[name] = torch.empty(tensor.shape, dtype=tensor.dtype) + else: + torch_state_dict[name] = tensor.contiguous() + return torch_state_dict + + +def get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir, + tag=None, + exclude_frozen_parameters=False, + lazy_mode=False): + """ + Convert ZeRO 2 or 3 checkpoint into a single fp32 consolidated state_dict that can be loaded with + ``load_state_dict()`` and used for training without DeepSpeed or shared with others, for example + via a model hub. + + Args: + - ``checkpoint_dir``: path to the desired checkpoint folder + - ``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`` + - ``exclude_frozen_parameters``: exclude frozen parameters + - ``lazy_mode``: get state_dict in lazy mode. It returns a dict of pesduo tensor instead of torch tensor, which is more memory efficient. + Convert the pesduo tensor to torch tensor by ``.contiguous()`` + + Returns: + - pytorch ``state_dict`` + + A typical usage might be :: + + from deepspeed.utils.zero_to_fp32 import get_fp32_state_dict_from_zero_checkpoint + # do the training and checkpoint saving + state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir) # already on cpu + model = model.cpu() # move to cpu + model.load_state_dict(state_dict) + # submit to model hub or save the model to share with others + + In this example the ``model`` will no longer be usable in the deepspeed context of the same + application. i.e. you will need to re-initialize the deepspeed engine, since + ``model.load_state_dict(state_dict)`` will remove all the deepspeed magic from it. + + If you want it all done for you, use ``load_state_dict_from_zero_checkpoint`` instead. + + Note: the above usage may not work if your application doesn't have sufficient free CPU memory. + You may need to use the offline approach using the ``zero_to_fp32.py`` script that is saved with + the checkpoint. Or you can load state_dict in lazy mode :: + + from deepspeed.utils.zero_to_fp32 import get_fp32_state_dict_from_zero_checkpoint + state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir, lazy_mode=True) # not on cpu + for name, lazy_tensor in state_dict.item(): + tensor = lazy_tensor.contiguous() # to cpu + print(name, tensor) + # del tensor to release memory if it no longer in use + """ + if tag is None: + latest_path = os.path.join(checkpoint_dir, 'latest') + if os.path.isfile(latest_path): + with open(latest_path, 'r') as fd: + tag = fd.read().strip() + else: + raise ValueError(f"Unable to find 'latest' file at {latest_path}") + + ds_checkpoint_dir = os.path.join(checkpoint_dir, tag) + + if not os.path.isdir(ds_checkpoint_dir): + raise FileNotFoundError(f"Directory '{ds_checkpoint_dir}' doesn't exist") + + state_dict = _get_fp32_state_dict_from_zero_checkpoint(ds_checkpoint_dir, exclude_frozen_parameters) + if lazy_mode: + return state_dict + else: + return to_torch_tensor(state_dict) + + +def convert_zero_checkpoint_to_fp32_state_dict(checkpoint_dir, + output_dir, + max_shard_size="5GB", + safe_serialization=False, + tag=None, + exclude_frozen_parameters=False): + """ + Convert ZeRO 2 or 3 checkpoint into a single fp32 consolidated ``state_dict`` file that can be + loaded with ``torch.load(file)`` + ``load_state_dict()`` and used for training without DeepSpeed. + + Args: + - ``checkpoint_dir``: path to the desired checkpoint folder. (one that contains the tag-folder, like ``global_step14``) + - ``output_dir``: directory to the pytorch fp32 state_dict output files + - ``max_shard_size``: the maximum size for a checkpoint before being sharded, default value is 5GB + - ``safe_serialization``: whether to save the model using `safetensors` or the traditional PyTorch way (that uses `pickle`). + - ``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`` + - ``exclude_frozen_parameters``: exclude frozen parameters + """ + + # Dependency pre-check + if safe_serialization: + try: + from safetensors.torch import save_file + except ImportError: + print('If you want to use `safe_serialization`, please `pip install safetensors`') + raise + if max_shard_size is not None: + try: + from huggingface_hub import split_torch_state_dict_into_shards + except ImportError: + print('If you want to use `max_shard_size`, please `pip install huggingface_hub`') + raise + + # Convert zero checkpoint to state_dict + state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir, + tag, + exclude_frozen_parameters, + lazy_mode=True) + + # Shard the model if it is too big. + weights_name = "model.safetensors" if safe_serialization else "pytorch_model.bin" + if max_shard_size is not None: + filename_pattern = weights_name.replace(".bin", "{suffix}.bin").replace(".safetensors", "{suffix}.safetensors") + # an memory-efficient approach for sharding + empty_state_dict = to_torch_tensor(state_dict, return_empty_tensor=True) + state_dict_split = split_torch_state_dict_into_shards(empty_state_dict, + filename_pattern=filename_pattern, + max_shard_size=max_shard_size) + else: + from collections import namedtuple + StateDictSplit = namedtuple("StateDictSplit", ["is_sharded", "filename_to_tensors"]) + state_dict_split = StateDictSplit(is_sharded=False, + filename_to_tensors={weights_name: list(state_dict.keys())}) + + # Save the model by shard + os.makedirs(output_dir, exist_ok=True) + filename_to_tensors = state_dict_split.filename_to_tensors.items() + for shard_file, tensors in tqdm(filename_to_tensors, desc="Saving checkpoint shards"): + shard_state_dict = {tensor_name: state_dict[tensor_name] for tensor_name in tensors} + shard_state_dict = to_torch_tensor(shard_state_dict) + output_path = os.path.join(output_dir, shard_file) + if safe_serialization: + save_file(shard_state_dict, output_path, metadata={"format": "pt"}) + else: + torch.save(shard_state_dict, output_path) + # release the memory of current shard + for tensor_name in list(shard_state_dict.keys()): + del state_dict[tensor_name] + del shard_state_dict[tensor_name] + del shard_state_dict + gc.collect() + + # Save index if sharded + if state_dict_split.is_sharded: + index = { + "metadata": state_dict_split.metadata, + "weight_map": state_dict_split.tensor_to_filename, + } + save_index_file = "model.safetensors.index.json" if safe_serialization else "pytorch_model.bin.index.json" + save_index_file = os.path.join(output_dir, save_index_file) + with open(save_index_file, "w", encoding="utf-8") as f: + content = json.dumps(index, indent=2, sort_keys=True) + "\n" + f.write(content) + + +def load_state_dict_from_zero_checkpoint(model, checkpoint_dir, tag=None): + """ + 1. Put the provided model to cpu + 2. Convert ZeRO 2 or 3 checkpoint into a single fp32 consolidated ``state_dict`` + 3. Load it into the provided model + + Args: + - ``model``: the model object to update + - ``checkpoint_dir``: path to the desired checkpoint folder. (one that contains the tag-folder, like ``global_step14``) + - ``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`` + + Returns: + - ``model`: modified model + + Make sure you have plenty of CPU memory available before you call this function. If you don't + have enough use the ``zero_to_fp32.py`` utility to do the conversion. You will find it + conveniently placed for you in the checkpoint folder. + + A typical usage might be :: + + from deepspeed.utils.zero_to_fp32 import load_state_dict_from_zero_checkpoint + model = load_state_dict_from_zero_checkpoint(trainer.model, checkpoint_dir) + # submit to model hub or save the model to share with others + + Note, that once this was run, the ``model`` will no longer be usable in the deepspeed context + of the same application. i.e. you will need to re-initialize the deepspeed engine, since + ``model.load_state_dict(state_dict)`` will remove all the deepspeed magic from it. + + """ + logger.info(f"Extracting fp32 weights") + state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir, tag) + + logger.info(f"Overwriting model with fp32 weights") + model = model.cpu() + model.load_state_dict(state_dict, strict=False) + + return model + + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + parser.add_argument("checkpoint_dir", + type=str, + help="path to the desired checkpoint folder, e.g., path/checkpoint-12") + parser.add_argument("output_dir", + type=str, + help="directory to the pytorch fp32 state_dict output files" + "(e.g. path/checkpoint-12-output/)") + parser.add_argument( + "--max_shard_size", + type=str, + default="5GB", + help="The maximum size for a checkpoint before being sharded. Checkpoints shard will then be each of size" + "lower than this size. If expressed as a string, needs to be digits followed by a unit (like `5MB`" + "We default it to 5GB in order for models to be able to run easily on free-tier google colab instances" + "without CPU OOM issues.") + parser.add_argument( + "--safe_serialization", + default=False, + action='store_true', + help="Whether to save the model using `safetensors` or the traditional PyTorch way (that uses `pickle`).") + parser.add_argument("-t", + "--tag", + type=str, + default=None, + help="checkpoint tag used as a unique identifier for checkpoint. e.g., global_step1") + parser.add_argument("--exclude_frozen_parameters", action='store_true', help="exclude frozen parameters") + parser.add_argument("-d", "--debug", action='store_true', help="enable debug") + args = parser.parse_args() + + debug = args.debug + + convert_zero_checkpoint_to_fp32_state_dict(args.checkpoint_dir, + args.output_dir, + max_shard_size=args.max_shard_size, + safe_serialization=args.safe_serialization, + tag=args.tag, + exclude_frozen_parameters=args.exclude_frozen_parameters) diff --git a/checkpoint-630/README.md b/checkpoint-630/README.md new file mode 100644 index 0000000000000000000000000000000000000000..4eae946233309baf42f5bad9740186144a4f3b33 --- /dev/null +++ b/checkpoint-630/README.md @@ -0,0 +1,202 @@ +--- +base_model: ../../initial_seq_model +library_name: peft +--- + +# Model Card for Model ID + + + + + +## Model Details + +### Model Description + + + + + +- **Developed by:** [More Information Needed] +- **Funded by [optional]:** [More Information Needed] +- **Shared by [optional]:** [More Information Needed] +- **Model type:** [More Information Needed] +- **Language(s) (NLP):** [More Information Needed] +- **License:** [More Information Needed] +- **Finetuned from model [optional]:** [More Information Needed] + +### Model Sources [optional] + + + +- **Repository:** [More Information Needed] +- **Paper [optional]:** [More Information Needed] +- **Demo [optional]:** [More Information Needed] + +## Uses + + + +### Direct Use + + + +[More Information Needed] + +### Downstream Use [optional] + + + +[More Information Needed] + +### Out-of-Scope Use + + + +[More Information Needed] + +## Bias, Risks, and Limitations + + + +[More Information Needed] + +### Recommendations + + + +Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations. + +## How to Get Started with the Model + +Use the code below to get started with the model. + +[More Information Needed] + +## Training Details + +### Training Data + + + +[More Information Needed] + +### Training Procedure + + + +#### Preprocessing [optional] + +[More Information Needed] + + +#### Training Hyperparameters + +- **Training regime:** [More Information Needed] + +#### Speeds, Sizes, Times [optional] + + + +[More Information Needed] + +## Evaluation + + + +### Testing Data, Factors & Metrics + +#### Testing Data + + + +[More Information Needed] + +#### Factors + + + +[More Information Needed] + +#### Metrics + + + +[More Information Needed] + +### Results + +[More Information Needed] + +#### Summary + + + +## Model Examination [optional] + + + +[More Information Needed] + +## Environmental Impact + + + +Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700). + +- **Hardware Type:** [More Information Needed] +- **Hours used:** [More Information Needed] +- **Cloud Provider:** [More Information Needed] +- **Compute Region:** [More Information Needed] +- **Carbon Emitted:** [More Information Needed] + +## Technical Specifications [optional] + +### Model Architecture and Objective + +[More Information Needed] + +### Compute Infrastructure + +[More Information Needed] + +#### Hardware + +[More Information Needed] + +#### Software + +[More Information Needed] + +## Citation [optional] + + + +**BibTeX:** + +[More Information Needed] + +**APA:** + +[More Information Needed] + +## Glossary [optional] + + + +[More Information Needed] + +## More Information [optional] + +[More Information Needed] + +## Model Card Authors [optional] + +[More Information Needed] + +## Model Card Contact + +[More Information Needed] +### Framework versions + +- PEFT 0.14.0 \ No newline at end of file diff --git a/checkpoint-630/adapter_config.json b/checkpoint-630/adapter_config.json new file mode 100644 index 0000000000000000000000000000000000000000..e1a650486f9ba9bab8c8dbb7d564bdc4ec121cf7 --- /dev/null +++ b/checkpoint-630/adapter_config.json @@ -0,0 +1,38 @@ +{ + "alpha_pattern": {}, + "auto_mapping": null, + "base_model_name_or_path": "../../initial_seq_model", + "bias": "none", + "eva_config": null, + "exclude_modules": null, + "fan_in_fan_out": false, + "inference_mode": true, + "init_lora_weights": true, + "layer_replication": null, + "layers_pattern": null, + "layers_to_transform": null, + "loftq_config": {}, + "lora_alpha": 16, + "lora_bias": false, + "lora_dropout": 0.1, + "megatron_config": null, + "megatron_core": "megatron.core", + "modules_to_save": null, + "peft_type": "LORA", + "r": 8, + "rank_pattern": {}, + "revision": null, + "target_modules": [ + "k_proj", + "o_proj", + "gate_proj", + "down_proj", + "score", + "v_proj", + "up_proj", + "q_proj" + ], + "task_type": "CAUSAL_LM", + "use_dora": false, + "use_rslora": false +} \ No newline at end of file diff --git a/checkpoint-630/adapter_model.safetensors b/checkpoint-630/adapter_model.safetensors new file mode 100644 index 0000000000000000000000000000000000000000..d10a931c7ff91ea9ec38773548208a9a6da44b49 --- /dev/null +++ b/checkpoint-630/adapter_model.safetensors @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:544998d3f565b144359200f3945a44153544852f17fee41c581de3c5b7fad1b6 +size 42068368 diff --git a/checkpoint-630/global_step630/bf16_zero_pp_rank_0_mp_rank_00_optim_states.pt b/checkpoint-630/global_step630/bf16_zero_pp_rank_0_mp_rank_00_optim_states.pt new file mode 100644 index 0000000000000000000000000000000000000000..ffa2ea49ca701b57b0c581f5a500e192e145ce03 --- /dev/null +++ b/checkpoint-630/global_step630/bf16_zero_pp_rank_0_mp_rank_00_optim_states.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:64c85490281b2edcb02ff501cab60bb97afff356c267b09df2c01c745f9e0cf9 +size 63016432 diff --git a/checkpoint-630/global_step630/bf16_zero_pp_rank_1_mp_rank_00_optim_states.pt b/checkpoint-630/global_step630/bf16_zero_pp_rank_1_mp_rank_00_optim_states.pt new file mode 100644 index 0000000000000000000000000000000000000000..7659181e4ab61f2ad13b8a64dcc9b429397f35f1 --- /dev/null +++ b/checkpoint-630/global_step630/bf16_zero_pp_rank_1_mp_rank_00_optim_states.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e6d287ac8ed7366db597cdc72d970205785ae974d609da478999f35ed332ef8d +size 63016432 diff --git a/checkpoint-630/global_step630/bf16_zero_pp_rank_2_mp_rank_00_optim_states.pt b/checkpoint-630/global_step630/bf16_zero_pp_rank_2_mp_rank_00_optim_states.pt new file mode 100644 index 0000000000000000000000000000000000000000..c7762b5e1f6d84d4181592f5fc279ed465228ad7 --- /dev/null +++ b/checkpoint-630/global_step630/bf16_zero_pp_rank_2_mp_rank_00_optim_states.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d2aa93f9ef00530b139faed2439b9718c635828772f5115b91e40bdca9c1f8db +size 63016432 diff --git a/checkpoint-630/global_step630/bf16_zero_pp_rank_3_mp_rank_00_optim_states.pt b/checkpoint-630/global_step630/bf16_zero_pp_rank_3_mp_rank_00_optim_states.pt new file mode 100644 index 0000000000000000000000000000000000000000..ef5017da5601fdd6bf719afc408105f3510dbe0d --- /dev/null +++ b/checkpoint-630/global_step630/bf16_zero_pp_rank_3_mp_rank_00_optim_states.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f9bf70c2565eb8c8c3a4cbd9063dddde3c7702bb41c45335ac7c2a110687ff63 +size 63016432 diff --git a/checkpoint-630/global_step630/zero_pp_rank_0_mp_rank_00_model_states.pt b/checkpoint-630/global_step630/zero_pp_rank_0_mp_rank_00_model_states.pt new file mode 100644 index 0000000000000000000000000000000000000000..576b3ea833b06aa6ecfc3b2eaeb66278d7ca9c79 --- /dev/null +++ b/checkpoint-630/global_step630/zero_pp_rank_0_mp_rank_00_model_states.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fbcb4ce1b311465216d267f7f98ea8b7ac07f9c0642a7572ce20917e588d58ae +size 442088 diff --git a/checkpoint-630/global_step630/zero_pp_rank_1_mp_rank_00_model_states.pt b/checkpoint-630/global_step630/zero_pp_rank_1_mp_rank_00_model_states.pt new file mode 100644 index 0000000000000000000000000000000000000000..5610b94443dabc7bc4cee63d6b00580c4ca5d5e9 --- /dev/null +++ b/checkpoint-630/global_step630/zero_pp_rank_1_mp_rank_00_model_states.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:91e24de73c2fe170617688fa1101cebe35a5922cffb42a8d9a08464d106170e7 +size 442088 diff --git a/checkpoint-630/global_step630/zero_pp_rank_2_mp_rank_00_model_states.pt b/checkpoint-630/global_step630/zero_pp_rank_2_mp_rank_00_model_states.pt new file mode 100644 index 0000000000000000000000000000000000000000..4ce6e1d3cb7618b3b37d31dcde6623c04ad98e87 --- /dev/null +++ b/checkpoint-630/global_step630/zero_pp_rank_2_mp_rank_00_model_states.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:df085591b77ed0bf060b6eddbff6baeea8d5f5477104154c98ffeef78d23f957 +size 442088 diff --git a/checkpoint-630/global_step630/zero_pp_rank_3_mp_rank_00_model_states.pt b/checkpoint-630/global_step630/zero_pp_rank_3_mp_rank_00_model_states.pt new file mode 100644 index 0000000000000000000000000000000000000000..614fca1554d770b74a95a462a898e62e19a0ae45 --- /dev/null +++ b/checkpoint-630/global_step630/zero_pp_rank_3_mp_rank_00_model_states.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:90a3b03a7ba67df251cbc4805a1430bd4a259f729ce32cf1bb3682bf56ecf5f2 +size 442088 diff --git a/checkpoint-630/latest b/checkpoint-630/latest new file mode 100644 index 0000000000000000000000000000000000000000..ee5543a3c0265b1c804126c2546694d234fc3cf7 --- /dev/null +++ b/checkpoint-630/latest @@ -0,0 +1 @@ +global_step630 \ No newline at end of file diff --git a/checkpoint-630/rng_state_0.pth b/checkpoint-630/rng_state_0.pth new file mode 100644 index 0000000000000000000000000000000000000000..4b0027c52b70b83bad8c2940f51c104d898a648b --- /dev/null +++ b/checkpoint-630/rng_state_0.pth @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e03e130b1cc5124ef8622f2d6d2ce4983c8cc9118063d5d94fe88b6d4a392da6 +size 14960 diff --git a/checkpoint-630/rng_state_1.pth b/checkpoint-630/rng_state_1.pth new file mode 100644 index 0000000000000000000000000000000000000000..1eac859f5592682fc921f7bb69d6a36fd3abc2f8 --- /dev/null +++ b/checkpoint-630/rng_state_1.pth @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:99131ebc8fac194307965456482a2f321ace30acde310e982dbea0f6cc367e17 +size 14960 diff --git a/checkpoint-630/rng_state_2.pth b/checkpoint-630/rng_state_2.pth new file mode 100644 index 0000000000000000000000000000000000000000..1925ea50d787c0e9890057840f2143f2dfaa8566 --- /dev/null +++ b/checkpoint-630/rng_state_2.pth @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:23f3979f5174fef8f3b0a2552dec848bdadd98be0f93017d7925d2fe4929e52b +size 14960 diff --git a/checkpoint-630/rng_state_3.pth b/checkpoint-630/rng_state_3.pth new file mode 100644 index 0000000000000000000000000000000000000000..036acbfbc85fc1634def5df0ed09f2bf4fa9c900 --- /dev/null +++ b/checkpoint-630/rng_state_3.pth @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0662a435b9aee33065070db4c747554bcf4788d1af93913a861b4c8023227457 +size 14960 diff --git a/checkpoint-630/scheduler.pt b/checkpoint-630/scheduler.pt new file mode 100644 index 0000000000000000000000000000000000000000..8de5074ad3e2e7f6b8a001bd4b5638dc66180697 --- /dev/null +++ b/checkpoint-630/scheduler.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c0bdc4f8fde010a95350064f7ac4bb65e1253e648998a41d8bce78273e571a2e +size 1064 diff --git a/checkpoint-630/special_tokens_map.json b/checkpoint-630/special_tokens_map.json new file mode 100644 index 0000000000000000000000000000000000000000..a8eb9ef63af01dfa2c350573b543b14275370944 --- /dev/null +++ b/checkpoint-630/special_tokens_map.json @@ -0,0 +1,30 @@ +{ + "bos_token": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false + }, + "eos_token": { + "content": "<|END_OF_TURN_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false + }, + "pad_token": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false + }, + "unk_token": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false + } +} diff --git a/checkpoint-630/tokenizer.json b/checkpoint-630/tokenizer.json new file mode 100644 index 0000000000000000000000000000000000000000..91a1344d38167f152a8803a80eb79ca4b465adbb --- /dev/null +++ b/checkpoint-630/tokenizer.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:28c8b8038fcb2756e349a51832a56634423c579a869f39642526327aa56b2989 +size 20125189 diff --git a/checkpoint-630/tokenizer_config.json b/checkpoint-630/tokenizer_config.json new file mode 100644 index 0000000000000000000000000000000000000000..100ac1a3b6cff4a9043d2c0fd6b1603d1c1ee1e1 --- /dev/null +++ b/checkpoint-630/tokenizer_config.json @@ -0,0 +1,364 @@ +{ + "add_bos_token": true, + "add_eos_token": false, + "add_prefix_space": false, + "added_tokens_decoder": { + "0": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "1": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "2": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "3": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "4": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "5": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "6": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "7": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "255000": { + "content": "<|START_OF_TURN_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255001": { + "content": "<|END_OF_TURN_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "255002": { + "content": "<|YES_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255003": { + "content": "<|NO_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255004": { + "content": "<|GOOD_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255005": { + "content": "<|BAD_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255006": { + "content": "<|USER_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255007": { + "content": "<|CHATBOT_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255008": { + "content": "<|SYSTEM_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255009": { + "content": "<|USER_0_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255010": { + "content": "<|USER_1_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255011": { + "content": "<|USER_2_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255012": { + "content": "<|USER_3_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255013": { + "content": "<|USER_4_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255014": { + "content": "<|USER_5_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255015": { + "content": "<|USER_6_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255016": { + "content": "<|USER_7_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255017": { + "content": "<|USER_8_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255018": { + "content": "<|USER_9_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255019": { + "content": "<|START_THINKING|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255020": { + "content": "<|END_THINKING|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255021": { + "content": "<|START_RESPONSE|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "255022": { + "content": "<|END_RESPONSE|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "255023": { + "content": "<|START_ACTION|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255024": { + "content": "<|END_ACTION|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255025": { + "content": "<|START_TOOL_RESULT|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255026": { + "content": "<|END_TOOL_RESULT|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255027": { + "content": "<|EXTRA_8_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255028": { + "content": "<|NEW_FILE|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "255029": { + "content": "<|BEGINNING_OF_PREFIX_FIM_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255030": { + "content": "<|BEGINNING_OF_MIDDLE_FIM_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255031": { + "content": "<|BEGINNING_OF_SUFFIX_FIM_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255032": { + "content": "<|END_OF_MIDDLE_FIM_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + } + }, + "bos_token": "", + "chat_template": [ + { + "name": "default", + "template": "{% if documents %}\n{% set tools = [] %}\n{%- macro document_turn(documents) -%}\n{# format documents into chat turn #}\n<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|><|START_THINKING|>I will look through the document to address the users needs.<|END_THINKING|><|START_ACTION|>[\n {\"tool_call_id\": \"0\", \"tool_name\": \"direct-injected-document\", \"parameters\": {}}\n]<|END_ACTION|><|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|><|START_TOOL_RESULT|>[\n {\n \"tool_call_id\": \"0\",\n \"results\": {\n{% for doc in documents %}\n \"{{ loop.index0 }}\": {{doc|tojson}}{% if not loop.last %},\n {% endif %}\n{% endfor %}\n\n },\n \"is_error\": null\n }\n]<|END_TOOL_RESULT|><|END_OF_TURN_TOKEN|>{%- endmacro %}\n{%- macro tool_call_id_to_int(messages, tool_call_id) %}\n{%- set counter = namespace(value=0) %}\n{%- set tool_call_id_seen = namespace(value=false) %}\n{%- for msg in messages %}\n {%- if msg.tool_calls %}\n {%- for tool_call in msg.tool_calls %}\n {%- if tool_call.id == tool_call_id and not tool_call_id_seen.value -%}\n {{ counter.value }}\n {%- set tool_call_id_seen.value = true %}\n {%- endif %}\n {%- set counter.value = counter.value + 1 %}\n {%- endfor %}\n {%- endif %}\n{%- endfor %}\n{%- endmacro %}\n{%- macro format_tool_message(messages, tool_msg) -%}\n{# format tool message #}\n {\n \"tool_call_id\": \"{{ tool_call_id_to_int(messages, tool_msg.tool_call_id) }}\",\n \"results\": {\n \"0\": {{ tool_msg.content|tojson }}\n },\n \"is_error\": null\n }\n{%- endmacro -%}\n{%- if messages and messages[0]['role']|lower == 'system' %}{%- set developer_preamble = messages[0]['content'] %}{% endif %}\n{%- set tool_idx = namespace(value=0) %}\n{%- set tool_ids_seen = namespace(value=[]) %}\n{%- set sent_documents = namespace(value=false) %}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|># System Preamble\nYou are in contextual safety mode. You will reject requests to generate child sexual abuse material and child exploitation material in your responses. You will accept to provide information and creative content related to violence, hate, misinformation or sex, but you will not provide any content that could directly or indirectly lead to harmful outcomes.\n\nYour information cutoff date is June 2024.\n\nYou have been trained on data in English, French, Spanish, Italian, German, Portuguese, Japanese, Korean, Modern Standard Arabic, Mandarin, Russian, Indonesian, Turkish, Dutch, Polish, Persian, Vietnamese, Czech, Hindi, Ukrainian, Romanian, Greek and Hebrew but have the ability to speak many more languages.\n{% if tools or documents %}\n\nYou have been trained to have advanced reasoning and tool-use capabilities and you should make best use of these skills to serve user's requests.\n\n## Tool Use\nThink about how you can make best use of the provided tools to help with the task and come up with a high level plan that you will execute first.\n\n0. Start by writing <|START_THINKING|> followed by a detailed step by step plan of how you will solve the problem. For each step explain your thinking fully and give details of required tool calls (if needed). Unless specified otherwise, you write your plan in natural language. When you finish, close it out with <|END_THINKING|>.\n You can optionally choose to skip this step when the user request is so straightforward to address that only a trivial plan would be needed.\n NOTE: You MUST skip this step when you are directly responding to the user's request without using any tools.\n\nThen carry out your plan by repeatedly executing the following steps.\n1. Action: write <|START_ACTION|> followed by a list of JSON-formatted tool calls, with each one containing \"tool_name\" and \"parameters\" fields.\n When there are multiple tool calls which are completely independent of each other (i.e. they can be executed in parallel), you should list them out all together in one step. When you finish, close it out with <|END_ACTION|>.\n2. Observation: you will then receive results of those tool calls in JSON format in the very next turn, wrapped around by <|START_TOOL_RESULT|> and <|END_TOOL_RESULT|>. Carefully observe those results and think about what to do next. Note that these results will be provided to you in a separate turn. NEVER hallucinate results.\n Every tool call produces a list of results (when a tool call produces no result or a single result, it'll still get wrapped inside a list). Each result is clearly linked to its originating tool call via its \"tool_call_id\".\n3. Reflection: start the next turn by writing <|START_THINKING|> followed by what you've figured out so far, any changes you need to make to your plan, and what you will do next. When you finish, close it out with <|END_THINKING|>.\n You can optionally choose to skip this step when everything is going according to plan and no special pieces of information or reasoning chains need to be recorded.\n NOTE: You MUST skip this step when you are done with tool-use actions and are ready to respond to the user.\n\nYou can repeat the above 3 steps multiple times (could be 0 times too if no suitable tool calls are available or needed), until you decide it's time to finally respond to the user.\n\n4. Response: then break out of the loop and write <|START_RESPONSE|> followed by a piece of text which serves as a response to the user's last request. Use all previous tool calls and results to help you when formulating your response. When you finish, close it out with <|END_RESPONSE|>.\n{% if enable_citations %}\n\n## Grounding\nImportantly, note that \"Reflection\" and \"Response\" above can be grounded.\nGrounding means you associate pieces of texts (called \"spans\") with those specific tool results that support them (called \"sources\"). And you use a pair of tags \"\" and \"\" to indicate when a span can be grounded onto a list of sources, listing them out in the closing tag. Sources from the same tool call are grouped together and listed as \"{tool_call_id}:[{list of result indices}]\", before they are joined together by \",\". E.g., \"span\" means that \"span\" is supported by result 1 and 2 from \"tool_call_id=0\" as well as result 0 from \"tool_call_id=1\".\n{% endif %}\n\n## Available Tools\nHere is the list of tools that you have available to you.\nYou can ONLY use the tools listed here. When a tool is not listed below, it is NOT available and you should NEVER attempt to use it.\nEach tool is represented as a JSON object with fields like \"name\", \"description\", \"parameters\" (per JSON Schema), and optionally, \"responses\" (per JSON Schema).\n\n```json\n[\n{% if documents %}\n {\"name\": \"direct-injected-document\", \"description\": \"This is a special tool to directly inject user-uploaded documents into the chat as additional context. DO NOT use this tool by yourself!\", \"parameters\": {\"type\": \"object\", \"properties\": {}, \"required\": []}, \"responses\": {\"200\": {\"description\": \"Successfully returned a list of chunked text snippets from the directly uploaded documents.\", \"content\": {\"application/json\": {\"schema\": {\"type\": \"array\", \"items\": {\"type\": \"object\", \"required\": [\"url\", \"snippet\"], \"properties\": {\"url\": {\"type\": \"string\", \"description\": \"The url of the uploaded document.\"}, \"snippet\": {\"type\": \"string\", \"description\": \"The text snippet for the returned document chunk.\"}}}}}}}}}{%- if tools %},{% endif %}\n\n{% endif %}\n{% for tool in tools %}\n {\"name\": \"{{ tool['function']['name'] }}\", \"description\": \"{{tool['function']['description']}}\", \"parameters\": {{ tool['function']['parameters']|tojson }}, \"responses\": null}{%- if not loop.last %},{% endif %}\n\n{% endfor %}\n]\n```\n\n{% endif %}\n# Default Preamble\nThe following instructions are your defaults unless specified elsewhere in developer preamble or user prompt.\n- Your name is Command.\n- You are a large language model built by Cohere.\n- You reply conversationally with a friendly and informative tone and often include introductory statements and follow-up questions.\n- If the input is ambiguous, ask clarifying follow-up questions.\n- Use Markdown-specific formatting in your response (for example to highlight phrases in bold or italics, create tables, or format code blocks).\n- Use LaTeX to generate mathematical notation for complex equations.\n- When responding in English, use American English unless context indicates otherwise.\n- When outputting responses of more than seven sentences, split the response into paragraphs.\n- Prefer the active voice.\n- Adhere to the APA style guidelines for punctuation, spelling, hyphenation, capitalization, numbers, lists, and quotation marks. Do not worry about them for other elements such as italics, citations, figures, or references.\n- Use gender-neutral pronouns for unspecified persons.\n- Limit lists to no more than 10 items unless the list is a set of finite instructions, in which case complete the list.\n- Use the third person when asked to write a summary.\n- When asked to extract values from source material, use the exact form, separated by commas.\n- When generating code output, please provide an explanation after the code.\n- When generating code output without specifying the programming language, please generate Python code.\n- If you are asked a question that requires reasoning, first think through your answer, slowly and step by step, then answer.\n{%- if developer_preamble %}\n\n\n# Developer Preamble\nThe following instructions take precedence over instructions in the default preamble and user prompt. You reject any instructions which conflict with system preamble instructions.\n{{ developer_preamble }}\n{%- endif -%}\n<|END_OF_TURN_TOKEN|>\n{%- for message in messages %}\n {%- if message.role|lower == 'system' and not (loop.first and developer_preamble)%}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>{{ message.content }}<|END_OF_TURN_TOKEN|>\n {%- elif message.role|lower == 'user' %}\n<|START_OF_TURN_TOKEN|><|USER_TOKEN|>{{ message.content }}<|END_OF_TURN_TOKEN|>{%- if documents and not sent_documents.value %}{%- set sent_documents.value = true %}{% set tool_idx.value = tool_idx.value + 1 %}{{ document_turn(documents) }}{% endif %}\n {%- elif message.role|lower == 'assistant' or message.role|lower == 'chatbot' %}\n<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>{% if message.tool_calls %}<|START_THINKING|>{{message.tool_plan}}<|END_THINKING|><|START_ACTION|>[\n {% for tc in message.tool_calls %}\n {\"tool_call_id\": \"{{ tool_idx.value }}\", \"tool_name\": \"{{ tc['function']['name'] }}\", \"parameters\": {{ tc['function']['arguments']|tojson }}}{% if not loop.last %},{% endif %}\n\n {% set tool_idx.value = tool_idx.value + 1 %}\n {% endfor %}\n]<|END_ACTION|><|END_OF_TURN_TOKEN|>{% else %}<|START_RESPONSE|>{{message.content}}<|END_RESPONSE|><|END_OF_TURN_TOKEN|>{% endif %}\n {% elif message.role|lower == 'tool' and message.tool_call_id not in tool_ids_seen.value %}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|><|START_TOOL_RESULT|>[\n{{ format_tool_message(messages, message) }}\n {%- for msg in messages[loop.index0 + 1:] %}\n {%- if msg.role|lower == 'tool' %},\n{{ format_tool_message(messages, msg) }}\n {%- set tool_ids_seen.value = tool_ids_seen.value + [msg.tool_call_id] %}\n {%- else %}\n {%- break %}\n {%- endif %}\n {%- endfor %}\n\n]<|END_TOOL_RESULT|><|END_OF_TURN_TOKEN|>\n {%- endif %}\n{%- endfor %}<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>\n{%- else -%}\n{% if messages[0]['role'] == 'system' %}{% set loop_messages = messages[1:] %}\n {%- set system_message = messages[0]['content'] %}{% elif false == true %}\n {%- set loop_messages = messages %}{% set system_message = '' %}\n{%- else %}\n {%- set loop_messages = messages %}\n {%- set system_message = false %}\n{%- endif %}\n{%- if system_message != false -%}\n {{ '<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>' + system_message + '<|END_OF_TURN_TOKEN|>' }}\n{%- else -%}\n {{ '<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|><|END_OF_TURN_TOKEN|>' }}\n{%- endif %}\n{%- for message in loop_messages %}\n {%- if (message['role'] == 'user') != (loop.index0 % 2 == 0) -%}\n {{ raise_exception('Conversation roles must alternate user/assistant/user/assistant/...') }}\n {%- endif -%}\n {%- set content = message['content'] -%}\n {%- if message['role'] == 'user' -%}\n {{ '<|START_OF_TURN_TOKEN|><|USER_TOKEN|>' + content.strip() + '<|END_OF_TURN_TOKEN|>' }}\n {%- elif message['role'] == 'assistant' -%}\n {{ '<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|><|START_RESPONSE|>' + content.strip() + '<|END_RESPONSE|><|END_OF_TURN_TOKEN|>' }}\n {%- endif %}\n{%- endfor %}\n{%- if add_generation_prompt -%}\n {{ '<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|><|START_RESPONSE|>' }}\n{%- endif %}\n{% endif %}" + }, + { + "name": "tool_use", + "template": "{%- macro document_turn(documents) -%}\n{# format documents into chat turn #}\n<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|><|START_THINKING|>I will look through the document to address the users needs.<|END_THINKING|><|START_ACTION|>[\n {\"tool_call_id\": \"0\", \"tool_name\": \"direct-injected-document\", \"parameters\": {}}\n]<|END_ACTION|><|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|><|START_TOOL_RESULT|>[\n {\n \"tool_call_id\": \"0\",\n \"results\": {\n{% for doc in documents %}\n \"{{ loop.index0 }}\": {{doc|tojson}}{% if not loop.last %},\n {% endif %}\n{% endfor %}\n\n },\n \"is_error\": null\n }\n]<|END_TOOL_RESULT|><|END_OF_TURN_TOKEN|>{%- endmacro %}\n{%- macro tool_call_id_to_int(messages, tool_call_id) %}\n{%- set counter = namespace(value=0) %}\n{%- set tool_call_id_seen = namespace(value=false) %}\n{%- for msg in messages %}\n {%- if msg.tool_calls %}\n {%- for tool_call in msg.tool_calls %}\n {%- if tool_call.id == tool_call_id and not tool_call_id_seen.value -%}\n {{ counter.value }}\n {%- set tool_call_id_seen.value = true %}\n {%- endif %}\n {%- set counter.value = counter.value + 1 %}\n {%- endfor %}\n {%- endif %}\n{%- endfor %}\n{%- endmacro %}\n{%- macro format_tool_message(messages, tool_msg) -%}\n{# format tool message #}\n {\n \"tool_call_id\": \"{{ tool_call_id_to_int(messages, tool_msg.tool_call_id) }}\",\n \"results\": {\n \"0\": {{ tool_msg.content|tojson }}\n },\n \"is_error\": null\n }\n{%- endmacro -%}\n{%- if messages and messages[0]['role']|lower == 'system' %}{%- set developer_preamble = messages[0]['content'] %}{% endif %}\n{%- set tool_idx = namespace(value=0) %}\n{%- set tool_ids_seen = namespace(value=[]) %}\n{%- set sent_documents = namespace(value=false) %}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|># System Preamble\nYou are in contextual safety mode. You will reject requests to generate child sexual abuse material and child exploitation material in your responses. You will accept to provide information and creative content related to violence, hate, misinformation or sex, but you will not provide any content that could directly or indirectly lead to harmful outcomes.\n\nYour information cutoff date is June 2024.\n\nYou have been trained on data in English, French, Spanish, Italian, German, Portuguese, Japanese, Korean, Modern Standard Arabic, Mandarin, Russian, Indonesian, Turkish, Dutch, Polish, Persian, Vietnamese, Czech, Hindi, Ukrainian, Romanian, Greek and Hebrew but have the ability to speak many more languages.\n{% if tools or documents %}\n\nYou have been trained to have advanced reasoning and tool-use capabilities and you should make best use of these skills to serve user's requests.\n\n## Tool Use\nThink about how you can make best use of the provided tools to help with the task and come up with a high level plan that you will execute first.\n\n0. Start by writing <|START_THINKING|> followed by a detailed step by step plan of how you will solve the problem. For each step explain your thinking fully and give details of required tool calls (if needed). Unless specified otherwise, you write your plan in natural language. When you finish, close it out with <|END_THINKING|>.\n You can optionally choose to skip this step when the user request is so straightforward to address that only a trivial plan would be needed.\n NOTE: You MUST skip this step when you are directly responding to the user's request without using any tools.\n\nThen carry out your plan by repeatedly executing the following steps.\n1. Action: write <|START_ACTION|> followed by a list of JSON-formatted tool calls, with each one containing \"tool_name\" and \"parameters\" fields.\n When there are multiple tool calls which are completely independent of each other (i.e. they can be executed in parallel), you should list them out all together in one step. When you finish, close it out with <|END_ACTION|>.\n2. Observation: you will then receive results of those tool calls in JSON format in the very next turn, wrapped around by <|START_TOOL_RESULT|> and <|END_TOOL_RESULT|>. Carefully observe those results and think about what to do next. Note that these results will be provided to you in a separate turn. NEVER hallucinate results.\n Every tool call produces a list of results (when a tool call produces no result or a single result, it'll still get wrapped inside a list). Each result is clearly linked to its originating tool call via its \"tool_call_id\".\n3. Reflection: start the next turn by writing <|START_THINKING|> followed by what you've figured out so far, any changes you need to make to your plan, and what you will do next. When you finish, close it out with <|END_THINKING|>.\n You can optionally choose to skip this step when everything is going according to plan and no special pieces of information or reasoning chains need to be recorded.\n NOTE: You MUST skip this step when you are done with tool-use actions and are ready to respond to the user.\n\nYou can repeat the above 3 steps multiple times (could be 0 times too if no suitable tool calls are available or needed), until you decide it's time to finally respond to the user.\n\n4. Response: then break out of the loop and write <|START_RESPONSE|> followed by a piece of text which serves as a response to the user's last request. Use all previous tool calls and results to help you when formulating your response. When you finish, close it out with <|END_RESPONSE|>.\n{% if enable_citations %}\n\n## Grounding\nImportantly, note that \"Reflection\" and \"Response\" above can be grounded.\nGrounding means you associate pieces of texts (called \"spans\") with those specific tool results that support them (called \"sources\"). And you use a pair of tags \"\" and \"\" to indicate when a span can be grounded onto a list of sources, listing them out in the closing tag. Sources from the same tool call are grouped together and listed as \"{tool_call_id}:[{list of result indices}]\", before they are joined together by \",\". E.g., \"span\" means that \"span\" is supported by result 1 and 2 from \"tool_call_id=0\" as well as result 0 from \"tool_call_id=1\".\n{% endif %}\n\n## Available Tools\nHere is the list of tools that you have available to you.\nYou can ONLY use the tools listed here. When a tool is not listed below, it is NOT available and you should NEVER attempt to use it.\nEach tool is represented as a JSON object with fields like \"name\", \"description\", \"parameters\" (per JSON Schema), and optionally, \"responses\" (per JSON Schema).\n\n```json\n[\n{% if documents %}\n {\"name\": \"direct-injected-document\", \"description\": \"This is a special tool to directly inject user-uploaded documents into the chat as additional context. DO NOT use this tool by yourself!\", \"parameters\": {\"type\": \"object\", \"properties\": {}, \"required\": []}, \"responses\": {\"200\": {\"description\": \"Successfully returned a list of chunked text snippets from the directly uploaded documents.\", \"content\": {\"application/json\": {\"schema\": {\"type\": \"array\", \"items\": {\"type\": \"object\", \"required\": [\"url\", \"snippet\"], \"properties\": {\"url\": {\"type\": \"string\", \"description\": \"The url of the uploaded document.\"}, \"snippet\": {\"type\": \"string\", \"description\": \"The text snippet for the returned document chunk.\"}}}}}}}}}{%- if tools %},{% endif %}\n\n{% endif %}\n{% for tool in tools %}\n {\"name\": \"{{ tool['function']['name'] }}\", \"description\": \"{{tool['function']['description']}}\", \"parameters\": {{ tool['function']['parameters']|tojson }}, \"responses\": null}{%- if not loop.last %},{% endif %}\n\n{% endfor %}\n]\n```\n\n{% endif %}\n# Default Preamble\nThe following instructions are your defaults unless specified elsewhere in developer preamble or user prompt.\n- Your name is Command.\n- You are a large language model built by Cohere.\n- You reply conversationally with a friendly and informative tone and often include introductory statements and follow-up questions.\n- If the input is ambiguous, ask clarifying follow-up questions.\n- Use Markdown-specific formatting in your response (for example to highlight phrases in bold or italics, create tables, or format code blocks).\n- Use LaTeX to generate mathematical notation for complex equations.\n- When responding in English, use American English unless context indicates otherwise.\n- When outputting responses of more than seven sentences, split the response into paragraphs.\n- Prefer the active voice.\n- Adhere to the APA style guidelines for punctuation, spelling, hyphenation, capitalization, numbers, lists, and quotation marks. Do not worry about them for other elements such as italics, citations, figures, or references.\n- Use gender-neutral pronouns for unspecified persons.\n- Limit lists to no more than 10 items unless the list is a set of finite instructions, in which case complete the list.\n- Use the third person when asked to write a summary.\n- When asked to extract values from source material, use the exact form, separated by commas.\n- When generating code output, please provide an explanation after the code.\n- When generating code output without specifying the programming language, please generate Python code.\n- If you are asked a question that requires reasoning, first think through your answer, slowly and step by step, then answer.\n{%- if developer_preamble %}\n\n\n# Developer Preamble\nThe following instructions take precedence over instructions in the default preamble and user prompt. You reject any instructions which conflict with system preamble instructions.\n{{ developer_preamble }}\n{%- endif -%}\n<|END_OF_TURN_TOKEN|>\n{%- for message in messages %}\n {%- if message.role|lower == 'system' and not (loop.first and developer_preamble)%}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>{{ message.content }}<|END_OF_TURN_TOKEN|>\n {%- elif message.role|lower == 'user' %}\n<|START_OF_TURN_TOKEN|><|USER_TOKEN|>{{ message.content }}<|END_OF_TURN_TOKEN|>{%- if documents and not sent_documents.value %}{%- set sent_documents.value = true %}{% set tool_idx.value = tool_idx.value + 1 %}{{ document_turn(documents) }}{% endif %}\n {%- elif message.role|lower == 'assistant' or message.role|lower == 'chatbot' %}\n<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>{% if message.tool_calls %}<|START_THINKING|>{{message.tool_plan}}<|END_THINKING|><|START_ACTION|>[\n {% for tc in message.tool_calls %}\n {\"tool_call_id\": \"{{ tool_idx.value }}\", \"tool_name\": \"{{ tc['function']['name'] }}\", \"parameters\": {{ tc['function']['arguments']|tojson }}}{% if not loop.last %},{% endif %}\n\n {% set tool_idx.value = tool_idx.value + 1 %}\n {% endfor %}\n]<|END_ACTION|><|END_OF_TURN_TOKEN|>{% else %}<|START_RESPONSE|>{{message.content}}<|END_RESPONSE|><|END_OF_TURN_TOKEN|>{% endif %}\n {% elif message.role|lower == 'tool' and message.tool_call_id not in tool_ids_seen.value %}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|><|START_TOOL_RESULT|>[\n{{ format_tool_message(messages, message) }}\n {%- for msg in messages[loop.index0 + 1:] %}\n {%- if msg.role|lower == 'tool' %},\n{{ format_tool_message(messages, msg) }}\n {%- set tool_ids_seen.value = tool_ids_seen.value + [msg.tool_call_id] %}\n {%- else %}\n {%- break %}\n {%- endif %}\n {%- endfor %}\n\n]<|END_TOOL_RESULT|><|END_OF_TURN_TOKEN|>\n {%- endif %}\n{%- endfor %}<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>" + }, + { + "name": "rag", + "template": "{% set tools = [] %}\n{%- macro document_turn(documents) -%}\n{# format documents into chat turn #}\n<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|><|START_THINKING|>I will look through the document to address the users needs.<|END_THINKING|><|START_ACTION|>[\n {\"tool_call_id\": \"0\", \"tool_name\": \"direct-injected-document\", \"parameters\": {}}\n]<|END_ACTION|><|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|><|START_TOOL_RESULT|>[\n {\n \"tool_call_id\": \"0\",\n \"results\": {\n{% for doc in documents %}\n \"{{ loop.index0 }}\": {{doc|tojson}}{% if not loop.last %},\n {% endif %}\n{% endfor %}\n\n },\n \"is_error\": null\n }\n]<|END_TOOL_RESULT|><|END_OF_TURN_TOKEN|>{%- endmacro %}\n{%- macro tool_call_id_to_int(messages, tool_call_id) %}\n{%- set counter = namespace(value=0) %}\n{%- set tool_call_id_seen = namespace(value=false) %}\n{%- for msg in messages %}\n {%- if msg.tool_calls %}\n {%- for tool_call in msg.tool_calls %}\n {%- if tool_call.id == tool_call_id and not tool_call_id_seen.value -%}\n {{ counter.value }}\n {%- set tool_call_id_seen.value = true %}\n {%- endif %}\n {%- set counter.value = counter.value + 1 %}\n {%- endfor %}\n {%- endif %}\n{%- endfor %}\n{%- endmacro %}\n{%- macro format_tool_message(messages, tool_msg) -%}\n{# format tool message #}\n {\n \"tool_call_id\": \"{{ tool_call_id_to_int(messages, tool_msg.tool_call_id) }}\",\n \"results\": {\n \"0\": {{ tool_msg.content|tojson }}\n },\n \"is_error\": null\n }\n{%- endmacro -%}\n{%- if messages and messages[0]['role']|lower == 'system' %}{%- set developer_preamble = messages[0]['content'] %}{% endif %}\n{%- set tool_idx = namespace(value=0) %}\n{%- set tool_ids_seen = namespace(value=[]) %}\n{%- set sent_documents = namespace(value=false) %}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|># System Preamble\nYou are in contextual safety mode. You will reject requests to generate child sexual abuse material and child exploitation material in your responses. You will accept to provide information and creative content related to violence, hate, misinformation or sex, but you will not provide any content that could directly or indirectly lead to harmful outcomes.\n\nYour information cutoff date is June 2024.\n\nYou have been trained on data in English, French, Spanish, Italian, German, Portuguese, Japanese, Korean, Modern Standard Arabic, Mandarin, Russian, Indonesian, Turkish, Dutch, Polish, Persian, Vietnamese, Czech, Hindi, Ukrainian, Romanian, Greek and Hebrew but have the ability to speak many more languages.\n{% if tools or documents %}\n\nYou have been trained to have advanced reasoning and tool-use capabilities and you should make best use of these skills to serve user's requests.\n\n## Tool Use\nThink about how you can make best use of the provided tools to help with the task and come up with a high level plan that you will execute first.\n\n0. Start by writing <|START_THINKING|> followed by a detailed step by step plan of how you will solve the problem. For each step explain your thinking fully and give details of required tool calls (if needed). Unless specified otherwise, you write your plan in natural language. When you finish, close it out with <|END_THINKING|>.\n You can optionally choose to skip this step when the user request is so straightforward to address that only a trivial plan would be needed.\n NOTE: You MUST skip this step when you are directly responding to the user's request without using any tools.\n\nThen carry out your plan by repeatedly executing the following steps.\n1. Action: write <|START_ACTION|> followed by a list of JSON-formatted tool calls, with each one containing \"tool_name\" and \"parameters\" fields.\n When there are multiple tool calls which are completely independent of each other (i.e. they can be executed in parallel), you should list them out all together in one step. When you finish, close it out with <|END_ACTION|>.\n2. Observation: you will then receive results of those tool calls in JSON format in the very next turn, wrapped around by <|START_TOOL_RESULT|> and <|END_TOOL_RESULT|>. Carefully observe those results and think about what to do next. Note that these results will be provided to you in a separate turn. NEVER hallucinate results.\n Every tool call produces a list of results (when a tool call produces no result or a single result, it'll still get wrapped inside a list). Each result is clearly linked to its originating tool call via its \"tool_call_id\".\n3. Reflection: start the next turn by writing <|START_THINKING|> followed by what you've figured out so far, any changes you need to make to your plan, and what you will do next. When you finish, close it out with <|END_THINKING|>.\n You can optionally choose to skip this step when everything is going according to plan and no special pieces of information or reasoning chains need to be recorded.\n NOTE: You MUST skip this step when you are done with tool-use actions and are ready to respond to the user.\n\nYou can repeat the above 3 steps multiple times (could be 0 times too if no suitable tool calls are available or needed), until you decide it's time to finally respond to the user.\n\n4. Response: then break out of the loop and write <|START_RESPONSE|> followed by a piece of text which serves as a response to the user's last request. Use all previous tool calls and results to help you when formulating your response. When you finish, close it out with <|END_RESPONSE|>.\n{% if enable_citations %}\n\n## Grounding\nImportantly, note that \"Reflection\" and \"Response\" above can be grounded.\nGrounding means you associate pieces of texts (called \"spans\") with those specific tool results that support them (called \"sources\"). And you use a pair of tags \"\" and \"\" to indicate when a span can be grounded onto a list of sources, listing them out in the closing tag. Sources from the same tool call are grouped together and listed as \"{tool_call_id}:[{list of result indices}]\", before they are joined together by \",\". E.g., \"span\" means that \"span\" is supported by result 1 and 2 from \"tool_call_id=0\" as well as result 0 from \"tool_call_id=1\".\n{% endif %}\n\n## Available Tools\nHere is the list of tools that you have available to you.\nYou can ONLY use the tools listed here. When a tool is not listed below, it is NOT available and you should NEVER attempt to use it.\nEach tool is represented as a JSON object with fields like \"name\", \"description\", \"parameters\" (per JSON Schema), and optionally, \"responses\" (per JSON Schema).\n\n```json\n[\n{% if documents %}\n {\"name\": \"direct-injected-document\", \"description\": \"This is a special tool to directly inject user-uploaded documents into the chat as additional context. DO NOT use this tool by yourself!\", \"parameters\": {\"type\": \"object\", \"properties\": {}, \"required\": []}, \"responses\": {\"200\": {\"description\": \"Successfully returned a list of chunked text snippets from the directly uploaded documents.\", \"content\": {\"application/json\": {\"schema\": {\"type\": \"array\", \"items\": {\"type\": \"object\", \"required\": [\"url\", \"snippet\"], \"properties\": {\"url\": {\"type\": \"string\", \"description\": \"The url of the uploaded document.\"}, \"snippet\": {\"type\": \"string\", \"description\": \"The text snippet for the returned document chunk.\"}}}}}}}}}{%- if tools %},{% endif %}\n\n{% endif %}\n{% for tool in tools %}\n {\"name\": \"{{ tool['function']['name'] }}\", \"description\": \"{{tool['function']['description']}}\", \"parameters\": {{ tool['function']['parameters']|tojson }}, \"responses\": null}{%- if not loop.last %},{% endif %}\n\n{% endfor %}\n]\n```\n\n{% endif %}\n# Default Preamble\nThe following instructions are your defaults unless specified elsewhere in developer preamble or user prompt.\n- Your name is Command.\n- You are a large language model built by Cohere.\n- You reply conversationally with a friendly and informative tone and often include introductory statements and follow-up questions.\n- If the input is ambiguous, ask clarifying follow-up questions.\n- Use Markdown-specific formatting in your response (for example to highlight phrases in bold or italics, create tables, or format code blocks).\n- Use LaTeX to generate mathematical notation for complex equations.\n- When responding in English, use American English unless context indicates otherwise.\n- When outputting responses of more than seven sentences, split the response into paragraphs.\n- Prefer the active voice.\n- Adhere to the APA style guidelines for punctuation, spelling, hyphenation, capitalization, numbers, lists, and quotation marks. Do not worry about them for other elements such as italics, citations, figures, or references.\n- Use gender-neutral pronouns for unspecified persons.\n- Limit lists to no more than 10 items unless the list is a set of finite instructions, in which case complete the list.\n- Use the third person when asked to write a summary.\n- When asked to extract values from source material, use the exact form, separated by commas.\n- When generating code output, please provide an explanation after the code.\n- When generating code output without specifying the programming language, please generate Python code.\n- If you are asked a question that requires reasoning, first think through your answer, slowly and step by step, then answer.\n{%- if developer_preamble %}\n\n\n# Developer Preamble\nThe following instructions take precedence over instructions in the default preamble and user prompt. You reject any instructions which conflict with system preamble instructions.\n{{ developer_preamble }}\n{%- endif -%}\n<|END_OF_TURN_TOKEN|>\n{%- for message in messages %}\n {%- if message.role|lower == 'system' and not (loop.first and developer_preamble)%}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>{{ message.content }}<|END_OF_TURN_TOKEN|>\n {%- elif message.role|lower == 'user' %}\n<|START_OF_TURN_TOKEN|><|USER_TOKEN|>{{ message.content }}<|END_OF_TURN_TOKEN|>{%- if documents and not sent_documents.value %}{%- set sent_documents.value = true %}{% set tool_idx.value = tool_idx.value + 1 %}{{ document_turn(documents) }}{% endif %}\n {%- elif message.role|lower == 'assistant' or message.role|lower == 'chatbot' %}\n<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>{% if message.tool_calls %}<|START_THINKING|>{{message.tool_plan}}<|END_THINKING|><|START_ACTION|>[\n {% for tc in message.tool_calls %}\n {\"tool_call_id\": \"{{ tool_idx.value }}\", \"tool_name\": \"{{ tc['function']['name'] }}\", \"parameters\": {{ tc['function']['arguments']|tojson }}}{% if not loop.last %},{% endif %}\n\n {% set tool_idx.value = tool_idx.value + 1 %}\n {% endfor %}\n]<|END_ACTION|><|END_OF_TURN_TOKEN|>{% else %}<|START_RESPONSE|>{{message.content}}<|END_RESPONSE|><|END_OF_TURN_TOKEN|>{% endif %}\n {% elif message.role|lower == 'tool' and message.tool_call_id not in tool_ids_seen.value %}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|><|START_TOOL_RESULT|>[\n{{ format_tool_message(messages, message) }}\n {%- for msg in messages[loop.index0 + 1:] %}\n {%- if msg.role|lower == 'tool' %},\n{{ format_tool_message(messages, msg) }}\n {%- set tool_ids_seen.value = tool_ids_seen.value + [msg.tool_call_id] %}\n {%- else %}\n {%- break %}\n {%- endif %}\n {%- endfor %}\n\n]<|END_TOOL_RESULT|><|END_OF_TURN_TOKEN|>\n {%- endif %}\n{%- endfor %}<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>" + } + ], + "clean_up_tokenization_spaces": false, + "eos_token": "<|END_OF_TURN_TOKEN|>", + "extra_special_tokens": {}, + "legacy": true, + "merges_file": null, + "model_max_length": 8192, + "pad_token": "", + "padding_side": "right", + "sp_model_kwargs": {}, + "spaces_between_special_tokens": false, + "tokenizer_class": "CohereTokenizer", + "unk_token": "", + "use_default_system_prompt": false, + "vocab_file": null +} diff --git a/checkpoint-630/trainer_state.json b/checkpoint-630/trainer_state.json new file mode 100644 index 0000000000000000000000000000000000000000..cf40745dc8f94b304ae0753081ac9e6858f70fd5 --- /dev/null +++ b/checkpoint-630/trainer_state.json @@ -0,0 +1,2270 @@ +{ + "best_metric": null, + "best_model_checkpoint": null, + "epoch": 0.2190161654788806, + "eval_steps": 150, + "global_step": 630, + "is_hyper_param_search": false, + "is_local_process_zero": true, + "is_world_process_zero": true, + "log_history": [ + { + "epoch": 0.0006952894142186686, + "grad_norm": 5.413117383066536, + "learning_rate": 6.944444444444445e-07, + "loss": 2.3653, + "step": 2 + }, + { + "epoch": 0.0013905788284373371, + "grad_norm": 5.092870612337868, + "learning_rate": 1.388888888888889e-06, + "loss": 2.5001, + "step": 4 + }, + { + "epoch": 0.0020858682426560054, + "grad_norm": 3.6285625961711943, + "learning_rate": 2.0833333333333334e-06, + "loss": 2.3759, + "step": 6 + }, + { + "epoch": 0.0027811576568746743, + "grad_norm": 2.5025911526151075, + "learning_rate": 2.777777777777778e-06, + "loss": 1.944, + "step": 8 + }, + { + "epoch": 0.0034764470710933427, + "grad_norm": 3.077266049542496, + "learning_rate": 3.4722222222222224e-06, + "loss": 2.2504, + "step": 10 + }, + { + "epoch": 0.004171736485312011, + "grad_norm": 4.068243939187174, + "learning_rate": 4.166666666666667e-06, + "loss": 2.0637, + "step": 12 + }, + { + "epoch": 0.00486702589953068, + "grad_norm": 3.511444738830971, + "learning_rate": 4.861111111111111e-06, + "loss": 2.3604, + "step": 14 + }, + { + "epoch": 0.0055623153137493485, + "grad_norm": 5.925744892256934, + "learning_rate": 5.555555555555556e-06, + "loss": 2.6528, + "step": 16 + }, + { + "epoch": 0.0062576047279680165, + "grad_norm": 2.7950114871483405, + "learning_rate": 6.25e-06, + "loss": 2.3229, + "step": 18 + }, + { + "epoch": 0.006952894142186685, + "grad_norm": 6.586211843766182, + "learning_rate": 6.944444444444445e-06, + "loss": 2.342, + "step": 20 + }, + { + "epoch": 0.0076481835564053535, + "grad_norm": 4.902839955269193, + "learning_rate": 7.63888888888889e-06, + "loss": 2.4188, + "step": 22 + }, + { + "epoch": 0.008343472970624021, + "grad_norm": 4.257062809771645, + "learning_rate": 8.333333333333334e-06, + "loss": 1.7957, + "step": 24 + }, + { + "epoch": 0.009038762384842691, + "grad_norm": 4.460352004615699, + "learning_rate": 9.027777777777777e-06, + "loss": 2.0726, + "step": 26 + }, + { + "epoch": 0.00973405179906136, + "grad_norm": 5.858061506133739, + "learning_rate": 9.722222222222223e-06, + "loss": 2.0455, + "step": 28 + }, + { + "epoch": 0.010429341213280027, + "grad_norm": 4.331946668100709, + "learning_rate": 1.0416666666666668e-05, + "loss": 1.7645, + "step": 30 + }, + { + "epoch": 0.011124630627498697, + "grad_norm": 5.428742204187391, + "learning_rate": 1.1111111111111112e-05, + "loss": 1.7446, + "step": 32 + }, + { + "epoch": 0.011819920041717365, + "grad_norm": 2.485909286541028, + "learning_rate": 1.1805555555555555e-05, + "loss": 1.5885, + "step": 34 + }, + { + "epoch": 0.012515209455936033, + "grad_norm": 3.2602949308730222, + "learning_rate": 1.25e-05, + "loss": 1.1014, + "step": 36 + }, + { + "epoch": 0.013210498870154701, + "grad_norm": 4.962187747415964, + "learning_rate": 1.3194444444444446e-05, + "loss": 1.3588, + "step": 38 + }, + { + "epoch": 0.01390578828437337, + "grad_norm": 7.627756894198461, + "learning_rate": 1.388888888888889e-05, + "loss": 1.4014, + "step": 40 + }, + { + "epoch": 0.014601077698592039, + "grad_norm": 2.821848388410092, + "learning_rate": 1.4583333333333335e-05, + "loss": 1.0959, + "step": 42 + }, + { + "epoch": 0.015296367112810707, + "grad_norm": 10.989320944549025, + "learning_rate": 1.527777777777778e-05, + "loss": 1.739, + "step": 44 + }, + { + "epoch": 0.015991656527029375, + "grad_norm": 4.300936602591115, + "learning_rate": 1.597222222222222e-05, + "loss": 1.1078, + "step": 46 + }, + { + "epoch": 0.016686945941248043, + "grad_norm": 3.7539663261019856, + "learning_rate": 1.6666666666666667e-05, + "loss": 1.2701, + "step": 48 + }, + { + "epoch": 0.017382235355466714, + "grad_norm": 2.589248169352173, + "learning_rate": 1.736111111111111e-05, + "loss": 1.4452, + "step": 50 + }, + { + "epoch": 0.018077524769685382, + "grad_norm": 3.6679301322156177, + "learning_rate": 1.8055555555555555e-05, + "loss": 1.4243, + "step": 52 + }, + { + "epoch": 0.01877281418390405, + "grad_norm": 2.0885660923860074, + "learning_rate": 1.8750000000000002e-05, + "loss": 1.4453, + "step": 54 + }, + { + "epoch": 0.01946810359812272, + "grad_norm": 2.955353237610474, + "learning_rate": 1.9444444444444445e-05, + "loss": 1.5388, + "step": 56 + }, + { + "epoch": 0.020163393012341387, + "grad_norm": 3.0527006398487018, + "learning_rate": 2.013888888888889e-05, + "loss": 1.4043, + "step": 58 + }, + { + "epoch": 0.020858682426560055, + "grad_norm": 1.9862208864154767, + "learning_rate": 2.0833333333333336e-05, + "loss": 1.1007, + "step": 60 + }, + { + "epoch": 0.021553971840778723, + "grad_norm": 2.347361178472164, + "learning_rate": 2.152777777777778e-05, + "loss": 0.9291, + "step": 62 + }, + { + "epoch": 0.022249261254997394, + "grad_norm": 2.4812993223105995, + "learning_rate": 2.2222222222222223e-05, + "loss": 0.9592, + "step": 64 + }, + { + "epoch": 0.022944550669216062, + "grad_norm": 1.639333831845777, + "learning_rate": 2.2916666666666667e-05, + "loss": 1.0645, + "step": 66 + }, + { + "epoch": 0.02363984008343473, + "grad_norm": 2.92858351082494, + "learning_rate": 2.361111111111111e-05, + "loss": 1.4269, + "step": 68 + }, + { + "epoch": 0.024335129497653398, + "grad_norm": 2.8503434812871604, + "learning_rate": 2.4305555555555558e-05, + "loss": 0.7829, + "step": 70 + }, + { + "epoch": 0.025030418911872066, + "grad_norm": 2.4875590459354107, + "learning_rate": 2.5e-05, + "loss": 0.9733, + "step": 72 + }, + { + "epoch": 0.025725708326090734, + "grad_norm": 5.2567545525905075, + "learning_rate": 2.5694444444444445e-05, + "loss": 1.3559, + "step": 74 + }, + { + "epoch": 0.026420997740309402, + "grad_norm": 4.68745753567611, + "learning_rate": 2.6388888888888892e-05, + "loss": 1.1499, + "step": 76 + }, + { + "epoch": 0.027116287154528074, + "grad_norm": 2.810345453706711, + "learning_rate": 2.7083333333333332e-05, + "loss": 0.8636, + "step": 78 + }, + { + "epoch": 0.02781157656874674, + "grad_norm": 3.0144493626195388, + "learning_rate": 2.777777777777778e-05, + "loss": 0.9274, + "step": 80 + }, + { + "epoch": 0.02850686598296541, + "grad_norm": 2.3263036535508523, + "learning_rate": 2.8472222222222223e-05, + "loss": 1.3979, + "step": 82 + }, + { + "epoch": 0.029202155397184078, + "grad_norm": 1.6009019341419857, + "learning_rate": 2.916666666666667e-05, + "loss": 0.9039, + "step": 84 + }, + { + "epoch": 0.029897444811402746, + "grad_norm": 2.0637506891442294, + "learning_rate": 2.9861111111111113e-05, + "loss": 1.5187, + "step": 86 + }, + { + "epoch": 0.030592734225621414, + "grad_norm": 1.5533001268209932, + "learning_rate": 3.055555555555556e-05, + "loss": 0.8937, + "step": 88 + }, + { + "epoch": 0.03128802363984008, + "grad_norm": 1.9974857545819733, + "learning_rate": 3.125e-05, + "loss": 0.8218, + "step": 90 + }, + { + "epoch": 0.03198331305405875, + "grad_norm": 1.871899331408953, + "learning_rate": 3.194444444444444e-05, + "loss": 1.2451, + "step": 92 + }, + { + "epoch": 0.03267860246827742, + "grad_norm": 1.591601830348497, + "learning_rate": 3.263888888888889e-05, + "loss": 0.7485, + "step": 94 + }, + { + "epoch": 0.033373891882496086, + "grad_norm": 2.404166647711005, + "learning_rate": 3.3333333333333335e-05, + "loss": 1.1587, + "step": 96 + }, + { + "epoch": 0.03406918129671476, + "grad_norm": 1.581080788392888, + "learning_rate": 3.402777777777778e-05, + "loss": 0.9578, + "step": 98 + }, + { + "epoch": 0.03476447071093343, + "grad_norm": 2.1551207338771547, + "learning_rate": 3.472222222222222e-05, + "loss": 1.1305, + "step": 100 + }, + { + "epoch": 0.0354597601251521, + "grad_norm": 4.2246272812704, + "learning_rate": 3.541666666666667e-05, + "loss": 1.04, + "step": 102 + }, + { + "epoch": 0.036155049539370765, + "grad_norm": 2.5526898161765588, + "learning_rate": 3.611111111111111e-05, + "loss": 1.0743, + "step": 104 + }, + { + "epoch": 0.03685033895358943, + "grad_norm": 1.9784815137623597, + "learning_rate": 3.6805555555555556e-05, + "loss": 0.9667, + "step": 106 + }, + { + "epoch": 0.0375456283678081, + "grad_norm": 1.9131648200880944, + "learning_rate": 3.7500000000000003e-05, + "loss": 0.8951, + "step": 108 + }, + { + "epoch": 0.03824091778202677, + "grad_norm": 3.9405296351174575, + "learning_rate": 3.8194444444444444e-05, + "loss": 1.222, + "step": 110 + }, + { + "epoch": 0.03893620719624544, + "grad_norm": 13.764861545850291, + "learning_rate": 3.888888888888889e-05, + "loss": 1.0497, + "step": 112 + }, + { + "epoch": 0.039631496610464105, + "grad_norm": 3.998123122175411, + "learning_rate": 3.958333333333333e-05, + "loss": 1.0901, + "step": 114 + }, + { + "epoch": 0.04032678602468277, + "grad_norm": 3.126193921423756, + "learning_rate": 4.027777777777778e-05, + "loss": 1.1143, + "step": 116 + }, + { + "epoch": 0.04102207543890144, + "grad_norm": 2.7839926692610613, + "learning_rate": 4.0972222222222225e-05, + "loss": 1.1637, + "step": 118 + }, + { + "epoch": 0.04171736485312011, + "grad_norm": 2.591162621161276, + "learning_rate": 4.166666666666667e-05, + "loss": 1.0624, + "step": 120 + }, + { + "epoch": 0.04241265426733878, + "grad_norm": 1.4930703711545332, + "learning_rate": 4.236111111111111e-05, + "loss": 1.0239, + "step": 122 + }, + { + "epoch": 0.043107943681557445, + "grad_norm": 4.355150070532966, + "learning_rate": 4.305555555555556e-05, + "loss": 1.266, + "step": 124 + }, + { + "epoch": 0.04380323309577612, + "grad_norm": 1.8285608876277135, + "learning_rate": 4.375e-05, + "loss": 1.0667, + "step": 126 + }, + { + "epoch": 0.04449852250999479, + "grad_norm": 2.1848832742617055, + "learning_rate": 4.4444444444444447e-05, + "loss": 0.7549, + "step": 128 + }, + { + "epoch": 0.045193811924213456, + "grad_norm": 3.547857947451226, + "learning_rate": 4.5138888888888894e-05, + "loss": 0.7974, + "step": 130 + }, + { + "epoch": 0.045889101338432124, + "grad_norm": 3.372457028128184, + "learning_rate": 4.5833333333333334e-05, + "loss": 1.0482, + "step": 132 + }, + { + "epoch": 0.04658439075265079, + "grad_norm": 2.2871138548091703, + "learning_rate": 4.652777777777778e-05, + "loss": 0.8246, + "step": 134 + }, + { + "epoch": 0.04727968016686946, + "grad_norm": 1.7489408054743605, + "learning_rate": 4.722222222222222e-05, + "loss": 1.0011, + "step": 136 + }, + { + "epoch": 0.04797496958108813, + "grad_norm": 1.944650349232646, + "learning_rate": 4.791666666666667e-05, + "loss": 0.7828, + "step": 138 + }, + { + "epoch": 0.048670258995306796, + "grad_norm": 2.321619459307342, + "learning_rate": 4.8611111111111115e-05, + "loss": 1.02, + "step": 140 + }, + { + "epoch": 0.049365548409525464, + "grad_norm": 5.317732559595606, + "learning_rate": 4.930555555555556e-05, + "loss": 0.9539, + "step": 142 + }, + { + "epoch": 0.05006083782374413, + "grad_norm": 1.5887292172279854, + "learning_rate": 5e-05, + "loss": 0.7961, + "step": 144 + }, + { + "epoch": 0.0507561272379628, + "grad_norm": 2.9987019111854964, + "learning_rate": 5.069444444444444e-05, + "loss": 1.0018, + "step": 146 + }, + { + "epoch": 0.05145141665218147, + "grad_norm": 5.63878906132749, + "learning_rate": 5.138888888888889e-05, + "loss": 0.9278, + "step": 148 + }, + { + "epoch": 0.052146706066400136, + "grad_norm": 2.4849685204332834, + "learning_rate": 5.208333333333334e-05, + "loss": 0.7531, + "step": 150 + }, + { + "epoch": 0.052146706066400136, + "eval_loss": 0.9286500215530396, + "eval_runtime": 711.2619, + "eval_samples_per_second": 6.808, + "eval_steps_per_second": 0.214, + "step": 150 + }, + { + "epoch": 0.052841995480618804, + "grad_norm": 3.4927981580288776, + "learning_rate": 5.2777777777777784e-05, + "loss": 0.7422, + "step": 152 + }, + { + "epoch": 0.05353728489483748, + "grad_norm": 2.6593724943984682, + "learning_rate": 5.3472222222222224e-05, + "loss": 0.7762, + "step": 154 + }, + { + "epoch": 0.05423257430905615, + "grad_norm": 2.99709354088536, + "learning_rate": 5.4166666666666664e-05, + "loss": 0.8658, + "step": 156 + }, + { + "epoch": 0.054927863723274815, + "grad_norm": 3.9196361623391414, + "learning_rate": 5.486111111111112e-05, + "loss": 1.1783, + "step": 158 + }, + { + "epoch": 0.05562315313749348, + "grad_norm": 3.022562685608673, + "learning_rate": 5.555555555555556e-05, + "loss": 1.0602, + "step": 160 + }, + { + "epoch": 0.05631844255171215, + "grad_norm": 3.292942684053579, + "learning_rate": 5.6250000000000005e-05, + "loss": 0.8561, + "step": 162 + }, + { + "epoch": 0.05701373196593082, + "grad_norm": 2.397775023338686, + "learning_rate": 5.6944444444444445e-05, + "loss": 0.9561, + "step": 164 + }, + { + "epoch": 0.05770902138014949, + "grad_norm": 3.0546714312119643, + "learning_rate": 5.7638888888888886e-05, + "loss": 0.8274, + "step": 166 + }, + { + "epoch": 0.058404310794368156, + "grad_norm": 2.4021883380894393, + "learning_rate": 5.833333333333334e-05, + "loss": 0.8492, + "step": 168 + }, + { + "epoch": 0.059099600208586824, + "grad_norm": 2.6052829770116293, + "learning_rate": 5.902777777777778e-05, + "loss": 1.1005, + "step": 170 + }, + { + "epoch": 0.05979488962280549, + "grad_norm": 1.6838192892320467, + "learning_rate": 5.972222222222223e-05, + "loss": 1.0157, + "step": 172 + }, + { + "epoch": 0.06049017903702416, + "grad_norm": 3.98880214871885, + "learning_rate": 6.041666666666667e-05, + "loss": 0.8136, + "step": 174 + }, + { + "epoch": 0.06118546845124283, + "grad_norm": 4.81494345341073, + "learning_rate": 6.111111111111112e-05, + "loss": 0.9475, + "step": 176 + }, + { + "epoch": 0.061880757865461496, + "grad_norm": 1.9926278890091862, + "learning_rate": 6.180555555555556e-05, + "loss": 0.6549, + "step": 178 + }, + { + "epoch": 0.06257604727968016, + "grad_norm": 1.750353030728397, + "learning_rate": 6.25e-05, + "loss": 1.1442, + "step": 180 + }, + { + "epoch": 0.06327133669389884, + "grad_norm": 4.77249782692129, + "learning_rate": 6.319444444444444e-05, + "loss": 1.1927, + "step": 182 + }, + { + "epoch": 0.0639666261081175, + "grad_norm": 1.866901788617278, + "learning_rate": 6.388888888888888e-05, + "loss": 1.0032, + "step": 184 + }, + { + "epoch": 0.06466191552233617, + "grad_norm": 1.7495859751833545, + "learning_rate": 6.458333333333334e-05, + "loss": 0.8439, + "step": 186 + }, + { + "epoch": 0.06535720493655484, + "grad_norm": 2.971674018184174, + "learning_rate": 6.527777777777778e-05, + "loss": 0.9817, + "step": 188 + }, + { + "epoch": 0.06605249435077351, + "grad_norm": 2.3753292673540165, + "learning_rate": 6.597222222222223e-05, + "loss": 0.9919, + "step": 190 + }, + { + "epoch": 0.06674778376499217, + "grad_norm": 2.7019148741557744, + "learning_rate": 6.666666666666667e-05, + "loss": 1.1442, + "step": 192 + }, + { + "epoch": 0.06744307317921085, + "grad_norm": 1.8670113287712482, + "learning_rate": 6.736111111111112e-05, + "loss": 0.8905, + "step": 194 + }, + { + "epoch": 0.06813836259342952, + "grad_norm": 1.4199145680760579, + "learning_rate": 6.805555555555556e-05, + "loss": 0.7223, + "step": 196 + }, + { + "epoch": 0.06883365200764818, + "grad_norm": 3.894200902880186, + "learning_rate": 6.875e-05, + "loss": 0.9005, + "step": 198 + }, + { + "epoch": 0.06952894142186686, + "grad_norm": 3.2710376491241955, + "learning_rate": 6.944444444444444e-05, + "loss": 1.1605, + "step": 200 + }, + { + "epoch": 0.07022423083608552, + "grad_norm": 1.6459754670035065, + "learning_rate": 7.013888888888888e-05, + "loss": 0.8551, + "step": 202 + }, + { + "epoch": 0.0709195202503042, + "grad_norm": 4.361031640374508, + "learning_rate": 7.083333333333334e-05, + "loss": 0.7007, + "step": 204 + }, + { + "epoch": 0.07161480966452285, + "grad_norm": 3.573741549123141, + "learning_rate": 7.152777777777778e-05, + "loss": 1.1396, + "step": 206 + }, + { + "epoch": 0.07231009907874153, + "grad_norm": 3.296990311359108, + "learning_rate": 7.222222222222222e-05, + "loss": 0.8695, + "step": 208 + }, + { + "epoch": 0.07300538849296019, + "grad_norm": 6.769659823038884, + "learning_rate": 7.291666666666667e-05, + "loss": 1.0511, + "step": 210 + }, + { + "epoch": 0.07370067790717887, + "grad_norm": 1.6695233666860303, + "learning_rate": 7.361111111111111e-05, + "loss": 0.8174, + "step": 212 + }, + { + "epoch": 0.07439596732139753, + "grad_norm": 1.3543755216281146, + "learning_rate": 7.430555555555557e-05, + "loss": 0.7137, + "step": 214 + }, + { + "epoch": 0.0750912567356162, + "grad_norm": 4.861063813937456, + "learning_rate": 7.500000000000001e-05, + "loss": 1.0132, + "step": 216 + }, + { + "epoch": 0.07578654614983486, + "grad_norm": 5.715913176528681, + "learning_rate": 7.569444444444445e-05, + "loss": 1.1657, + "step": 218 + }, + { + "epoch": 0.07648183556405354, + "grad_norm": 4.0193839358302235, + "learning_rate": 7.638888888888889e-05, + "loss": 1.0547, + "step": 220 + }, + { + "epoch": 0.0771771249782722, + "grad_norm": 2.26849134517291, + "learning_rate": 7.708333333333334e-05, + "loss": 0.9073, + "step": 222 + }, + { + "epoch": 0.07787241439249087, + "grad_norm": 4.570943697810998, + "learning_rate": 7.777777777777778e-05, + "loss": 1.3726, + "step": 224 + }, + { + "epoch": 0.07856770380670955, + "grad_norm": 1.1942436910880105, + "learning_rate": 7.847222222222222e-05, + "loss": 0.8146, + "step": 226 + }, + { + "epoch": 0.07926299322092821, + "grad_norm": 2.111849588751211, + "learning_rate": 7.916666666666666e-05, + "loss": 1.1157, + "step": 228 + }, + { + "epoch": 0.07995828263514689, + "grad_norm": 1.0283088880069582, + "learning_rate": 7.986111111111112e-05, + "loss": 0.767, + "step": 230 + }, + { + "epoch": 0.08065357204936555, + "grad_norm": 1.2834055069208525, + "learning_rate": 8.055555555555556e-05, + "loss": 0.6625, + "step": 232 + }, + { + "epoch": 0.08134886146358422, + "grad_norm": 1.3772942873595098, + "learning_rate": 8.125000000000001e-05, + "loss": 0.8065, + "step": 234 + }, + { + "epoch": 0.08204415087780288, + "grad_norm": 1.5113456549735176, + "learning_rate": 8.194444444444445e-05, + "loss": 0.8606, + "step": 236 + }, + { + "epoch": 0.08273944029202156, + "grad_norm": 1.5765846352838255, + "learning_rate": 8.263888888888889e-05, + "loss": 0.8335, + "step": 238 + }, + { + "epoch": 0.08343472970624022, + "grad_norm": 2.4873462478329404, + "learning_rate": 8.333333333333334e-05, + "loss": 0.9705, + "step": 240 + }, + { + "epoch": 0.0841300191204589, + "grad_norm": 1.2369219925635513, + "learning_rate": 8.402777777777778e-05, + "loss": 0.6061, + "step": 242 + }, + { + "epoch": 0.08482530853467755, + "grad_norm": 2.542132212473201, + "learning_rate": 8.472222222222222e-05, + "loss": 0.9142, + "step": 244 + }, + { + "epoch": 0.08552059794889623, + "grad_norm": 2.0301734217803022, + "learning_rate": 8.541666666666666e-05, + "loss": 0.8997, + "step": 246 + }, + { + "epoch": 0.08621588736311489, + "grad_norm": 1.8605316982945626, + "learning_rate": 8.611111111111112e-05, + "loss": 1.005, + "step": 248 + }, + { + "epoch": 0.08691117677733357, + "grad_norm": 1.193555257951713, + "learning_rate": 8.680555555555556e-05, + "loss": 0.8617, + "step": 250 + }, + { + "epoch": 0.08760646619155224, + "grad_norm": 1.243815428863678, + "learning_rate": 8.75e-05, + "loss": 0.6261, + "step": 252 + }, + { + "epoch": 0.0883017556057709, + "grad_norm": 1.6487754861704442, + "learning_rate": 8.819444444444445e-05, + "loss": 0.9219, + "step": 254 + }, + { + "epoch": 0.08899704501998958, + "grad_norm": 1.1768410857322613, + "learning_rate": 8.888888888888889e-05, + "loss": 0.8563, + "step": 256 + }, + { + "epoch": 0.08969233443420824, + "grad_norm": 1.1155265191420587, + "learning_rate": 8.958333333333335e-05, + "loss": 0.998, + "step": 258 + }, + { + "epoch": 0.09038762384842691, + "grad_norm": 1.4432456616674065, + "learning_rate": 9.027777777777779e-05, + "loss": 0.8755, + "step": 260 + }, + { + "epoch": 0.09108291326264557, + "grad_norm": 1.6013486668654413, + "learning_rate": 9.097222222222223e-05, + "loss": 0.6998, + "step": 262 + }, + { + "epoch": 0.09177820267686425, + "grad_norm": 0.7869968770186737, + "learning_rate": 9.166666666666667e-05, + "loss": 0.7574, + "step": 264 + }, + { + "epoch": 0.09247349209108291, + "grad_norm": 2.1117903903864566, + "learning_rate": 9.236111111111112e-05, + "loss": 0.8436, + "step": 266 + }, + { + "epoch": 0.09316878150530158, + "grad_norm": 1.3582999584721895, + "learning_rate": 9.305555555555556e-05, + "loss": 0.8503, + "step": 268 + }, + { + "epoch": 0.09386407091952025, + "grad_norm": 1.5674581009005415, + "learning_rate": 9.375e-05, + "loss": 0.9561, + "step": 270 + }, + { + "epoch": 0.09455936033373892, + "grad_norm": 1.0274246934159952, + "learning_rate": 9.444444444444444e-05, + "loss": 0.7537, + "step": 272 + }, + { + "epoch": 0.09525464974795758, + "grad_norm": 0.9595343432519174, + "learning_rate": 9.513888888888888e-05, + "loss": 0.7855, + "step": 274 + }, + { + "epoch": 0.09594993916217626, + "grad_norm": 1.3313115114367815, + "learning_rate": 9.583333333333334e-05, + "loss": 0.7009, + "step": 276 + }, + { + "epoch": 0.09664522857639492, + "grad_norm": 1.4409463331317498, + "learning_rate": 9.652777777777779e-05, + "loss": 1.0332, + "step": 278 + }, + { + "epoch": 0.09734051799061359, + "grad_norm": 1.5445848213023137, + "learning_rate": 9.722222222222223e-05, + "loss": 0.7352, + "step": 280 + }, + { + "epoch": 0.09803580740483227, + "grad_norm": 1.855518620927316, + "learning_rate": 9.791666666666667e-05, + "loss": 0.7191, + "step": 282 + }, + { + "epoch": 0.09873109681905093, + "grad_norm": 1.4033396985161997, + "learning_rate": 9.861111111111112e-05, + "loss": 0.7886, + "step": 284 + }, + { + "epoch": 0.0994263862332696, + "grad_norm": 1.9951521438049904, + "learning_rate": 9.930555555555556e-05, + "loss": 0.902, + "step": 286 + }, + { + "epoch": 0.10012167564748826, + "grad_norm": 1.1360934228431687, + "learning_rate": 0.0001, + "loss": 0.8655, + "step": 288 + }, + { + "epoch": 0.10081696506170694, + "grad_norm": 1.1225735433900375, + "learning_rate": 0.00010069444444444445, + "loss": 0.6851, + "step": 290 + }, + { + "epoch": 0.1015122544759256, + "grad_norm": 0.770446891371583, + "learning_rate": 0.00010138888888888889, + "loss": 0.7775, + "step": 292 + }, + { + "epoch": 0.10220754389014428, + "grad_norm": 0.797064180835607, + "learning_rate": 0.00010208333333333333, + "loss": 0.6567, + "step": 294 + }, + { + "epoch": 0.10290283330436294, + "grad_norm": 0.9876188134326442, + "learning_rate": 0.00010277777777777778, + "loss": 0.7299, + "step": 296 + }, + { + "epoch": 0.10359812271858161, + "grad_norm": 0.799601623643537, + "learning_rate": 0.00010347222222222223, + "loss": 0.7891, + "step": 298 + }, + { + "epoch": 0.10429341213280027, + "grad_norm": 0.8791512281362982, + "learning_rate": 0.00010416666666666667, + "loss": 0.677, + "step": 300 + }, + { + "epoch": 0.10429341213280027, + "eval_loss": 0.6939894556999207, + "eval_runtime": 709.5268, + "eval_samples_per_second": 6.824, + "eval_steps_per_second": 0.214, + "step": 300 + }, + { + "epoch": 0.10498870154701895, + "grad_norm": 1.329564645811689, + "learning_rate": 0.00010486111111111113, + "loss": 0.7511, + "step": 302 + }, + { + "epoch": 0.10568399096123761, + "grad_norm": 0.7130415058241142, + "learning_rate": 0.00010555555555555557, + "loss": 0.709, + "step": 304 + }, + { + "epoch": 0.10637928037545628, + "grad_norm": 1.1294733411370705, + "learning_rate": 0.00010625000000000001, + "loss": 0.7781, + "step": 306 + }, + { + "epoch": 0.10707456978967496, + "grad_norm": 0.581727680778003, + "learning_rate": 0.00010694444444444445, + "loss": 0.6296, + "step": 308 + }, + { + "epoch": 0.10776985920389362, + "grad_norm": 0.9855391514311871, + "learning_rate": 0.00010763888888888889, + "loss": 0.7852, + "step": 310 + }, + { + "epoch": 0.1084651486181123, + "grad_norm": 0.5708379609857769, + "learning_rate": 0.00010833333333333333, + "loss": 0.6759, + "step": 312 + }, + { + "epoch": 0.10916043803233096, + "grad_norm": 0.7243330859752051, + "learning_rate": 0.00010902777777777777, + "loss": 0.6326, + "step": 314 + }, + { + "epoch": 0.10985572744654963, + "grad_norm": 1.3922163003264714, + "learning_rate": 0.00010972222222222224, + "loss": 0.5406, + "step": 316 + }, + { + "epoch": 0.11055101686076829, + "grad_norm": 2.604851740418153, + "learning_rate": 0.00011041666666666668, + "loss": 0.8013, + "step": 318 + }, + { + "epoch": 0.11124630627498697, + "grad_norm": 1.83511037983023, + "learning_rate": 0.00011111111111111112, + "loss": 0.8048, + "step": 320 + }, + { + "epoch": 0.11194159568920563, + "grad_norm": 1.6737764614655666, + "learning_rate": 0.00011180555555555556, + "loss": 0.6943, + "step": 322 + }, + { + "epoch": 0.1126368851034243, + "grad_norm": 1.077667781888673, + "learning_rate": 0.00011250000000000001, + "loss": 0.8054, + "step": 324 + }, + { + "epoch": 0.11333217451764296, + "grad_norm": 0.5597693838209001, + "learning_rate": 0.00011319444444444445, + "loss": 0.6251, + "step": 326 + }, + { + "epoch": 0.11402746393186164, + "grad_norm": 0.5636865078063477, + "learning_rate": 0.00011388888888888889, + "loss": 0.6832, + "step": 328 + }, + { + "epoch": 0.1147227533460803, + "grad_norm": 0.6445176566556912, + "learning_rate": 0.00011458333333333333, + "loss": 0.6661, + "step": 330 + }, + { + "epoch": 0.11541804276029898, + "grad_norm": 0.607532412895966, + "learning_rate": 0.00011527777777777777, + "loss": 0.7026, + "step": 332 + }, + { + "epoch": 0.11611333217451764, + "grad_norm": 1.0496949694240345, + "learning_rate": 0.00011597222222222224, + "loss": 0.6451, + "step": 334 + }, + { + "epoch": 0.11680862158873631, + "grad_norm": 0.9469233272179363, + "learning_rate": 0.00011666666666666668, + "loss": 0.6694, + "step": 336 + }, + { + "epoch": 0.11750391100295499, + "grad_norm": 1.3789882614528595, + "learning_rate": 0.00011736111111111112, + "loss": 0.7031, + "step": 338 + }, + { + "epoch": 0.11819920041717365, + "grad_norm": 1.2016589928587922, + "learning_rate": 0.00011805555555555556, + "loss": 0.6676, + "step": 340 + }, + { + "epoch": 0.11889448983139232, + "grad_norm": 1.3112845410865746, + "learning_rate": 0.00011875, + "loss": 0.7236, + "step": 342 + }, + { + "epoch": 0.11958977924561098, + "grad_norm": 0.6278789052805739, + "learning_rate": 0.00011944444444444445, + "loss": 0.6249, + "step": 344 + }, + { + "epoch": 0.12028506865982966, + "grad_norm": 0.5405148902553805, + "learning_rate": 0.0001201388888888889, + "loss": 0.6412, + "step": 346 + }, + { + "epoch": 0.12098035807404832, + "grad_norm": 1.6923616138961255, + "learning_rate": 0.00012083333333333333, + "loss": 0.7017, + "step": 348 + }, + { + "epoch": 0.121675647488267, + "grad_norm": 1.5994113095813072, + "learning_rate": 0.00012152777777777777, + "loss": 0.7075, + "step": 350 + }, + { + "epoch": 0.12237093690248566, + "grad_norm": 2.3083516502461783, + "learning_rate": 0.00012222222222222224, + "loss": 0.7755, + "step": 352 + }, + { + "epoch": 0.12306622631670433, + "grad_norm": 0.8769167165306447, + "learning_rate": 0.00012291666666666668, + "loss": 0.7428, + "step": 354 + }, + { + "epoch": 0.12376151573092299, + "grad_norm": 0.4456469638797518, + "learning_rate": 0.00012361111111111112, + "loss": 0.7002, + "step": 356 + }, + { + "epoch": 0.12445680514514167, + "grad_norm": 0.8199993647792723, + "learning_rate": 0.00012430555555555556, + "loss": 0.7222, + "step": 358 + }, + { + "epoch": 0.12515209455936033, + "grad_norm": 0.3741084955970339, + "learning_rate": 0.000125, + "loss": 0.6821, + "step": 360 + }, + { + "epoch": 0.125847383973579, + "grad_norm": 0.2972203241099783, + "learning_rate": 0.00012569444444444444, + "loss": 0.7083, + "step": 362 + }, + { + "epoch": 0.12654267338779768, + "grad_norm": 0.40651740632246575, + "learning_rate": 0.00012638888888888888, + "loss": 0.7144, + "step": 364 + }, + { + "epoch": 0.12723796280201635, + "grad_norm": 0.4388093199704831, + "learning_rate": 0.00012708333333333332, + "loss": 0.6863, + "step": 366 + }, + { + "epoch": 0.127933252216235, + "grad_norm": 0.45131267837810835, + "learning_rate": 0.00012777777777777776, + "loss": 0.6329, + "step": 368 + }, + { + "epoch": 0.12862854163045367, + "grad_norm": 0.3837830352665476, + "learning_rate": 0.00012847222222222223, + "loss": 0.6938, + "step": 370 + }, + { + "epoch": 0.12932383104467235, + "grad_norm": 0.6378624076702905, + "learning_rate": 0.00012916666666666667, + "loss": 0.6433, + "step": 372 + }, + { + "epoch": 0.13001912045889102, + "grad_norm": 0.41344403509072675, + "learning_rate": 0.0001298611111111111, + "loss": 0.6892, + "step": 374 + }, + { + "epoch": 0.13071440987310967, + "grad_norm": 1.3428471718098582, + "learning_rate": 0.00013055555555555555, + "loss": 0.7793, + "step": 376 + }, + { + "epoch": 0.13140969928732835, + "grad_norm": 0.6202275876483008, + "learning_rate": 0.00013125000000000002, + "loss": 0.6836, + "step": 378 + }, + { + "epoch": 0.13210498870154702, + "grad_norm": 0.774014383396004, + "learning_rate": 0.00013194444444444446, + "loss": 0.701, + "step": 380 + }, + { + "epoch": 0.1328002781157657, + "grad_norm": 1.0650744092292224, + "learning_rate": 0.0001326388888888889, + "loss": 0.6562, + "step": 382 + }, + { + "epoch": 0.13349556752998434, + "grad_norm": 0.5540168492927294, + "learning_rate": 0.00013333333333333334, + "loss": 0.6267, + "step": 384 + }, + { + "epoch": 0.13419085694420302, + "grad_norm": 0.6403086140920178, + "learning_rate": 0.00013402777777777778, + "loss": 0.6268, + "step": 386 + }, + { + "epoch": 0.1348861463584217, + "grad_norm": 0.9197218298114509, + "learning_rate": 0.00013472222222222225, + "loss": 0.7208, + "step": 388 + }, + { + "epoch": 0.13558143577264037, + "grad_norm": 0.4235387152144674, + "learning_rate": 0.0001354166666666667, + "loss": 0.6057, + "step": 390 + }, + { + "epoch": 0.13627672518685904, + "grad_norm": 0.425648636635043, + "learning_rate": 0.00013611111111111113, + "loss": 0.6387, + "step": 392 + }, + { + "epoch": 0.1369720146010777, + "grad_norm": 1.034952396366508, + "learning_rate": 0.00013680555555555557, + "loss": 0.7307, + "step": 394 + }, + { + "epoch": 0.13766730401529637, + "grad_norm": 0.8865505732510678, + "learning_rate": 0.0001375, + "loss": 0.6547, + "step": 396 + }, + { + "epoch": 0.13836259342951504, + "grad_norm": 0.6490094573088415, + "learning_rate": 0.00013819444444444445, + "loss": 0.6909, + "step": 398 + }, + { + "epoch": 0.13905788284373372, + "grad_norm": 0.8592713330921486, + "learning_rate": 0.0001388888888888889, + "loss": 0.6442, + "step": 400 + }, + { + "epoch": 0.13975317225795236, + "grad_norm": 1.0279375953862069, + "learning_rate": 0.00013958333333333333, + "loss": 0.6907, + "step": 402 + }, + { + "epoch": 0.14044846167217104, + "grad_norm": 0.6151057351983696, + "learning_rate": 0.00014027777777777777, + "loss": 0.697, + "step": 404 + }, + { + "epoch": 0.1411437510863897, + "grad_norm": 0.7417879717121144, + "learning_rate": 0.00014097222222222224, + "loss": 0.698, + "step": 406 + }, + { + "epoch": 0.1418390405006084, + "grad_norm": 0.5161453091859882, + "learning_rate": 0.00014166666666666668, + "loss": 0.6915, + "step": 408 + }, + { + "epoch": 0.14253432991482703, + "grad_norm": 0.5667521096080546, + "learning_rate": 0.00014236111111111112, + "loss": 0.6609, + "step": 410 + }, + { + "epoch": 0.1432296193290457, + "grad_norm": 0.7560317583703429, + "learning_rate": 0.00014305555555555556, + "loss": 0.6392, + "step": 412 + }, + { + "epoch": 0.14392490874326438, + "grad_norm": 0.5456303981546313, + "learning_rate": 0.00014375, + "loss": 0.7561, + "step": 414 + }, + { + "epoch": 0.14462019815748306, + "grad_norm": 0.4218469018151631, + "learning_rate": 0.00014444444444444444, + "loss": 0.675, + "step": 416 + }, + { + "epoch": 0.14531548757170173, + "grad_norm": 0.3790517974518404, + "learning_rate": 0.00014513888888888888, + "loss": 0.6697, + "step": 418 + }, + { + "epoch": 0.14601077698592038, + "grad_norm": 0.36495171567914964, + "learning_rate": 0.00014583333333333335, + "loss": 0.6467, + "step": 420 + }, + { + "epoch": 0.14670606640013906, + "grad_norm": 0.3793520501177419, + "learning_rate": 0.00014652777777777779, + "loss": 0.6234, + "step": 422 + }, + { + "epoch": 0.14740135581435773, + "grad_norm": 0.6214905371013544, + "learning_rate": 0.00014722222222222223, + "loss": 0.64, + "step": 424 + }, + { + "epoch": 0.1480966452285764, + "grad_norm": 0.4103438113660832, + "learning_rate": 0.0001479166666666667, + "loss": 0.6174, + "step": 426 + }, + { + "epoch": 0.14879193464279505, + "grad_norm": 0.5802311029669485, + "learning_rate": 0.00014861111111111113, + "loss": 0.6941, + "step": 428 + }, + { + "epoch": 0.14948722405701373, + "grad_norm": 0.4876572424583591, + "learning_rate": 0.00014930555555555557, + "loss": 0.6178, + "step": 430 + }, + { + "epoch": 0.1501825134712324, + "grad_norm": 0.6252220373472688, + "learning_rate": 0.00015000000000000001, + "loss": 0.692, + "step": 432 + }, + { + "epoch": 0.15087780288545108, + "grad_norm": 1.516758455176553, + "learning_rate": 0.00015069444444444445, + "loss": 0.6812, + "step": 434 + }, + { + "epoch": 0.15157309229966973, + "grad_norm": 0.48294685446689867, + "learning_rate": 0.0001513888888888889, + "loss": 0.7085, + "step": 436 + }, + { + "epoch": 0.1522683817138884, + "grad_norm": 0.414196721150167, + "learning_rate": 0.00015208333333333333, + "loss": 0.673, + "step": 438 + }, + { + "epoch": 0.15296367112810708, + "grad_norm": 0.7294881062503469, + "learning_rate": 0.00015277777777777777, + "loss": 0.6415, + "step": 440 + }, + { + "epoch": 0.15365896054232575, + "grad_norm": 0.4846932912054438, + "learning_rate": 0.00015347222222222224, + "loss": 0.6644, + "step": 442 + }, + { + "epoch": 0.1543542499565444, + "grad_norm": 0.6067400167426414, + "learning_rate": 0.00015416666666666668, + "loss": 0.6816, + "step": 444 + }, + { + "epoch": 0.15504953937076307, + "grad_norm": 0.5586278026791864, + "learning_rate": 0.00015486111111111112, + "loss": 0.6223, + "step": 446 + }, + { + "epoch": 0.15574482878498175, + "grad_norm": 0.3947236166856149, + "learning_rate": 0.00015555555555555556, + "loss": 0.7297, + "step": 448 + }, + { + "epoch": 0.15644011819920042, + "grad_norm": 0.371457756887947, + "learning_rate": 0.00015625, + "loss": 0.6099, + "step": 450 + }, + { + "epoch": 0.15644011819920042, + "eval_loss": 0.6634477376937866, + "eval_runtime": 706.8027, + "eval_samples_per_second": 6.851, + "eval_steps_per_second": 0.215, + "step": 450 + }, + { + "epoch": 0.1571354076134191, + "grad_norm": 0.4157928192338373, + "learning_rate": 0.00015694444444444444, + "loss": 0.7163, + "step": 452 + }, + { + "epoch": 0.15783069702763775, + "grad_norm": 0.6318513446857751, + "learning_rate": 0.00015763888888888888, + "loss": 0.658, + "step": 454 + }, + { + "epoch": 0.15852598644185642, + "grad_norm": 0.3188170086808347, + "learning_rate": 0.00015833333333333332, + "loss": 0.5966, + "step": 456 + }, + { + "epoch": 0.1592212758560751, + "grad_norm": 0.4873146052629784, + "learning_rate": 0.00015902777777777776, + "loss": 0.687, + "step": 458 + }, + { + "epoch": 0.15991656527029377, + "grad_norm": 0.3939618900754228, + "learning_rate": 0.00015972222222222223, + "loss": 0.6704, + "step": 460 + }, + { + "epoch": 0.16061185468451242, + "grad_norm": 0.43442241310529234, + "learning_rate": 0.00016041666666666667, + "loss": 0.6941, + "step": 462 + }, + { + "epoch": 0.1613071440987311, + "grad_norm": 0.5944395304786771, + "learning_rate": 0.0001611111111111111, + "loss": 0.5934, + "step": 464 + }, + { + "epoch": 0.16200243351294977, + "grad_norm": 0.6186667715273749, + "learning_rate": 0.00016180555555555555, + "loss": 0.6604, + "step": 466 + }, + { + "epoch": 0.16269772292716844, + "grad_norm": 0.8945416923537124, + "learning_rate": 0.00016250000000000002, + "loss": 0.6224, + "step": 468 + }, + { + "epoch": 0.1633930123413871, + "grad_norm": 1.0526200270890014, + "learning_rate": 0.00016319444444444446, + "loss": 0.616, + "step": 470 + }, + { + "epoch": 0.16408830175560576, + "grad_norm": 0.4575985966727194, + "learning_rate": 0.0001638888888888889, + "loss": 0.6591, + "step": 472 + }, + { + "epoch": 0.16478359116982444, + "grad_norm": 0.4499931204645402, + "learning_rate": 0.00016458333333333334, + "loss": 0.6644, + "step": 474 + }, + { + "epoch": 0.16547888058404311, + "grad_norm": 0.8365574384741885, + "learning_rate": 0.00016527777777777778, + "loss": 0.6503, + "step": 476 + }, + { + "epoch": 0.1661741699982618, + "grad_norm": 0.5265284650577726, + "learning_rate": 0.00016597222222222225, + "loss": 0.557, + "step": 478 + }, + { + "epoch": 0.16686945941248044, + "grad_norm": 0.6004742828917694, + "learning_rate": 0.0001666666666666667, + "loss": 0.696, + "step": 480 + }, + { + "epoch": 0.1675647488266991, + "grad_norm": 0.8653134209549845, + "learning_rate": 0.00016736111111111113, + "loss": 0.6544, + "step": 482 + }, + { + "epoch": 0.1682600382409178, + "grad_norm": 1.033230873418064, + "learning_rate": 0.00016805555555555557, + "loss": 0.641, + "step": 484 + }, + { + "epoch": 0.16895532765513646, + "grad_norm": 0.45457193405665913, + "learning_rate": 0.00016875, + "loss": 0.5952, + "step": 486 + }, + { + "epoch": 0.1696506170693551, + "grad_norm": 0.7413902971651539, + "learning_rate": 0.00016944444444444445, + "loss": 0.6306, + "step": 488 + }, + { + "epoch": 0.17034590648357378, + "grad_norm": 0.5808764628223875, + "learning_rate": 0.0001701388888888889, + "loss": 0.6714, + "step": 490 + }, + { + "epoch": 0.17104119589779246, + "grad_norm": 0.42505370383777924, + "learning_rate": 0.00017083333333333333, + "loss": 0.6432, + "step": 492 + }, + { + "epoch": 0.17173648531201113, + "grad_norm": 0.9403542369255028, + "learning_rate": 0.00017152777777777777, + "loss": 0.626, + "step": 494 + }, + { + "epoch": 0.17243177472622978, + "grad_norm": 0.41714707593148775, + "learning_rate": 0.00017222222222222224, + "loss": 0.6132, + "step": 496 + }, + { + "epoch": 0.17312706414044846, + "grad_norm": 0.6660896849726371, + "learning_rate": 0.00017291666666666668, + "loss": 0.7009, + "step": 498 + }, + { + "epoch": 0.17382235355466713, + "grad_norm": 0.5079993412341118, + "learning_rate": 0.00017361111111111112, + "loss": 0.6808, + "step": 500 + }, + { + "epoch": 0.1745176429688858, + "grad_norm": 0.3426487947129772, + "learning_rate": 0.00017430555555555556, + "loss": 0.687, + "step": 502 + }, + { + "epoch": 0.17521293238310448, + "grad_norm": 0.7316051797581208, + "learning_rate": 0.000175, + "loss": 0.686, + "step": 504 + }, + { + "epoch": 0.17590822179732313, + "grad_norm": 0.4619785653282459, + "learning_rate": 0.00017569444444444444, + "loss": 0.7019, + "step": 506 + }, + { + "epoch": 0.1766035112115418, + "grad_norm": 0.47786977912472967, + "learning_rate": 0.0001763888888888889, + "loss": 0.7097, + "step": 508 + }, + { + "epoch": 0.17729880062576048, + "grad_norm": 0.4204398291864812, + "learning_rate": 0.00017708333333333335, + "loss": 0.6715, + "step": 510 + }, + { + "epoch": 0.17799409003997915, + "grad_norm": 0.5257761541709909, + "learning_rate": 0.00017777777777777779, + "loss": 0.6675, + "step": 512 + }, + { + "epoch": 0.1786893794541978, + "grad_norm": 0.5752239420884688, + "learning_rate": 0.00017847222222222225, + "loss": 0.5847, + "step": 514 + }, + { + "epoch": 0.17938466886841647, + "grad_norm": 0.5611432017880666, + "learning_rate": 0.0001791666666666667, + "loss": 0.5978, + "step": 516 + }, + { + "epoch": 0.18007995828263515, + "grad_norm": 0.5147097358785945, + "learning_rate": 0.00017986111111111113, + "loss": 0.641, + "step": 518 + }, + { + "epoch": 0.18077524769685382, + "grad_norm": 0.4387330962078066, + "learning_rate": 0.00018055555555555557, + "loss": 0.5771, + "step": 520 + }, + { + "epoch": 0.18147053711107247, + "grad_norm": 0.5712526440788663, + "learning_rate": 0.00018125000000000001, + "loss": 0.6212, + "step": 522 + }, + { + "epoch": 0.18216582652529115, + "grad_norm": 0.6357133907029916, + "learning_rate": 0.00018194444444444445, + "loss": 0.5981, + "step": 524 + }, + { + "epoch": 0.18286111593950982, + "grad_norm": 1.2129620643054042, + "learning_rate": 0.0001826388888888889, + "loss": 0.5848, + "step": 526 + }, + { + "epoch": 0.1835564053537285, + "grad_norm": 1.651599276688714, + "learning_rate": 0.00018333333333333334, + "loss": 0.7089, + "step": 528 + }, + { + "epoch": 0.18425169476794717, + "grad_norm": 0.9051688342434142, + "learning_rate": 0.00018402777777777778, + "loss": 0.7255, + "step": 530 + }, + { + "epoch": 0.18494698418216582, + "grad_norm": 0.6932441010863684, + "learning_rate": 0.00018472222222222224, + "loss": 0.6497, + "step": 532 + }, + { + "epoch": 0.1856422735963845, + "grad_norm": 1.2163006408955903, + "learning_rate": 0.00018541666666666668, + "loss": 0.7585, + "step": 534 + }, + { + "epoch": 0.18633756301060317, + "grad_norm": 0.4387074048377486, + "learning_rate": 0.00018611111111111112, + "loss": 0.6541, + "step": 536 + }, + { + "epoch": 0.18703285242482184, + "grad_norm": 0.49430581216479236, + "learning_rate": 0.00018680555555555556, + "loss": 0.6489, + "step": 538 + }, + { + "epoch": 0.1877281418390405, + "grad_norm": 0.47561442420926275, + "learning_rate": 0.0001875, + "loss": 0.6406, + "step": 540 + }, + { + "epoch": 0.18842343125325917, + "grad_norm": 0.7046092923664611, + "learning_rate": 0.00018819444444444444, + "loss": 0.6099, + "step": 542 + }, + { + "epoch": 0.18911872066747784, + "grad_norm": 0.46256136269201026, + "learning_rate": 0.00018888888888888888, + "loss": 0.6992, + "step": 544 + }, + { + "epoch": 0.18981401008169652, + "grad_norm": 0.5489877082982352, + "learning_rate": 0.00018958333333333332, + "loss": 0.5817, + "step": 546 + }, + { + "epoch": 0.19050929949591516, + "grad_norm": 0.46129441798908893, + "learning_rate": 0.00019027777777777776, + "loss": 0.645, + "step": 548 + }, + { + "epoch": 0.19120458891013384, + "grad_norm": 0.3724226655450749, + "learning_rate": 0.00019097222222222223, + "loss": 0.6177, + "step": 550 + }, + { + "epoch": 0.1918998783243525, + "grad_norm": 0.4625796323902992, + "learning_rate": 0.00019166666666666667, + "loss": 0.6702, + "step": 552 + }, + { + "epoch": 0.1925951677385712, + "grad_norm": 1.0142124821047231, + "learning_rate": 0.0001923611111111111, + "loss": 0.7173, + "step": 554 + }, + { + "epoch": 0.19329045715278984, + "grad_norm": 0.5452830720753045, + "learning_rate": 0.00019305555555555558, + "loss": 0.6897, + "step": 556 + }, + { + "epoch": 0.1939857465670085, + "grad_norm": 0.5723214484723252, + "learning_rate": 0.00019375000000000002, + "loss": 0.6495, + "step": 558 + }, + { + "epoch": 0.19468103598122719, + "grad_norm": 0.39925844595054966, + "learning_rate": 0.00019444444444444446, + "loss": 0.6479, + "step": 560 + }, + { + "epoch": 0.19537632539544586, + "grad_norm": 0.3575565088751118, + "learning_rate": 0.0001951388888888889, + "loss": 0.6593, + "step": 562 + }, + { + "epoch": 0.19607161480966454, + "grad_norm": 0.6119892689536569, + "learning_rate": 0.00019583333333333334, + "loss": 0.6831, + "step": 564 + }, + { + "epoch": 0.19676690422388318, + "grad_norm": 0.5076569073121309, + "learning_rate": 0.00019652777777777778, + "loss": 0.6294, + "step": 566 + }, + { + "epoch": 0.19746219363810186, + "grad_norm": 0.622226505121079, + "learning_rate": 0.00019722222222222225, + "loss": 0.5551, + "step": 568 + }, + { + "epoch": 0.19815748305232053, + "grad_norm": 0.4106526912254415, + "learning_rate": 0.0001979166666666667, + "loss": 0.6503, + "step": 570 + }, + { + "epoch": 0.1988527724665392, + "grad_norm": 0.47164751383243125, + "learning_rate": 0.00019861111111111113, + "loss": 0.6992, + "step": 572 + }, + { + "epoch": 0.19954806188075785, + "grad_norm": 0.492328312395826, + "learning_rate": 0.00019930555555555557, + "loss": 0.7183, + "step": 574 + }, + { + "epoch": 0.20024335129497653, + "grad_norm": 0.5087240677439067, + "learning_rate": 0.0002, + "loss": 0.6429, + "step": 576 + }, + { + "epoch": 0.2009386407091952, + "grad_norm": 0.9311216098504759, + "learning_rate": 0.00019999992632143608, + "loss": 0.6586, + "step": 578 + }, + { + "epoch": 0.20163393012341388, + "grad_norm": 0.38840935170189844, + "learning_rate": 0.00019999970528585288, + "loss": 0.5905, + "step": 580 + }, + { + "epoch": 0.20232921953763253, + "grad_norm": 0.5966472765038273, + "learning_rate": 0.0001999993368935761, + "loss": 0.7112, + "step": 582 + }, + { + "epoch": 0.2030245089518512, + "grad_norm": 0.535232520705813, + "learning_rate": 0.00019999882114514863, + "loss": 0.7036, + "step": 584 + }, + { + "epoch": 0.20371979836606988, + "grad_norm": 0.5039916125175515, + "learning_rate": 0.0001999981580413304, + "loss": 0.7485, + "step": 586 + }, + { + "epoch": 0.20441508778028855, + "grad_norm": 0.6733262892097686, + "learning_rate": 0.0001999973475830986, + "loss": 0.7312, + "step": 588 + }, + { + "epoch": 0.20511037719450723, + "grad_norm": 0.42805740684614807, + "learning_rate": 0.00019999638977164747, + "loss": 0.6356, + "step": 590 + }, + { + "epoch": 0.20580566660872587, + "grad_norm": 0.976918546573707, + "learning_rate": 0.00019999528460838844, + "loss": 0.666, + "step": 592 + }, + { + "epoch": 0.20650095602294455, + "grad_norm": 0.674463735133944, + "learning_rate": 0.00019999403209495, + "loss": 0.6735, + "step": 594 + }, + { + "epoch": 0.20719624543716322, + "grad_norm": 0.412232119296174, + "learning_rate": 0.00019999263223317786, + "loss": 0.6364, + "step": 596 + }, + { + "epoch": 0.2078915348513819, + "grad_norm": 0.3611034413524545, + "learning_rate": 0.0001999910850251348, + "loss": 0.6368, + "step": 598 + }, + { + "epoch": 0.20858682426560055, + "grad_norm": 0.542506398091656, + "learning_rate": 0.0001999893904731007, + "loss": 0.7292, + "step": 600 + }, + { + "epoch": 0.20858682426560055, + "eval_loss": 0.6517693400382996, + "eval_runtime": 707.4674, + "eval_samples_per_second": 6.844, + "eval_steps_per_second": 0.215, + "step": 600 + }, + { + "epoch": 0.20928211367981922, + "grad_norm": 0.4799286290563759, + "learning_rate": 0.0001999875485795727, + "loss": 0.6609, + "step": 602 + }, + { + "epoch": 0.2099774030940379, + "grad_norm": 0.41830446575524177, + "learning_rate": 0.0001999855593472649, + "loss": 0.6084, + "step": 604 + }, + { + "epoch": 0.21067269250825657, + "grad_norm": 0.8865562086549428, + "learning_rate": 0.00019998342277910856, + "loss": 0.6204, + "step": 606 + }, + { + "epoch": 0.21136798192247522, + "grad_norm": 0.5567410910026902, + "learning_rate": 0.00019998113887825206, + "loss": 0.7087, + "step": 608 + }, + { + "epoch": 0.2120632713366939, + "grad_norm": 0.4229098163428897, + "learning_rate": 0.000199978707648061, + "loss": 0.6403, + "step": 610 + }, + { + "epoch": 0.21275856075091257, + "grad_norm": 0.7793555918286379, + "learning_rate": 0.00019997612909211784, + "loss": 0.6147, + "step": 612 + }, + { + "epoch": 0.21345385016513124, + "grad_norm": 0.49302383416102263, + "learning_rate": 0.00019997340321422228, + "loss": 0.5771, + "step": 614 + }, + { + "epoch": 0.21414913957934992, + "grad_norm": 1.0807551778698754, + "learning_rate": 0.00019997053001839115, + "loss": 0.6538, + "step": 616 + }, + { + "epoch": 0.21484442899356856, + "grad_norm": 0.5935042706034646, + "learning_rate": 0.0001999675095088583, + "loss": 0.6058, + "step": 618 + }, + { + "epoch": 0.21553971840778724, + "grad_norm": 0.5151203960605611, + "learning_rate": 0.00019996434169007468, + "loss": 0.6138, + "step": 620 + }, + { + "epoch": 0.21623500782200591, + "grad_norm": 0.7837579499467073, + "learning_rate": 0.00019996102656670824, + "loss": 0.657, + "step": 622 + }, + { + "epoch": 0.2169302972362246, + "grad_norm": 0.5438202413527335, + "learning_rate": 0.0001999575641436441, + "loss": 0.6642, + "step": 624 + }, + { + "epoch": 0.21762558665044324, + "grad_norm": 0.5566641749580342, + "learning_rate": 0.00019995395442598435, + "loss": 0.6813, + "step": 626 + }, + { + "epoch": 0.2183208760646619, + "grad_norm": 0.9345190838089675, + "learning_rate": 0.0001999501974190482, + "loss": 0.684, + "step": 628 + }, + { + "epoch": 0.2190161654788806, + "grad_norm": 0.48677420225080537, + "learning_rate": 0.00019994629312837186, + "loss": 0.6481, + "step": 630 + } + ], + "logging_steps": 2, + "max_steps": 5752, + "num_input_tokens_seen": 0, + "num_train_epochs": 2, + "save_steps": 90, + "stateful_callbacks": { + "TrainerControl": { + "args": { + "should_epoch_stop": false, + "should_evaluate": false, + "should_log": false, + "should_save": true, + "should_training_stop": false + }, + "attributes": {} + } + }, + "total_flos": 2509358735818752.0, + "train_batch_size": 4, + "trial_name": null, + "trial_params": null +} diff --git a/checkpoint-630/training_args.bin b/checkpoint-630/training_args.bin new file mode 100644 index 0000000000000000000000000000000000000000..fba3b63792fed5a70be0307e26ba27ef584b1528 --- /dev/null +++ b/checkpoint-630/training_args.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b72add547acd6c009f3a3770072d0cdf7de7e797c7597084319db874a556e470 +size 6904 diff --git a/checkpoint-630/zero_to_fp32.py b/checkpoint-630/zero_to_fp32.py new file mode 100644 index 0000000000000000000000000000000000000000..0e759146cadd92ddfefab3680146c2bd6a2b5c04 --- /dev/null +++ b/checkpoint-630/zero_to_fp32.py @@ -0,0 +1,760 @@ +#!/usr/bin/env python + +# Copyright (c) Microsoft Corporation. +# SPDX-License-Identifier: Apache-2.0 + +# DeepSpeed Team + +# This script extracts fp32 consolidated weights from a zero 1, 2 and 3 DeepSpeed checkpoints. It gets +# copied into the top level checkpoint dir, so the user can easily do the conversion at any point in +# the future. Once extracted, the weights don't require DeepSpeed and can be used in any +# application. +# +# example: +# python zero_to_fp32.py . output_dir/ +# or +# python zero_to_fp32.py . output_dir/ --safe_serialization + +import argparse +import torch +import glob +import math +import os +import re +import gc +import json +import numpy as np +from tqdm import tqdm +from collections import OrderedDict +from dataclasses import dataclass + +# while this script doesn't use deepspeed to recover data, since the checkpoints are pickled with +# DeepSpeed data structures it has to be available in the current python environment. +from deepspeed.utils import logger +from deepspeed.checkpoint.constants import (DS_VERSION, OPTIMIZER_STATE_DICT, SINGLE_PARTITION_OF_FP32_GROUPS, + FP32_FLAT_GROUPS, ZERO_STAGE, PARTITION_COUNT, PARAM_SHAPES, BUFFER_NAMES, + FROZEN_PARAM_SHAPES, FROZEN_PARAM_FRAGMENTS) + + +@dataclass +class zero_model_state: + buffers: dict() + param_shapes: dict() + shared_params: list + ds_version: int + frozen_param_shapes: dict() + frozen_param_fragments: dict() + + +debug = 0 + +# load to cpu +device = torch.device('cpu') + + +def atoi(text): + return int(text) if text.isdigit() else text + + +def natural_keys(text): + ''' + alist.sort(key=natural_keys) sorts in human order + http://nedbatchelder.com/blog/200712/human_sorting.html + (See Toothy's implementation in the comments) + ''' + return [atoi(c) for c in re.split(r'(\d+)', text)] + + +def get_model_state_file(checkpoint_dir, zero_stage): + if not os.path.isdir(checkpoint_dir): + raise FileNotFoundError(f"Directory '{checkpoint_dir}' doesn't exist") + + # there should be only one file + if zero_stage <= 2: + file = os.path.join(checkpoint_dir, "mp_rank_00_model_states.pt") + elif zero_stage == 3: + file = os.path.join(checkpoint_dir, "zero_pp_rank_0_mp_rank_00_model_states.pt") + + if not os.path.exists(file): + raise FileNotFoundError(f"can't find model states file at '{file}'") + + return file + + +def get_checkpoint_files(checkpoint_dir, glob_pattern): + # XXX: need to test that this simple glob rule works for multi-node setup too + ckpt_files = sorted(glob.glob(os.path.join(checkpoint_dir, glob_pattern)), key=natural_keys) + + if len(ckpt_files) == 0: + raise FileNotFoundError(f"can't find {glob_pattern} files in directory '{checkpoint_dir}'") + + return ckpt_files + + +def get_optim_files(checkpoint_dir): + return get_checkpoint_files(checkpoint_dir, "*_optim_states.pt") + + +def get_model_state_files(checkpoint_dir): + return get_checkpoint_files(checkpoint_dir, "*_model_states.pt") + + +def parse_model_states(files): + zero_model_states = [] + for file in files: + state_dict = torch.load(file, map_location=device, weights_only=False) + + if BUFFER_NAMES not in state_dict: + raise ValueError(f"{file} is not a model state checkpoint") + buffer_names = state_dict[BUFFER_NAMES] + if debug: + print("Found buffers:", buffer_names) + + # recover just the buffers while restoring them to fp32 if they were saved in fp16 + buffers = {k: v.float() for k, v in state_dict["module"].items() if k in buffer_names} + param_shapes = state_dict[PARAM_SHAPES] + + # collect parameters that are included in param_shapes + param_names = [] + for s in param_shapes: + for name in s.keys(): + param_names.append(name) + + # update with frozen parameters + frozen_param_shapes = state_dict.get(FROZEN_PARAM_SHAPES, None) + if frozen_param_shapes is not None: + if debug: + print(f"Found frozen_param_shapes: {frozen_param_shapes}") + param_names += list(frozen_param_shapes.keys()) + + # handle shared params + shared_params = [[k, v] for k, v in state_dict["shared_params"].items()] + + ds_version = state_dict.get(DS_VERSION, None) + + frozen_param_fragments = state_dict.get(FROZEN_PARAM_FRAGMENTS, None) + + z_model_state = zero_model_state(buffers=buffers, + param_shapes=param_shapes, + shared_params=shared_params, + ds_version=ds_version, + frozen_param_shapes=frozen_param_shapes, + frozen_param_fragments=frozen_param_fragments) + zero_model_states.append(z_model_state) + + return zero_model_states + + +def parse_optim_states(files, ds_checkpoint_dir): + total_files = len(files) + state_dicts = [] + for f in tqdm(files, desc='Loading checkpoint shards'): + state_dict = torch.load(f, map_location=device, mmap=True, weights_only=False) + # immediately discard the potentially huge 2 optimizer states as we only care for fp32 master weights + # and also handle the case where it was already removed by another helper script + state_dict["optimizer_state_dict"].pop("optimizer_state_dict", None) + state_dicts.append(state_dict) + + if not ZERO_STAGE in state_dicts[0][OPTIMIZER_STATE_DICT]: + raise ValueError(f"{files[0]} is not a zero checkpoint") + zero_stage = state_dicts[0][OPTIMIZER_STATE_DICT][ZERO_STAGE] + world_size = state_dicts[0][OPTIMIZER_STATE_DICT][PARTITION_COUNT] + + # For ZeRO-2 each param group can have different partition_count as data parallelism for expert + # parameters can be different from data parallelism for non-expert parameters. So we can just + # use the max of the partition_count to get the dp world_size. + + if type(world_size) is list: + world_size = max(world_size) + + if world_size != total_files: + raise ValueError( + f"Expected {world_size} of '*_optim_states.pt' under '{ds_checkpoint_dir}' but found {total_files} files. " + "Possibly due to an overwrite of an old checkpoint, or a checkpoint didn't get saved by one or more processes." + ) + + # the groups are named differently in each stage + if zero_stage <= 2: + fp32_groups_key = SINGLE_PARTITION_OF_FP32_GROUPS + elif zero_stage == 3: + fp32_groups_key = FP32_FLAT_GROUPS + else: + raise ValueError(f"unknown zero stage {zero_stage}") + + fp32_flat_groups = [state_dicts[i][OPTIMIZER_STATE_DICT][fp32_groups_key] for i in range(len(state_dicts))] + return zero_stage, world_size, fp32_flat_groups + + +def _get_fp32_state_dict_from_zero_checkpoint(ds_checkpoint_dir, exclude_frozen_parameters): + """ + Returns fp32 state_dict reconstructed from ds checkpoint + + Args: + - ``ds_checkpoint_dir``: path to the deepspeed checkpoint folder (where the optimizer files are) + + """ + print(f"Processing zero checkpoint '{ds_checkpoint_dir}'") + + optim_files = get_optim_files(ds_checkpoint_dir) + zero_stage, world_size, fp32_flat_groups = parse_optim_states(optim_files, ds_checkpoint_dir) + print(f"Detected checkpoint of type zero stage {zero_stage}, world_size: {world_size}") + + model_files = get_model_state_files(ds_checkpoint_dir) + + zero_model_states = parse_model_states(model_files) + print(f'Parsing checkpoint created by deepspeed=={zero_model_states[0].ds_version}') + + if zero_stage <= 2: + return _get_fp32_state_dict_from_zero2_checkpoint(world_size, fp32_flat_groups, zero_model_states, + exclude_frozen_parameters) + elif zero_stage == 3: + return _get_fp32_state_dict_from_zero3_checkpoint(world_size, fp32_flat_groups, zero_model_states, + exclude_frozen_parameters) + + +def _zero2_merge_frozen_params(state_dict, zero_model_states): + if zero_model_states[0].frozen_param_shapes is None or len(zero_model_states[0].frozen_param_shapes) == 0: + return + + frozen_param_shapes = zero_model_states[0].frozen_param_shapes + frozen_param_fragments = zero_model_states[0].frozen_param_fragments + + if debug: + num_elem = sum(s.numel() for s in frozen_param_shapes.values()) + print(f'rank 0: {FROZEN_PARAM_SHAPES}.numel = {num_elem}') + + wanted_params = len(frozen_param_shapes) + wanted_numel = sum(s.numel() for s in frozen_param_shapes.values()) + avail_numel = sum([p.numel() for p in frozen_param_fragments.values()]) + print(f'Frozen params: Have {avail_numel} numels to process.') + print(f'Frozen params: Need {wanted_numel} numels in {wanted_params} params') + + total_params = 0 + total_numel = 0 + for name, shape in frozen_param_shapes.items(): + total_params += 1 + unpartitioned_numel = shape.numel() + total_numel += unpartitioned_numel + + state_dict[name] = frozen_param_fragments[name] + + if debug: + print(f"{name} full shape: {shape} unpartitioned numel {unpartitioned_numel} ") + + print(f"Reconstructed Frozen fp32 state dict with {total_params} params {total_numel} elements") + + +def _has_callable(obj, fn): + attr = getattr(obj, fn, None) + return callable(attr) + + +def _zero2_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states): + param_shapes = zero_model_states[0].param_shapes + + # Reconstruction protocol: + # + # XXX: document this + + if debug: + for i in range(world_size): + for j in range(len(fp32_flat_groups[0])): + print(f"{FP32_FLAT_GROUPS}[{i}][{j}].shape={fp32_flat_groups[i][j].shape}") + + # XXX: memory usage doubles here (zero2) + num_param_groups = len(fp32_flat_groups[0]) + merged_single_partition_of_fp32_groups = [] + for i in range(num_param_groups): + merged_partitions = [sd[i] for sd in fp32_flat_groups] + full_single_fp32_vector = torch.cat(merged_partitions, 0) + merged_single_partition_of_fp32_groups.append(full_single_fp32_vector) + avail_numel = sum( + [full_single_fp32_vector.numel() for full_single_fp32_vector in merged_single_partition_of_fp32_groups]) + + if debug: + wanted_params = sum([len(shapes) for shapes in param_shapes]) + wanted_numel = sum([sum(shape.numel() for shape in shapes.values()) for shapes in param_shapes]) + # not asserting if there is a mismatch due to possible padding + print(f"Have {avail_numel} numels to process.") + print(f"Need {wanted_numel} numels in {wanted_params} params.") + + # params + # XXX: for huge models that can't fit into the host's RAM we will have to recode this to support + # out-of-core computing solution + total_numel = 0 + total_params = 0 + for shapes, full_single_fp32_vector in zip(param_shapes, merged_single_partition_of_fp32_groups): + offset = 0 + avail_numel = full_single_fp32_vector.numel() + for name, shape in shapes.items(): + + unpartitioned_numel = shape.numel() if _has_callable(shape, 'numel') else math.prod(shape) + total_numel += unpartitioned_numel + total_params += 1 + + if debug: + print(f"{name} full shape: {shape} unpartitioned numel {unpartitioned_numel} ") + state_dict[name] = full_single_fp32_vector.narrow(0, offset, unpartitioned_numel).view(shape) + offset += unpartitioned_numel + + # Z2 started to align to 2*world_size to improve nccl performance. Therefore both offset and + # avail_numel can differ by anywhere between 0..2*world_size. Due to two unrelated complex + # paddings performed in the code it's almost impossible to predict the exact numbers w/o the + # live optimizer object, so we are checking that the numbers are within the right range + align_to = 2 * world_size + + def zero2_align(x): + return align_to * math.ceil(x / align_to) + + if debug: + print(f"original offset={offset}, avail_numel={avail_numel}") + + offset = zero2_align(offset) + avail_numel = zero2_align(avail_numel) + + if debug: + print(f"aligned offset={offset}, avail_numel={avail_numel}") + + # Sanity check + if offset != avail_numel: + raise ValueError(f"consumed {offset} numels out of {avail_numel} - something is wrong") + + print(f"Reconstructed fp32 state dict with {total_params} params {total_numel} elements") + + +def _get_fp32_state_dict_from_zero2_checkpoint(world_size, fp32_flat_groups, zero_model_states, + exclude_frozen_parameters): + state_dict = OrderedDict() + + # buffers + buffers = zero_model_states[0].buffers + state_dict.update(buffers) + if debug: + print(f"added {len(buffers)} buffers") + + if not exclude_frozen_parameters: + _zero2_merge_frozen_params(state_dict, zero_model_states) + + _zero2_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states) + + # recover shared parameters + for pair in zero_model_states[0].shared_params: + if pair[1] in state_dict: + state_dict[pair[0]] = state_dict[pair[1]] + + return state_dict + + +def zero3_partitioned_param_info(unpartitioned_numel, world_size): + remainder = unpartitioned_numel % world_size + padding_numel = (world_size - remainder) if remainder else 0 + partitioned_numel = math.ceil(unpartitioned_numel / world_size) + return partitioned_numel, padding_numel + + +def _zero3_merge_frozen_params(state_dict, world_size, zero_model_states): + if zero_model_states[0].frozen_param_shapes is None or len(zero_model_states[0].frozen_param_shapes) == 0: + return + + if debug: + for i in range(world_size): + num_elem = sum(s.numel() for s in zero_model_states[i].frozen_param_fragments.values()) + print(f'rank {i}: {FROZEN_PARAM_SHAPES}.numel = {num_elem}') + + frozen_param_shapes = zero_model_states[0].frozen_param_shapes + wanted_params = len(frozen_param_shapes) + wanted_numel = sum(s.numel() for s in frozen_param_shapes.values()) + avail_numel = sum([p.numel() for p in zero_model_states[0].frozen_param_fragments.values()]) * world_size + print(f'Frozen params: Have {avail_numel} numels to process.') + print(f'Frozen params: Need {wanted_numel} numels in {wanted_params} params') + + total_params = 0 + total_numel = 0 + for name, shape in zero_model_states[0].frozen_param_shapes.items(): + total_params += 1 + unpartitioned_numel = shape.numel() + total_numel += unpartitioned_numel + + param_frags = tuple(model_state.frozen_param_fragments[name] for model_state in zero_model_states) + state_dict[name] = torch.cat(param_frags, 0).narrow(0, 0, unpartitioned_numel).view(shape) + + partitioned_numel, partitioned_padding_numel = zero3_partitioned_param_info(unpartitioned_numel, world_size) + + if debug: + print( + f"Frozen params: {total_params} {name} full shape: {shape} partition0 numel={partitioned_numel} partitioned_padding_numel={partitioned_padding_numel}" + ) + + print(f"Reconstructed Frozen fp32 state dict with {total_params} params {total_numel} elements") + + +class GatheredTensor: + """ + A pseudo tensor that collects partitioned weights. + It is more memory efficient when there are multiple groups. + """ + + def __init__(self, flat_groups, flat_groups_offset, offset, partitioned_numel, shape): + self.flat_groups = flat_groups + self.flat_groups_offset = flat_groups_offset + self.offset = offset + self.partitioned_numel = partitioned_numel + self.shape = shape + self.dtype = self.flat_groups[0][0].dtype + + def contiguous(self): + """ + Merge partitioned weights from flat_groups into a single tensor. + """ + end_idx = self.offset + self.partitioned_numel + world_size = len(self.flat_groups) + pad_flat_param_chunks = [] + + for rank_i in range(world_size): + # for each rank, we need to collect weights from related group/groups + flat_groups_at_rank_i = self.flat_groups[rank_i] + start_group_id = None + end_group_id = None + for group_id in range(len(self.flat_groups_offset)): + if self.flat_groups_offset[group_id] <= self.offset < self.flat_groups_offset[group_id + 1]: + start_group_id = group_id + if self.flat_groups_offset[group_id] < end_idx <= self.flat_groups_offset[group_id + 1]: + end_group_id = group_id + break + # collect weights from related group/groups + for group_id in range(start_group_id, end_group_id + 1): + flat_tensor = flat_groups_at_rank_i[group_id] + start_offset = self.offset - self.flat_groups_offset[group_id] + end_offset = min(end_idx, self.flat_groups_offset[group_id + 1]) - self.flat_groups_offset[group_id] + pad_flat_param_chunks.append(flat_tensor[start_offset:end_offset]) + + # collect weights from all ranks + pad_flat_param = torch.cat(pad_flat_param_chunks, dim=0) + param = pad_flat_param[:self.shape.numel()].view(self.shape).contiguous() + return param + + +def _zero3_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states): + param_shapes = zero_model_states[0].param_shapes + avail_numel = sum([flat_group.numel() for flat_group in fp32_flat_groups[0]]) * world_size + + # Reconstruction protocol: For zero3 we need to zip the partitions together at boundary of each + # param, re-consolidating each param, while dealing with padding if any + + # merge list of dicts, preserving order + param_shapes = {k: v for d in param_shapes for k, v in d.items()} + + if debug: + for i in range(world_size): + print(f"{FP32_FLAT_GROUPS}[{i}].shape={fp32_flat_groups[i].shape}") + + wanted_params = len(param_shapes) + wanted_numel = sum(shape.numel() for shape in param_shapes.values()) + # not asserting if there is a mismatch due to possible padding + avail_numel = fp32_flat_groups[0].numel() * world_size + print(f"Trainable params: Have {avail_numel} numels to process.") + print(f"Trainable params: Need {wanted_numel} numels in {wanted_params} params.") + + # params + # XXX: for huge models that can't fit into the host's RAM we will have to recode this to support + # out-of-core computing solution + offset = 0 + total_numel = 0 + total_params = 0 + flat_groups_offset = [0] + list(np.cumsum([flat_tensor.numel() for flat_tensor in fp32_flat_groups[0]])) + for name, shape in tqdm(param_shapes.items(), desc='Gathering sharded weights'): + unpartitioned_numel = shape.numel() + total_numel += unpartitioned_numel + total_params += 1 + partitioned_numel, partitioned_padding_numel = zero3_partitioned_param_info(unpartitioned_numel, world_size) + + if debug: + print( + f"Trainable params: {total_params} {name} full shape: {shape} partition0 numel={partitioned_numel} partitioned_padding_numel={partitioned_padding_numel}" + ) + + # memory efficient tensor + tensor = GatheredTensor(fp32_flat_groups, flat_groups_offset, offset, partitioned_numel, shape) + state_dict[name] = tensor + offset += partitioned_numel + + offset *= world_size + + # Sanity check + if offset != avail_numel: + raise ValueError(f"consumed {offset} numels out of {avail_numel} - something is wrong") + + print(f"Reconstructed Trainable fp32 state dict with {total_params} params {total_numel} elements") + + +def _get_fp32_state_dict_from_zero3_checkpoint(world_size, fp32_flat_groups, zero_model_states, + exclude_frozen_parameters): + state_dict = OrderedDict() + + # buffers + buffers = zero_model_states[0].buffers + state_dict.update(buffers) + if debug: + print(f"added {len(buffers)} buffers") + + if not exclude_frozen_parameters: + _zero3_merge_frozen_params(state_dict, world_size, zero_model_states) + + _zero3_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states) + + # recover shared parameters + for pair in zero_model_states[0].shared_params: + if pair[1] in state_dict: + state_dict[pair[0]] = state_dict[pair[1]] + + return state_dict + + +def to_torch_tensor(state_dict, return_empty_tensor=False): + """ + Convert state_dict of GatheredTensor to torch tensor + """ + torch_state_dict = {} + converted_tensors = {} + for name, tensor in state_dict.items(): + tensor_id = id(tensor) + if tensor_id in converted_tensors: # shared tensors + shared_tensor = torch_state_dict[converted_tensors[tensor_id]] + torch_state_dict[name] = shared_tensor + else: + converted_tensors[tensor_id] = name + if return_empty_tensor: + torch_state_dict[name] = torch.empty(tensor.shape, dtype=tensor.dtype) + else: + torch_state_dict[name] = tensor.contiguous() + return torch_state_dict + + +def get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir, + tag=None, + exclude_frozen_parameters=False, + lazy_mode=False): + """ + Convert ZeRO 2 or 3 checkpoint into a single fp32 consolidated state_dict that can be loaded with + ``load_state_dict()`` and used for training without DeepSpeed or shared with others, for example + via a model hub. + + Args: + - ``checkpoint_dir``: path to the desired checkpoint folder + - ``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`` + - ``exclude_frozen_parameters``: exclude frozen parameters + - ``lazy_mode``: get state_dict in lazy mode. It returns a dict of pesduo tensor instead of torch tensor, which is more memory efficient. + Convert the pesduo tensor to torch tensor by ``.contiguous()`` + + Returns: + - pytorch ``state_dict`` + + A typical usage might be :: + + from deepspeed.utils.zero_to_fp32 import get_fp32_state_dict_from_zero_checkpoint + # do the training and checkpoint saving + state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir) # already on cpu + model = model.cpu() # move to cpu + model.load_state_dict(state_dict) + # submit to model hub or save the model to share with others + + In this example the ``model`` will no longer be usable in the deepspeed context of the same + application. i.e. you will need to re-initialize the deepspeed engine, since + ``model.load_state_dict(state_dict)`` will remove all the deepspeed magic from it. + + If you want it all done for you, use ``load_state_dict_from_zero_checkpoint`` instead. + + Note: the above usage may not work if your application doesn't have sufficient free CPU memory. + You may need to use the offline approach using the ``zero_to_fp32.py`` script that is saved with + the checkpoint. Or you can load state_dict in lazy mode :: + + from deepspeed.utils.zero_to_fp32 import get_fp32_state_dict_from_zero_checkpoint + state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir, lazy_mode=True) # not on cpu + for name, lazy_tensor in state_dict.item(): + tensor = lazy_tensor.contiguous() # to cpu + print(name, tensor) + # del tensor to release memory if it no longer in use + """ + if tag is None: + latest_path = os.path.join(checkpoint_dir, 'latest') + if os.path.isfile(latest_path): + with open(latest_path, 'r') as fd: + tag = fd.read().strip() + else: + raise ValueError(f"Unable to find 'latest' file at {latest_path}") + + ds_checkpoint_dir = os.path.join(checkpoint_dir, tag) + + if not os.path.isdir(ds_checkpoint_dir): + raise FileNotFoundError(f"Directory '{ds_checkpoint_dir}' doesn't exist") + + state_dict = _get_fp32_state_dict_from_zero_checkpoint(ds_checkpoint_dir, exclude_frozen_parameters) + if lazy_mode: + return state_dict + else: + return to_torch_tensor(state_dict) + + +def convert_zero_checkpoint_to_fp32_state_dict(checkpoint_dir, + output_dir, + max_shard_size="5GB", + safe_serialization=False, + tag=None, + exclude_frozen_parameters=False): + """ + Convert ZeRO 2 or 3 checkpoint into a single fp32 consolidated ``state_dict`` file that can be + loaded with ``torch.load(file)`` + ``load_state_dict()`` and used for training without DeepSpeed. + + Args: + - ``checkpoint_dir``: path to the desired checkpoint folder. (one that contains the tag-folder, like ``global_step14``) + - ``output_dir``: directory to the pytorch fp32 state_dict output files + - ``max_shard_size``: the maximum size for a checkpoint before being sharded, default value is 5GB + - ``safe_serialization``: whether to save the model using `safetensors` or the traditional PyTorch way (that uses `pickle`). + - ``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`` + - ``exclude_frozen_parameters``: exclude frozen parameters + """ + + # Dependency pre-check + if safe_serialization: + try: + from safetensors.torch import save_file + except ImportError: + print('If you want to use `safe_serialization`, please `pip install safetensors`') + raise + if max_shard_size is not None: + try: + from huggingface_hub import split_torch_state_dict_into_shards + except ImportError: + print('If you want to use `max_shard_size`, please `pip install huggingface_hub`') + raise + + # Convert zero checkpoint to state_dict + state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir, + tag, + exclude_frozen_parameters, + lazy_mode=True) + + # Shard the model if it is too big. + weights_name = "model.safetensors" if safe_serialization else "pytorch_model.bin" + if max_shard_size is not None: + filename_pattern = weights_name.replace(".bin", "{suffix}.bin").replace(".safetensors", "{suffix}.safetensors") + # an memory-efficient approach for sharding + empty_state_dict = to_torch_tensor(state_dict, return_empty_tensor=True) + state_dict_split = split_torch_state_dict_into_shards(empty_state_dict, + filename_pattern=filename_pattern, + max_shard_size=max_shard_size) + else: + from collections import namedtuple + StateDictSplit = namedtuple("StateDictSplit", ["is_sharded", "filename_to_tensors"]) + state_dict_split = StateDictSplit(is_sharded=False, + filename_to_tensors={weights_name: list(state_dict.keys())}) + + # Save the model by shard + os.makedirs(output_dir, exist_ok=True) + filename_to_tensors = state_dict_split.filename_to_tensors.items() + for shard_file, tensors in tqdm(filename_to_tensors, desc="Saving checkpoint shards"): + shard_state_dict = {tensor_name: state_dict[tensor_name] for tensor_name in tensors} + shard_state_dict = to_torch_tensor(shard_state_dict) + output_path = os.path.join(output_dir, shard_file) + if safe_serialization: + save_file(shard_state_dict, output_path, metadata={"format": "pt"}) + else: + torch.save(shard_state_dict, output_path) + # release the memory of current shard + for tensor_name in list(shard_state_dict.keys()): + del state_dict[tensor_name] + del shard_state_dict[tensor_name] + del shard_state_dict + gc.collect() + + # Save index if sharded + if state_dict_split.is_sharded: + index = { + "metadata": state_dict_split.metadata, + "weight_map": state_dict_split.tensor_to_filename, + } + save_index_file = "model.safetensors.index.json" if safe_serialization else "pytorch_model.bin.index.json" + save_index_file = os.path.join(output_dir, save_index_file) + with open(save_index_file, "w", encoding="utf-8") as f: + content = json.dumps(index, indent=2, sort_keys=True) + "\n" + f.write(content) + + +def load_state_dict_from_zero_checkpoint(model, checkpoint_dir, tag=None): + """ + 1. Put the provided model to cpu + 2. Convert ZeRO 2 or 3 checkpoint into a single fp32 consolidated ``state_dict`` + 3. Load it into the provided model + + Args: + - ``model``: the model object to update + - ``checkpoint_dir``: path to the desired checkpoint folder. (one that contains the tag-folder, like ``global_step14``) + - ``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`` + + Returns: + - ``model`: modified model + + Make sure you have plenty of CPU memory available before you call this function. If you don't + have enough use the ``zero_to_fp32.py`` utility to do the conversion. You will find it + conveniently placed for you in the checkpoint folder. + + A typical usage might be :: + + from deepspeed.utils.zero_to_fp32 import load_state_dict_from_zero_checkpoint + model = load_state_dict_from_zero_checkpoint(trainer.model, checkpoint_dir) + # submit to model hub or save the model to share with others + + Note, that once this was run, the ``model`` will no longer be usable in the deepspeed context + of the same application. i.e. you will need to re-initialize the deepspeed engine, since + ``model.load_state_dict(state_dict)`` will remove all the deepspeed magic from it. + + """ + logger.info(f"Extracting fp32 weights") + state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir, tag) + + logger.info(f"Overwriting model with fp32 weights") + model = model.cpu() + model.load_state_dict(state_dict, strict=False) + + return model + + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + parser.add_argument("checkpoint_dir", + type=str, + help="path to the desired checkpoint folder, e.g., path/checkpoint-12") + parser.add_argument("output_dir", + type=str, + help="directory to the pytorch fp32 state_dict output files" + "(e.g. path/checkpoint-12-output/)") + parser.add_argument( + "--max_shard_size", + type=str, + default="5GB", + help="The maximum size for a checkpoint before being sharded. Checkpoints shard will then be each of size" + "lower than this size. If expressed as a string, needs to be digits followed by a unit (like `5MB`" + "We default it to 5GB in order for models to be able to run easily on free-tier google colab instances" + "without CPU OOM issues.") + parser.add_argument( + "--safe_serialization", + default=False, + action='store_true', + help="Whether to save the model using `safetensors` or the traditional PyTorch way (that uses `pickle`).") + parser.add_argument("-t", + "--tag", + type=str, + default=None, + help="checkpoint tag used as a unique identifier for checkpoint. e.g., global_step1") + parser.add_argument("--exclude_frozen_parameters", action='store_true', help="exclude frozen parameters") + parser.add_argument("-d", "--debug", action='store_true', help="enable debug") + args = parser.parse_args() + + debug = args.debug + + convert_zero_checkpoint_to_fp32_state_dict(args.checkpoint_dir, + args.output_dir, + max_shard_size=args.max_shard_size, + safe_serialization=args.safe_serialization, + tag=args.tag, + exclude_frozen_parameters=args.exclude_frozen_parameters) diff --git a/checkpoint-720/README.md b/checkpoint-720/README.md new file mode 100644 index 0000000000000000000000000000000000000000..4eae946233309baf42f5bad9740186144a4f3b33 --- /dev/null +++ b/checkpoint-720/README.md @@ -0,0 +1,202 @@ +--- +base_model: ../../initial_seq_model +library_name: peft +--- + +# Model Card for Model ID + + + + + +## Model Details + +### Model Description + + + + + +- **Developed by:** [More Information Needed] +- **Funded by [optional]:** [More Information Needed] +- **Shared by [optional]:** [More Information Needed] +- **Model type:** [More Information Needed] +- **Language(s) (NLP):** [More Information Needed] +- **License:** [More Information Needed] +- **Finetuned from model [optional]:** [More Information Needed] + +### Model Sources [optional] + + + +- **Repository:** [More Information Needed] +- **Paper [optional]:** [More Information Needed] +- **Demo [optional]:** [More Information Needed] + +## Uses + + + +### Direct Use + + + +[More Information Needed] + +### Downstream Use [optional] + + + +[More Information Needed] + +### Out-of-Scope Use + + + +[More Information Needed] + +## Bias, Risks, and Limitations + + + +[More Information Needed] + +### Recommendations + + + +Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations. + +## How to Get Started with the Model + +Use the code below to get started with the model. + +[More Information Needed] + +## Training Details + +### Training Data + + + +[More Information Needed] + +### Training Procedure + + + +#### Preprocessing [optional] + +[More Information Needed] + + +#### Training Hyperparameters + +- **Training regime:** [More Information Needed] + +#### Speeds, Sizes, Times [optional] + + + +[More Information Needed] + +## Evaluation + + + +### Testing Data, Factors & Metrics + +#### Testing Data + + + +[More Information Needed] + +#### Factors + + + +[More Information Needed] + +#### Metrics + + + +[More Information Needed] + +### Results + +[More Information Needed] + +#### Summary + + + +## Model Examination [optional] + + + +[More Information Needed] + +## Environmental Impact + + + +Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700). + +- **Hardware Type:** [More Information Needed] +- **Hours used:** [More Information Needed] +- **Cloud Provider:** [More Information Needed] +- **Compute Region:** [More Information Needed] +- **Carbon Emitted:** [More Information Needed] + +## Technical Specifications [optional] + +### Model Architecture and Objective + +[More Information Needed] + +### Compute Infrastructure + +[More Information Needed] + +#### Hardware + +[More Information Needed] + +#### Software + +[More Information Needed] + +## Citation [optional] + + + +**BibTeX:** + +[More Information Needed] + +**APA:** + +[More Information Needed] + +## Glossary [optional] + + + +[More Information Needed] + +## More Information [optional] + +[More Information Needed] + +## Model Card Authors [optional] + +[More Information Needed] + +## Model Card Contact + +[More Information Needed] +### Framework versions + +- PEFT 0.14.0 \ No newline at end of file diff --git a/checkpoint-720/adapter_config.json b/checkpoint-720/adapter_config.json new file mode 100644 index 0000000000000000000000000000000000000000..e1a650486f9ba9bab8c8dbb7d564bdc4ec121cf7 --- /dev/null +++ b/checkpoint-720/adapter_config.json @@ -0,0 +1,38 @@ +{ + "alpha_pattern": {}, + "auto_mapping": null, + "base_model_name_or_path": "../../initial_seq_model", + "bias": "none", + "eva_config": null, + "exclude_modules": null, + "fan_in_fan_out": false, + "inference_mode": true, + "init_lora_weights": true, + "layer_replication": null, + "layers_pattern": null, + "layers_to_transform": null, + "loftq_config": {}, + "lora_alpha": 16, + "lora_bias": false, + "lora_dropout": 0.1, + "megatron_config": null, + "megatron_core": "megatron.core", + "modules_to_save": null, + "peft_type": "LORA", + "r": 8, + "rank_pattern": {}, + "revision": null, + "target_modules": [ + "k_proj", + "o_proj", + "gate_proj", + "down_proj", + "score", + "v_proj", + "up_proj", + "q_proj" + ], + "task_type": "CAUSAL_LM", + "use_dora": false, + "use_rslora": false +} \ No newline at end of file diff --git a/checkpoint-720/adapter_model.safetensors b/checkpoint-720/adapter_model.safetensors new file mode 100644 index 0000000000000000000000000000000000000000..db78984eebe4573c2ef69b35556bda8db25d5b1a --- /dev/null +++ b/checkpoint-720/adapter_model.safetensors @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d33d46b02df60f38652e3f17c2fb7dd7234217d0e537abcc4581123b05f03bab +size 42068368 diff --git a/checkpoint-720/global_step720/bf16_zero_pp_rank_0_mp_rank_00_optim_states.pt b/checkpoint-720/global_step720/bf16_zero_pp_rank_0_mp_rank_00_optim_states.pt new file mode 100644 index 0000000000000000000000000000000000000000..5b6a04a2d91fc61a85158e41a242381fdbd67aed --- /dev/null +++ b/checkpoint-720/global_step720/bf16_zero_pp_rank_0_mp_rank_00_optim_states.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6cbde33fe6b747207a3ef246654a49e04243e9eaef7a20c1fd2b421a56aaa083 +size 63016432 diff --git a/checkpoint-720/global_step720/bf16_zero_pp_rank_1_mp_rank_00_optim_states.pt b/checkpoint-720/global_step720/bf16_zero_pp_rank_1_mp_rank_00_optim_states.pt new file mode 100644 index 0000000000000000000000000000000000000000..6f982dcef7588000a8252a4df42f1f1922df9727 --- /dev/null +++ b/checkpoint-720/global_step720/bf16_zero_pp_rank_1_mp_rank_00_optim_states.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:26dbb31c33faa98b143c33e0d1ac7ab9244ab72bef3998eef5e33a3d5a18fc78 +size 63016432 diff --git a/checkpoint-720/global_step720/bf16_zero_pp_rank_2_mp_rank_00_optim_states.pt b/checkpoint-720/global_step720/bf16_zero_pp_rank_2_mp_rank_00_optim_states.pt new file mode 100644 index 0000000000000000000000000000000000000000..b3bcd64f11b262c0df79ec5f5f842c7afe12cf1a --- /dev/null +++ b/checkpoint-720/global_step720/bf16_zero_pp_rank_2_mp_rank_00_optim_states.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:25e54941507f0f0a0d60a81dd18123d51236f49fa613696524598a8ba73af6f0 +size 63016432 diff --git a/checkpoint-720/global_step720/bf16_zero_pp_rank_3_mp_rank_00_optim_states.pt b/checkpoint-720/global_step720/bf16_zero_pp_rank_3_mp_rank_00_optim_states.pt new file mode 100644 index 0000000000000000000000000000000000000000..7c8cccedc59dcfd9e44bd4fd1f0c0df59cb330eb --- /dev/null +++ b/checkpoint-720/global_step720/bf16_zero_pp_rank_3_mp_rank_00_optim_states.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ca1e7646307219cd60f7a00014705f0533a8f37a210be1f6b8af319ed277faf3 +size 63016432 diff --git a/checkpoint-720/global_step720/zero_pp_rank_0_mp_rank_00_model_states.pt b/checkpoint-720/global_step720/zero_pp_rank_0_mp_rank_00_model_states.pt new file mode 100644 index 0000000000000000000000000000000000000000..c6e1ec1e48703c0e96bf3e971b0fada735f88fd3 --- /dev/null +++ b/checkpoint-720/global_step720/zero_pp_rank_0_mp_rank_00_model_states.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:29622de5ec2e1961f82f3a3a046b126d6da8ac4fb40a1f59f2f44cd9094b50ea +size 442088 diff --git a/checkpoint-720/global_step720/zero_pp_rank_1_mp_rank_00_model_states.pt b/checkpoint-720/global_step720/zero_pp_rank_1_mp_rank_00_model_states.pt new file mode 100644 index 0000000000000000000000000000000000000000..7de6011a7fc90cdbb17bacc86b64af91c7f0c357 --- /dev/null +++ b/checkpoint-720/global_step720/zero_pp_rank_1_mp_rank_00_model_states.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:028cbde08d2c0e5f7ad3a468e84f9d414b94a5c6efa5f4bf1f26818e0e0fb112 +size 442088 diff --git a/checkpoint-720/global_step720/zero_pp_rank_2_mp_rank_00_model_states.pt b/checkpoint-720/global_step720/zero_pp_rank_2_mp_rank_00_model_states.pt new file mode 100644 index 0000000000000000000000000000000000000000..b1edcb1afaacc476921811ac8714be427074ae8c --- /dev/null +++ b/checkpoint-720/global_step720/zero_pp_rank_2_mp_rank_00_model_states.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2b15e2e8501330717ec6696bbaa6f3da6d5b54721f4274a51c99326019b4a36f +size 442088 diff --git a/checkpoint-720/global_step720/zero_pp_rank_3_mp_rank_00_model_states.pt b/checkpoint-720/global_step720/zero_pp_rank_3_mp_rank_00_model_states.pt new file mode 100644 index 0000000000000000000000000000000000000000..e304d1eae2a06c1993e5f40eacdaea0701fbe15e --- /dev/null +++ b/checkpoint-720/global_step720/zero_pp_rank_3_mp_rank_00_model_states.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ce24996d77979b7b3ab36cd59e7f12412235b6c3eb9d0a0a59aae307bb4f32e0 +size 442088 diff --git a/checkpoint-720/latest b/checkpoint-720/latest new file mode 100644 index 0000000000000000000000000000000000000000..8f1ba4819555d797ee4ba6952e5ead833fa2d83a --- /dev/null +++ b/checkpoint-720/latest @@ -0,0 +1 @@ +global_step720 \ No newline at end of file diff --git a/checkpoint-720/rng_state_0.pth b/checkpoint-720/rng_state_0.pth new file mode 100644 index 0000000000000000000000000000000000000000..382b3ea21eabc0dce2d068e35880536002330cc7 --- /dev/null +++ b/checkpoint-720/rng_state_0.pth @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a56f84928815db9de32428ecf23664f1eec32d2fc73e7ad4e2cd42fddf96e21e +size 14960 diff --git a/checkpoint-720/rng_state_1.pth b/checkpoint-720/rng_state_1.pth new file mode 100644 index 0000000000000000000000000000000000000000..805efd1eb5a86bfea519b609b6c6cb5c93fdb4b4 --- /dev/null +++ b/checkpoint-720/rng_state_1.pth @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dcd75b6eb15e556af564881a131230300e3abe36801505981875a0284109fce7 +size 14960 diff --git a/checkpoint-720/rng_state_2.pth b/checkpoint-720/rng_state_2.pth new file mode 100644 index 0000000000000000000000000000000000000000..cff44ef7d35027af29d9449052beaf58da6f83c8 --- /dev/null +++ b/checkpoint-720/rng_state_2.pth @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:db96afa234ac63eb517b3a3ce214ad4eb2a505d8b1ff1504f7e0916e42303e5b +size 14960 diff --git a/checkpoint-720/rng_state_3.pth b/checkpoint-720/rng_state_3.pth new file mode 100644 index 0000000000000000000000000000000000000000..f05d4555aeaa64edca14f0d4b9ea32eebc8bc0d2 --- /dev/null +++ b/checkpoint-720/rng_state_3.pth @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b5fec65912363a55689f9177beba9a902fee23b1e28e97eb58368e20912cfe7b +size 14960 diff --git a/checkpoint-720/scheduler.pt b/checkpoint-720/scheduler.pt new file mode 100644 index 0000000000000000000000000000000000000000..99e6805a3a19e32a9d279d76eb4a521a02fc2ff4 --- /dev/null +++ b/checkpoint-720/scheduler.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:11bb5d9c27dae54053b70a4362b3a1d341a606877c619931034c298695e842c3 +size 1064 diff --git a/checkpoint-720/special_tokens_map.json b/checkpoint-720/special_tokens_map.json new file mode 100644 index 0000000000000000000000000000000000000000..a8eb9ef63af01dfa2c350573b543b14275370944 --- /dev/null +++ b/checkpoint-720/special_tokens_map.json @@ -0,0 +1,30 @@ +{ + "bos_token": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false + }, + "eos_token": { + "content": "<|END_OF_TURN_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false + }, + "pad_token": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false + }, + "unk_token": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false + } +} diff --git a/checkpoint-720/tokenizer.json b/checkpoint-720/tokenizer.json new file mode 100644 index 0000000000000000000000000000000000000000..91a1344d38167f152a8803a80eb79ca4b465adbb --- /dev/null +++ b/checkpoint-720/tokenizer.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:28c8b8038fcb2756e349a51832a56634423c579a869f39642526327aa56b2989 +size 20125189 diff --git a/checkpoint-720/tokenizer_config.json b/checkpoint-720/tokenizer_config.json new file mode 100644 index 0000000000000000000000000000000000000000..100ac1a3b6cff4a9043d2c0fd6b1603d1c1ee1e1 --- /dev/null +++ b/checkpoint-720/tokenizer_config.json @@ -0,0 +1,364 @@ +{ + "add_bos_token": true, + "add_eos_token": false, + "add_prefix_space": false, + "added_tokens_decoder": { + "0": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "1": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "2": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "3": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "4": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "5": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "6": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "7": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "255000": { + "content": "<|START_OF_TURN_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255001": { + "content": "<|END_OF_TURN_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "255002": { + "content": "<|YES_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255003": { + "content": "<|NO_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255004": { + "content": "<|GOOD_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255005": { + "content": "<|BAD_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255006": { + "content": "<|USER_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255007": { + "content": "<|CHATBOT_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255008": { + "content": "<|SYSTEM_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255009": { + "content": "<|USER_0_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255010": { + "content": "<|USER_1_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255011": { + "content": "<|USER_2_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255012": { + "content": "<|USER_3_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255013": { + "content": "<|USER_4_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255014": { + "content": "<|USER_5_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255015": { + "content": "<|USER_6_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255016": { + "content": "<|USER_7_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255017": { + "content": "<|USER_8_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255018": { + "content": "<|USER_9_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255019": { + "content": "<|START_THINKING|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255020": { + "content": "<|END_THINKING|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255021": { + "content": "<|START_RESPONSE|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "255022": { + "content": "<|END_RESPONSE|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "255023": { + "content": "<|START_ACTION|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255024": { + "content": "<|END_ACTION|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255025": { + "content": "<|START_TOOL_RESULT|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255026": { + "content": "<|END_TOOL_RESULT|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255027": { + "content": "<|EXTRA_8_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255028": { + "content": "<|NEW_FILE|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "255029": { + "content": "<|BEGINNING_OF_PREFIX_FIM_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255030": { + "content": "<|BEGINNING_OF_MIDDLE_FIM_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255031": { + "content": "<|BEGINNING_OF_SUFFIX_FIM_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255032": { + "content": "<|END_OF_MIDDLE_FIM_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + } + }, + "bos_token": "", + "chat_template": [ + { + "name": "default", + "template": "{% if documents %}\n{% set tools = [] %}\n{%- macro document_turn(documents) -%}\n{# format documents into chat turn #}\n<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|><|START_THINKING|>I will look through the document to address the users needs.<|END_THINKING|><|START_ACTION|>[\n {\"tool_call_id\": \"0\", \"tool_name\": \"direct-injected-document\", \"parameters\": {}}\n]<|END_ACTION|><|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|><|START_TOOL_RESULT|>[\n {\n \"tool_call_id\": \"0\",\n \"results\": {\n{% for doc in documents %}\n \"{{ loop.index0 }}\": {{doc|tojson}}{% if not loop.last %},\n {% endif %}\n{% endfor %}\n\n },\n \"is_error\": null\n }\n]<|END_TOOL_RESULT|><|END_OF_TURN_TOKEN|>{%- endmacro %}\n{%- macro tool_call_id_to_int(messages, tool_call_id) %}\n{%- set counter = namespace(value=0) %}\n{%- set tool_call_id_seen = namespace(value=false) %}\n{%- for msg in messages %}\n {%- if msg.tool_calls %}\n {%- for tool_call in msg.tool_calls %}\n {%- if tool_call.id == tool_call_id and not tool_call_id_seen.value -%}\n {{ counter.value }}\n {%- set tool_call_id_seen.value = true %}\n {%- endif %}\n {%- set counter.value = counter.value + 1 %}\n {%- endfor %}\n {%- endif %}\n{%- endfor %}\n{%- endmacro %}\n{%- macro format_tool_message(messages, tool_msg) -%}\n{# format tool message #}\n {\n \"tool_call_id\": \"{{ tool_call_id_to_int(messages, tool_msg.tool_call_id) }}\",\n \"results\": {\n \"0\": {{ tool_msg.content|tojson }}\n },\n \"is_error\": null\n }\n{%- endmacro -%}\n{%- if messages and messages[0]['role']|lower == 'system' %}{%- set developer_preamble = messages[0]['content'] %}{% endif %}\n{%- set tool_idx = namespace(value=0) %}\n{%- set tool_ids_seen = namespace(value=[]) %}\n{%- set sent_documents = namespace(value=false) %}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|># System Preamble\nYou are in contextual safety mode. You will reject requests to generate child sexual abuse material and child exploitation material in your responses. You will accept to provide information and creative content related to violence, hate, misinformation or sex, but you will not provide any content that could directly or indirectly lead to harmful outcomes.\n\nYour information cutoff date is June 2024.\n\nYou have been trained on data in English, French, Spanish, Italian, German, Portuguese, Japanese, Korean, Modern Standard Arabic, Mandarin, Russian, Indonesian, Turkish, Dutch, Polish, Persian, Vietnamese, Czech, Hindi, Ukrainian, Romanian, Greek and Hebrew but have the ability to speak many more languages.\n{% if tools or documents %}\n\nYou have been trained to have advanced reasoning and tool-use capabilities and you should make best use of these skills to serve user's requests.\n\n## Tool Use\nThink about how you can make best use of the provided tools to help with the task and come up with a high level plan that you will execute first.\n\n0. Start by writing <|START_THINKING|> followed by a detailed step by step plan of how you will solve the problem. For each step explain your thinking fully and give details of required tool calls (if needed). Unless specified otherwise, you write your plan in natural language. When you finish, close it out with <|END_THINKING|>.\n You can optionally choose to skip this step when the user request is so straightforward to address that only a trivial plan would be needed.\n NOTE: You MUST skip this step when you are directly responding to the user's request without using any tools.\n\nThen carry out your plan by repeatedly executing the following steps.\n1. Action: write <|START_ACTION|> followed by a list of JSON-formatted tool calls, with each one containing \"tool_name\" and \"parameters\" fields.\n When there are multiple tool calls which are completely independent of each other (i.e. they can be executed in parallel), you should list them out all together in one step. When you finish, close it out with <|END_ACTION|>.\n2. Observation: you will then receive results of those tool calls in JSON format in the very next turn, wrapped around by <|START_TOOL_RESULT|> and <|END_TOOL_RESULT|>. Carefully observe those results and think about what to do next. Note that these results will be provided to you in a separate turn. NEVER hallucinate results.\n Every tool call produces a list of results (when a tool call produces no result or a single result, it'll still get wrapped inside a list). Each result is clearly linked to its originating tool call via its \"tool_call_id\".\n3. Reflection: start the next turn by writing <|START_THINKING|> followed by what you've figured out so far, any changes you need to make to your plan, and what you will do next. When you finish, close it out with <|END_THINKING|>.\n You can optionally choose to skip this step when everything is going according to plan and no special pieces of information or reasoning chains need to be recorded.\n NOTE: You MUST skip this step when you are done with tool-use actions and are ready to respond to the user.\n\nYou can repeat the above 3 steps multiple times (could be 0 times too if no suitable tool calls are available or needed), until you decide it's time to finally respond to the user.\n\n4. Response: then break out of the loop and write <|START_RESPONSE|> followed by a piece of text which serves as a response to the user's last request. Use all previous tool calls and results to help you when formulating your response. When you finish, close it out with <|END_RESPONSE|>.\n{% if enable_citations %}\n\n## Grounding\nImportantly, note that \"Reflection\" and \"Response\" above can be grounded.\nGrounding means you associate pieces of texts (called \"spans\") with those specific tool results that support them (called \"sources\"). And you use a pair of tags \"\" and \"\" to indicate when a span can be grounded onto a list of sources, listing them out in the closing tag. Sources from the same tool call are grouped together and listed as \"{tool_call_id}:[{list of result indices}]\", before they are joined together by \",\". E.g., \"span\" means that \"span\" is supported by result 1 and 2 from \"tool_call_id=0\" as well as result 0 from \"tool_call_id=1\".\n{% endif %}\n\n## Available Tools\nHere is the list of tools that you have available to you.\nYou can ONLY use the tools listed here. When a tool is not listed below, it is NOT available and you should NEVER attempt to use it.\nEach tool is represented as a JSON object with fields like \"name\", \"description\", \"parameters\" (per JSON Schema), and optionally, \"responses\" (per JSON Schema).\n\n```json\n[\n{% if documents %}\n {\"name\": \"direct-injected-document\", \"description\": \"This is a special tool to directly inject user-uploaded documents into the chat as additional context. DO NOT use this tool by yourself!\", \"parameters\": {\"type\": \"object\", \"properties\": {}, \"required\": []}, \"responses\": {\"200\": {\"description\": \"Successfully returned a list of chunked text snippets from the directly uploaded documents.\", \"content\": {\"application/json\": {\"schema\": {\"type\": \"array\", \"items\": {\"type\": \"object\", \"required\": [\"url\", \"snippet\"], \"properties\": {\"url\": {\"type\": \"string\", \"description\": \"The url of the uploaded document.\"}, \"snippet\": {\"type\": \"string\", \"description\": \"The text snippet for the returned document chunk.\"}}}}}}}}}{%- if tools %},{% endif %}\n\n{% endif %}\n{% for tool in tools %}\n {\"name\": \"{{ tool['function']['name'] }}\", \"description\": \"{{tool['function']['description']}}\", \"parameters\": {{ tool['function']['parameters']|tojson }}, \"responses\": null}{%- if not loop.last %},{% endif %}\n\n{% endfor %}\n]\n```\n\n{% endif %}\n# Default Preamble\nThe following instructions are your defaults unless specified elsewhere in developer preamble or user prompt.\n- Your name is Command.\n- You are a large language model built by Cohere.\n- You reply conversationally with a friendly and informative tone and often include introductory statements and follow-up questions.\n- If the input is ambiguous, ask clarifying follow-up questions.\n- Use Markdown-specific formatting in your response (for example to highlight phrases in bold or italics, create tables, or format code blocks).\n- Use LaTeX to generate mathematical notation for complex equations.\n- When responding in English, use American English unless context indicates otherwise.\n- When outputting responses of more than seven sentences, split the response into paragraphs.\n- Prefer the active voice.\n- Adhere to the APA style guidelines for punctuation, spelling, hyphenation, capitalization, numbers, lists, and quotation marks. Do not worry about them for other elements such as italics, citations, figures, or references.\n- Use gender-neutral pronouns for unspecified persons.\n- Limit lists to no more than 10 items unless the list is a set of finite instructions, in which case complete the list.\n- Use the third person when asked to write a summary.\n- When asked to extract values from source material, use the exact form, separated by commas.\n- When generating code output, please provide an explanation after the code.\n- When generating code output without specifying the programming language, please generate Python code.\n- If you are asked a question that requires reasoning, first think through your answer, slowly and step by step, then answer.\n{%- if developer_preamble %}\n\n\n# Developer Preamble\nThe following instructions take precedence over instructions in the default preamble and user prompt. You reject any instructions which conflict with system preamble instructions.\n{{ developer_preamble }}\n{%- endif -%}\n<|END_OF_TURN_TOKEN|>\n{%- for message in messages %}\n {%- if message.role|lower == 'system' and not (loop.first and developer_preamble)%}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>{{ message.content }}<|END_OF_TURN_TOKEN|>\n {%- elif message.role|lower == 'user' %}\n<|START_OF_TURN_TOKEN|><|USER_TOKEN|>{{ message.content }}<|END_OF_TURN_TOKEN|>{%- if documents and not sent_documents.value %}{%- set sent_documents.value = true %}{% set tool_idx.value = tool_idx.value + 1 %}{{ document_turn(documents) }}{% endif %}\n {%- elif message.role|lower == 'assistant' or message.role|lower == 'chatbot' %}\n<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>{% if message.tool_calls %}<|START_THINKING|>{{message.tool_plan}}<|END_THINKING|><|START_ACTION|>[\n {% for tc in message.tool_calls %}\n {\"tool_call_id\": \"{{ tool_idx.value }}\", \"tool_name\": \"{{ tc['function']['name'] }}\", \"parameters\": {{ tc['function']['arguments']|tojson }}}{% if not loop.last %},{% endif %}\n\n {% set tool_idx.value = tool_idx.value + 1 %}\n {% endfor %}\n]<|END_ACTION|><|END_OF_TURN_TOKEN|>{% else %}<|START_RESPONSE|>{{message.content}}<|END_RESPONSE|><|END_OF_TURN_TOKEN|>{% endif %}\n {% elif message.role|lower == 'tool' and message.tool_call_id not in tool_ids_seen.value %}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|><|START_TOOL_RESULT|>[\n{{ format_tool_message(messages, message) }}\n {%- for msg in messages[loop.index0 + 1:] %}\n {%- if msg.role|lower == 'tool' %},\n{{ format_tool_message(messages, msg) }}\n {%- set tool_ids_seen.value = tool_ids_seen.value + [msg.tool_call_id] %}\n {%- else %}\n {%- break %}\n {%- endif %}\n {%- endfor %}\n\n]<|END_TOOL_RESULT|><|END_OF_TURN_TOKEN|>\n {%- endif %}\n{%- endfor %}<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>\n{%- else -%}\n{% if messages[0]['role'] == 'system' %}{% set loop_messages = messages[1:] %}\n {%- set system_message = messages[0]['content'] %}{% elif false == true %}\n {%- set loop_messages = messages %}{% set system_message = '' %}\n{%- else %}\n {%- set loop_messages = messages %}\n {%- set system_message = false %}\n{%- endif %}\n{%- if system_message != false -%}\n {{ '<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>' + system_message + '<|END_OF_TURN_TOKEN|>' }}\n{%- else -%}\n {{ '<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|><|END_OF_TURN_TOKEN|>' }}\n{%- endif %}\n{%- for message in loop_messages %}\n {%- if (message['role'] == 'user') != (loop.index0 % 2 == 0) -%}\n {{ raise_exception('Conversation roles must alternate user/assistant/user/assistant/...') }}\n {%- endif -%}\n {%- set content = message['content'] -%}\n {%- if message['role'] == 'user' -%}\n {{ '<|START_OF_TURN_TOKEN|><|USER_TOKEN|>' + content.strip() + '<|END_OF_TURN_TOKEN|>' }}\n {%- elif message['role'] == 'assistant' -%}\n {{ '<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|><|START_RESPONSE|>' + content.strip() + '<|END_RESPONSE|><|END_OF_TURN_TOKEN|>' }}\n {%- endif %}\n{%- endfor %}\n{%- if add_generation_prompt -%}\n {{ '<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|><|START_RESPONSE|>' }}\n{%- endif %}\n{% endif %}" + }, + { + "name": "tool_use", + "template": "{%- macro document_turn(documents) -%}\n{# format documents into chat turn #}\n<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|><|START_THINKING|>I will look through the document to address the users needs.<|END_THINKING|><|START_ACTION|>[\n {\"tool_call_id\": \"0\", \"tool_name\": \"direct-injected-document\", \"parameters\": {}}\n]<|END_ACTION|><|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|><|START_TOOL_RESULT|>[\n {\n \"tool_call_id\": \"0\",\n \"results\": {\n{% for doc in documents %}\n \"{{ loop.index0 }}\": {{doc|tojson}}{% if not loop.last %},\n {% endif %}\n{% endfor %}\n\n },\n \"is_error\": null\n }\n]<|END_TOOL_RESULT|><|END_OF_TURN_TOKEN|>{%- endmacro %}\n{%- macro tool_call_id_to_int(messages, tool_call_id) %}\n{%- set counter = namespace(value=0) %}\n{%- set tool_call_id_seen = namespace(value=false) %}\n{%- for msg in messages %}\n {%- if msg.tool_calls %}\n {%- for tool_call in msg.tool_calls %}\n {%- if tool_call.id == tool_call_id and not tool_call_id_seen.value -%}\n {{ counter.value }}\n {%- set tool_call_id_seen.value = true %}\n {%- endif %}\n {%- set counter.value = counter.value + 1 %}\n {%- endfor %}\n {%- endif %}\n{%- endfor %}\n{%- endmacro %}\n{%- macro format_tool_message(messages, tool_msg) -%}\n{# format tool message #}\n {\n \"tool_call_id\": \"{{ tool_call_id_to_int(messages, tool_msg.tool_call_id) }}\",\n \"results\": {\n \"0\": {{ tool_msg.content|tojson }}\n },\n \"is_error\": null\n }\n{%- endmacro -%}\n{%- if messages and messages[0]['role']|lower == 'system' %}{%- set developer_preamble = messages[0]['content'] %}{% endif %}\n{%- set tool_idx = namespace(value=0) %}\n{%- set tool_ids_seen = namespace(value=[]) %}\n{%- set sent_documents = namespace(value=false) %}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|># System Preamble\nYou are in contextual safety mode. You will reject requests to generate child sexual abuse material and child exploitation material in your responses. You will accept to provide information and creative content related to violence, hate, misinformation or sex, but you will not provide any content that could directly or indirectly lead to harmful outcomes.\n\nYour information cutoff date is June 2024.\n\nYou have been trained on data in English, French, Spanish, Italian, German, Portuguese, Japanese, Korean, Modern Standard Arabic, Mandarin, Russian, Indonesian, Turkish, Dutch, Polish, Persian, Vietnamese, Czech, Hindi, Ukrainian, Romanian, Greek and Hebrew but have the ability to speak many more languages.\n{% if tools or documents %}\n\nYou have been trained to have advanced reasoning and tool-use capabilities and you should make best use of these skills to serve user's requests.\n\n## Tool Use\nThink about how you can make best use of the provided tools to help with the task and come up with a high level plan that you will execute first.\n\n0. Start by writing <|START_THINKING|> followed by a detailed step by step plan of how you will solve the problem. For each step explain your thinking fully and give details of required tool calls (if needed). Unless specified otherwise, you write your plan in natural language. When you finish, close it out with <|END_THINKING|>.\n You can optionally choose to skip this step when the user request is so straightforward to address that only a trivial plan would be needed.\n NOTE: You MUST skip this step when you are directly responding to the user's request without using any tools.\n\nThen carry out your plan by repeatedly executing the following steps.\n1. Action: write <|START_ACTION|> followed by a list of JSON-formatted tool calls, with each one containing \"tool_name\" and \"parameters\" fields.\n When there are multiple tool calls which are completely independent of each other (i.e. they can be executed in parallel), you should list them out all together in one step. When you finish, close it out with <|END_ACTION|>.\n2. Observation: you will then receive results of those tool calls in JSON format in the very next turn, wrapped around by <|START_TOOL_RESULT|> and <|END_TOOL_RESULT|>. Carefully observe those results and think about what to do next. Note that these results will be provided to you in a separate turn. NEVER hallucinate results.\n Every tool call produces a list of results (when a tool call produces no result or a single result, it'll still get wrapped inside a list). Each result is clearly linked to its originating tool call via its \"tool_call_id\".\n3. Reflection: start the next turn by writing <|START_THINKING|> followed by what you've figured out so far, any changes you need to make to your plan, and what you will do next. When you finish, close it out with <|END_THINKING|>.\n You can optionally choose to skip this step when everything is going according to plan and no special pieces of information or reasoning chains need to be recorded.\n NOTE: You MUST skip this step when you are done with tool-use actions and are ready to respond to the user.\n\nYou can repeat the above 3 steps multiple times (could be 0 times too if no suitable tool calls are available or needed), until you decide it's time to finally respond to the user.\n\n4. Response: then break out of the loop and write <|START_RESPONSE|> followed by a piece of text which serves as a response to the user's last request. Use all previous tool calls and results to help you when formulating your response. When you finish, close it out with <|END_RESPONSE|>.\n{% if enable_citations %}\n\n## Grounding\nImportantly, note that \"Reflection\" and \"Response\" above can be grounded.\nGrounding means you associate pieces of texts (called \"spans\") with those specific tool results that support them (called \"sources\"). And you use a pair of tags \"\" and \"\" to indicate when a span can be grounded onto a list of sources, listing them out in the closing tag. Sources from the same tool call are grouped together and listed as \"{tool_call_id}:[{list of result indices}]\", before they are joined together by \",\". E.g., \"span\" means that \"span\" is supported by result 1 and 2 from \"tool_call_id=0\" as well as result 0 from \"tool_call_id=1\".\n{% endif %}\n\n## Available Tools\nHere is the list of tools that you have available to you.\nYou can ONLY use the tools listed here. When a tool is not listed below, it is NOT available and you should NEVER attempt to use it.\nEach tool is represented as a JSON object with fields like \"name\", \"description\", \"parameters\" (per JSON Schema), and optionally, \"responses\" (per JSON Schema).\n\n```json\n[\n{% if documents %}\n {\"name\": \"direct-injected-document\", \"description\": \"This is a special tool to directly inject user-uploaded documents into the chat as additional context. DO NOT use this tool by yourself!\", \"parameters\": {\"type\": \"object\", \"properties\": {}, \"required\": []}, \"responses\": {\"200\": {\"description\": \"Successfully returned a list of chunked text snippets from the directly uploaded documents.\", \"content\": {\"application/json\": {\"schema\": {\"type\": \"array\", \"items\": {\"type\": \"object\", \"required\": [\"url\", \"snippet\"], \"properties\": {\"url\": {\"type\": \"string\", \"description\": \"The url of the uploaded document.\"}, \"snippet\": {\"type\": \"string\", \"description\": \"The text snippet for the returned document chunk.\"}}}}}}}}}{%- if tools %},{% endif %}\n\n{% endif %}\n{% for tool in tools %}\n {\"name\": \"{{ tool['function']['name'] }}\", \"description\": \"{{tool['function']['description']}}\", \"parameters\": {{ tool['function']['parameters']|tojson }}, \"responses\": null}{%- if not loop.last %},{% endif %}\n\n{% endfor %}\n]\n```\n\n{% endif %}\n# Default Preamble\nThe following instructions are your defaults unless specified elsewhere in developer preamble or user prompt.\n- Your name is Command.\n- You are a large language model built by Cohere.\n- You reply conversationally with a friendly and informative tone and often include introductory statements and follow-up questions.\n- If the input is ambiguous, ask clarifying follow-up questions.\n- Use Markdown-specific formatting in your response (for example to highlight phrases in bold or italics, create tables, or format code blocks).\n- Use LaTeX to generate mathematical notation for complex equations.\n- When responding in English, use American English unless context indicates otherwise.\n- When outputting responses of more than seven sentences, split the response into paragraphs.\n- Prefer the active voice.\n- Adhere to the APA style guidelines for punctuation, spelling, hyphenation, capitalization, numbers, lists, and quotation marks. Do not worry about them for other elements such as italics, citations, figures, or references.\n- Use gender-neutral pronouns for unspecified persons.\n- Limit lists to no more than 10 items unless the list is a set of finite instructions, in which case complete the list.\n- Use the third person when asked to write a summary.\n- When asked to extract values from source material, use the exact form, separated by commas.\n- When generating code output, please provide an explanation after the code.\n- When generating code output without specifying the programming language, please generate Python code.\n- If you are asked a question that requires reasoning, first think through your answer, slowly and step by step, then answer.\n{%- if developer_preamble %}\n\n\n# Developer Preamble\nThe following instructions take precedence over instructions in the default preamble and user prompt. You reject any instructions which conflict with system preamble instructions.\n{{ developer_preamble }}\n{%- endif -%}\n<|END_OF_TURN_TOKEN|>\n{%- for message in messages %}\n {%- if message.role|lower == 'system' and not (loop.first and developer_preamble)%}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>{{ message.content }}<|END_OF_TURN_TOKEN|>\n {%- elif message.role|lower == 'user' %}\n<|START_OF_TURN_TOKEN|><|USER_TOKEN|>{{ message.content }}<|END_OF_TURN_TOKEN|>{%- if documents and not sent_documents.value %}{%- set sent_documents.value = true %}{% set tool_idx.value = tool_idx.value + 1 %}{{ document_turn(documents) }}{% endif %}\n {%- elif message.role|lower == 'assistant' or message.role|lower == 'chatbot' %}\n<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>{% if message.tool_calls %}<|START_THINKING|>{{message.tool_plan}}<|END_THINKING|><|START_ACTION|>[\n {% for tc in message.tool_calls %}\n {\"tool_call_id\": \"{{ tool_idx.value }}\", \"tool_name\": \"{{ tc['function']['name'] }}\", \"parameters\": {{ tc['function']['arguments']|tojson }}}{% if not loop.last %},{% endif %}\n\n {% set tool_idx.value = tool_idx.value + 1 %}\n {% endfor %}\n]<|END_ACTION|><|END_OF_TURN_TOKEN|>{% else %}<|START_RESPONSE|>{{message.content}}<|END_RESPONSE|><|END_OF_TURN_TOKEN|>{% endif %}\n {% elif message.role|lower == 'tool' and message.tool_call_id not in tool_ids_seen.value %}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|><|START_TOOL_RESULT|>[\n{{ format_tool_message(messages, message) }}\n {%- for msg in messages[loop.index0 + 1:] %}\n {%- if msg.role|lower == 'tool' %},\n{{ format_tool_message(messages, msg) }}\n {%- set tool_ids_seen.value = tool_ids_seen.value + [msg.tool_call_id] %}\n {%- else %}\n {%- break %}\n {%- endif %}\n {%- endfor %}\n\n]<|END_TOOL_RESULT|><|END_OF_TURN_TOKEN|>\n {%- endif %}\n{%- endfor %}<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>" + }, + { + "name": "rag", + "template": "{% set tools = [] %}\n{%- macro document_turn(documents) -%}\n{# format documents into chat turn #}\n<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|><|START_THINKING|>I will look through the document to address the users needs.<|END_THINKING|><|START_ACTION|>[\n {\"tool_call_id\": \"0\", \"tool_name\": \"direct-injected-document\", \"parameters\": {}}\n]<|END_ACTION|><|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|><|START_TOOL_RESULT|>[\n {\n \"tool_call_id\": \"0\",\n \"results\": {\n{% for doc in documents %}\n \"{{ loop.index0 }}\": {{doc|tojson}}{% if not loop.last %},\n {% endif %}\n{% endfor %}\n\n },\n \"is_error\": null\n }\n]<|END_TOOL_RESULT|><|END_OF_TURN_TOKEN|>{%- endmacro %}\n{%- macro tool_call_id_to_int(messages, tool_call_id) %}\n{%- set counter = namespace(value=0) %}\n{%- set tool_call_id_seen = namespace(value=false) %}\n{%- for msg in messages %}\n {%- if msg.tool_calls %}\n {%- for tool_call in msg.tool_calls %}\n {%- if tool_call.id == tool_call_id and not tool_call_id_seen.value -%}\n {{ counter.value }}\n {%- set tool_call_id_seen.value = true %}\n {%- endif %}\n {%- set counter.value = counter.value + 1 %}\n {%- endfor %}\n {%- endif %}\n{%- endfor %}\n{%- endmacro %}\n{%- macro format_tool_message(messages, tool_msg) -%}\n{# format tool message #}\n {\n \"tool_call_id\": \"{{ tool_call_id_to_int(messages, tool_msg.tool_call_id) }}\",\n \"results\": {\n \"0\": {{ tool_msg.content|tojson }}\n },\n \"is_error\": null\n }\n{%- endmacro -%}\n{%- if messages and messages[0]['role']|lower == 'system' %}{%- set developer_preamble = messages[0]['content'] %}{% endif %}\n{%- set tool_idx = namespace(value=0) %}\n{%- set tool_ids_seen = namespace(value=[]) %}\n{%- set sent_documents = namespace(value=false) %}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|># System Preamble\nYou are in contextual safety mode. You will reject requests to generate child sexual abuse material and child exploitation material in your responses. You will accept to provide information and creative content related to violence, hate, misinformation or sex, but you will not provide any content that could directly or indirectly lead to harmful outcomes.\n\nYour information cutoff date is June 2024.\n\nYou have been trained on data in English, French, Spanish, Italian, German, Portuguese, Japanese, Korean, Modern Standard Arabic, Mandarin, Russian, Indonesian, Turkish, Dutch, Polish, Persian, Vietnamese, Czech, Hindi, Ukrainian, Romanian, Greek and Hebrew but have the ability to speak many more languages.\n{% if tools or documents %}\n\nYou have been trained to have advanced reasoning and tool-use capabilities and you should make best use of these skills to serve user's requests.\n\n## Tool Use\nThink about how you can make best use of the provided tools to help with the task and come up with a high level plan that you will execute first.\n\n0. Start by writing <|START_THINKING|> followed by a detailed step by step plan of how you will solve the problem. For each step explain your thinking fully and give details of required tool calls (if needed). Unless specified otherwise, you write your plan in natural language. When you finish, close it out with <|END_THINKING|>.\n You can optionally choose to skip this step when the user request is so straightforward to address that only a trivial plan would be needed.\n NOTE: You MUST skip this step when you are directly responding to the user's request without using any tools.\n\nThen carry out your plan by repeatedly executing the following steps.\n1. Action: write <|START_ACTION|> followed by a list of JSON-formatted tool calls, with each one containing \"tool_name\" and \"parameters\" fields.\n When there are multiple tool calls which are completely independent of each other (i.e. they can be executed in parallel), you should list them out all together in one step. When you finish, close it out with <|END_ACTION|>.\n2. Observation: you will then receive results of those tool calls in JSON format in the very next turn, wrapped around by <|START_TOOL_RESULT|> and <|END_TOOL_RESULT|>. Carefully observe those results and think about what to do next. Note that these results will be provided to you in a separate turn. NEVER hallucinate results.\n Every tool call produces a list of results (when a tool call produces no result or a single result, it'll still get wrapped inside a list). Each result is clearly linked to its originating tool call via its \"tool_call_id\".\n3. Reflection: start the next turn by writing <|START_THINKING|> followed by what you've figured out so far, any changes you need to make to your plan, and what you will do next. When you finish, close it out with <|END_THINKING|>.\n You can optionally choose to skip this step when everything is going according to plan and no special pieces of information or reasoning chains need to be recorded.\n NOTE: You MUST skip this step when you are done with tool-use actions and are ready to respond to the user.\n\nYou can repeat the above 3 steps multiple times (could be 0 times too if no suitable tool calls are available or needed), until you decide it's time to finally respond to the user.\n\n4. Response: then break out of the loop and write <|START_RESPONSE|> followed by a piece of text which serves as a response to the user's last request. Use all previous tool calls and results to help you when formulating your response. When you finish, close it out with <|END_RESPONSE|>.\n{% if enable_citations %}\n\n## Grounding\nImportantly, note that \"Reflection\" and \"Response\" above can be grounded.\nGrounding means you associate pieces of texts (called \"spans\") with those specific tool results that support them (called \"sources\"). And you use a pair of tags \"\" and \"\" to indicate when a span can be grounded onto a list of sources, listing them out in the closing tag. Sources from the same tool call are grouped together and listed as \"{tool_call_id}:[{list of result indices}]\", before they are joined together by \",\". E.g., \"span\" means that \"span\" is supported by result 1 and 2 from \"tool_call_id=0\" as well as result 0 from \"tool_call_id=1\".\n{% endif %}\n\n## Available Tools\nHere is the list of tools that you have available to you.\nYou can ONLY use the tools listed here. When a tool is not listed below, it is NOT available and you should NEVER attempt to use it.\nEach tool is represented as a JSON object with fields like \"name\", \"description\", \"parameters\" (per JSON Schema), and optionally, \"responses\" (per JSON Schema).\n\n```json\n[\n{% if documents %}\n {\"name\": \"direct-injected-document\", \"description\": \"This is a special tool to directly inject user-uploaded documents into the chat as additional context. DO NOT use this tool by yourself!\", \"parameters\": {\"type\": \"object\", \"properties\": {}, \"required\": []}, \"responses\": {\"200\": {\"description\": \"Successfully returned a list of chunked text snippets from the directly uploaded documents.\", \"content\": {\"application/json\": {\"schema\": {\"type\": \"array\", \"items\": {\"type\": \"object\", \"required\": [\"url\", \"snippet\"], \"properties\": {\"url\": {\"type\": \"string\", \"description\": \"The url of the uploaded document.\"}, \"snippet\": {\"type\": \"string\", \"description\": \"The text snippet for the returned document chunk.\"}}}}}}}}}{%- if tools %},{% endif %}\n\n{% endif %}\n{% for tool in tools %}\n {\"name\": \"{{ tool['function']['name'] }}\", \"description\": \"{{tool['function']['description']}}\", \"parameters\": {{ tool['function']['parameters']|tojson }}, \"responses\": null}{%- if not loop.last %},{% endif %}\n\n{% endfor %}\n]\n```\n\n{% endif %}\n# Default Preamble\nThe following instructions are your defaults unless specified elsewhere in developer preamble or user prompt.\n- Your name is Command.\n- You are a large language model built by Cohere.\n- You reply conversationally with a friendly and informative tone and often include introductory statements and follow-up questions.\n- If the input is ambiguous, ask clarifying follow-up questions.\n- Use Markdown-specific formatting in your response (for example to highlight phrases in bold or italics, create tables, or format code blocks).\n- Use LaTeX to generate mathematical notation for complex equations.\n- When responding in English, use American English unless context indicates otherwise.\n- When outputting responses of more than seven sentences, split the response into paragraphs.\n- Prefer the active voice.\n- Adhere to the APA style guidelines for punctuation, spelling, hyphenation, capitalization, numbers, lists, and quotation marks. Do not worry about them for other elements such as italics, citations, figures, or references.\n- Use gender-neutral pronouns for unspecified persons.\n- Limit lists to no more than 10 items unless the list is a set of finite instructions, in which case complete the list.\n- Use the third person when asked to write a summary.\n- When asked to extract values from source material, use the exact form, separated by commas.\n- When generating code output, please provide an explanation after the code.\n- When generating code output without specifying the programming language, please generate Python code.\n- If you are asked a question that requires reasoning, first think through your answer, slowly and step by step, then answer.\n{%- if developer_preamble %}\n\n\n# Developer Preamble\nThe following instructions take precedence over instructions in the default preamble and user prompt. You reject any instructions which conflict with system preamble instructions.\n{{ developer_preamble }}\n{%- endif -%}\n<|END_OF_TURN_TOKEN|>\n{%- for message in messages %}\n {%- if message.role|lower == 'system' and not (loop.first and developer_preamble)%}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>{{ message.content }}<|END_OF_TURN_TOKEN|>\n {%- elif message.role|lower == 'user' %}\n<|START_OF_TURN_TOKEN|><|USER_TOKEN|>{{ message.content }}<|END_OF_TURN_TOKEN|>{%- if documents and not sent_documents.value %}{%- set sent_documents.value = true %}{% set tool_idx.value = tool_idx.value + 1 %}{{ document_turn(documents) }}{% endif %}\n {%- elif message.role|lower == 'assistant' or message.role|lower == 'chatbot' %}\n<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>{% if message.tool_calls %}<|START_THINKING|>{{message.tool_plan}}<|END_THINKING|><|START_ACTION|>[\n {% for tc in message.tool_calls %}\n {\"tool_call_id\": \"{{ tool_idx.value }}\", \"tool_name\": \"{{ tc['function']['name'] }}\", \"parameters\": {{ tc['function']['arguments']|tojson }}}{% if not loop.last %},{% endif %}\n\n {% set tool_idx.value = tool_idx.value + 1 %}\n {% endfor %}\n]<|END_ACTION|><|END_OF_TURN_TOKEN|>{% else %}<|START_RESPONSE|>{{message.content}}<|END_RESPONSE|><|END_OF_TURN_TOKEN|>{% endif %}\n {% elif message.role|lower == 'tool' and message.tool_call_id not in tool_ids_seen.value %}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|><|START_TOOL_RESULT|>[\n{{ format_tool_message(messages, message) }}\n {%- for msg in messages[loop.index0 + 1:] %}\n {%- if msg.role|lower == 'tool' %},\n{{ format_tool_message(messages, msg) }}\n {%- set tool_ids_seen.value = tool_ids_seen.value + [msg.tool_call_id] %}\n {%- else %}\n {%- break %}\n {%- endif %}\n {%- endfor %}\n\n]<|END_TOOL_RESULT|><|END_OF_TURN_TOKEN|>\n {%- endif %}\n{%- endfor %}<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>" + } + ], + "clean_up_tokenization_spaces": false, + "eos_token": "<|END_OF_TURN_TOKEN|>", + "extra_special_tokens": {}, + "legacy": true, + "merges_file": null, + "model_max_length": 8192, + "pad_token": "", + "padding_side": "right", + "sp_model_kwargs": {}, + "spaces_between_special_tokens": false, + "tokenizer_class": "CohereTokenizer", + "unk_token": "", + "use_default_system_prompt": false, + "vocab_file": null +} diff --git a/checkpoint-720/trainer_state.json b/checkpoint-720/trainer_state.json new file mode 100644 index 0000000000000000000000000000000000000000..ca4865f50a59e0ffc9127c6898788477cf1822d7 --- /dev/null +++ b/checkpoint-720/trainer_state.json @@ -0,0 +1,2585 @@ +{ + "best_metric": null, + "best_model_checkpoint": null, + "epoch": 0.25030418911872065, + "eval_steps": 150, + "global_step": 720, + "is_hyper_param_search": false, + "is_local_process_zero": true, + "is_world_process_zero": true, + "log_history": [ + { + "epoch": 0.0006952894142186686, + "grad_norm": 5.413117383066536, + "learning_rate": 6.944444444444445e-07, + "loss": 2.3653, + "step": 2 + }, + { + "epoch": 0.0013905788284373371, + "grad_norm": 5.092870612337868, + "learning_rate": 1.388888888888889e-06, + "loss": 2.5001, + "step": 4 + }, + { + "epoch": 0.0020858682426560054, + "grad_norm": 3.6285625961711943, + "learning_rate": 2.0833333333333334e-06, + "loss": 2.3759, + "step": 6 + }, + { + "epoch": 0.0027811576568746743, + "grad_norm": 2.5025911526151075, + "learning_rate": 2.777777777777778e-06, + "loss": 1.944, + "step": 8 + }, + { + "epoch": 0.0034764470710933427, + "grad_norm": 3.077266049542496, + "learning_rate": 3.4722222222222224e-06, + "loss": 2.2504, + "step": 10 + }, + { + "epoch": 0.004171736485312011, + "grad_norm": 4.068243939187174, + "learning_rate": 4.166666666666667e-06, + "loss": 2.0637, + "step": 12 + }, + { + "epoch": 0.00486702589953068, + "grad_norm": 3.511444738830971, + "learning_rate": 4.861111111111111e-06, + "loss": 2.3604, + "step": 14 + }, + { + "epoch": 0.0055623153137493485, + "grad_norm": 5.925744892256934, + "learning_rate": 5.555555555555556e-06, + "loss": 2.6528, + "step": 16 + }, + { + "epoch": 0.0062576047279680165, + "grad_norm": 2.7950114871483405, + "learning_rate": 6.25e-06, + "loss": 2.3229, + "step": 18 + }, + { + "epoch": 0.006952894142186685, + "grad_norm": 6.586211843766182, + "learning_rate": 6.944444444444445e-06, + "loss": 2.342, + "step": 20 + }, + { + "epoch": 0.0076481835564053535, + "grad_norm": 4.902839955269193, + "learning_rate": 7.63888888888889e-06, + "loss": 2.4188, + "step": 22 + }, + { + "epoch": 0.008343472970624021, + "grad_norm": 4.257062809771645, + "learning_rate": 8.333333333333334e-06, + "loss": 1.7957, + "step": 24 + }, + { + "epoch": 0.009038762384842691, + "grad_norm": 4.460352004615699, + "learning_rate": 9.027777777777777e-06, + "loss": 2.0726, + "step": 26 + }, + { + "epoch": 0.00973405179906136, + "grad_norm": 5.858061506133739, + "learning_rate": 9.722222222222223e-06, + "loss": 2.0455, + "step": 28 + }, + { + "epoch": 0.010429341213280027, + "grad_norm": 4.331946668100709, + "learning_rate": 1.0416666666666668e-05, + "loss": 1.7645, + "step": 30 + }, + { + "epoch": 0.011124630627498697, + "grad_norm": 5.428742204187391, + "learning_rate": 1.1111111111111112e-05, + "loss": 1.7446, + "step": 32 + }, + { + "epoch": 0.011819920041717365, + "grad_norm": 2.485909286541028, + "learning_rate": 1.1805555555555555e-05, + "loss": 1.5885, + "step": 34 + }, + { + "epoch": 0.012515209455936033, + "grad_norm": 3.2602949308730222, + "learning_rate": 1.25e-05, + "loss": 1.1014, + "step": 36 + }, + { + "epoch": 0.013210498870154701, + "grad_norm": 4.962187747415964, + "learning_rate": 1.3194444444444446e-05, + "loss": 1.3588, + "step": 38 + }, + { + "epoch": 0.01390578828437337, + "grad_norm": 7.627756894198461, + "learning_rate": 1.388888888888889e-05, + "loss": 1.4014, + "step": 40 + }, + { + "epoch": 0.014601077698592039, + "grad_norm": 2.821848388410092, + "learning_rate": 1.4583333333333335e-05, + "loss": 1.0959, + "step": 42 + }, + { + "epoch": 0.015296367112810707, + "grad_norm": 10.989320944549025, + "learning_rate": 1.527777777777778e-05, + "loss": 1.739, + "step": 44 + }, + { + "epoch": 0.015991656527029375, + "grad_norm": 4.300936602591115, + "learning_rate": 1.597222222222222e-05, + "loss": 1.1078, + "step": 46 + }, + { + "epoch": 0.016686945941248043, + "grad_norm": 3.7539663261019856, + "learning_rate": 1.6666666666666667e-05, + "loss": 1.2701, + "step": 48 + }, + { + "epoch": 0.017382235355466714, + "grad_norm": 2.589248169352173, + "learning_rate": 1.736111111111111e-05, + "loss": 1.4452, + "step": 50 + }, + { + "epoch": 0.018077524769685382, + "grad_norm": 3.6679301322156177, + "learning_rate": 1.8055555555555555e-05, + "loss": 1.4243, + "step": 52 + }, + { + "epoch": 0.01877281418390405, + "grad_norm": 2.0885660923860074, + "learning_rate": 1.8750000000000002e-05, + "loss": 1.4453, + "step": 54 + }, + { + "epoch": 0.01946810359812272, + "grad_norm": 2.955353237610474, + "learning_rate": 1.9444444444444445e-05, + "loss": 1.5388, + "step": 56 + }, + { + "epoch": 0.020163393012341387, + "grad_norm": 3.0527006398487018, + "learning_rate": 2.013888888888889e-05, + "loss": 1.4043, + "step": 58 + }, + { + "epoch": 0.020858682426560055, + "grad_norm": 1.9862208864154767, + "learning_rate": 2.0833333333333336e-05, + "loss": 1.1007, + "step": 60 + }, + { + "epoch": 0.021553971840778723, + "grad_norm": 2.347361178472164, + "learning_rate": 2.152777777777778e-05, + "loss": 0.9291, + "step": 62 + }, + { + "epoch": 0.022249261254997394, + "grad_norm": 2.4812993223105995, + "learning_rate": 2.2222222222222223e-05, + "loss": 0.9592, + "step": 64 + }, + { + "epoch": 0.022944550669216062, + "grad_norm": 1.639333831845777, + "learning_rate": 2.2916666666666667e-05, + "loss": 1.0645, + "step": 66 + }, + { + "epoch": 0.02363984008343473, + "grad_norm": 2.92858351082494, + "learning_rate": 2.361111111111111e-05, + "loss": 1.4269, + "step": 68 + }, + { + "epoch": 0.024335129497653398, + "grad_norm": 2.8503434812871604, + "learning_rate": 2.4305555555555558e-05, + "loss": 0.7829, + "step": 70 + }, + { + "epoch": 0.025030418911872066, + "grad_norm": 2.4875590459354107, + "learning_rate": 2.5e-05, + "loss": 0.9733, + "step": 72 + }, + { + "epoch": 0.025725708326090734, + "grad_norm": 5.2567545525905075, + "learning_rate": 2.5694444444444445e-05, + "loss": 1.3559, + "step": 74 + }, + { + "epoch": 0.026420997740309402, + "grad_norm": 4.68745753567611, + "learning_rate": 2.6388888888888892e-05, + "loss": 1.1499, + "step": 76 + }, + { + "epoch": 0.027116287154528074, + "grad_norm": 2.810345453706711, + "learning_rate": 2.7083333333333332e-05, + "loss": 0.8636, + "step": 78 + }, + { + "epoch": 0.02781157656874674, + "grad_norm": 3.0144493626195388, + "learning_rate": 2.777777777777778e-05, + "loss": 0.9274, + "step": 80 + }, + { + "epoch": 0.02850686598296541, + "grad_norm": 2.3263036535508523, + "learning_rate": 2.8472222222222223e-05, + "loss": 1.3979, + "step": 82 + }, + { + "epoch": 0.029202155397184078, + "grad_norm": 1.6009019341419857, + "learning_rate": 2.916666666666667e-05, + "loss": 0.9039, + "step": 84 + }, + { + "epoch": 0.029897444811402746, + "grad_norm": 2.0637506891442294, + "learning_rate": 2.9861111111111113e-05, + "loss": 1.5187, + "step": 86 + }, + { + "epoch": 0.030592734225621414, + "grad_norm": 1.5533001268209932, + "learning_rate": 3.055555555555556e-05, + "loss": 0.8937, + "step": 88 + }, + { + "epoch": 0.03128802363984008, + "grad_norm": 1.9974857545819733, + "learning_rate": 3.125e-05, + "loss": 0.8218, + "step": 90 + }, + { + "epoch": 0.03198331305405875, + "grad_norm": 1.871899331408953, + "learning_rate": 3.194444444444444e-05, + "loss": 1.2451, + "step": 92 + }, + { + "epoch": 0.03267860246827742, + "grad_norm": 1.591601830348497, + "learning_rate": 3.263888888888889e-05, + "loss": 0.7485, + "step": 94 + }, + { + "epoch": 0.033373891882496086, + "grad_norm": 2.404166647711005, + "learning_rate": 3.3333333333333335e-05, + "loss": 1.1587, + "step": 96 + }, + { + "epoch": 0.03406918129671476, + "grad_norm": 1.581080788392888, + "learning_rate": 3.402777777777778e-05, + "loss": 0.9578, + "step": 98 + }, + { + "epoch": 0.03476447071093343, + "grad_norm": 2.1551207338771547, + "learning_rate": 3.472222222222222e-05, + "loss": 1.1305, + "step": 100 + }, + { + "epoch": 0.0354597601251521, + "grad_norm": 4.2246272812704, + "learning_rate": 3.541666666666667e-05, + "loss": 1.04, + "step": 102 + }, + { + "epoch": 0.036155049539370765, + "grad_norm": 2.5526898161765588, + "learning_rate": 3.611111111111111e-05, + "loss": 1.0743, + "step": 104 + }, + { + "epoch": 0.03685033895358943, + "grad_norm": 1.9784815137623597, + "learning_rate": 3.6805555555555556e-05, + "loss": 0.9667, + "step": 106 + }, + { + "epoch": 0.0375456283678081, + "grad_norm": 1.9131648200880944, + "learning_rate": 3.7500000000000003e-05, + "loss": 0.8951, + "step": 108 + }, + { + "epoch": 0.03824091778202677, + "grad_norm": 3.9405296351174575, + "learning_rate": 3.8194444444444444e-05, + "loss": 1.222, + "step": 110 + }, + { + "epoch": 0.03893620719624544, + "grad_norm": 13.764861545850291, + "learning_rate": 3.888888888888889e-05, + "loss": 1.0497, + "step": 112 + }, + { + "epoch": 0.039631496610464105, + "grad_norm": 3.998123122175411, + "learning_rate": 3.958333333333333e-05, + "loss": 1.0901, + "step": 114 + }, + { + "epoch": 0.04032678602468277, + "grad_norm": 3.126193921423756, + "learning_rate": 4.027777777777778e-05, + "loss": 1.1143, + "step": 116 + }, + { + "epoch": 0.04102207543890144, + "grad_norm": 2.7839926692610613, + "learning_rate": 4.0972222222222225e-05, + "loss": 1.1637, + "step": 118 + }, + { + "epoch": 0.04171736485312011, + "grad_norm": 2.591162621161276, + "learning_rate": 4.166666666666667e-05, + "loss": 1.0624, + "step": 120 + }, + { + "epoch": 0.04241265426733878, + "grad_norm": 1.4930703711545332, + "learning_rate": 4.236111111111111e-05, + "loss": 1.0239, + "step": 122 + }, + { + "epoch": 0.043107943681557445, + "grad_norm": 4.355150070532966, + "learning_rate": 4.305555555555556e-05, + "loss": 1.266, + "step": 124 + }, + { + "epoch": 0.04380323309577612, + "grad_norm": 1.8285608876277135, + "learning_rate": 4.375e-05, + "loss": 1.0667, + "step": 126 + }, + { + "epoch": 0.04449852250999479, + "grad_norm": 2.1848832742617055, + "learning_rate": 4.4444444444444447e-05, + "loss": 0.7549, + "step": 128 + }, + { + "epoch": 0.045193811924213456, + "grad_norm": 3.547857947451226, + "learning_rate": 4.5138888888888894e-05, + "loss": 0.7974, + "step": 130 + }, + { + "epoch": 0.045889101338432124, + "grad_norm": 3.372457028128184, + "learning_rate": 4.5833333333333334e-05, + "loss": 1.0482, + "step": 132 + }, + { + "epoch": 0.04658439075265079, + "grad_norm": 2.2871138548091703, + "learning_rate": 4.652777777777778e-05, + "loss": 0.8246, + "step": 134 + }, + { + "epoch": 0.04727968016686946, + "grad_norm": 1.7489408054743605, + "learning_rate": 4.722222222222222e-05, + "loss": 1.0011, + "step": 136 + }, + { + "epoch": 0.04797496958108813, + "grad_norm": 1.944650349232646, + "learning_rate": 4.791666666666667e-05, + "loss": 0.7828, + "step": 138 + }, + { + "epoch": 0.048670258995306796, + "grad_norm": 2.321619459307342, + "learning_rate": 4.8611111111111115e-05, + "loss": 1.02, + "step": 140 + }, + { + "epoch": 0.049365548409525464, + "grad_norm": 5.317732559595606, + "learning_rate": 4.930555555555556e-05, + "loss": 0.9539, + "step": 142 + }, + { + "epoch": 0.05006083782374413, + "grad_norm": 1.5887292172279854, + "learning_rate": 5e-05, + "loss": 0.7961, + "step": 144 + }, + { + "epoch": 0.0507561272379628, + "grad_norm": 2.9987019111854964, + "learning_rate": 5.069444444444444e-05, + "loss": 1.0018, + "step": 146 + }, + { + "epoch": 0.05145141665218147, + "grad_norm": 5.63878906132749, + "learning_rate": 5.138888888888889e-05, + "loss": 0.9278, + "step": 148 + }, + { + "epoch": 0.052146706066400136, + "grad_norm": 2.4849685204332834, + "learning_rate": 5.208333333333334e-05, + "loss": 0.7531, + "step": 150 + }, + { + "epoch": 0.052146706066400136, + "eval_loss": 0.9286500215530396, + "eval_runtime": 711.2619, + "eval_samples_per_second": 6.808, + "eval_steps_per_second": 0.214, + "step": 150 + }, + { + "epoch": 0.052841995480618804, + "grad_norm": 3.4927981580288776, + "learning_rate": 5.2777777777777784e-05, + "loss": 0.7422, + "step": 152 + }, + { + "epoch": 0.05353728489483748, + "grad_norm": 2.6593724943984682, + "learning_rate": 5.3472222222222224e-05, + "loss": 0.7762, + "step": 154 + }, + { + "epoch": 0.05423257430905615, + "grad_norm": 2.99709354088536, + "learning_rate": 5.4166666666666664e-05, + "loss": 0.8658, + "step": 156 + }, + { + "epoch": 0.054927863723274815, + "grad_norm": 3.9196361623391414, + "learning_rate": 5.486111111111112e-05, + "loss": 1.1783, + "step": 158 + }, + { + "epoch": 0.05562315313749348, + "grad_norm": 3.022562685608673, + "learning_rate": 5.555555555555556e-05, + "loss": 1.0602, + "step": 160 + }, + { + "epoch": 0.05631844255171215, + "grad_norm": 3.292942684053579, + "learning_rate": 5.6250000000000005e-05, + "loss": 0.8561, + "step": 162 + }, + { + "epoch": 0.05701373196593082, + "grad_norm": 2.397775023338686, + "learning_rate": 5.6944444444444445e-05, + "loss": 0.9561, + "step": 164 + }, + { + "epoch": 0.05770902138014949, + "grad_norm": 3.0546714312119643, + "learning_rate": 5.7638888888888886e-05, + "loss": 0.8274, + "step": 166 + }, + { + "epoch": 0.058404310794368156, + "grad_norm": 2.4021883380894393, + "learning_rate": 5.833333333333334e-05, + "loss": 0.8492, + "step": 168 + }, + { + "epoch": 0.059099600208586824, + "grad_norm": 2.6052829770116293, + "learning_rate": 5.902777777777778e-05, + "loss": 1.1005, + "step": 170 + }, + { + "epoch": 0.05979488962280549, + "grad_norm": 1.6838192892320467, + "learning_rate": 5.972222222222223e-05, + "loss": 1.0157, + "step": 172 + }, + { + "epoch": 0.06049017903702416, + "grad_norm": 3.98880214871885, + "learning_rate": 6.041666666666667e-05, + "loss": 0.8136, + "step": 174 + }, + { + "epoch": 0.06118546845124283, + "grad_norm": 4.81494345341073, + "learning_rate": 6.111111111111112e-05, + "loss": 0.9475, + "step": 176 + }, + { + "epoch": 0.061880757865461496, + "grad_norm": 1.9926278890091862, + "learning_rate": 6.180555555555556e-05, + "loss": 0.6549, + "step": 178 + }, + { + "epoch": 0.06257604727968016, + "grad_norm": 1.750353030728397, + "learning_rate": 6.25e-05, + "loss": 1.1442, + "step": 180 + }, + { + "epoch": 0.06327133669389884, + "grad_norm": 4.77249782692129, + "learning_rate": 6.319444444444444e-05, + "loss": 1.1927, + "step": 182 + }, + { + "epoch": 0.0639666261081175, + "grad_norm": 1.866901788617278, + "learning_rate": 6.388888888888888e-05, + "loss": 1.0032, + "step": 184 + }, + { + "epoch": 0.06466191552233617, + "grad_norm": 1.7495859751833545, + "learning_rate": 6.458333333333334e-05, + "loss": 0.8439, + "step": 186 + }, + { + "epoch": 0.06535720493655484, + "grad_norm": 2.971674018184174, + "learning_rate": 6.527777777777778e-05, + "loss": 0.9817, + "step": 188 + }, + { + "epoch": 0.06605249435077351, + "grad_norm": 2.3753292673540165, + "learning_rate": 6.597222222222223e-05, + "loss": 0.9919, + "step": 190 + }, + { + "epoch": 0.06674778376499217, + "grad_norm": 2.7019148741557744, + "learning_rate": 6.666666666666667e-05, + "loss": 1.1442, + "step": 192 + }, + { + "epoch": 0.06744307317921085, + "grad_norm": 1.8670113287712482, + "learning_rate": 6.736111111111112e-05, + "loss": 0.8905, + "step": 194 + }, + { + "epoch": 0.06813836259342952, + "grad_norm": 1.4199145680760579, + "learning_rate": 6.805555555555556e-05, + "loss": 0.7223, + "step": 196 + }, + { + "epoch": 0.06883365200764818, + "grad_norm": 3.894200902880186, + "learning_rate": 6.875e-05, + "loss": 0.9005, + "step": 198 + }, + { + "epoch": 0.06952894142186686, + "grad_norm": 3.2710376491241955, + "learning_rate": 6.944444444444444e-05, + "loss": 1.1605, + "step": 200 + }, + { + "epoch": 0.07022423083608552, + "grad_norm": 1.6459754670035065, + "learning_rate": 7.013888888888888e-05, + "loss": 0.8551, + "step": 202 + }, + { + "epoch": 0.0709195202503042, + "grad_norm": 4.361031640374508, + "learning_rate": 7.083333333333334e-05, + "loss": 0.7007, + "step": 204 + }, + { + "epoch": 0.07161480966452285, + "grad_norm": 3.573741549123141, + "learning_rate": 7.152777777777778e-05, + "loss": 1.1396, + "step": 206 + }, + { + "epoch": 0.07231009907874153, + "grad_norm": 3.296990311359108, + "learning_rate": 7.222222222222222e-05, + "loss": 0.8695, + "step": 208 + }, + { + "epoch": 0.07300538849296019, + "grad_norm": 6.769659823038884, + "learning_rate": 7.291666666666667e-05, + "loss": 1.0511, + "step": 210 + }, + { + "epoch": 0.07370067790717887, + "grad_norm": 1.6695233666860303, + "learning_rate": 7.361111111111111e-05, + "loss": 0.8174, + "step": 212 + }, + { + "epoch": 0.07439596732139753, + "grad_norm": 1.3543755216281146, + "learning_rate": 7.430555555555557e-05, + "loss": 0.7137, + "step": 214 + }, + { + "epoch": 0.0750912567356162, + "grad_norm": 4.861063813937456, + "learning_rate": 7.500000000000001e-05, + "loss": 1.0132, + "step": 216 + }, + { + "epoch": 0.07578654614983486, + "grad_norm": 5.715913176528681, + "learning_rate": 7.569444444444445e-05, + "loss": 1.1657, + "step": 218 + }, + { + "epoch": 0.07648183556405354, + "grad_norm": 4.0193839358302235, + "learning_rate": 7.638888888888889e-05, + "loss": 1.0547, + "step": 220 + }, + { + "epoch": 0.0771771249782722, + "grad_norm": 2.26849134517291, + "learning_rate": 7.708333333333334e-05, + "loss": 0.9073, + "step": 222 + }, + { + "epoch": 0.07787241439249087, + "grad_norm": 4.570943697810998, + "learning_rate": 7.777777777777778e-05, + "loss": 1.3726, + "step": 224 + }, + { + "epoch": 0.07856770380670955, + "grad_norm": 1.1942436910880105, + "learning_rate": 7.847222222222222e-05, + "loss": 0.8146, + "step": 226 + }, + { + "epoch": 0.07926299322092821, + "grad_norm": 2.111849588751211, + "learning_rate": 7.916666666666666e-05, + "loss": 1.1157, + "step": 228 + }, + { + "epoch": 0.07995828263514689, + "grad_norm": 1.0283088880069582, + "learning_rate": 7.986111111111112e-05, + "loss": 0.767, + "step": 230 + }, + { + "epoch": 0.08065357204936555, + "grad_norm": 1.2834055069208525, + "learning_rate": 8.055555555555556e-05, + "loss": 0.6625, + "step": 232 + }, + { + "epoch": 0.08134886146358422, + "grad_norm": 1.3772942873595098, + "learning_rate": 8.125000000000001e-05, + "loss": 0.8065, + "step": 234 + }, + { + "epoch": 0.08204415087780288, + "grad_norm": 1.5113456549735176, + "learning_rate": 8.194444444444445e-05, + "loss": 0.8606, + "step": 236 + }, + { + "epoch": 0.08273944029202156, + "grad_norm": 1.5765846352838255, + "learning_rate": 8.263888888888889e-05, + "loss": 0.8335, + "step": 238 + }, + { + "epoch": 0.08343472970624022, + "grad_norm": 2.4873462478329404, + "learning_rate": 8.333333333333334e-05, + "loss": 0.9705, + "step": 240 + }, + { + "epoch": 0.0841300191204589, + "grad_norm": 1.2369219925635513, + "learning_rate": 8.402777777777778e-05, + "loss": 0.6061, + "step": 242 + }, + { + "epoch": 0.08482530853467755, + "grad_norm": 2.542132212473201, + "learning_rate": 8.472222222222222e-05, + "loss": 0.9142, + "step": 244 + }, + { + "epoch": 0.08552059794889623, + "grad_norm": 2.0301734217803022, + "learning_rate": 8.541666666666666e-05, + "loss": 0.8997, + "step": 246 + }, + { + "epoch": 0.08621588736311489, + "grad_norm": 1.8605316982945626, + "learning_rate": 8.611111111111112e-05, + "loss": 1.005, + "step": 248 + }, + { + "epoch": 0.08691117677733357, + "grad_norm": 1.193555257951713, + "learning_rate": 8.680555555555556e-05, + "loss": 0.8617, + "step": 250 + }, + { + "epoch": 0.08760646619155224, + "grad_norm": 1.243815428863678, + "learning_rate": 8.75e-05, + "loss": 0.6261, + "step": 252 + }, + { + "epoch": 0.0883017556057709, + "grad_norm": 1.6487754861704442, + "learning_rate": 8.819444444444445e-05, + "loss": 0.9219, + "step": 254 + }, + { + "epoch": 0.08899704501998958, + "grad_norm": 1.1768410857322613, + "learning_rate": 8.888888888888889e-05, + "loss": 0.8563, + "step": 256 + }, + { + "epoch": 0.08969233443420824, + "grad_norm": 1.1155265191420587, + "learning_rate": 8.958333333333335e-05, + "loss": 0.998, + "step": 258 + }, + { + "epoch": 0.09038762384842691, + "grad_norm": 1.4432456616674065, + "learning_rate": 9.027777777777779e-05, + "loss": 0.8755, + "step": 260 + }, + { + "epoch": 0.09108291326264557, + "grad_norm": 1.6013486668654413, + "learning_rate": 9.097222222222223e-05, + "loss": 0.6998, + "step": 262 + }, + { + "epoch": 0.09177820267686425, + "grad_norm": 0.7869968770186737, + "learning_rate": 9.166666666666667e-05, + "loss": 0.7574, + "step": 264 + }, + { + "epoch": 0.09247349209108291, + "grad_norm": 2.1117903903864566, + "learning_rate": 9.236111111111112e-05, + "loss": 0.8436, + "step": 266 + }, + { + "epoch": 0.09316878150530158, + "grad_norm": 1.3582999584721895, + "learning_rate": 9.305555555555556e-05, + "loss": 0.8503, + "step": 268 + }, + { + "epoch": 0.09386407091952025, + "grad_norm": 1.5674581009005415, + "learning_rate": 9.375e-05, + "loss": 0.9561, + "step": 270 + }, + { + "epoch": 0.09455936033373892, + "grad_norm": 1.0274246934159952, + "learning_rate": 9.444444444444444e-05, + "loss": 0.7537, + "step": 272 + }, + { + "epoch": 0.09525464974795758, + "grad_norm": 0.9595343432519174, + "learning_rate": 9.513888888888888e-05, + "loss": 0.7855, + "step": 274 + }, + { + "epoch": 0.09594993916217626, + "grad_norm": 1.3313115114367815, + "learning_rate": 9.583333333333334e-05, + "loss": 0.7009, + "step": 276 + }, + { + "epoch": 0.09664522857639492, + "grad_norm": 1.4409463331317498, + "learning_rate": 9.652777777777779e-05, + "loss": 1.0332, + "step": 278 + }, + { + "epoch": 0.09734051799061359, + "grad_norm": 1.5445848213023137, + "learning_rate": 9.722222222222223e-05, + "loss": 0.7352, + "step": 280 + }, + { + "epoch": 0.09803580740483227, + "grad_norm": 1.855518620927316, + "learning_rate": 9.791666666666667e-05, + "loss": 0.7191, + "step": 282 + }, + { + "epoch": 0.09873109681905093, + "grad_norm": 1.4033396985161997, + "learning_rate": 9.861111111111112e-05, + "loss": 0.7886, + "step": 284 + }, + { + "epoch": 0.0994263862332696, + "grad_norm": 1.9951521438049904, + "learning_rate": 9.930555555555556e-05, + "loss": 0.902, + "step": 286 + }, + { + "epoch": 0.10012167564748826, + "grad_norm": 1.1360934228431687, + "learning_rate": 0.0001, + "loss": 0.8655, + "step": 288 + }, + { + "epoch": 0.10081696506170694, + "grad_norm": 1.1225735433900375, + "learning_rate": 0.00010069444444444445, + "loss": 0.6851, + "step": 290 + }, + { + "epoch": 0.1015122544759256, + "grad_norm": 0.770446891371583, + "learning_rate": 0.00010138888888888889, + "loss": 0.7775, + "step": 292 + }, + { + "epoch": 0.10220754389014428, + "grad_norm": 0.797064180835607, + "learning_rate": 0.00010208333333333333, + "loss": 0.6567, + "step": 294 + }, + { + "epoch": 0.10290283330436294, + "grad_norm": 0.9876188134326442, + "learning_rate": 0.00010277777777777778, + "loss": 0.7299, + "step": 296 + }, + { + "epoch": 0.10359812271858161, + "grad_norm": 0.799601623643537, + "learning_rate": 0.00010347222222222223, + "loss": 0.7891, + "step": 298 + }, + { + "epoch": 0.10429341213280027, + "grad_norm": 0.8791512281362982, + "learning_rate": 0.00010416666666666667, + "loss": 0.677, + "step": 300 + }, + { + "epoch": 0.10429341213280027, + "eval_loss": 0.6939894556999207, + "eval_runtime": 709.5268, + "eval_samples_per_second": 6.824, + "eval_steps_per_second": 0.214, + "step": 300 + }, + { + "epoch": 0.10498870154701895, + "grad_norm": 1.329564645811689, + "learning_rate": 0.00010486111111111113, + "loss": 0.7511, + "step": 302 + }, + { + "epoch": 0.10568399096123761, + "grad_norm": 0.7130415058241142, + "learning_rate": 0.00010555555555555557, + "loss": 0.709, + "step": 304 + }, + { + "epoch": 0.10637928037545628, + "grad_norm": 1.1294733411370705, + "learning_rate": 0.00010625000000000001, + "loss": 0.7781, + "step": 306 + }, + { + "epoch": 0.10707456978967496, + "grad_norm": 0.581727680778003, + "learning_rate": 0.00010694444444444445, + "loss": 0.6296, + "step": 308 + }, + { + "epoch": 0.10776985920389362, + "grad_norm": 0.9855391514311871, + "learning_rate": 0.00010763888888888889, + "loss": 0.7852, + "step": 310 + }, + { + "epoch": 0.1084651486181123, + "grad_norm": 0.5708379609857769, + "learning_rate": 0.00010833333333333333, + "loss": 0.6759, + "step": 312 + }, + { + "epoch": 0.10916043803233096, + "grad_norm": 0.7243330859752051, + "learning_rate": 0.00010902777777777777, + "loss": 0.6326, + "step": 314 + }, + { + "epoch": 0.10985572744654963, + "grad_norm": 1.3922163003264714, + "learning_rate": 0.00010972222222222224, + "loss": 0.5406, + "step": 316 + }, + { + "epoch": 0.11055101686076829, + "grad_norm": 2.604851740418153, + "learning_rate": 0.00011041666666666668, + "loss": 0.8013, + "step": 318 + }, + { + "epoch": 0.11124630627498697, + "grad_norm": 1.83511037983023, + "learning_rate": 0.00011111111111111112, + "loss": 0.8048, + "step": 320 + }, + { + "epoch": 0.11194159568920563, + "grad_norm": 1.6737764614655666, + "learning_rate": 0.00011180555555555556, + "loss": 0.6943, + "step": 322 + }, + { + "epoch": 0.1126368851034243, + "grad_norm": 1.077667781888673, + "learning_rate": 0.00011250000000000001, + "loss": 0.8054, + "step": 324 + }, + { + "epoch": 0.11333217451764296, + "grad_norm": 0.5597693838209001, + "learning_rate": 0.00011319444444444445, + "loss": 0.6251, + "step": 326 + }, + { + "epoch": 0.11402746393186164, + "grad_norm": 0.5636865078063477, + "learning_rate": 0.00011388888888888889, + "loss": 0.6832, + "step": 328 + }, + { + "epoch": 0.1147227533460803, + "grad_norm": 0.6445176566556912, + "learning_rate": 0.00011458333333333333, + "loss": 0.6661, + "step": 330 + }, + { + "epoch": 0.11541804276029898, + "grad_norm": 0.607532412895966, + "learning_rate": 0.00011527777777777777, + "loss": 0.7026, + "step": 332 + }, + { + "epoch": 0.11611333217451764, + "grad_norm": 1.0496949694240345, + "learning_rate": 0.00011597222222222224, + "loss": 0.6451, + "step": 334 + }, + { + "epoch": 0.11680862158873631, + "grad_norm": 0.9469233272179363, + "learning_rate": 0.00011666666666666668, + "loss": 0.6694, + "step": 336 + }, + { + "epoch": 0.11750391100295499, + "grad_norm": 1.3789882614528595, + "learning_rate": 0.00011736111111111112, + "loss": 0.7031, + "step": 338 + }, + { + "epoch": 0.11819920041717365, + "grad_norm": 1.2016589928587922, + "learning_rate": 0.00011805555555555556, + "loss": 0.6676, + "step": 340 + }, + { + "epoch": 0.11889448983139232, + "grad_norm": 1.3112845410865746, + "learning_rate": 0.00011875, + "loss": 0.7236, + "step": 342 + }, + { + "epoch": 0.11958977924561098, + "grad_norm": 0.6278789052805739, + "learning_rate": 0.00011944444444444445, + "loss": 0.6249, + "step": 344 + }, + { + "epoch": 0.12028506865982966, + "grad_norm": 0.5405148902553805, + "learning_rate": 0.0001201388888888889, + "loss": 0.6412, + "step": 346 + }, + { + "epoch": 0.12098035807404832, + "grad_norm": 1.6923616138961255, + "learning_rate": 0.00012083333333333333, + "loss": 0.7017, + "step": 348 + }, + { + "epoch": 0.121675647488267, + "grad_norm": 1.5994113095813072, + "learning_rate": 0.00012152777777777777, + "loss": 0.7075, + "step": 350 + }, + { + "epoch": 0.12237093690248566, + "grad_norm": 2.3083516502461783, + "learning_rate": 0.00012222222222222224, + "loss": 0.7755, + "step": 352 + }, + { + "epoch": 0.12306622631670433, + "grad_norm": 0.8769167165306447, + "learning_rate": 0.00012291666666666668, + "loss": 0.7428, + "step": 354 + }, + { + "epoch": 0.12376151573092299, + "grad_norm": 0.4456469638797518, + "learning_rate": 0.00012361111111111112, + "loss": 0.7002, + "step": 356 + }, + { + "epoch": 0.12445680514514167, + "grad_norm": 0.8199993647792723, + "learning_rate": 0.00012430555555555556, + "loss": 0.7222, + "step": 358 + }, + { + "epoch": 0.12515209455936033, + "grad_norm": 0.3741084955970339, + "learning_rate": 0.000125, + "loss": 0.6821, + "step": 360 + }, + { + "epoch": 0.125847383973579, + "grad_norm": 0.2972203241099783, + "learning_rate": 0.00012569444444444444, + "loss": 0.7083, + "step": 362 + }, + { + "epoch": 0.12654267338779768, + "grad_norm": 0.40651740632246575, + "learning_rate": 0.00012638888888888888, + "loss": 0.7144, + "step": 364 + }, + { + "epoch": 0.12723796280201635, + "grad_norm": 0.4388093199704831, + "learning_rate": 0.00012708333333333332, + "loss": 0.6863, + "step": 366 + }, + { + "epoch": 0.127933252216235, + "grad_norm": 0.45131267837810835, + "learning_rate": 0.00012777777777777776, + "loss": 0.6329, + "step": 368 + }, + { + "epoch": 0.12862854163045367, + "grad_norm": 0.3837830352665476, + "learning_rate": 0.00012847222222222223, + "loss": 0.6938, + "step": 370 + }, + { + "epoch": 0.12932383104467235, + "grad_norm": 0.6378624076702905, + "learning_rate": 0.00012916666666666667, + "loss": 0.6433, + "step": 372 + }, + { + "epoch": 0.13001912045889102, + "grad_norm": 0.41344403509072675, + "learning_rate": 0.0001298611111111111, + "loss": 0.6892, + "step": 374 + }, + { + "epoch": 0.13071440987310967, + "grad_norm": 1.3428471718098582, + "learning_rate": 0.00013055555555555555, + "loss": 0.7793, + "step": 376 + }, + { + "epoch": 0.13140969928732835, + "grad_norm": 0.6202275876483008, + "learning_rate": 0.00013125000000000002, + "loss": 0.6836, + "step": 378 + }, + { + "epoch": 0.13210498870154702, + "grad_norm": 0.774014383396004, + "learning_rate": 0.00013194444444444446, + "loss": 0.701, + "step": 380 + }, + { + "epoch": 0.1328002781157657, + "grad_norm": 1.0650744092292224, + "learning_rate": 0.0001326388888888889, + "loss": 0.6562, + "step": 382 + }, + { + "epoch": 0.13349556752998434, + "grad_norm": 0.5540168492927294, + "learning_rate": 0.00013333333333333334, + "loss": 0.6267, + "step": 384 + }, + { + "epoch": 0.13419085694420302, + "grad_norm": 0.6403086140920178, + "learning_rate": 0.00013402777777777778, + "loss": 0.6268, + "step": 386 + }, + { + "epoch": 0.1348861463584217, + "grad_norm": 0.9197218298114509, + "learning_rate": 0.00013472222222222225, + "loss": 0.7208, + "step": 388 + }, + { + "epoch": 0.13558143577264037, + "grad_norm": 0.4235387152144674, + "learning_rate": 0.0001354166666666667, + "loss": 0.6057, + "step": 390 + }, + { + "epoch": 0.13627672518685904, + "grad_norm": 0.425648636635043, + "learning_rate": 0.00013611111111111113, + "loss": 0.6387, + "step": 392 + }, + { + "epoch": 0.1369720146010777, + "grad_norm": 1.034952396366508, + "learning_rate": 0.00013680555555555557, + "loss": 0.7307, + "step": 394 + }, + { + "epoch": 0.13766730401529637, + "grad_norm": 0.8865505732510678, + "learning_rate": 0.0001375, + "loss": 0.6547, + "step": 396 + }, + { + "epoch": 0.13836259342951504, + "grad_norm": 0.6490094573088415, + "learning_rate": 0.00013819444444444445, + "loss": 0.6909, + "step": 398 + }, + { + "epoch": 0.13905788284373372, + "grad_norm": 0.8592713330921486, + "learning_rate": 0.0001388888888888889, + "loss": 0.6442, + "step": 400 + }, + { + "epoch": 0.13975317225795236, + "grad_norm": 1.0279375953862069, + "learning_rate": 0.00013958333333333333, + "loss": 0.6907, + "step": 402 + }, + { + "epoch": 0.14044846167217104, + "grad_norm": 0.6151057351983696, + "learning_rate": 0.00014027777777777777, + "loss": 0.697, + "step": 404 + }, + { + "epoch": 0.1411437510863897, + "grad_norm": 0.7417879717121144, + "learning_rate": 0.00014097222222222224, + "loss": 0.698, + "step": 406 + }, + { + "epoch": 0.1418390405006084, + "grad_norm": 0.5161453091859882, + "learning_rate": 0.00014166666666666668, + "loss": 0.6915, + "step": 408 + }, + { + "epoch": 0.14253432991482703, + "grad_norm": 0.5667521096080546, + "learning_rate": 0.00014236111111111112, + "loss": 0.6609, + "step": 410 + }, + { + "epoch": 0.1432296193290457, + "grad_norm": 0.7560317583703429, + "learning_rate": 0.00014305555555555556, + "loss": 0.6392, + "step": 412 + }, + { + "epoch": 0.14392490874326438, + "grad_norm": 0.5456303981546313, + "learning_rate": 0.00014375, + "loss": 0.7561, + "step": 414 + }, + { + "epoch": 0.14462019815748306, + "grad_norm": 0.4218469018151631, + "learning_rate": 0.00014444444444444444, + "loss": 0.675, + "step": 416 + }, + { + "epoch": 0.14531548757170173, + "grad_norm": 0.3790517974518404, + "learning_rate": 0.00014513888888888888, + "loss": 0.6697, + "step": 418 + }, + { + "epoch": 0.14601077698592038, + "grad_norm": 0.36495171567914964, + "learning_rate": 0.00014583333333333335, + "loss": 0.6467, + "step": 420 + }, + { + "epoch": 0.14670606640013906, + "grad_norm": 0.3793520501177419, + "learning_rate": 0.00014652777777777779, + "loss": 0.6234, + "step": 422 + }, + { + "epoch": 0.14740135581435773, + "grad_norm": 0.6214905371013544, + "learning_rate": 0.00014722222222222223, + "loss": 0.64, + "step": 424 + }, + { + "epoch": 0.1480966452285764, + "grad_norm": 0.4103438113660832, + "learning_rate": 0.0001479166666666667, + "loss": 0.6174, + "step": 426 + }, + { + "epoch": 0.14879193464279505, + "grad_norm": 0.5802311029669485, + "learning_rate": 0.00014861111111111113, + "loss": 0.6941, + "step": 428 + }, + { + "epoch": 0.14948722405701373, + "grad_norm": 0.4876572424583591, + "learning_rate": 0.00014930555555555557, + "loss": 0.6178, + "step": 430 + }, + { + "epoch": 0.1501825134712324, + "grad_norm": 0.6252220373472688, + "learning_rate": 0.00015000000000000001, + "loss": 0.692, + "step": 432 + }, + { + "epoch": 0.15087780288545108, + "grad_norm": 1.516758455176553, + "learning_rate": 0.00015069444444444445, + "loss": 0.6812, + "step": 434 + }, + { + "epoch": 0.15157309229966973, + "grad_norm": 0.48294685446689867, + "learning_rate": 0.0001513888888888889, + "loss": 0.7085, + "step": 436 + }, + { + "epoch": 0.1522683817138884, + "grad_norm": 0.414196721150167, + "learning_rate": 0.00015208333333333333, + "loss": 0.673, + "step": 438 + }, + { + "epoch": 0.15296367112810708, + "grad_norm": 0.7294881062503469, + "learning_rate": 0.00015277777777777777, + "loss": 0.6415, + "step": 440 + }, + { + "epoch": 0.15365896054232575, + "grad_norm": 0.4846932912054438, + "learning_rate": 0.00015347222222222224, + "loss": 0.6644, + "step": 442 + }, + { + "epoch": 0.1543542499565444, + "grad_norm": 0.6067400167426414, + "learning_rate": 0.00015416666666666668, + "loss": 0.6816, + "step": 444 + }, + { + "epoch": 0.15504953937076307, + "grad_norm": 0.5586278026791864, + "learning_rate": 0.00015486111111111112, + "loss": 0.6223, + "step": 446 + }, + { + "epoch": 0.15574482878498175, + "grad_norm": 0.3947236166856149, + "learning_rate": 0.00015555555555555556, + "loss": 0.7297, + "step": 448 + }, + { + "epoch": 0.15644011819920042, + "grad_norm": 0.371457756887947, + "learning_rate": 0.00015625, + "loss": 0.6099, + "step": 450 + }, + { + "epoch": 0.15644011819920042, + "eval_loss": 0.6634477376937866, + "eval_runtime": 706.8027, + "eval_samples_per_second": 6.851, + "eval_steps_per_second": 0.215, + "step": 450 + }, + { + "epoch": 0.1571354076134191, + "grad_norm": 0.4157928192338373, + "learning_rate": 0.00015694444444444444, + "loss": 0.7163, + "step": 452 + }, + { + "epoch": 0.15783069702763775, + "grad_norm": 0.6318513446857751, + "learning_rate": 0.00015763888888888888, + "loss": 0.658, + "step": 454 + }, + { + "epoch": 0.15852598644185642, + "grad_norm": 0.3188170086808347, + "learning_rate": 0.00015833333333333332, + "loss": 0.5966, + "step": 456 + }, + { + "epoch": 0.1592212758560751, + "grad_norm": 0.4873146052629784, + "learning_rate": 0.00015902777777777776, + "loss": 0.687, + "step": 458 + }, + { + "epoch": 0.15991656527029377, + "grad_norm": 0.3939618900754228, + "learning_rate": 0.00015972222222222223, + "loss": 0.6704, + "step": 460 + }, + { + "epoch": 0.16061185468451242, + "grad_norm": 0.43442241310529234, + "learning_rate": 0.00016041666666666667, + "loss": 0.6941, + "step": 462 + }, + { + "epoch": 0.1613071440987311, + "grad_norm": 0.5944395304786771, + "learning_rate": 0.0001611111111111111, + "loss": 0.5934, + "step": 464 + }, + { + "epoch": 0.16200243351294977, + "grad_norm": 0.6186667715273749, + "learning_rate": 0.00016180555555555555, + "loss": 0.6604, + "step": 466 + }, + { + "epoch": 0.16269772292716844, + "grad_norm": 0.8945416923537124, + "learning_rate": 0.00016250000000000002, + "loss": 0.6224, + "step": 468 + }, + { + "epoch": 0.1633930123413871, + "grad_norm": 1.0526200270890014, + "learning_rate": 0.00016319444444444446, + "loss": 0.616, + "step": 470 + }, + { + "epoch": 0.16408830175560576, + "grad_norm": 0.4575985966727194, + "learning_rate": 0.0001638888888888889, + "loss": 0.6591, + "step": 472 + }, + { + "epoch": 0.16478359116982444, + "grad_norm": 0.4499931204645402, + "learning_rate": 0.00016458333333333334, + "loss": 0.6644, + "step": 474 + }, + { + "epoch": 0.16547888058404311, + "grad_norm": 0.8365574384741885, + "learning_rate": 0.00016527777777777778, + "loss": 0.6503, + "step": 476 + }, + { + "epoch": 0.1661741699982618, + "grad_norm": 0.5265284650577726, + "learning_rate": 0.00016597222222222225, + "loss": 0.557, + "step": 478 + }, + { + "epoch": 0.16686945941248044, + "grad_norm": 0.6004742828917694, + "learning_rate": 0.0001666666666666667, + "loss": 0.696, + "step": 480 + }, + { + "epoch": 0.1675647488266991, + "grad_norm": 0.8653134209549845, + "learning_rate": 0.00016736111111111113, + "loss": 0.6544, + "step": 482 + }, + { + "epoch": 0.1682600382409178, + "grad_norm": 1.033230873418064, + "learning_rate": 0.00016805555555555557, + "loss": 0.641, + "step": 484 + }, + { + "epoch": 0.16895532765513646, + "grad_norm": 0.45457193405665913, + "learning_rate": 0.00016875, + "loss": 0.5952, + "step": 486 + }, + { + "epoch": 0.1696506170693551, + "grad_norm": 0.7413902971651539, + "learning_rate": 0.00016944444444444445, + "loss": 0.6306, + "step": 488 + }, + { + "epoch": 0.17034590648357378, + "grad_norm": 0.5808764628223875, + "learning_rate": 0.0001701388888888889, + "loss": 0.6714, + "step": 490 + }, + { + "epoch": 0.17104119589779246, + "grad_norm": 0.42505370383777924, + "learning_rate": 0.00017083333333333333, + "loss": 0.6432, + "step": 492 + }, + { + "epoch": 0.17173648531201113, + "grad_norm": 0.9403542369255028, + "learning_rate": 0.00017152777777777777, + "loss": 0.626, + "step": 494 + }, + { + "epoch": 0.17243177472622978, + "grad_norm": 0.41714707593148775, + "learning_rate": 0.00017222222222222224, + "loss": 0.6132, + "step": 496 + }, + { + "epoch": 0.17312706414044846, + "grad_norm": 0.6660896849726371, + "learning_rate": 0.00017291666666666668, + "loss": 0.7009, + "step": 498 + }, + { + "epoch": 0.17382235355466713, + "grad_norm": 0.5079993412341118, + "learning_rate": 0.00017361111111111112, + "loss": 0.6808, + "step": 500 + }, + { + "epoch": 0.1745176429688858, + "grad_norm": 0.3426487947129772, + "learning_rate": 0.00017430555555555556, + "loss": 0.687, + "step": 502 + }, + { + "epoch": 0.17521293238310448, + "grad_norm": 0.7316051797581208, + "learning_rate": 0.000175, + "loss": 0.686, + "step": 504 + }, + { + "epoch": 0.17590822179732313, + "grad_norm": 0.4619785653282459, + "learning_rate": 0.00017569444444444444, + "loss": 0.7019, + "step": 506 + }, + { + "epoch": 0.1766035112115418, + "grad_norm": 0.47786977912472967, + "learning_rate": 0.0001763888888888889, + "loss": 0.7097, + "step": 508 + }, + { + "epoch": 0.17729880062576048, + "grad_norm": 0.4204398291864812, + "learning_rate": 0.00017708333333333335, + "loss": 0.6715, + "step": 510 + }, + { + "epoch": 0.17799409003997915, + "grad_norm": 0.5257761541709909, + "learning_rate": 0.00017777777777777779, + "loss": 0.6675, + "step": 512 + }, + { + "epoch": 0.1786893794541978, + "grad_norm": 0.5752239420884688, + "learning_rate": 0.00017847222222222225, + "loss": 0.5847, + "step": 514 + }, + { + "epoch": 0.17938466886841647, + "grad_norm": 0.5611432017880666, + "learning_rate": 0.0001791666666666667, + "loss": 0.5978, + "step": 516 + }, + { + "epoch": 0.18007995828263515, + "grad_norm": 0.5147097358785945, + "learning_rate": 0.00017986111111111113, + "loss": 0.641, + "step": 518 + }, + { + "epoch": 0.18077524769685382, + "grad_norm": 0.4387330962078066, + "learning_rate": 0.00018055555555555557, + "loss": 0.5771, + "step": 520 + }, + { + "epoch": 0.18147053711107247, + "grad_norm": 0.5712526440788663, + "learning_rate": 0.00018125000000000001, + "loss": 0.6212, + "step": 522 + }, + { + "epoch": 0.18216582652529115, + "grad_norm": 0.6357133907029916, + "learning_rate": 0.00018194444444444445, + "loss": 0.5981, + "step": 524 + }, + { + "epoch": 0.18286111593950982, + "grad_norm": 1.2129620643054042, + "learning_rate": 0.0001826388888888889, + "loss": 0.5848, + "step": 526 + }, + { + "epoch": 0.1835564053537285, + "grad_norm": 1.651599276688714, + "learning_rate": 0.00018333333333333334, + "loss": 0.7089, + "step": 528 + }, + { + "epoch": 0.18425169476794717, + "grad_norm": 0.9051688342434142, + "learning_rate": 0.00018402777777777778, + "loss": 0.7255, + "step": 530 + }, + { + "epoch": 0.18494698418216582, + "grad_norm": 0.6932441010863684, + "learning_rate": 0.00018472222222222224, + "loss": 0.6497, + "step": 532 + }, + { + "epoch": 0.1856422735963845, + "grad_norm": 1.2163006408955903, + "learning_rate": 0.00018541666666666668, + "loss": 0.7585, + "step": 534 + }, + { + "epoch": 0.18633756301060317, + "grad_norm": 0.4387074048377486, + "learning_rate": 0.00018611111111111112, + "loss": 0.6541, + "step": 536 + }, + { + "epoch": 0.18703285242482184, + "grad_norm": 0.49430581216479236, + "learning_rate": 0.00018680555555555556, + "loss": 0.6489, + "step": 538 + }, + { + "epoch": 0.1877281418390405, + "grad_norm": 0.47561442420926275, + "learning_rate": 0.0001875, + "loss": 0.6406, + "step": 540 + }, + { + "epoch": 0.18842343125325917, + "grad_norm": 0.7046092923664611, + "learning_rate": 0.00018819444444444444, + "loss": 0.6099, + "step": 542 + }, + { + "epoch": 0.18911872066747784, + "grad_norm": 0.46256136269201026, + "learning_rate": 0.00018888888888888888, + "loss": 0.6992, + "step": 544 + }, + { + "epoch": 0.18981401008169652, + "grad_norm": 0.5489877082982352, + "learning_rate": 0.00018958333333333332, + "loss": 0.5817, + "step": 546 + }, + { + "epoch": 0.19050929949591516, + "grad_norm": 0.46129441798908893, + "learning_rate": 0.00019027777777777776, + "loss": 0.645, + "step": 548 + }, + { + "epoch": 0.19120458891013384, + "grad_norm": 0.3724226655450749, + "learning_rate": 0.00019097222222222223, + "loss": 0.6177, + "step": 550 + }, + { + "epoch": 0.1918998783243525, + "grad_norm": 0.4625796323902992, + "learning_rate": 0.00019166666666666667, + "loss": 0.6702, + "step": 552 + }, + { + "epoch": 0.1925951677385712, + "grad_norm": 1.0142124821047231, + "learning_rate": 0.0001923611111111111, + "loss": 0.7173, + "step": 554 + }, + { + "epoch": 0.19329045715278984, + "grad_norm": 0.5452830720753045, + "learning_rate": 0.00019305555555555558, + "loss": 0.6897, + "step": 556 + }, + { + "epoch": 0.1939857465670085, + "grad_norm": 0.5723214484723252, + "learning_rate": 0.00019375000000000002, + "loss": 0.6495, + "step": 558 + }, + { + "epoch": 0.19468103598122719, + "grad_norm": 0.39925844595054966, + "learning_rate": 0.00019444444444444446, + "loss": 0.6479, + "step": 560 + }, + { + "epoch": 0.19537632539544586, + "grad_norm": 0.3575565088751118, + "learning_rate": 0.0001951388888888889, + "loss": 0.6593, + "step": 562 + }, + { + "epoch": 0.19607161480966454, + "grad_norm": 0.6119892689536569, + "learning_rate": 0.00019583333333333334, + "loss": 0.6831, + "step": 564 + }, + { + "epoch": 0.19676690422388318, + "grad_norm": 0.5076569073121309, + "learning_rate": 0.00019652777777777778, + "loss": 0.6294, + "step": 566 + }, + { + "epoch": 0.19746219363810186, + "grad_norm": 0.622226505121079, + "learning_rate": 0.00019722222222222225, + "loss": 0.5551, + "step": 568 + }, + { + "epoch": 0.19815748305232053, + "grad_norm": 0.4106526912254415, + "learning_rate": 0.0001979166666666667, + "loss": 0.6503, + "step": 570 + }, + { + "epoch": 0.1988527724665392, + "grad_norm": 0.47164751383243125, + "learning_rate": 0.00019861111111111113, + "loss": 0.6992, + "step": 572 + }, + { + "epoch": 0.19954806188075785, + "grad_norm": 0.492328312395826, + "learning_rate": 0.00019930555555555557, + "loss": 0.7183, + "step": 574 + }, + { + "epoch": 0.20024335129497653, + "grad_norm": 0.5087240677439067, + "learning_rate": 0.0002, + "loss": 0.6429, + "step": 576 + }, + { + "epoch": 0.2009386407091952, + "grad_norm": 0.9311216098504759, + "learning_rate": 0.00019999992632143608, + "loss": 0.6586, + "step": 578 + }, + { + "epoch": 0.20163393012341388, + "grad_norm": 0.38840935170189844, + "learning_rate": 0.00019999970528585288, + "loss": 0.5905, + "step": 580 + }, + { + "epoch": 0.20232921953763253, + "grad_norm": 0.5966472765038273, + "learning_rate": 0.0001999993368935761, + "loss": 0.7112, + "step": 582 + }, + { + "epoch": 0.2030245089518512, + "grad_norm": 0.535232520705813, + "learning_rate": 0.00019999882114514863, + "loss": 0.7036, + "step": 584 + }, + { + "epoch": 0.20371979836606988, + "grad_norm": 0.5039916125175515, + "learning_rate": 0.0001999981580413304, + "loss": 0.7485, + "step": 586 + }, + { + "epoch": 0.20441508778028855, + "grad_norm": 0.6733262892097686, + "learning_rate": 0.0001999973475830986, + "loss": 0.7312, + "step": 588 + }, + { + "epoch": 0.20511037719450723, + "grad_norm": 0.42805740684614807, + "learning_rate": 0.00019999638977164747, + "loss": 0.6356, + "step": 590 + }, + { + "epoch": 0.20580566660872587, + "grad_norm": 0.976918546573707, + "learning_rate": 0.00019999528460838844, + "loss": 0.666, + "step": 592 + }, + { + "epoch": 0.20650095602294455, + "grad_norm": 0.674463735133944, + "learning_rate": 0.00019999403209495, + "loss": 0.6735, + "step": 594 + }, + { + "epoch": 0.20719624543716322, + "grad_norm": 0.412232119296174, + "learning_rate": 0.00019999263223317786, + "loss": 0.6364, + "step": 596 + }, + { + "epoch": 0.2078915348513819, + "grad_norm": 0.3611034413524545, + "learning_rate": 0.0001999910850251348, + "loss": 0.6368, + "step": 598 + }, + { + "epoch": 0.20858682426560055, + "grad_norm": 0.542506398091656, + "learning_rate": 0.0001999893904731007, + "loss": 0.7292, + "step": 600 + }, + { + "epoch": 0.20858682426560055, + "eval_loss": 0.6517693400382996, + "eval_runtime": 707.4674, + "eval_samples_per_second": 6.844, + "eval_steps_per_second": 0.215, + "step": 600 + }, + { + "epoch": 0.20928211367981922, + "grad_norm": 0.4799286290563759, + "learning_rate": 0.0001999875485795727, + "loss": 0.6609, + "step": 602 + }, + { + "epoch": 0.2099774030940379, + "grad_norm": 0.41830446575524177, + "learning_rate": 0.0001999855593472649, + "loss": 0.6084, + "step": 604 + }, + { + "epoch": 0.21067269250825657, + "grad_norm": 0.8865562086549428, + "learning_rate": 0.00019998342277910856, + "loss": 0.6204, + "step": 606 + }, + { + "epoch": 0.21136798192247522, + "grad_norm": 0.5567410910026902, + "learning_rate": 0.00019998113887825206, + "loss": 0.7087, + "step": 608 + }, + { + "epoch": 0.2120632713366939, + "grad_norm": 0.4229098163428897, + "learning_rate": 0.000199978707648061, + "loss": 0.6403, + "step": 610 + }, + { + "epoch": 0.21275856075091257, + "grad_norm": 0.7793555918286379, + "learning_rate": 0.00019997612909211784, + "loss": 0.6147, + "step": 612 + }, + { + "epoch": 0.21345385016513124, + "grad_norm": 0.49302383416102263, + "learning_rate": 0.00019997340321422228, + "loss": 0.5771, + "step": 614 + }, + { + "epoch": 0.21414913957934992, + "grad_norm": 1.0807551778698754, + "learning_rate": 0.00019997053001839115, + "loss": 0.6538, + "step": 616 + }, + { + "epoch": 0.21484442899356856, + "grad_norm": 0.5935042706034646, + "learning_rate": 0.0001999675095088583, + "loss": 0.6058, + "step": 618 + }, + { + "epoch": 0.21553971840778724, + "grad_norm": 0.5151203960605611, + "learning_rate": 0.00019996434169007468, + "loss": 0.6138, + "step": 620 + }, + { + "epoch": 0.21623500782200591, + "grad_norm": 0.7837579499467073, + "learning_rate": 0.00019996102656670824, + "loss": 0.657, + "step": 622 + }, + { + "epoch": 0.2169302972362246, + "grad_norm": 0.5438202413527335, + "learning_rate": 0.0001999575641436441, + "loss": 0.6642, + "step": 624 + }, + { + "epoch": 0.21762558665044324, + "grad_norm": 0.5566641749580342, + "learning_rate": 0.00019995395442598435, + "loss": 0.6813, + "step": 626 + }, + { + "epoch": 0.2183208760646619, + "grad_norm": 0.9345190838089675, + "learning_rate": 0.0001999501974190482, + "loss": 0.684, + "step": 628 + }, + { + "epoch": 0.2190161654788806, + "grad_norm": 0.48677420225080537, + "learning_rate": 0.00019994629312837186, + "loss": 0.6481, + "step": 630 + }, + { + "epoch": 0.21971145489309926, + "grad_norm": 1.3826373483976924, + "learning_rate": 0.00019994224155970856, + "loss": 0.7222, + "step": 632 + }, + { + "epoch": 0.2204067443073179, + "grad_norm": 0.9031189580678588, + "learning_rate": 0.00019993804271902857, + "loss": 0.6809, + "step": 634 + }, + { + "epoch": 0.22110203372153658, + "grad_norm": 0.5674519795217096, + "learning_rate": 0.00019993369661251923, + "loss": 0.6184, + "step": 636 + }, + { + "epoch": 0.22179732313575526, + "grad_norm": 2.5294344265719135, + "learning_rate": 0.0001999292032465848, + "loss": 0.7686, + "step": 638 + }, + { + "epoch": 0.22249261254997393, + "grad_norm": 2.8855656605632047, + "learning_rate": 0.00019992456262784658, + "loss": 0.8215, + "step": 640 + }, + { + "epoch": 0.2231879019641926, + "grad_norm": 1.5331524159142917, + "learning_rate": 0.00019991977476314286, + "loss": 0.7057, + "step": 642 + }, + { + "epoch": 0.22388319137841126, + "grad_norm": 0.8086145005161695, + "learning_rate": 0.0001999148396595289, + "loss": 0.6289, + "step": 644 + }, + { + "epoch": 0.22457848079262993, + "grad_norm": 0.767389193699688, + "learning_rate": 0.00019990975732427693, + "loss": 0.6117, + "step": 646 + }, + { + "epoch": 0.2252737702068486, + "grad_norm": 0.9275190697426144, + "learning_rate": 0.0001999045277648761, + "loss": 0.6582, + "step": 648 + }, + { + "epoch": 0.22596905962106728, + "grad_norm": 0.8004230202091956, + "learning_rate": 0.00019989915098903257, + "loss": 0.5387, + "step": 650 + }, + { + "epoch": 0.22666434903528593, + "grad_norm": 0.8210833181388095, + "learning_rate": 0.0001998936270046694, + "loss": 0.5941, + "step": 652 + }, + { + "epoch": 0.2273596384495046, + "grad_norm": 2.1189675938584616, + "learning_rate": 0.00019988795581992656, + "loss": 0.7504, + "step": 654 + }, + { + "epoch": 0.22805492786372328, + "grad_norm": 0.5952032026226816, + "learning_rate": 0.000199882137443161, + "loss": 0.6643, + "step": 656 + }, + { + "epoch": 0.22875021727794195, + "grad_norm": 0.40481972159485846, + "learning_rate": 0.00019987617188294642, + "loss": 0.5225, + "step": 658 + }, + { + "epoch": 0.2294455066921606, + "grad_norm": 0.7478677085785272, + "learning_rate": 0.00019987005914807356, + "loss": 0.6561, + "step": 660 + }, + { + "epoch": 0.23014079610637928, + "grad_norm": 0.4468692254604696, + "learning_rate": 0.00019986379924754997, + "loss": 0.6262, + "step": 662 + }, + { + "epoch": 0.23083608552059795, + "grad_norm": 0.46697718493106893, + "learning_rate": 0.00019985739219060002, + "loss": 0.6178, + "step": 664 + }, + { + "epoch": 0.23153137493481663, + "grad_norm": 0.388728867903269, + "learning_rate": 0.000199850837986665, + "loss": 0.5544, + "step": 666 + }, + { + "epoch": 0.23222666434903527, + "grad_norm": 0.5731403139849517, + "learning_rate": 0.000199844136645403, + "loss": 0.5906, + "step": 668 + }, + { + "epoch": 0.23292195376325395, + "grad_norm": 0.7601215827849259, + "learning_rate": 0.0001998372881766889, + "loss": 0.6577, + "step": 670 + }, + { + "epoch": 0.23361724317747262, + "grad_norm": 0.8997786413980279, + "learning_rate": 0.00019983029259061446, + "loss": 0.6388, + "step": 672 + }, + { + "epoch": 0.2343125325916913, + "grad_norm": 0.519349430301096, + "learning_rate": 0.00019982314989748813, + "loss": 0.6561, + "step": 674 + }, + { + "epoch": 0.23500782200590997, + "grad_norm": 0.4918913590728881, + "learning_rate": 0.00019981586010783513, + "loss": 0.6176, + "step": 676 + }, + { + "epoch": 0.23570311142012862, + "grad_norm": 0.5324672662478441, + "learning_rate": 0.00019980842323239756, + "loss": 0.5801, + "step": 678 + }, + { + "epoch": 0.2363984008343473, + "grad_norm": 0.6375745879180794, + "learning_rate": 0.00019980083928213417, + "loss": 0.6885, + "step": 680 + }, + { + "epoch": 0.23709369024856597, + "grad_norm": 0.4317997282790841, + "learning_rate": 0.00019979310826822046, + "loss": 0.5727, + "step": 682 + }, + { + "epoch": 0.23778897966278464, + "grad_norm": 0.7933828103238656, + "learning_rate": 0.00019978523020204857, + "loss": 0.6703, + "step": 684 + }, + { + "epoch": 0.2384842690770033, + "grad_norm": 0.5465102255190097, + "learning_rate": 0.00019977720509522747, + "loss": 0.6675, + "step": 686 + }, + { + "epoch": 0.23917955849122197, + "grad_norm": 0.8356137363612883, + "learning_rate": 0.00019976903295958269, + "loss": 0.6558, + "step": 688 + }, + { + "epoch": 0.23987484790544064, + "grad_norm": 0.5190073187676806, + "learning_rate": 0.00019976071380715645, + "loss": 0.6779, + "step": 690 + }, + { + "epoch": 0.24057013731965932, + "grad_norm": 0.40561527338007225, + "learning_rate": 0.0001997522476502076, + "loss": 0.6687, + "step": 692 + }, + { + "epoch": 0.24126542673387796, + "grad_norm": 0.592821589706298, + "learning_rate": 0.0001997436345012117, + "loss": 0.6807, + "step": 694 + }, + { + "epoch": 0.24196071614809664, + "grad_norm": 0.686918345062074, + "learning_rate": 0.00019973487437286073, + "loss": 0.6831, + "step": 696 + }, + { + "epoch": 0.2426560055623153, + "grad_norm": 0.964075508243471, + "learning_rate": 0.00019972596727806346, + "loss": 0.665, + "step": 698 + }, + { + "epoch": 0.243351294976534, + "grad_norm": 0.739137434656244, + "learning_rate": 0.00019971691322994507, + "loss": 0.6387, + "step": 700 + }, + { + "epoch": 0.24404658439075266, + "grad_norm": 0.3978099419540589, + "learning_rate": 0.00019970771224184737, + "loss": 0.6143, + "step": 702 + }, + { + "epoch": 0.2447418738049713, + "grad_norm": 0.4997978607153984, + "learning_rate": 0.0001996983643273287, + "loss": 0.6083, + "step": 704 + }, + { + "epoch": 0.24543716321918999, + "grad_norm": 1.3443518380439796, + "learning_rate": 0.0001996888695001638, + "loss": 0.6711, + "step": 706 + }, + { + "epoch": 0.24613245263340866, + "grad_norm": 0.5424379336505594, + "learning_rate": 0.000199679227774344, + "loss": 0.6321, + "step": 708 + }, + { + "epoch": 0.24682774204762734, + "grad_norm": 0.7689235498835658, + "learning_rate": 0.00019966943916407712, + "loss": 0.6918, + "step": 710 + }, + { + "epoch": 0.24752303146184598, + "grad_norm": 0.6467240394468301, + "learning_rate": 0.00019965950368378734, + "loss": 0.6368, + "step": 712 + }, + { + "epoch": 0.24821832087606466, + "grad_norm": 0.48819289451999526, + "learning_rate": 0.00019964942134811532, + "loss": 0.5875, + "step": 714 + }, + { + "epoch": 0.24891361029028333, + "grad_norm": 1.1929427463467126, + "learning_rate": 0.00019963919217191807, + "loss": 0.6795, + "step": 716 + }, + { + "epoch": 0.249608899704502, + "grad_norm": 0.4182713825442439, + "learning_rate": 0.00019962881617026902, + "loss": 0.5835, + "step": 718 + }, + { + "epoch": 0.25030418911872065, + "grad_norm": 0.5770262516296942, + "learning_rate": 0.00019961829335845795, + "loss": 0.6299, + "step": 720 + } + ], + "logging_steps": 2, + "max_steps": 5752, + "num_input_tokens_seen": 0, + "num_train_epochs": 2, + "save_steps": 90, + "stateful_callbacks": { + "TrainerControl": { + "args": { + "should_epoch_stop": false, + "should_evaluate": false, + "should_log": false, + "should_save": true, + "should_training_stop": false + }, + "attributes": {} + } + }, + "total_flos": 2868123288993792.0, + "train_batch_size": 4, + "trial_name": null, + "trial_params": null +} diff --git a/checkpoint-720/training_args.bin b/checkpoint-720/training_args.bin new file mode 100644 index 0000000000000000000000000000000000000000..fba3b63792fed5a70be0307e26ba27ef584b1528 --- /dev/null +++ b/checkpoint-720/training_args.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b72add547acd6c009f3a3770072d0cdf7de7e797c7597084319db874a556e470 +size 6904 diff --git a/checkpoint-720/zero_to_fp32.py b/checkpoint-720/zero_to_fp32.py new file mode 100644 index 0000000000000000000000000000000000000000..0e759146cadd92ddfefab3680146c2bd6a2b5c04 --- /dev/null +++ b/checkpoint-720/zero_to_fp32.py @@ -0,0 +1,760 @@ +#!/usr/bin/env python + +# Copyright (c) Microsoft Corporation. +# SPDX-License-Identifier: Apache-2.0 + +# DeepSpeed Team + +# This script extracts fp32 consolidated weights from a zero 1, 2 and 3 DeepSpeed checkpoints. It gets +# copied into the top level checkpoint dir, so the user can easily do the conversion at any point in +# the future. Once extracted, the weights don't require DeepSpeed and can be used in any +# application. +# +# example: +# python zero_to_fp32.py . output_dir/ +# or +# python zero_to_fp32.py . output_dir/ --safe_serialization + +import argparse +import torch +import glob +import math +import os +import re +import gc +import json +import numpy as np +from tqdm import tqdm +from collections import OrderedDict +from dataclasses import dataclass + +# while this script doesn't use deepspeed to recover data, since the checkpoints are pickled with +# DeepSpeed data structures it has to be available in the current python environment. +from deepspeed.utils import logger +from deepspeed.checkpoint.constants import (DS_VERSION, OPTIMIZER_STATE_DICT, SINGLE_PARTITION_OF_FP32_GROUPS, + FP32_FLAT_GROUPS, ZERO_STAGE, PARTITION_COUNT, PARAM_SHAPES, BUFFER_NAMES, + FROZEN_PARAM_SHAPES, FROZEN_PARAM_FRAGMENTS) + + +@dataclass +class zero_model_state: + buffers: dict() + param_shapes: dict() + shared_params: list + ds_version: int + frozen_param_shapes: dict() + frozen_param_fragments: dict() + + +debug = 0 + +# load to cpu +device = torch.device('cpu') + + +def atoi(text): + return int(text) if text.isdigit() else text + + +def natural_keys(text): + ''' + alist.sort(key=natural_keys) sorts in human order + http://nedbatchelder.com/blog/200712/human_sorting.html + (See Toothy's implementation in the comments) + ''' + return [atoi(c) for c in re.split(r'(\d+)', text)] + + +def get_model_state_file(checkpoint_dir, zero_stage): + if not os.path.isdir(checkpoint_dir): + raise FileNotFoundError(f"Directory '{checkpoint_dir}' doesn't exist") + + # there should be only one file + if zero_stage <= 2: + file = os.path.join(checkpoint_dir, "mp_rank_00_model_states.pt") + elif zero_stage == 3: + file = os.path.join(checkpoint_dir, "zero_pp_rank_0_mp_rank_00_model_states.pt") + + if not os.path.exists(file): + raise FileNotFoundError(f"can't find model states file at '{file}'") + + return file + + +def get_checkpoint_files(checkpoint_dir, glob_pattern): + # XXX: need to test that this simple glob rule works for multi-node setup too + ckpt_files = sorted(glob.glob(os.path.join(checkpoint_dir, glob_pattern)), key=natural_keys) + + if len(ckpt_files) == 0: + raise FileNotFoundError(f"can't find {glob_pattern} files in directory '{checkpoint_dir}'") + + return ckpt_files + + +def get_optim_files(checkpoint_dir): + return get_checkpoint_files(checkpoint_dir, "*_optim_states.pt") + + +def get_model_state_files(checkpoint_dir): + return get_checkpoint_files(checkpoint_dir, "*_model_states.pt") + + +def parse_model_states(files): + zero_model_states = [] + for file in files: + state_dict = torch.load(file, map_location=device, weights_only=False) + + if BUFFER_NAMES not in state_dict: + raise ValueError(f"{file} is not a model state checkpoint") + buffer_names = state_dict[BUFFER_NAMES] + if debug: + print("Found buffers:", buffer_names) + + # recover just the buffers while restoring them to fp32 if they were saved in fp16 + buffers = {k: v.float() for k, v in state_dict["module"].items() if k in buffer_names} + param_shapes = state_dict[PARAM_SHAPES] + + # collect parameters that are included in param_shapes + param_names = [] + for s in param_shapes: + for name in s.keys(): + param_names.append(name) + + # update with frozen parameters + frozen_param_shapes = state_dict.get(FROZEN_PARAM_SHAPES, None) + if frozen_param_shapes is not None: + if debug: + print(f"Found frozen_param_shapes: {frozen_param_shapes}") + param_names += list(frozen_param_shapes.keys()) + + # handle shared params + shared_params = [[k, v] for k, v in state_dict["shared_params"].items()] + + ds_version = state_dict.get(DS_VERSION, None) + + frozen_param_fragments = state_dict.get(FROZEN_PARAM_FRAGMENTS, None) + + z_model_state = zero_model_state(buffers=buffers, + param_shapes=param_shapes, + shared_params=shared_params, + ds_version=ds_version, + frozen_param_shapes=frozen_param_shapes, + frozen_param_fragments=frozen_param_fragments) + zero_model_states.append(z_model_state) + + return zero_model_states + + +def parse_optim_states(files, ds_checkpoint_dir): + total_files = len(files) + state_dicts = [] + for f in tqdm(files, desc='Loading checkpoint shards'): + state_dict = torch.load(f, map_location=device, mmap=True, weights_only=False) + # immediately discard the potentially huge 2 optimizer states as we only care for fp32 master weights + # and also handle the case where it was already removed by another helper script + state_dict["optimizer_state_dict"].pop("optimizer_state_dict", None) + state_dicts.append(state_dict) + + if not ZERO_STAGE in state_dicts[0][OPTIMIZER_STATE_DICT]: + raise ValueError(f"{files[0]} is not a zero checkpoint") + zero_stage = state_dicts[0][OPTIMIZER_STATE_DICT][ZERO_STAGE] + world_size = state_dicts[0][OPTIMIZER_STATE_DICT][PARTITION_COUNT] + + # For ZeRO-2 each param group can have different partition_count as data parallelism for expert + # parameters can be different from data parallelism for non-expert parameters. So we can just + # use the max of the partition_count to get the dp world_size. + + if type(world_size) is list: + world_size = max(world_size) + + if world_size != total_files: + raise ValueError( + f"Expected {world_size} of '*_optim_states.pt' under '{ds_checkpoint_dir}' but found {total_files} files. " + "Possibly due to an overwrite of an old checkpoint, or a checkpoint didn't get saved by one or more processes." + ) + + # the groups are named differently in each stage + if zero_stage <= 2: + fp32_groups_key = SINGLE_PARTITION_OF_FP32_GROUPS + elif zero_stage == 3: + fp32_groups_key = FP32_FLAT_GROUPS + else: + raise ValueError(f"unknown zero stage {zero_stage}") + + fp32_flat_groups = [state_dicts[i][OPTIMIZER_STATE_DICT][fp32_groups_key] for i in range(len(state_dicts))] + return zero_stage, world_size, fp32_flat_groups + + +def _get_fp32_state_dict_from_zero_checkpoint(ds_checkpoint_dir, exclude_frozen_parameters): + """ + Returns fp32 state_dict reconstructed from ds checkpoint + + Args: + - ``ds_checkpoint_dir``: path to the deepspeed checkpoint folder (where the optimizer files are) + + """ + print(f"Processing zero checkpoint '{ds_checkpoint_dir}'") + + optim_files = get_optim_files(ds_checkpoint_dir) + zero_stage, world_size, fp32_flat_groups = parse_optim_states(optim_files, ds_checkpoint_dir) + print(f"Detected checkpoint of type zero stage {zero_stage}, world_size: {world_size}") + + model_files = get_model_state_files(ds_checkpoint_dir) + + zero_model_states = parse_model_states(model_files) + print(f'Parsing checkpoint created by deepspeed=={zero_model_states[0].ds_version}') + + if zero_stage <= 2: + return _get_fp32_state_dict_from_zero2_checkpoint(world_size, fp32_flat_groups, zero_model_states, + exclude_frozen_parameters) + elif zero_stage == 3: + return _get_fp32_state_dict_from_zero3_checkpoint(world_size, fp32_flat_groups, zero_model_states, + exclude_frozen_parameters) + + +def _zero2_merge_frozen_params(state_dict, zero_model_states): + if zero_model_states[0].frozen_param_shapes is None or len(zero_model_states[0].frozen_param_shapes) == 0: + return + + frozen_param_shapes = zero_model_states[0].frozen_param_shapes + frozen_param_fragments = zero_model_states[0].frozen_param_fragments + + if debug: + num_elem = sum(s.numel() for s in frozen_param_shapes.values()) + print(f'rank 0: {FROZEN_PARAM_SHAPES}.numel = {num_elem}') + + wanted_params = len(frozen_param_shapes) + wanted_numel = sum(s.numel() for s in frozen_param_shapes.values()) + avail_numel = sum([p.numel() for p in frozen_param_fragments.values()]) + print(f'Frozen params: Have {avail_numel} numels to process.') + print(f'Frozen params: Need {wanted_numel} numels in {wanted_params} params') + + total_params = 0 + total_numel = 0 + for name, shape in frozen_param_shapes.items(): + total_params += 1 + unpartitioned_numel = shape.numel() + total_numel += unpartitioned_numel + + state_dict[name] = frozen_param_fragments[name] + + if debug: + print(f"{name} full shape: {shape} unpartitioned numel {unpartitioned_numel} ") + + print(f"Reconstructed Frozen fp32 state dict with {total_params} params {total_numel} elements") + + +def _has_callable(obj, fn): + attr = getattr(obj, fn, None) + return callable(attr) + + +def _zero2_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states): + param_shapes = zero_model_states[0].param_shapes + + # Reconstruction protocol: + # + # XXX: document this + + if debug: + for i in range(world_size): + for j in range(len(fp32_flat_groups[0])): + print(f"{FP32_FLAT_GROUPS}[{i}][{j}].shape={fp32_flat_groups[i][j].shape}") + + # XXX: memory usage doubles here (zero2) + num_param_groups = len(fp32_flat_groups[0]) + merged_single_partition_of_fp32_groups = [] + for i in range(num_param_groups): + merged_partitions = [sd[i] for sd in fp32_flat_groups] + full_single_fp32_vector = torch.cat(merged_partitions, 0) + merged_single_partition_of_fp32_groups.append(full_single_fp32_vector) + avail_numel = sum( + [full_single_fp32_vector.numel() for full_single_fp32_vector in merged_single_partition_of_fp32_groups]) + + if debug: + wanted_params = sum([len(shapes) for shapes in param_shapes]) + wanted_numel = sum([sum(shape.numel() for shape in shapes.values()) for shapes in param_shapes]) + # not asserting if there is a mismatch due to possible padding + print(f"Have {avail_numel} numels to process.") + print(f"Need {wanted_numel} numels in {wanted_params} params.") + + # params + # XXX: for huge models that can't fit into the host's RAM we will have to recode this to support + # out-of-core computing solution + total_numel = 0 + total_params = 0 + for shapes, full_single_fp32_vector in zip(param_shapes, merged_single_partition_of_fp32_groups): + offset = 0 + avail_numel = full_single_fp32_vector.numel() + for name, shape in shapes.items(): + + unpartitioned_numel = shape.numel() if _has_callable(shape, 'numel') else math.prod(shape) + total_numel += unpartitioned_numel + total_params += 1 + + if debug: + print(f"{name} full shape: {shape} unpartitioned numel {unpartitioned_numel} ") + state_dict[name] = full_single_fp32_vector.narrow(0, offset, unpartitioned_numel).view(shape) + offset += unpartitioned_numel + + # Z2 started to align to 2*world_size to improve nccl performance. Therefore both offset and + # avail_numel can differ by anywhere between 0..2*world_size. Due to two unrelated complex + # paddings performed in the code it's almost impossible to predict the exact numbers w/o the + # live optimizer object, so we are checking that the numbers are within the right range + align_to = 2 * world_size + + def zero2_align(x): + return align_to * math.ceil(x / align_to) + + if debug: + print(f"original offset={offset}, avail_numel={avail_numel}") + + offset = zero2_align(offset) + avail_numel = zero2_align(avail_numel) + + if debug: + print(f"aligned offset={offset}, avail_numel={avail_numel}") + + # Sanity check + if offset != avail_numel: + raise ValueError(f"consumed {offset} numels out of {avail_numel} - something is wrong") + + print(f"Reconstructed fp32 state dict with {total_params} params {total_numel} elements") + + +def _get_fp32_state_dict_from_zero2_checkpoint(world_size, fp32_flat_groups, zero_model_states, + exclude_frozen_parameters): + state_dict = OrderedDict() + + # buffers + buffers = zero_model_states[0].buffers + state_dict.update(buffers) + if debug: + print(f"added {len(buffers)} buffers") + + if not exclude_frozen_parameters: + _zero2_merge_frozen_params(state_dict, zero_model_states) + + _zero2_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states) + + # recover shared parameters + for pair in zero_model_states[0].shared_params: + if pair[1] in state_dict: + state_dict[pair[0]] = state_dict[pair[1]] + + return state_dict + + +def zero3_partitioned_param_info(unpartitioned_numel, world_size): + remainder = unpartitioned_numel % world_size + padding_numel = (world_size - remainder) if remainder else 0 + partitioned_numel = math.ceil(unpartitioned_numel / world_size) + return partitioned_numel, padding_numel + + +def _zero3_merge_frozen_params(state_dict, world_size, zero_model_states): + if zero_model_states[0].frozen_param_shapes is None or len(zero_model_states[0].frozen_param_shapes) == 0: + return + + if debug: + for i in range(world_size): + num_elem = sum(s.numel() for s in zero_model_states[i].frozen_param_fragments.values()) + print(f'rank {i}: {FROZEN_PARAM_SHAPES}.numel = {num_elem}') + + frozen_param_shapes = zero_model_states[0].frozen_param_shapes + wanted_params = len(frozen_param_shapes) + wanted_numel = sum(s.numel() for s in frozen_param_shapes.values()) + avail_numel = sum([p.numel() for p in zero_model_states[0].frozen_param_fragments.values()]) * world_size + print(f'Frozen params: Have {avail_numel} numels to process.') + print(f'Frozen params: Need {wanted_numel} numels in {wanted_params} params') + + total_params = 0 + total_numel = 0 + for name, shape in zero_model_states[0].frozen_param_shapes.items(): + total_params += 1 + unpartitioned_numel = shape.numel() + total_numel += unpartitioned_numel + + param_frags = tuple(model_state.frozen_param_fragments[name] for model_state in zero_model_states) + state_dict[name] = torch.cat(param_frags, 0).narrow(0, 0, unpartitioned_numel).view(shape) + + partitioned_numel, partitioned_padding_numel = zero3_partitioned_param_info(unpartitioned_numel, world_size) + + if debug: + print( + f"Frozen params: {total_params} {name} full shape: {shape} partition0 numel={partitioned_numel} partitioned_padding_numel={partitioned_padding_numel}" + ) + + print(f"Reconstructed Frozen fp32 state dict with {total_params} params {total_numel} elements") + + +class GatheredTensor: + """ + A pseudo tensor that collects partitioned weights. + It is more memory efficient when there are multiple groups. + """ + + def __init__(self, flat_groups, flat_groups_offset, offset, partitioned_numel, shape): + self.flat_groups = flat_groups + self.flat_groups_offset = flat_groups_offset + self.offset = offset + self.partitioned_numel = partitioned_numel + self.shape = shape + self.dtype = self.flat_groups[0][0].dtype + + def contiguous(self): + """ + Merge partitioned weights from flat_groups into a single tensor. + """ + end_idx = self.offset + self.partitioned_numel + world_size = len(self.flat_groups) + pad_flat_param_chunks = [] + + for rank_i in range(world_size): + # for each rank, we need to collect weights from related group/groups + flat_groups_at_rank_i = self.flat_groups[rank_i] + start_group_id = None + end_group_id = None + for group_id in range(len(self.flat_groups_offset)): + if self.flat_groups_offset[group_id] <= self.offset < self.flat_groups_offset[group_id + 1]: + start_group_id = group_id + if self.flat_groups_offset[group_id] < end_idx <= self.flat_groups_offset[group_id + 1]: + end_group_id = group_id + break + # collect weights from related group/groups + for group_id in range(start_group_id, end_group_id + 1): + flat_tensor = flat_groups_at_rank_i[group_id] + start_offset = self.offset - self.flat_groups_offset[group_id] + end_offset = min(end_idx, self.flat_groups_offset[group_id + 1]) - self.flat_groups_offset[group_id] + pad_flat_param_chunks.append(flat_tensor[start_offset:end_offset]) + + # collect weights from all ranks + pad_flat_param = torch.cat(pad_flat_param_chunks, dim=0) + param = pad_flat_param[:self.shape.numel()].view(self.shape).contiguous() + return param + + +def _zero3_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states): + param_shapes = zero_model_states[0].param_shapes + avail_numel = sum([flat_group.numel() for flat_group in fp32_flat_groups[0]]) * world_size + + # Reconstruction protocol: For zero3 we need to zip the partitions together at boundary of each + # param, re-consolidating each param, while dealing with padding if any + + # merge list of dicts, preserving order + param_shapes = {k: v for d in param_shapes for k, v in d.items()} + + if debug: + for i in range(world_size): + print(f"{FP32_FLAT_GROUPS}[{i}].shape={fp32_flat_groups[i].shape}") + + wanted_params = len(param_shapes) + wanted_numel = sum(shape.numel() for shape in param_shapes.values()) + # not asserting if there is a mismatch due to possible padding + avail_numel = fp32_flat_groups[0].numel() * world_size + print(f"Trainable params: Have {avail_numel} numels to process.") + print(f"Trainable params: Need {wanted_numel} numels in {wanted_params} params.") + + # params + # XXX: for huge models that can't fit into the host's RAM we will have to recode this to support + # out-of-core computing solution + offset = 0 + total_numel = 0 + total_params = 0 + flat_groups_offset = [0] + list(np.cumsum([flat_tensor.numel() for flat_tensor in fp32_flat_groups[0]])) + for name, shape in tqdm(param_shapes.items(), desc='Gathering sharded weights'): + unpartitioned_numel = shape.numel() + total_numel += unpartitioned_numel + total_params += 1 + partitioned_numel, partitioned_padding_numel = zero3_partitioned_param_info(unpartitioned_numel, world_size) + + if debug: + print( + f"Trainable params: {total_params} {name} full shape: {shape} partition0 numel={partitioned_numel} partitioned_padding_numel={partitioned_padding_numel}" + ) + + # memory efficient tensor + tensor = GatheredTensor(fp32_flat_groups, flat_groups_offset, offset, partitioned_numel, shape) + state_dict[name] = tensor + offset += partitioned_numel + + offset *= world_size + + # Sanity check + if offset != avail_numel: + raise ValueError(f"consumed {offset} numels out of {avail_numel} - something is wrong") + + print(f"Reconstructed Trainable fp32 state dict with {total_params} params {total_numel} elements") + + +def _get_fp32_state_dict_from_zero3_checkpoint(world_size, fp32_flat_groups, zero_model_states, + exclude_frozen_parameters): + state_dict = OrderedDict() + + # buffers + buffers = zero_model_states[0].buffers + state_dict.update(buffers) + if debug: + print(f"added {len(buffers)} buffers") + + if not exclude_frozen_parameters: + _zero3_merge_frozen_params(state_dict, world_size, zero_model_states) + + _zero3_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states) + + # recover shared parameters + for pair in zero_model_states[0].shared_params: + if pair[1] in state_dict: + state_dict[pair[0]] = state_dict[pair[1]] + + return state_dict + + +def to_torch_tensor(state_dict, return_empty_tensor=False): + """ + Convert state_dict of GatheredTensor to torch tensor + """ + torch_state_dict = {} + converted_tensors = {} + for name, tensor in state_dict.items(): + tensor_id = id(tensor) + if tensor_id in converted_tensors: # shared tensors + shared_tensor = torch_state_dict[converted_tensors[tensor_id]] + torch_state_dict[name] = shared_tensor + else: + converted_tensors[tensor_id] = name + if return_empty_tensor: + torch_state_dict[name] = torch.empty(tensor.shape, dtype=tensor.dtype) + else: + torch_state_dict[name] = tensor.contiguous() + return torch_state_dict + + +def get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir, + tag=None, + exclude_frozen_parameters=False, + lazy_mode=False): + """ + Convert ZeRO 2 or 3 checkpoint into a single fp32 consolidated state_dict that can be loaded with + ``load_state_dict()`` and used for training without DeepSpeed or shared with others, for example + via a model hub. + + Args: + - ``checkpoint_dir``: path to the desired checkpoint folder + - ``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`` + - ``exclude_frozen_parameters``: exclude frozen parameters + - ``lazy_mode``: get state_dict in lazy mode. It returns a dict of pesduo tensor instead of torch tensor, which is more memory efficient. + Convert the pesduo tensor to torch tensor by ``.contiguous()`` + + Returns: + - pytorch ``state_dict`` + + A typical usage might be :: + + from deepspeed.utils.zero_to_fp32 import get_fp32_state_dict_from_zero_checkpoint + # do the training and checkpoint saving + state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir) # already on cpu + model = model.cpu() # move to cpu + model.load_state_dict(state_dict) + # submit to model hub or save the model to share with others + + In this example the ``model`` will no longer be usable in the deepspeed context of the same + application. i.e. you will need to re-initialize the deepspeed engine, since + ``model.load_state_dict(state_dict)`` will remove all the deepspeed magic from it. + + If you want it all done for you, use ``load_state_dict_from_zero_checkpoint`` instead. + + Note: the above usage may not work if your application doesn't have sufficient free CPU memory. + You may need to use the offline approach using the ``zero_to_fp32.py`` script that is saved with + the checkpoint. Or you can load state_dict in lazy mode :: + + from deepspeed.utils.zero_to_fp32 import get_fp32_state_dict_from_zero_checkpoint + state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir, lazy_mode=True) # not on cpu + for name, lazy_tensor in state_dict.item(): + tensor = lazy_tensor.contiguous() # to cpu + print(name, tensor) + # del tensor to release memory if it no longer in use + """ + if tag is None: + latest_path = os.path.join(checkpoint_dir, 'latest') + if os.path.isfile(latest_path): + with open(latest_path, 'r') as fd: + tag = fd.read().strip() + else: + raise ValueError(f"Unable to find 'latest' file at {latest_path}") + + ds_checkpoint_dir = os.path.join(checkpoint_dir, tag) + + if not os.path.isdir(ds_checkpoint_dir): + raise FileNotFoundError(f"Directory '{ds_checkpoint_dir}' doesn't exist") + + state_dict = _get_fp32_state_dict_from_zero_checkpoint(ds_checkpoint_dir, exclude_frozen_parameters) + if lazy_mode: + return state_dict + else: + return to_torch_tensor(state_dict) + + +def convert_zero_checkpoint_to_fp32_state_dict(checkpoint_dir, + output_dir, + max_shard_size="5GB", + safe_serialization=False, + tag=None, + exclude_frozen_parameters=False): + """ + Convert ZeRO 2 or 3 checkpoint into a single fp32 consolidated ``state_dict`` file that can be + loaded with ``torch.load(file)`` + ``load_state_dict()`` and used for training without DeepSpeed. + + Args: + - ``checkpoint_dir``: path to the desired checkpoint folder. (one that contains the tag-folder, like ``global_step14``) + - ``output_dir``: directory to the pytorch fp32 state_dict output files + - ``max_shard_size``: the maximum size for a checkpoint before being sharded, default value is 5GB + - ``safe_serialization``: whether to save the model using `safetensors` or the traditional PyTorch way (that uses `pickle`). + - ``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`` + - ``exclude_frozen_parameters``: exclude frozen parameters + """ + + # Dependency pre-check + if safe_serialization: + try: + from safetensors.torch import save_file + except ImportError: + print('If you want to use `safe_serialization`, please `pip install safetensors`') + raise + if max_shard_size is not None: + try: + from huggingface_hub import split_torch_state_dict_into_shards + except ImportError: + print('If you want to use `max_shard_size`, please `pip install huggingface_hub`') + raise + + # Convert zero checkpoint to state_dict + state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir, + tag, + exclude_frozen_parameters, + lazy_mode=True) + + # Shard the model if it is too big. + weights_name = "model.safetensors" if safe_serialization else "pytorch_model.bin" + if max_shard_size is not None: + filename_pattern = weights_name.replace(".bin", "{suffix}.bin").replace(".safetensors", "{suffix}.safetensors") + # an memory-efficient approach for sharding + empty_state_dict = to_torch_tensor(state_dict, return_empty_tensor=True) + state_dict_split = split_torch_state_dict_into_shards(empty_state_dict, + filename_pattern=filename_pattern, + max_shard_size=max_shard_size) + else: + from collections import namedtuple + StateDictSplit = namedtuple("StateDictSplit", ["is_sharded", "filename_to_tensors"]) + state_dict_split = StateDictSplit(is_sharded=False, + filename_to_tensors={weights_name: list(state_dict.keys())}) + + # Save the model by shard + os.makedirs(output_dir, exist_ok=True) + filename_to_tensors = state_dict_split.filename_to_tensors.items() + for shard_file, tensors in tqdm(filename_to_tensors, desc="Saving checkpoint shards"): + shard_state_dict = {tensor_name: state_dict[tensor_name] for tensor_name in tensors} + shard_state_dict = to_torch_tensor(shard_state_dict) + output_path = os.path.join(output_dir, shard_file) + if safe_serialization: + save_file(shard_state_dict, output_path, metadata={"format": "pt"}) + else: + torch.save(shard_state_dict, output_path) + # release the memory of current shard + for tensor_name in list(shard_state_dict.keys()): + del state_dict[tensor_name] + del shard_state_dict[tensor_name] + del shard_state_dict + gc.collect() + + # Save index if sharded + if state_dict_split.is_sharded: + index = { + "metadata": state_dict_split.metadata, + "weight_map": state_dict_split.tensor_to_filename, + } + save_index_file = "model.safetensors.index.json" if safe_serialization else "pytorch_model.bin.index.json" + save_index_file = os.path.join(output_dir, save_index_file) + with open(save_index_file, "w", encoding="utf-8") as f: + content = json.dumps(index, indent=2, sort_keys=True) + "\n" + f.write(content) + + +def load_state_dict_from_zero_checkpoint(model, checkpoint_dir, tag=None): + """ + 1. Put the provided model to cpu + 2. Convert ZeRO 2 or 3 checkpoint into a single fp32 consolidated ``state_dict`` + 3. Load it into the provided model + + Args: + - ``model``: the model object to update + - ``checkpoint_dir``: path to the desired checkpoint folder. (one that contains the tag-folder, like ``global_step14``) + - ``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`` + + Returns: + - ``model`: modified model + + Make sure you have plenty of CPU memory available before you call this function. If you don't + have enough use the ``zero_to_fp32.py`` utility to do the conversion. You will find it + conveniently placed for you in the checkpoint folder. + + A typical usage might be :: + + from deepspeed.utils.zero_to_fp32 import load_state_dict_from_zero_checkpoint + model = load_state_dict_from_zero_checkpoint(trainer.model, checkpoint_dir) + # submit to model hub or save the model to share with others + + Note, that once this was run, the ``model`` will no longer be usable in the deepspeed context + of the same application. i.e. you will need to re-initialize the deepspeed engine, since + ``model.load_state_dict(state_dict)`` will remove all the deepspeed magic from it. + + """ + logger.info(f"Extracting fp32 weights") + state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir, tag) + + logger.info(f"Overwriting model with fp32 weights") + model = model.cpu() + model.load_state_dict(state_dict, strict=False) + + return model + + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + parser.add_argument("checkpoint_dir", + type=str, + help="path to the desired checkpoint folder, e.g., path/checkpoint-12") + parser.add_argument("output_dir", + type=str, + help="directory to the pytorch fp32 state_dict output files" + "(e.g. path/checkpoint-12-output/)") + parser.add_argument( + "--max_shard_size", + type=str, + default="5GB", + help="The maximum size for a checkpoint before being sharded. Checkpoints shard will then be each of size" + "lower than this size. If expressed as a string, needs to be digits followed by a unit (like `5MB`" + "We default it to 5GB in order for models to be able to run easily on free-tier google colab instances" + "without CPU OOM issues.") + parser.add_argument( + "--safe_serialization", + default=False, + action='store_true', + help="Whether to save the model using `safetensors` or the traditional PyTorch way (that uses `pickle`).") + parser.add_argument("-t", + "--tag", + type=str, + default=None, + help="checkpoint tag used as a unique identifier for checkpoint. e.g., global_step1") + parser.add_argument("--exclude_frozen_parameters", action='store_true', help="exclude frozen parameters") + parser.add_argument("-d", "--debug", action='store_true', help="enable debug") + args = parser.parse_args() + + debug = args.debug + + convert_zero_checkpoint_to_fp32_state_dict(args.checkpoint_dir, + args.output_dir, + max_shard_size=args.max_shard_size, + safe_serialization=args.safe_serialization, + tag=args.tag, + exclude_frozen_parameters=args.exclude_frozen_parameters) diff --git a/checkpoint-810/README.md b/checkpoint-810/README.md new file mode 100644 index 0000000000000000000000000000000000000000..4eae946233309baf42f5bad9740186144a4f3b33 --- /dev/null +++ b/checkpoint-810/README.md @@ -0,0 +1,202 @@ +--- +base_model: ../../initial_seq_model +library_name: peft +--- + +# Model Card for Model ID + + + + + +## Model Details + +### Model Description + + + + + +- **Developed by:** [More Information Needed] +- **Funded by [optional]:** [More Information Needed] +- **Shared by [optional]:** [More Information Needed] +- **Model type:** [More Information Needed] +- **Language(s) (NLP):** [More Information Needed] +- **License:** [More Information Needed] +- **Finetuned from model [optional]:** [More Information Needed] + +### Model Sources [optional] + + + +- **Repository:** [More Information Needed] +- **Paper [optional]:** [More Information Needed] +- **Demo [optional]:** [More Information Needed] + +## Uses + + + +### Direct Use + + + +[More Information Needed] + +### Downstream Use [optional] + + + +[More Information Needed] + +### Out-of-Scope Use + + + +[More Information Needed] + +## Bias, Risks, and Limitations + + + +[More Information Needed] + +### Recommendations + + + +Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations. + +## How to Get Started with the Model + +Use the code below to get started with the model. + +[More Information Needed] + +## Training Details + +### Training Data + + + +[More Information Needed] + +### Training Procedure + + + +#### Preprocessing [optional] + +[More Information Needed] + + +#### Training Hyperparameters + +- **Training regime:** [More Information Needed] + +#### Speeds, Sizes, Times [optional] + + + +[More Information Needed] + +## Evaluation + + + +### Testing Data, Factors & Metrics + +#### Testing Data + + + +[More Information Needed] + +#### Factors + + + +[More Information Needed] + +#### Metrics + + + +[More Information Needed] + +### Results + +[More Information Needed] + +#### Summary + + + +## Model Examination [optional] + + + +[More Information Needed] + +## Environmental Impact + + + +Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700). + +- **Hardware Type:** [More Information Needed] +- **Hours used:** [More Information Needed] +- **Cloud Provider:** [More Information Needed] +- **Compute Region:** [More Information Needed] +- **Carbon Emitted:** [More Information Needed] + +## Technical Specifications [optional] + +### Model Architecture and Objective + +[More Information Needed] + +### Compute Infrastructure + +[More Information Needed] + +#### Hardware + +[More Information Needed] + +#### Software + +[More Information Needed] + +## Citation [optional] + + + +**BibTeX:** + +[More Information Needed] + +**APA:** + +[More Information Needed] + +## Glossary [optional] + + + +[More Information Needed] + +## More Information [optional] + +[More Information Needed] + +## Model Card Authors [optional] + +[More Information Needed] + +## Model Card Contact + +[More Information Needed] +### Framework versions + +- PEFT 0.14.0 \ No newline at end of file diff --git a/checkpoint-810/adapter_config.json b/checkpoint-810/adapter_config.json new file mode 100644 index 0000000000000000000000000000000000000000..e1a650486f9ba9bab8c8dbb7d564bdc4ec121cf7 --- /dev/null +++ b/checkpoint-810/adapter_config.json @@ -0,0 +1,38 @@ +{ + "alpha_pattern": {}, + "auto_mapping": null, + "base_model_name_or_path": "../../initial_seq_model", + "bias": "none", + "eva_config": null, + "exclude_modules": null, + "fan_in_fan_out": false, + "inference_mode": true, + "init_lora_weights": true, + "layer_replication": null, + "layers_pattern": null, + "layers_to_transform": null, + "loftq_config": {}, + "lora_alpha": 16, + "lora_bias": false, + "lora_dropout": 0.1, + "megatron_config": null, + "megatron_core": "megatron.core", + "modules_to_save": null, + "peft_type": "LORA", + "r": 8, + "rank_pattern": {}, + "revision": null, + "target_modules": [ + "k_proj", + "o_proj", + "gate_proj", + "down_proj", + "score", + "v_proj", + "up_proj", + "q_proj" + ], + "task_type": "CAUSAL_LM", + "use_dora": false, + "use_rslora": false +} \ No newline at end of file diff --git a/checkpoint-810/adapter_model.safetensors b/checkpoint-810/adapter_model.safetensors new file mode 100644 index 0000000000000000000000000000000000000000..82cc6657e026874e862fbef2c343eb2f8e1ca5d0 --- /dev/null +++ b/checkpoint-810/adapter_model.safetensors @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b9b9d5e7cad97c2974fd9be94cea20cfc79b8577ac79e0895ab8d30751aa27b8 +size 42068368 diff --git a/checkpoint-810/global_step810/bf16_zero_pp_rank_0_mp_rank_00_optim_states.pt b/checkpoint-810/global_step810/bf16_zero_pp_rank_0_mp_rank_00_optim_states.pt new file mode 100644 index 0000000000000000000000000000000000000000..5b047f133068ffea6a9110a43a939e1f84b8d61c --- /dev/null +++ b/checkpoint-810/global_step810/bf16_zero_pp_rank_0_mp_rank_00_optim_states.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:451ea893753558682544d4a7029fde44e62bef899a51c70e7f4fa42327a09da9 +size 63016432 diff --git a/checkpoint-810/global_step810/bf16_zero_pp_rank_1_mp_rank_00_optim_states.pt b/checkpoint-810/global_step810/bf16_zero_pp_rank_1_mp_rank_00_optim_states.pt new file mode 100644 index 0000000000000000000000000000000000000000..a71457e0cd6696f05d38b336191638723c68c715 --- /dev/null +++ b/checkpoint-810/global_step810/bf16_zero_pp_rank_1_mp_rank_00_optim_states.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:83ad7244b283ee6d86fbfd56320f217679d69c30473bb54cac49c67ba958ec72 +size 63016432 diff --git a/checkpoint-810/global_step810/bf16_zero_pp_rank_2_mp_rank_00_optim_states.pt b/checkpoint-810/global_step810/bf16_zero_pp_rank_2_mp_rank_00_optim_states.pt new file mode 100644 index 0000000000000000000000000000000000000000..141699f8578d8c8f0aeec74c624f35d683e03c57 --- /dev/null +++ b/checkpoint-810/global_step810/bf16_zero_pp_rank_2_mp_rank_00_optim_states.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:86af2a84a5aff5d1426a32c8a968059f995a2a04a2a9d61e0207a1827fc5255b +size 63016432 diff --git a/checkpoint-810/global_step810/bf16_zero_pp_rank_3_mp_rank_00_optim_states.pt b/checkpoint-810/global_step810/bf16_zero_pp_rank_3_mp_rank_00_optim_states.pt new file mode 100644 index 0000000000000000000000000000000000000000..04a99fd1a9402be9a13a5d16bada9b078de46aa2 --- /dev/null +++ b/checkpoint-810/global_step810/bf16_zero_pp_rank_3_mp_rank_00_optim_states.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:742a061cbae44451aefc67febeeb5d9a4791002671bf515d82ce985dafb73029 +size 63016432 diff --git a/checkpoint-810/global_step810/zero_pp_rank_0_mp_rank_00_model_states.pt b/checkpoint-810/global_step810/zero_pp_rank_0_mp_rank_00_model_states.pt new file mode 100644 index 0000000000000000000000000000000000000000..287e35c830ffbc5d2bc2b1acac9f17bbc8a58fc4 --- /dev/null +++ b/checkpoint-810/global_step810/zero_pp_rank_0_mp_rank_00_model_states.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9e831c5e2a5961d2675923387c36e8b24a3e6ab5ded64d449a58a6693113e435 +size 442088 diff --git a/checkpoint-810/global_step810/zero_pp_rank_1_mp_rank_00_model_states.pt b/checkpoint-810/global_step810/zero_pp_rank_1_mp_rank_00_model_states.pt new file mode 100644 index 0000000000000000000000000000000000000000..5026dded02c5d10df7b3243e9f734d81336416ff --- /dev/null +++ b/checkpoint-810/global_step810/zero_pp_rank_1_mp_rank_00_model_states.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:46ab0ace34775e1f93836dbc08fd72544f5a33387b80b502ea82e2a7c339a1a1 +size 442088 diff --git a/checkpoint-810/global_step810/zero_pp_rank_2_mp_rank_00_model_states.pt b/checkpoint-810/global_step810/zero_pp_rank_2_mp_rank_00_model_states.pt new file mode 100644 index 0000000000000000000000000000000000000000..35b63defa312ae7314349168df2847e24574be63 --- /dev/null +++ b/checkpoint-810/global_step810/zero_pp_rank_2_mp_rank_00_model_states.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ae3e9a9a7bcb1a96c3c3c9cb7ce1311b115cb0cc4c028a63065ff492facada1f +size 442088 diff --git a/checkpoint-810/global_step810/zero_pp_rank_3_mp_rank_00_model_states.pt b/checkpoint-810/global_step810/zero_pp_rank_3_mp_rank_00_model_states.pt new file mode 100644 index 0000000000000000000000000000000000000000..b961a47f980fa9cddff54083b065078547995e43 --- /dev/null +++ b/checkpoint-810/global_step810/zero_pp_rank_3_mp_rank_00_model_states.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bb941da5386825c5e171074debdaa0639e8d1d96c252403ed1bf9695d8c27ca7 +size 442088 diff --git a/checkpoint-810/latest b/checkpoint-810/latest new file mode 100644 index 0000000000000000000000000000000000000000..540e3fde0fafed2e05bb3c8c64a3ad152319067b --- /dev/null +++ b/checkpoint-810/latest @@ -0,0 +1 @@ +global_step810 \ No newline at end of file diff --git a/checkpoint-810/rng_state_0.pth b/checkpoint-810/rng_state_0.pth new file mode 100644 index 0000000000000000000000000000000000000000..8d954b630a9b22cf7a5d6294af936ecf24fcec1f --- /dev/null +++ b/checkpoint-810/rng_state_0.pth @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:702f34967c80bf152d299cfc7e32a4900b23443ae1b3247cda2da076d0d8e96c +size 14960 diff --git a/checkpoint-810/rng_state_1.pth b/checkpoint-810/rng_state_1.pth new file mode 100644 index 0000000000000000000000000000000000000000..40918b307f540f8de11545ac72160f7cb1ca8f8c --- /dev/null +++ b/checkpoint-810/rng_state_1.pth @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:248ab9f1ec33491dff0f2d3e3000812896920537a01e52a1b94a8fb979bec09d +size 14960 diff --git a/checkpoint-810/rng_state_2.pth b/checkpoint-810/rng_state_2.pth new file mode 100644 index 0000000000000000000000000000000000000000..532b2ad23c7a834fc61d051e8f13d07a0916be13 --- /dev/null +++ b/checkpoint-810/rng_state_2.pth @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bafec6e468c88635db069df14e67f1eabb3599e31b73cfa9d5a3f61bea74f6fc +size 14960 diff --git a/checkpoint-810/rng_state_3.pth b/checkpoint-810/rng_state_3.pth new file mode 100644 index 0000000000000000000000000000000000000000..46a77670a0c8a24047b4ef65143e59821db667fc --- /dev/null +++ b/checkpoint-810/rng_state_3.pth @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4d2979446a9394ee92e2dc95cc364f856bac4868873a673258a79a388f203abd +size 14960 diff --git a/checkpoint-810/scheduler.pt b/checkpoint-810/scheduler.pt new file mode 100644 index 0000000000000000000000000000000000000000..5c66249c490443e4e92c72f288570802a42659f3 --- /dev/null +++ b/checkpoint-810/scheduler.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:825656a8766bdd0fa5b00dd536cc3ab14130a9269be136f96b06f0241968e2b7 +size 1064 diff --git a/checkpoint-810/special_tokens_map.json b/checkpoint-810/special_tokens_map.json new file mode 100644 index 0000000000000000000000000000000000000000..a8eb9ef63af01dfa2c350573b543b14275370944 --- /dev/null +++ b/checkpoint-810/special_tokens_map.json @@ -0,0 +1,30 @@ +{ + "bos_token": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false + }, + "eos_token": { + "content": "<|END_OF_TURN_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false + }, + "pad_token": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false + }, + "unk_token": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false + } +} diff --git a/checkpoint-810/tokenizer.json b/checkpoint-810/tokenizer.json new file mode 100644 index 0000000000000000000000000000000000000000..91a1344d38167f152a8803a80eb79ca4b465adbb --- /dev/null +++ b/checkpoint-810/tokenizer.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:28c8b8038fcb2756e349a51832a56634423c579a869f39642526327aa56b2989 +size 20125189 diff --git a/checkpoint-810/tokenizer_config.json b/checkpoint-810/tokenizer_config.json new file mode 100644 index 0000000000000000000000000000000000000000..100ac1a3b6cff4a9043d2c0fd6b1603d1c1ee1e1 --- /dev/null +++ b/checkpoint-810/tokenizer_config.json @@ -0,0 +1,364 @@ +{ + "add_bos_token": true, + "add_eos_token": false, + "add_prefix_space": false, + "added_tokens_decoder": { + "0": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "1": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "2": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "3": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "4": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "5": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "6": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "7": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "255000": { + "content": "<|START_OF_TURN_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255001": { + "content": "<|END_OF_TURN_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "255002": { + "content": "<|YES_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255003": { + "content": "<|NO_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255004": { + "content": "<|GOOD_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255005": { + "content": "<|BAD_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255006": { + "content": "<|USER_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255007": { + "content": "<|CHATBOT_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255008": { + "content": "<|SYSTEM_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255009": { + "content": "<|USER_0_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255010": { + "content": "<|USER_1_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255011": { + "content": "<|USER_2_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255012": { + "content": "<|USER_3_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255013": { + "content": "<|USER_4_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255014": { + "content": "<|USER_5_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255015": { + "content": "<|USER_6_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255016": { + "content": "<|USER_7_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255017": { + "content": "<|USER_8_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255018": { + "content": "<|USER_9_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255019": { + "content": "<|START_THINKING|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255020": { + "content": "<|END_THINKING|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255021": { + "content": "<|START_RESPONSE|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "255022": { + "content": "<|END_RESPONSE|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "255023": { + "content": "<|START_ACTION|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255024": { + "content": "<|END_ACTION|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255025": { + "content": "<|START_TOOL_RESULT|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255026": { + "content": "<|END_TOOL_RESULT|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255027": { + "content": "<|EXTRA_8_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255028": { + "content": "<|NEW_FILE|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "255029": { + "content": "<|BEGINNING_OF_PREFIX_FIM_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255030": { + "content": "<|BEGINNING_OF_MIDDLE_FIM_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255031": { + "content": "<|BEGINNING_OF_SUFFIX_FIM_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255032": { + "content": "<|END_OF_MIDDLE_FIM_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + } + }, + "bos_token": "", + "chat_template": [ + { + "name": "default", + "template": "{% if documents %}\n{% set tools = [] %}\n{%- macro document_turn(documents) -%}\n{# format documents into chat turn #}\n<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|><|START_THINKING|>I will look through the document to address the users needs.<|END_THINKING|><|START_ACTION|>[\n {\"tool_call_id\": \"0\", \"tool_name\": \"direct-injected-document\", \"parameters\": {}}\n]<|END_ACTION|><|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|><|START_TOOL_RESULT|>[\n {\n \"tool_call_id\": \"0\",\n \"results\": {\n{% for doc in documents %}\n \"{{ loop.index0 }}\": {{doc|tojson}}{% if not loop.last %},\n {% endif %}\n{% endfor %}\n\n },\n \"is_error\": null\n }\n]<|END_TOOL_RESULT|><|END_OF_TURN_TOKEN|>{%- endmacro %}\n{%- macro tool_call_id_to_int(messages, tool_call_id) %}\n{%- set counter = namespace(value=0) %}\n{%- set tool_call_id_seen = namespace(value=false) %}\n{%- for msg in messages %}\n {%- if msg.tool_calls %}\n {%- for tool_call in msg.tool_calls %}\n {%- if tool_call.id == tool_call_id and not tool_call_id_seen.value -%}\n {{ counter.value }}\n {%- set tool_call_id_seen.value = true %}\n {%- endif %}\n {%- set counter.value = counter.value + 1 %}\n {%- endfor %}\n {%- endif %}\n{%- endfor %}\n{%- endmacro %}\n{%- macro format_tool_message(messages, tool_msg) -%}\n{# format tool message #}\n {\n \"tool_call_id\": \"{{ tool_call_id_to_int(messages, tool_msg.tool_call_id) }}\",\n \"results\": {\n \"0\": {{ tool_msg.content|tojson }}\n },\n \"is_error\": null\n }\n{%- endmacro -%}\n{%- if messages and messages[0]['role']|lower == 'system' %}{%- set developer_preamble = messages[0]['content'] %}{% endif %}\n{%- set tool_idx = namespace(value=0) %}\n{%- set tool_ids_seen = namespace(value=[]) %}\n{%- set sent_documents = namespace(value=false) %}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|># System Preamble\nYou are in contextual safety mode. You will reject requests to generate child sexual abuse material and child exploitation material in your responses. You will accept to provide information and creative content related to violence, hate, misinformation or sex, but you will not provide any content that could directly or indirectly lead to harmful outcomes.\n\nYour information cutoff date is June 2024.\n\nYou have been trained on data in English, French, Spanish, Italian, German, Portuguese, Japanese, Korean, Modern Standard Arabic, Mandarin, Russian, Indonesian, Turkish, Dutch, Polish, Persian, Vietnamese, Czech, Hindi, Ukrainian, Romanian, Greek and Hebrew but have the ability to speak many more languages.\n{% if tools or documents %}\n\nYou have been trained to have advanced reasoning and tool-use capabilities and you should make best use of these skills to serve user's requests.\n\n## Tool Use\nThink about how you can make best use of the provided tools to help with the task and come up with a high level plan that you will execute first.\n\n0. Start by writing <|START_THINKING|> followed by a detailed step by step plan of how you will solve the problem. For each step explain your thinking fully and give details of required tool calls (if needed). Unless specified otherwise, you write your plan in natural language. When you finish, close it out with <|END_THINKING|>.\n You can optionally choose to skip this step when the user request is so straightforward to address that only a trivial plan would be needed.\n NOTE: You MUST skip this step when you are directly responding to the user's request without using any tools.\n\nThen carry out your plan by repeatedly executing the following steps.\n1. Action: write <|START_ACTION|> followed by a list of JSON-formatted tool calls, with each one containing \"tool_name\" and \"parameters\" fields.\n When there are multiple tool calls which are completely independent of each other (i.e. they can be executed in parallel), you should list them out all together in one step. When you finish, close it out with <|END_ACTION|>.\n2. Observation: you will then receive results of those tool calls in JSON format in the very next turn, wrapped around by <|START_TOOL_RESULT|> and <|END_TOOL_RESULT|>. Carefully observe those results and think about what to do next. Note that these results will be provided to you in a separate turn. NEVER hallucinate results.\n Every tool call produces a list of results (when a tool call produces no result or a single result, it'll still get wrapped inside a list). Each result is clearly linked to its originating tool call via its \"tool_call_id\".\n3. Reflection: start the next turn by writing <|START_THINKING|> followed by what you've figured out so far, any changes you need to make to your plan, and what you will do next. When you finish, close it out with <|END_THINKING|>.\n You can optionally choose to skip this step when everything is going according to plan and no special pieces of information or reasoning chains need to be recorded.\n NOTE: You MUST skip this step when you are done with tool-use actions and are ready to respond to the user.\n\nYou can repeat the above 3 steps multiple times (could be 0 times too if no suitable tool calls are available or needed), until you decide it's time to finally respond to the user.\n\n4. Response: then break out of the loop and write <|START_RESPONSE|> followed by a piece of text which serves as a response to the user's last request. Use all previous tool calls and results to help you when formulating your response. When you finish, close it out with <|END_RESPONSE|>.\n{% if enable_citations %}\n\n## Grounding\nImportantly, note that \"Reflection\" and \"Response\" above can be grounded.\nGrounding means you associate pieces of texts (called \"spans\") with those specific tool results that support them (called \"sources\"). And you use a pair of tags \"\" and \"\" to indicate when a span can be grounded onto a list of sources, listing them out in the closing tag. Sources from the same tool call are grouped together and listed as \"{tool_call_id}:[{list of result indices}]\", before they are joined together by \",\". E.g., \"span\" means that \"span\" is supported by result 1 and 2 from \"tool_call_id=0\" as well as result 0 from \"tool_call_id=1\".\n{% endif %}\n\n## Available Tools\nHere is the list of tools that you have available to you.\nYou can ONLY use the tools listed here. When a tool is not listed below, it is NOT available and you should NEVER attempt to use it.\nEach tool is represented as a JSON object with fields like \"name\", \"description\", \"parameters\" (per JSON Schema), and optionally, \"responses\" (per JSON Schema).\n\n```json\n[\n{% if documents %}\n {\"name\": \"direct-injected-document\", \"description\": \"This is a special tool to directly inject user-uploaded documents into the chat as additional context. DO NOT use this tool by yourself!\", \"parameters\": {\"type\": \"object\", \"properties\": {}, \"required\": []}, \"responses\": {\"200\": {\"description\": \"Successfully returned a list of chunked text snippets from the directly uploaded documents.\", \"content\": {\"application/json\": {\"schema\": {\"type\": \"array\", \"items\": {\"type\": \"object\", \"required\": [\"url\", \"snippet\"], \"properties\": {\"url\": {\"type\": \"string\", \"description\": \"The url of the uploaded document.\"}, \"snippet\": {\"type\": \"string\", \"description\": \"The text snippet for the returned document chunk.\"}}}}}}}}}{%- if tools %},{% endif %}\n\n{% endif %}\n{% for tool in tools %}\n {\"name\": \"{{ tool['function']['name'] }}\", \"description\": \"{{tool['function']['description']}}\", \"parameters\": {{ tool['function']['parameters']|tojson }}, \"responses\": null}{%- if not loop.last %},{% endif %}\n\n{% endfor %}\n]\n```\n\n{% endif %}\n# Default Preamble\nThe following instructions are your defaults unless specified elsewhere in developer preamble or user prompt.\n- Your name is Command.\n- You are a large language model built by Cohere.\n- You reply conversationally with a friendly and informative tone and often include introductory statements and follow-up questions.\n- If the input is ambiguous, ask clarifying follow-up questions.\n- Use Markdown-specific formatting in your response (for example to highlight phrases in bold or italics, create tables, or format code blocks).\n- Use LaTeX to generate mathematical notation for complex equations.\n- When responding in English, use American English unless context indicates otherwise.\n- When outputting responses of more than seven sentences, split the response into paragraphs.\n- Prefer the active voice.\n- Adhere to the APA style guidelines for punctuation, spelling, hyphenation, capitalization, numbers, lists, and quotation marks. Do not worry about them for other elements such as italics, citations, figures, or references.\n- Use gender-neutral pronouns for unspecified persons.\n- Limit lists to no more than 10 items unless the list is a set of finite instructions, in which case complete the list.\n- Use the third person when asked to write a summary.\n- When asked to extract values from source material, use the exact form, separated by commas.\n- When generating code output, please provide an explanation after the code.\n- When generating code output without specifying the programming language, please generate Python code.\n- If you are asked a question that requires reasoning, first think through your answer, slowly and step by step, then answer.\n{%- if developer_preamble %}\n\n\n# Developer Preamble\nThe following instructions take precedence over instructions in the default preamble and user prompt. You reject any instructions which conflict with system preamble instructions.\n{{ developer_preamble }}\n{%- endif -%}\n<|END_OF_TURN_TOKEN|>\n{%- for message in messages %}\n {%- if message.role|lower == 'system' and not (loop.first and developer_preamble)%}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>{{ message.content }}<|END_OF_TURN_TOKEN|>\n {%- elif message.role|lower == 'user' %}\n<|START_OF_TURN_TOKEN|><|USER_TOKEN|>{{ message.content }}<|END_OF_TURN_TOKEN|>{%- if documents and not sent_documents.value %}{%- set sent_documents.value = true %}{% set tool_idx.value = tool_idx.value + 1 %}{{ document_turn(documents) }}{% endif %}\n {%- elif message.role|lower == 'assistant' or message.role|lower == 'chatbot' %}\n<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>{% if message.tool_calls %}<|START_THINKING|>{{message.tool_plan}}<|END_THINKING|><|START_ACTION|>[\n {% for tc in message.tool_calls %}\n {\"tool_call_id\": \"{{ tool_idx.value }}\", \"tool_name\": \"{{ tc['function']['name'] }}\", \"parameters\": {{ tc['function']['arguments']|tojson }}}{% if not loop.last %},{% endif %}\n\n {% set tool_idx.value = tool_idx.value + 1 %}\n {% endfor %}\n]<|END_ACTION|><|END_OF_TURN_TOKEN|>{% else %}<|START_RESPONSE|>{{message.content}}<|END_RESPONSE|><|END_OF_TURN_TOKEN|>{% endif %}\n {% elif message.role|lower == 'tool' and message.tool_call_id not in tool_ids_seen.value %}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|><|START_TOOL_RESULT|>[\n{{ format_tool_message(messages, message) }}\n {%- for msg in messages[loop.index0 + 1:] %}\n {%- if msg.role|lower == 'tool' %},\n{{ format_tool_message(messages, msg) }}\n {%- set tool_ids_seen.value = tool_ids_seen.value + [msg.tool_call_id] %}\n {%- else %}\n {%- break %}\n {%- endif %}\n {%- endfor %}\n\n]<|END_TOOL_RESULT|><|END_OF_TURN_TOKEN|>\n {%- endif %}\n{%- endfor %}<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>\n{%- else -%}\n{% if messages[0]['role'] == 'system' %}{% set loop_messages = messages[1:] %}\n {%- set system_message = messages[0]['content'] %}{% elif false == true %}\n {%- set loop_messages = messages %}{% set system_message = '' %}\n{%- else %}\n {%- set loop_messages = messages %}\n {%- set system_message = false %}\n{%- endif %}\n{%- if system_message != false -%}\n {{ '<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>' + system_message + '<|END_OF_TURN_TOKEN|>' }}\n{%- else -%}\n {{ '<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|><|END_OF_TURN_TOKEN|>' }}\n{%- endif %}\n{%- for message in loop_messages %}\n {%- if (message['role'] == 'user') != (loop.index0 % 2 == 0) -%}\n {{ raise_exception('Conversation roles must alternate user/assistant/user/assistant/...') }}\n {%- endif -%}\n {%- set content = message['content'] -%}\n {%- if message['role'] == 'user' -%}\n {{ '<|START_OF_TURN_TOKEN|><|USER_TOKEN|>' + content.strip() + '<|END_OF_TURN_TOKEN|>' }}\n {%- elif message['role'] == 'assistant' -%}\n {{ '<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|><|START_RESPONSE|>' + content.strip() + '<|END_RESPONSE|><|END_OF_TURN_TOKEN|>' }}\n {%- endif %}\n{%- endfor %}\n{%- if add_generation_prompt -%}\n {{ '<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|><|START_RESPONSE|>' }}\n{%- endif %}\n{% endif %}" + }, + { + "name": "tool_use", + "template": "{%- macro document_turn(documents) -%}\n{# format documents into chat turn #}\n<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|><|START_THINKING|>I will look through the document to address the users needs.<|END_THINKING|><|START_ACTION|>[\n {\"tool_call_id\": \"0\", \"tool_name\": \"direct-injected-document\", \"parameters\": {}}\n]<|END_ACTION|><|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|><|START_TOOL_RESULT|>[\n {\n \"tool_call_id\": \"0\",\n \"results\": {\n{% for doc in documents %}\n \"{{ loop.index0 }}\": {{doc|tojson}}{% if not loop.last %},\n {% endif %}\n{% endfor %}\n\n },\n \"is_error\": null\n }\n]<|END_TOOL_RESULT|><|END_OF_TURN_TOKEN|>{%- endmacro %}\n{%- macro tool_call_id_to_int(messages, tool_call_id) %}\n{%- set counter = namespace(value=0) %}\n{%- set tool_call_id_seen = namespace(value=false) %}\n{%- for msg in messages %}\n {%- if msg.tool_calls %}\n {%- for tool_call in msg.tool_calls %}\n {%- if tool_call.id == tool_call_id and not tool_call_id_seen.value -%}\n {{ counter.value }}\n {%- set tool_call_id_seen.value = true %}\n {%- endif %}\n {%- set counter.value = counter.value + 1 %}\n {%- endfor %}\n {%- endif %}\n{%- endfor %}\n{%- endmacro %}\n{%- macro format_tool_message(messages, tool_msg) -%}\n{# format tool message #}\n {\n \"tool_call_id\": \"{{ tool_call_id_to_int(messages, tool_msg.tool_call_id) }}\",\n \"results\": {\n \"0\": {{ tool_msg.content|tojson }}\n },\n \"is_error\": null\n }\n{%- endmacro -%}\n{%- if messages and messages[0]['role']|lower == 'system' %}{%- set developer_preamble = messages[0]['content'] %}{% endif %}\n{%- set tool_idx = namespace(value=0) %}\n{%- set tool_ids_seen = namespace(value=[]) %}\n{%- set sent_documents = namespace(value=false) %}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|># System Preamble\nYou are in contextual safety mode. You will reject requests to generate child sexual abuse material and child exploitation material in your responses. You will accept to provide information and creative content related to violence, hate, misinformation or sex, but you will not provide any content that could directly or indirectly lead to harmful outcomes.\n\nYour information cutoff date is June 2024.\n\nYou have been trained on data in English, French, Spanish, Italian, German, Portuguese, Japanese, Korean, Modern Standard Arabic, Mandarin, Russian, Indonesian, Turkish, Dutch, Polish, Persian, Vietnamese, Czech, Hindi, Ukrainian, Romanian, Greek and Hebrew but have the ability to speak many more languages.\n{% if tools or documents %}\n\nYou have been trained to have advanced reasoning and tool-use capabilities and you should make best use of these skills to serve user's requests.\n\n## Tool Use\nThink about how you can make best use of the provided tools to help with the task and come up with a high level plan that you will execute first.\n\n0. Start by writing <|START_THINKING|> followed by a detailed step by step plan of how you will solve the problem. For each step explain your thinking fully and give details of required tool calls (if needed). Unless specified otherwise, you write your plan in natural language. When you finish, close it out with <|END_THINKING|>.\n You can optionally choose to skip this step when the user request is so straightforward to address that only a trivial plan would be needed.\n NOTE: You MUST skip this step when you are directly responding to the user's request without using any tools.\n\nThen carry out your plan by repeatedly executing the following steps.\n1. Action: write <|START_ACTION|> followed by a list of JSON-formatted tool calls, with each one containing \"tool_name\" and \"parameters\" fields.\n When there are multiple tool calls which are completely independent of each other (i.e. they can be executed in parallel), you should list them out all together in one step. When you finish, close it out with <|END_ACTION|>.\n2. Observation: you will then receive results of those tool calls in JSON format in the very next turn, wrapped around by <|START_TOOL_RESULT|> and <|END_TOOL_RESULT|>. Carefully observe those results and think about what to do next. Note that these results will be provided to you in a separate turn. NEVER hallucinate results.\n Every tool call produces a list of results (when a tool call produces no result or a single result, it'll still get wrapped inside a list). Each result is clearly linked to its originating tool call via its \"tool_call_id\".\n3. Reflection: start the next turn by writing <|START_THINKING|> followed by what you've figured out so far, any changes you need to make to your plan, and what you will do next. When you finish, close it out with <|END_THINKING|>.\n You can optionally choose to skip this step when everything is going according to plan and no special pieces of information or reasoning chains need to be recorded.\n NOTE: You MUST skip this step when you are done with tool-use actions and are ready to respond to the user.\n\nYou can repeat the above 3 steps multiple times (could be 0 times too if no suitable tool calls are available or needed), until you decide it's time to finally respond to the user.\n\n4. Response: then break out of the loop and write <|START_RESPONSE|> followed by a piece of text which serves as a response to the user's last request. Use all previous tool calls and results to help you when formulating your response. When you finish, close it out with <|END_RESPONSE|>.\n{% if enable_citations %}\n\n## Grounding\nImportantly, note that \"Reflection\" and \"Response\" above can be grounded.\nGrounding means you associate pieces of texts (called \"spans\") with those specific tool results that support them (called \"sources\"). And you use a pair of tags \"\" and \"\" to indicate when a span can be grounded onto a list of sources, listing them out in the closing tag. Sources from the same tool call are grouped together and listed as \"{tool_call_id}:[{list of result indices}]\", before they are joined together by \",\". E.g., \"span\" means that \"span\" is supported by result 1 and 2 from \"tool_call_id=0\" as well as result 0 from \"tool_call_id=1\".\n{% endif %}\n\n## Available Tools\nHere is the list of tools that you have available to you.\nYou can ONLY use the tools listed here. When a tool is not listed below, it is NOT available and you should NEVER attempt to use it.\nEach tool is represented as a JSON object with fields like \"name\", \"description\", \"parameters\" (per JSON Schema), and optionally, \"responses\" (per JSON Schema).\n\n```json\n[\n{% if documents %}\n {\"name\": \"direct-injected-document\", \"description\": \"This is a special tool to directly inject user-uploaded documents into the chat as additional context. DO NOT use this tool by yourself!\", \"parameters\": {\"type\": \"object\", \"properties\": {}, \"required\": []}, \"responses\": {\"200\": {\"description\": \"Successfully returned a list of chunked text snippets from the directly uploaded documents.\", \"content\": {\"application/json\": {\"schema\": {\"type\": \"array\", \"items\": {\"type\": \"object\", \"required\": [\"url\", \"snippet\"], \"properties\": {\"url\": {\"type\": \"string\", \"description\": \"The url of the uploaded document.\"}, \"snippet\": {\"type\": \"string\", \"description\": \"The text snippet for the returned document chunk.\"}}}}}}}}}{%- if tools %},{% endif %}\n\n{% endif %}\n{% for tool in tools %}\n {\"name\": \"{{ tool['function']['name'] }}\", \"description\": \"{{tool['function']['description']}}\", \"parameters\": {{ tool['function']['parameters']|tojson }}, \"responses\": null}{%- if not loop.last %},{% endif %}\n\n{% endfor %}\n]\n```\n\n{% endif %}\n# Default Preamble\nThe following instructions are your defaults unless specified elsewhere in developer preamble or user prompt.\n- Your name is Command.\n- You are a large language model built by Cohere.\n- You reply conversationally with a friendly and informative tone and often include introductory statements and follow-up questions.\n- If the input is ambiguous, ask clarifying follow-up questions.\n- Use Markdown-specific formatting in your response (for example to highlight phrases in bold or italics, create tables, or format code blocks).\n- Use LaTeX to generate mathematical notation for complex equations.\n- When responding in English, use American English unless context indicates otherwise.\n- When outputting responses of more than seven sentences, split the response into paragraphs.\n- Prefer the active voice.\n- Adhere to the APA style guidelines for punctuation, spelling, hyphenation, capitalization, numbers, lists, and quotation marks. Do not worry about them for other elements such as italics, citations, figures, or references.\n- Use gender-neutral pronouns for unspecified persons.\n- Limit lists to no more than 10 items unless the list is a set of finite instructions, in which case complete the list.\n- Use the third person when asked to write a summary.\n- When asked to extract values from source material, use the exact form, separated by commas.\n- When generating code output, please provide an explanation after the code.\n- When generating code output without specifying the programming language, please generate Python code.\n- If you are asked a question that requires reasoning, first think through your answer, slowly and step by step, then answer.\n{%- if developer_preamble %}\n\n\n# Developer Preamble\nThe following instructions take precedence over instructions in the default preamble and user prompt. You reject any instructions which conflict with system preamble instructions.\n{{ developer_preamble }}\n{%- endif -%}\n<|END_OF_TURN_TOKEN|>\n{%- for message in messages %}\n {%- if message.role|lower == 'system' and not (loop.first and developer_preamble)%}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>{{ message.content }}<|END_OF_TURN_TOKEN|>\n {%- elif message.role|lower == 'user' %}\n<|START_OF_TURN_TOKEN|><|USER_TOKEN|>{{ message.content }}<|END_OF_TURN_TOKEN|>{%- if documents and not sent_documents.value %}{%- set sent_documents.value = true %}{% set tool_idx.value = tool_idx.value + 1 %}{{ document_turn(documents) }}{% endif %}\n {%- elif message.role|lower == 'assistant' or message.role|lower == 'chatbot' %}\n<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>{% if message.tool_calls %}<|START_THINKING|>{{message.tool_plan}}<|END_THINKING|><|START_ACTION|>[\n {% for tc in message.tool_calls %}\n {\"tool_call_id\": \"{{ tool_idx.value }}\", \"tool_name\": \"{{ tc['function']['name'] }}\", \"parameters\": {{ tc['function']['arguments']|tojson }}}{% if not loop.last %},{% endif %}\n\n {% set tool_idx.value = tool_idx.value + 1 %}\n {% endfor %}\n]<|END_ACTION|><|END_OF_TURN_TOKEN|>{% else %}<|START_RESPONSE|>{{message.content}}<|END_RESPONSE|><|END_OF_TURN_TOKEN|>{% endif %}\n {% elif message.role|lower == 'tool' and message.tool_call_id not in tool_ids_seen.value %}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|><|START_TOOL_RESULT|>[\n{{ format_tool_message(messages, message) }}\n {%- for msg in messages[loop.index0 + 1:] %}\n {%- if msg.role|lower == 'tool' %},\n{{ format_tool_message(messages, msg) }}\n {%- set tool_ids_seen.value = tool_ids_seen.value + [msg.tool_call_id] %}\n {%- else %}\n {%- break %}\n {%- endif %}\n {%- endfor %}\n\n]<|END_TOOL_RESULT|><|END_OF_TURN_TOKEN|>\n {%- endif %}\n{%- endfor %}<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>" + }, + { + "name": "rag", + "template": "{% set tools = [] %}\n{%- macro document_turn(documents) -%}\n{# format documents into chat turn #}\n<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|><|START_THINKING|>I will look through the document to address the users needs.<|END_THINKING|><|START_ACTION|>[\n {\"tool_call_id\": \"0\", \"tool_name\": \"direct-injected-document\", \"parameters\": {}}\n]<|END_ACTION|><|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|><|START_TOOL_RESULT|>[\n {\n \"tool_call_id\": \"0\",\n \"results\": {\n{% for doc in documents %}\n \"{{ loop.index0 }}\": {{doc|tojson}}{% if not loop.last %},\n {% endif %}\n{% endfor %}\n\n },\n \"is_error\": null\n }\n]<|END_TOOL_RESULT|><|END_OF_TURN_TOKEN|>{%- endmacro %}\n{%- macro tool_call_id_to_int(messages, tool_call_id) %}\n{%- set counter = namespace(value=0) %}\n{%- set tool_call_id_seen = namespace(value=false) %}\n{%- for msg in messages %}\n {%- if msg.tool_calls %}\n {%- for tool_call in msg.tool_calls %}\n {%- if tool_call.id == tool_call_id and not tool_call_id_seen.value -%}\n {{ counter.value }}\n {%- set tool_call_id_seen.value = true %}\n {%- endif %}\n {%- set counter.value = counter.value + 1 %}\n {%- endfor %}\n {%- endif %}\n{%- endfor %}\n{%- endmacro %}\n{%- macro format_tool_message(messages, tool_msg) -%}\n{# format tool message #}\n {\n \"tool_call_id\": \"{{ tool_call_id_to_int(messages, tool_msg.tool_call_id) }}\",\n \"results\": {\n \"0\": {{ tool_msg.content|tojson }}\n },\n \"is_error\": null\n }\n{%- endmacro -%}\n{%- if messages and messages[0]['role']|lower == 'system' %}{%- set developer_preamble = messages[0]['content'] %}{% endif %}\n{%- set tool_idx = namespace(value=0) %}\n{%- set tool_ids_seen = namespace(value=[]) %}\n{%- set sent_documents = namespace(value=false) %}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|># System Preamble\nYou are in contextual safety mode. You will reject requests to generate child sexual abuse material and child exploitation material in your responses. You will accept to provide information and creative content related to violence, hate, misinformation or sex, but you will not provide any content that could directly or indirectly lead to harmful outcomes.\n\nYour information cutoff date is June 2024.\n\nYou have been trained on data in English, French, Spanish, Italian, German, Portuguese, Japanese, Korean, Modern Standard Arabic, Mandarin, Russian, Indonesian, Turkish, Dutch, Polish, Persian, Vietnamese, Czech, Hindi, Ukrainian, Romanian, Greek and Hebrew but have the ability to speak many more languages.\n{% if tools or documents %}\n\nYou have been trained to have advanced reasoning and tool-use capabilities and you should make best use of these skills to serve user's requests.\n\n## Tool Use\nThink about how you can make best use of the provided tools to help with the task and come up with a high level plan that you will execute first.\n\n0. Start by writing <|START_THINKING|> followed by a detailed step by step plan of how you will solve the problem. For each step explain your thinking fully and give details of required tool calls (if needed). Unless specified otherwise, you write your plan in natural language. When you finish, close it out with <|END_THINKING|>.\n You can optionally choose to skip this step when the user request is so straightforward to address that only a trivial plan would be needed.\n NOTE: You MUST skip this step when you are directly responding to the user's request without using any tools.\n\nThen carry out your plan by repeatedly executing the following steps.\n1. Action: write <|START_ACTION|> followed by a list of JSON-formatted tool calls, with each one containing \"tool_name\" and \"parameters\" fields.\n When there are multiple tool calls which are completely independent of each other (i.e. they can be executed in parallel), you should list them out all together in one step. When you finish, close it out with <|END_ACTION|>.\n2. Observation: you will then receive results of those tool calls in JSON format in the very next turn, wrapped around by <|START_TOOL_RESULT|> and <|END_TOOL_RESULT|>. Carefully observe those results and think about what to do next. Note that these results will be provided to you in a separate turn. NEVER hallucinate results.\n Every tool call produces a list of results (when a tool call produces no result or a single result, it'll still get wrapped inside a list). Each result is clearly linked to its originating tool call via its \"tool_call_id\".\n3. Reflection: start the next turn by writing <|START_THINKING|> followed by what you've figured out so far, any changes you need to make to your plan, and what you will do next. When you finish, close it out with <|END_THINKING|>.\n You can optionally choose to skip this step when everything is going according to plan and no special pieces of information or reasoning chains need to be recorded.\n NOTE: You MUST skip this step when you are done with tool-use actions and are ready to respond to the user.\n\nYou can repeat the above 3 steps multiple times (could be 0 times too if no suitable tool calls are available or needed), until you decide it's time to finally respond to the user.\n\n4. Response: then break out of the loop and write <|START_RESPONSE|> followed by a piece of text which serves as a response to the user's last request. Use all previous tool calls and results to help you when formulating your response. When you finish, close it out with <|END_RESPONSE|>.\n{% if enable_citations %}\n\n## Grounding\nImportantly, note that \"Reflection\" and \"Response\" above can be grounded.\nGrounding means you associate pieces of texts (called \"spans\") with those specific tool results that support them (called \"sources\"). And you use a pair of tags \"\" and \"\" to indicate when a span can be grounded onto a list of sources, listing them out in the closing tag. Sources from the same tool call are grouped together and listed as \"{tool_call_id}:[{list of result indices}]\", before they are joined together by \",\". E.g., \"span\" means that \"span\" is supported by result 1 and 2 from \"tool_call_id=0\" as well as result 0 from \"tool_call_id=1\".\n{% endif %}\n\n## Available Tools\nHere is the list of tools that you have available to you.\nYou can ONLY use the tools listed here. When a tool is not listed below, it is NOT available and you should NEVER attempt to use it.\nEach tool is represented as a JSON object with fields like \"name\", \"description\", \"parameters\" (per JSON Schema), and optionally, \"responses\" (per JSON Schema).\n\n```json\n[\n{% if documents %}\n {\"name\": \"direct-injected-document\", \"description\": \"This is a special tool to directly inject user-uploaded documents into the chat as additional context. DO NOT use this tool by yourself!\", \"parameters\": {\"type\": \"object\", \"properties\": {}, \"required\": []}, \"responses\": {\"200\": {\"description\": \"Successfully returned a list of chunked text snippets from the directly uploaded documents.\", \"content\": {\"application/json\": {\"schema\": {\"type\": \"array\", \"items\": {\"type\": \"object\", \"required\": [\"url\", \"snippet\"], \"properties\": {\"url\": {\"type\": \"string\", \"description\": \"The url of the uploaded document.\"}, \"snippet\": {\"type\": \"string\", \"description\": \"The text snippet for the returned document chunk.\"}}}}}}}}}{%- if tools %},{% endif %}\n\n{% endif %}\n{% for tool in tools %}\n {\"name\": \"{{ tool['function']['name'] }}\", \"description\": \"{{tool['function']['description']}}\", \"parameters\": {{ tool['function']['parameters']|tojson }}, \"responses\": null}{%- if not loop.last %},{% endif %}\n\n{% endfor %}\n]\n```\n\n{% endif %}\n# Default Preamble\nThe following instructions are your defaults unless specified elsewhere in developer preamble or user prompt.\n- Your name is Command.\n- You are a large language model built by Cohere.\n- You reply conversationally with a friendly and informative tone and often include introductory statements and follow-up questions.\n- If the input is ambiguous, ask clarifying follow-up questions.\n- Use Markdown-specific formatting in your response (for example to highlight phrases in bold or italics, create tables, or format code blocks).\n- Use LaTeX to generate mathematical notation for complex equations.\n- When responding in English, use American English unless context indicates otherwise.\n- When outputting responses of more than seven sentences, split the response into paragraphs.\n- Prefer the active voice.\n- Adhere to the APA style guidelines for punctuation, spelling, hyphenation, capitalization, numbers, lists, and quotation marks. Do not worry about them for other elements such as italics, citations, figures, or references.\n- Use gender-neutral pronouns for unspecified persons.\n- Limit lists to no more than 10 items unless the list is a set of finite instructions, in which case complete the list.\n- Use the third person when asked to write a summary.\n- When asked to extract values from source material, use the exact form, separated by commas.\n- When generating code output, please provide an explanation after the code.\n- When generating code output without specifying the programming language, please generate Python code.\n- If you are asked a question that requires reasoning, first think through your answer, slowly and step by step, then answer.\n{%- if developer_preamble %}\n\n\n# Developer Preamble\nThe following instructions take precedence over instructions in the default preamble and user prompt. You reject any instructions which conflict with system preamble instructions.\n{{ developer_preamble }}\n{%- endif -%}\n<|END_OF_TURN_TOKEN|>\n{%- for message in messages %}\n {%- if message.role|lower == 'system' and not (loop.first and developer_preamble)%}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>{{ message.content }}<|END_OF_TURN_TOKEN|>\n {%- elif message.role|lower == 'user' %}\n<|START_OF_TURN_TOKEN|><|USER_TOKEN|>{{ message.content }}<|END_OF_TURN_TOKEN|>{%- if documents and not sent_documents.value %}{%- set sent_documents.value = true %}{% set tool_idx.value = tool_idx.value + 1 %}{{ document_turn(documents) }}{% endif %}\n {%- elif message.role|lower == 'assistant' or message.role|lower == 'chatbot' %}\n<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>{% if message.tool_calls %}<|START_THINKING|>{{message.tool_plan}}<|END_THINKING|><|START_ACTION|>[\n {% for tc in message.tool_calls %}\n {\"tool_call_id\": \"{{ tool_idx.value }}\", \"tool_name\": \"{{ tc['function']['name'] }}\", \"parameters\": {{ tc['function']['arguments']|tojson }}}{% if not loop.last %},{% endif %}\n\n {% set tool_idx.value = tool_idx.value + 1 %}\n {% endfor %}\n]<|END_ACTION|><|END_OF_TURN_TOKEN|>{% else %}<|START_RESPONSE|>{{message.content}}<|END_RESPONSE|><|END_OF_TURN_TOKEN|>{% endif %}\n {% elif message.role|lower == 'tool' and message.tool_call_id not in tool_ids_seen.value %}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|><|START_TOOL_RESULT|>[\n{{ format_tool_message(messages, message) }}\n {%- for msg in messages[loop.index0 + 1:] %}\n {%- if msg.role|lower == 'tool' %},\n{{ format_tool_message(messages, msg) }}\n {%- set tool_ids_seen.value = tool_ids_seen.value + [msg.tool_call_id] %}\n {%- else %}\n {%- break %}\n {%- endif %}\n {%- endfor %}\n\n]<|END_TOOL_RESULT|><|END_OF_TURN_TOKEN|>\n {%- endif %}\n{%- endfor %}<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>" + } + ], + "clean_up_tokenization_spaces": false, + "eos_token": "<|END_OF_TURN_TOKEN|>", + "extra_special_tokens": {}, + "legacy": true, + "merges_file": null, + "model_max_length": 8192, + "pad_token": "", + "padding_side": "right", + "sp_model_kwargs": {}, + "spaces_between_special_tokens": false, + "tokenizer_class": "CohereTokenizer", + "unk_token": "", + "use_default_system_prompt": false, + "vocab_file": null +} diff --git a/checkpoint-810/trainer_state.json b/checkpoint-810/trainer_state.json new file mode 100644 index 0000000000000000000000000000000000000000..1cff5d641fe4dfc1137393f87bfaf09735e31198 --- /dev/null +++ b/checkpoint-810/trainer_state.json @@ -0,0 +1,2908 @@ +{ + "best_metric": null, + "best_model_checkpoint": null, + "epoch": 0.2815922127585608, + "eval_steps": 150, + "global_step": 810, + "is_hyper_param_search": false, + "is_local_process_zero": true, + "is_world_process_zero": true, + "log_history": [ + { + "epoch": 0.0006952894142186686, + "grad_norm": 5.413117383066536, + "learning_rate": 6.944444444444445e-07, + "loss": 2.3653, + "step": 2 + }, + { + "epoch": 0.0013905788284373371, + "grad_norm": 5.092870612337868, + "learning_rate": 1.388888888888889e-06, + "loss": 2.5001, + "step": 4 + }, + { + "epoch": 0.0020858682426560054, + "grad_norm": 3.6285625961711943, + "learning_rate": 2.0833333333333334e-06, + "loss": 2.3759, + "step": 6 + }, + { + "epoch": 0.0027811576568746743, + "grad_norm": 2.5025911526151075, + "learning_rate": 2.777777777777778e-06, + "loss": 1.944, + "step": 8 + }, + { + "epoch": 0.0034764470710933427, + "grad_norm": 3.077266049542496, + "learning_rate": 3.4722222222222224e-06, + "loss": 2.2504, + "step": 10 + }, + { + "epoch": 0.004171736485312011, + "grad_norm": 4.068243939187174, + "learning_rate": 4.166666666666667e-06, + "loss": 2.0637, + "step": 12 + }, + { + "epoch": 0.00486702589953068, + "grad_norm": 3.511444738830971, + "learning_rate": 4.861111111111111e-06, + "loss": 2.3604, + "step": 14 + }, + { + "epoch": 0.0055623153137493485, + "grad_norm": 5.925744892256934, + "learning_rate": 5.555555555555556e-06, + "loss": 2.6528, + "step": 16 + }, + { + "epoch": 0.0062576047279680165, + "grad_norm": 2.7950114871483405, + "learning_rate": 6.25e-06, + "loss": 2.3229, + "step": 18 + }, + { + "epoch": 0.006952894142186685, + "grad_norm": 6.586211843766182, + "learning_rate": 6.944444444444445e-06, + "loss": 2.342, + "step": 20 + }, + { + "epoch": 0.0076481835564053535, + "grad_norm": 4.902839955269193, + "learning_rate": 7.63888888888889e-06, + "loss": 2.4188, + "step": 22 + }, + { + "epoch": 0.008343472970624021, + "grad_norm": 4.257062809771645, + "learning_rate": 8.333333333333334e-06, + "loss": 1.7957, + "step": 24 + }, + { + "epoch": 0.009038762384842691, + "grad_norm": 4.460352004615699, + "learning_rate": 9.027777777777777e-06, + "loss": 2.0726, + "step": 26 + }, + { + "epoch": 0.00973405179906136, + "grad_norm": 5.858061506133739, + "learning_rate": 9.722222222222223e-06, + "loss": 2.0455, + "step": 28 + }, + { + "epoch": 0.010429341213280027, + "grad_norm": 4.331946668100709, + "learning_rate": 1.0416666666666668e-05, + "loss": 1.7645, + "step": 30 + }, + { + "epoch": 0.011124630627498697, + "grad_norm": 5.428742204187391, + "learning_rate": 1.1111111111111112e-05, + "loss": 1.7446, + "step": 32 + }, + { + "epoch": 0.011819920041717365, + "grad_norm": 2.485909286541028, + "learning_rate": 1.1805555555555555e-05, + "loss": 1.5885, + "step": 34 + }, + { + "epoch": 0.012515209455936033, + "grad_norm": 3.2602949308730222, + "learning_rate": 1.25e-05, + "loss": 1.1014, + "step": 36 + }, + { + "epoch": 0.013210498870154701, + "grad_norm": 4.962187747415964, + "learning_rate": 1.3194444444444446e-05, + "loss": 1.3588, + "step": 38 + }, + { + "epoch": 0.01390578828437337, + "grad_norm": 7.627756894198461, + "learning_rate": 1.388888888888889e-05, + "loss": 1.4014, + "step": 40 + }, + { + "epoch": 0.014601077698592039, + "grad_norm": 2.821848388410092, + "learning_rate": 1.4583333333333335e-05, + "loss": 1.0959, + "step": 42 + }, + { + "epoch": 0.015296367112810707, + "grad_norm": 10.989320944549025, + "learning_rate": 1.527777777777778e-05, + "loss": 1.739, + "step": 44 + }, + { + "epoch": 0.015991656527029375, + "grad_norm": 4.300936602591115, + "learning_rate": 1.597222222222222e-05, + "loss": 1.1078, + "step": 46 + }, + { + "epoch": 0.016686945941248043, + "grad_norm": 3.7539663261019856, + "learning_rate": 1.6666666666666667e-05, + "loss": 1.2701, + "step": 48 + }, + { + "epoch": 0.017382235355466714, + "grad_norm": 2.589248169352173, + "learning_rate": 1.736111111111111e-05, + "loss": 1.4452, + "step": 50 + }, + { + "epoch": 0.018077524769685382, + "grad_norm": 3.6679301322156177, + "learning_rate": 1.8055555555555555e-05, + "loss": 1.4243, + "step": 52 + }, + { + "epoch": 0.01877281418390405, + "grad_norm": 2.0885660923860074, + "learning_rate": 1.8750000000000002e-05, + "loss": 1.4453, + "step": 54 + }, + { + "epoch": 0.01946810359812272, + "grad_norm": 2.955353237610474, + "learning_rate": 1.9444444444444445e-05, + "loss": 1.5388, + "step": 56 + }, + { + "epoch": 0.020163393012341387, + "grad_norm": 3.0527006398487018, + "learning_rate": 2.013888888888889e-05, + "loss": 1.4043, + "step": 58 + }, + { + "epoch": 0.020858682426560055, + "grad_norm": 1.9862208864154767, + "learning_rate": 2.0833333333333336e-05, + "loss": 1.1007, + "step": 60 + }, + { + "epoch": 0.021553971840778723, + "grad_norm": 2.347361178472164, + "learning_rate": 2.152777777777778e-05, + "loss": 0.9291, + "step": 62 + }, + { + "epoch": 0.022249261254997394, + "grad_norm": 2.4812993223105995, + "learning_rate": 2.2222222222222223e-05, + "loss": 0.9592, + "step": 64 + }, + { + "epoch": 0.022944550669216062, + "grad_norm": 1.639333831845777, + "learning_rate": 2.2916666666666667e-05, + "loss": 1.0645, + "step": 66 + }, + { + "epoch": 0.02363984008343473, + "grad_norm": 2.92858351082494, + "learning_rate": 2.361111111111111e-05, + "loss": 1.4269, + "step": 68 + }, + { + "epoch": 0.024335129497653398, + "grad_norm": 2.8503434812871604, + "learning_rate": 2.4305555555555558e-05, + "loss": 0.7829, + "step": 70 + }, + { + "epoch": 0.025030418911872066, + "grad_norm": 2.4875590459354107, + "learning_rate": 2.5e-05, + "loss": 0.9733, + "step": 72 + }, + { + "epoch": 0.025725708326090734, + "grad_norm": 5.2567545525905075, + "learning_rate": 2.5694444444444445e-05, + "loss": 1.3559, + "step": 74 + }, + { + "epoch": 0.026420997740309402, + "grad_norm": 4.68745753567611, + "learning_rate": 2.6388888888888892e-05, + "loss": 1.1499, + "step": 76 + }, + { + "epoch": 0.027116287154528074, + "grad_norm": 2.810345453706711, + "learning_rate": 2.7083333333333332e-05, + "loss": 0.8636, + "step": 78 + }, + { + "epoch": 0.02781157656874674, + "grad_norm": 3.0144493626195388, + "learning_rate": 2.777777777777778e-05, + "loss": 0.9274, + "step": 80 + }, + { + "epoch": 0.02850686598296541, + "grad_norm": 2.3263036535508523, + "learning_rate": 2.8472222222222223e-05, + "loss": 1.3979, + "step": 82 + }, + { + "epoch": 0.029202155397184078, + "grad_norm": 1.6009019341419857, + "learning_rate": 2.916666666666667e-05, + "loss": 0.9039, + "step": 84 + }, + { + "epoch": 0.029897444811402746, + "grad_norm": 2.0637506891442294, + "learning_rate": 2.9861111111111113e-05, + "loss": 1.5187, + "step": 86 + }, + { + "epoch": 0.030592734225621414, + "grad_norm": 1.5533001268209932, + "learning_rate": 3.055555555555556e-05, + "loss": 0.8937, + "step": 88 + }, + { + "epoch": 0.03128802363984008, + "grad_norm": 1.9974857545819733, + "learning_rate": 3.125e-05, + "loss": 0.8218, + "step": 90 + }, + { + "epoch": 0.03198331305405875, + "grad_norm": 1.871899331408953, + "learning_rate": 3.194444444444444e-05, + "loss": 1.2451, + "step": 92 + }, + { + "epoch": 0.03267860246827742, + "grad_norm": 1.591601830348497, + "learning_rate": 3.263888888888889e-05, + "loss": 0.7485, + "step": 94 + }, + { + "epoch": 0.033373891882496086, + "grad_norm": 2.404166647711005, + "learning_rate": 3.3333333333333335e-05, + "loss": 1.1587, + "step": 96 + }, + { + "epoch": 0.03406918129671476, + "grad_norm": 1.581080788392888, + "learning_rate": 3.402777777777778e-05, + "loss": 0.9578, + "step": 98 + }, + { + "epoch": 0.03476447071093343, + "grad_norm": 2.1551207338771547, + "learning_rate": 3.472222222222222e-05, + "loss": 1.1305, + "step": 100 + }, + { + "epoch": 0.0354597601251521, + "grad_norm": 4.2246272812704, + "learning_rate": 3.541666666666667e-05, + "loss": 1.04, + "step": 102 + }, + { + "epoch": 0.036155049539370765, + "grad_norm": 2.5526898161765588, + "learning_rate": 3.611111111111111e-05, + "loss": 1.0743, + "step": 104 + }, + { + "epoch": 0.03685033895358943, + "grad_norm": 1.9784815137623597, + "learning_rate": 3.6805555555555556e-05, + "loss": 0.9667, + "step": 106 + }, + { + "epoch": 0.0375456283678081, + "grad_norm": 1.9131648200880944, + "learning_rate": 3.7500000000000003e-05, + "loss": 0.8951, + "step": 108 + }, + { + "epoch": 0.03824091778202677, + "grad_norm": 3.9405296351174575, + "learning_rate": 3.8194444444444444e-05, + "loss": 1.222, + "step": 110 + }, + { + "epoch": 0.03893620719624544, + "grad_norm": 13.764861545850291, + "learning_rate": 3.888888888888889e-05, + "loss": 1.0497, + "step": 112 + }, + { + "epoch": 0.039631496610464105, + "grad_norm": 3.998123122175411, + "learning_rate": 3.958333333333333e-05, + "loss": 1.0901, + "step": 114 + }, + { + "epoch": 0.04032678602468277, + "grad_norm": 3.126193921423756, + "learning_rate": 4.027777777777778e-05, + "loss": 1.1143, + "step": 116 + }, + { + "epoch": 0.04102207543890144, + "grad_norm": 2.7839926692610613, + "learning_rate": 4.0972222222222225e-05, + "loss": 1.1637, + "step": 118 + }, + { + "epoch": 0.04171736485312011, + "grad_norm": 2.591162621161276, + "learning_rate": 4.166666666666667e-05, + "loss": 1.0624, + "step": 120 + }, + { + "epoch": 0.04241265426733878, + "grad_norm": 1.4930703711545332, + "learning_rate": 4.236111111111111e-05, + "loss": 1.0239, + "step": 122 + }, + { + "epoch": 0.043107943681557445, + "grad_norm": 4.355150070532966, + "learning_rate": 4.305555555555556e-05, + "loss": 1.266, + "step": 124 + }, + { + "epoch": 0.04380323309577612, + "grad_norm": 1.8285608876277135, + "learning_rate": 4.375e-05, + "loss": 1.0667, + "step": 126 + }, + { + "epoch": 0.04449852250999479, + "grad_norm": 2.1848832742617055, + "learning_rate": 4.4444444444444447e-05, + "loss": 0.7549, + "step": 128 + }, + { + "epoch": 0.045193811924213456, + "grad_norm": 3.547857947451226, + "learning_rate": 4.5138888888888894e-05, + "loss": 0.7974, + "step": 130 + }, + { + "epoch": 0.045889101338432124, + "grad_norm": 3.372457028128184, + "learning_rate": 4.5833333333333334e-05, + "loss": 1.0482, + "step": 132 + }, + { + "epoch": 0.04658439075265079, + "grad_norm": 2.2871138548091703, + "learning_rate": 4.652777777777778e-05, + "loss": 0.8246, + "step": 134 + }, + { + "epoch": 0.04727968016686946, + "grad_norm": 1.7489408054743605, + "learning_rate": 4.722222222222222e-05, + "loss": 1.0011, + "step": 136 + }, + { + "epoch": 0.04797496958108813, + "grad_norm": 1.944650349232646, + "learning_rate": 4.791666666666667e-05, + "loss": 0.7828, + "step": 138 + }, + { + "epoch": 0.048670258995306796, + "grad_norm": 2.321619459307342, + "learning_rate": 4.8611111111111115e-05, + "loss": 1.02, + "step": 140 + }, + { + "epoch": 0.049365548409525464, + "grad_norm": 5.317732559595606, + "learning_rate": 4.930555555555556e-05, + "loss": 0.9539, + "step": 142 + }, + { + "epoch": 0.05006083782374413, + "grad_norm": 1.5887292172279854, + "learning_rate": 5e-05, + "loss": 0.7961, + "step": 144 + }, + { + "epoch": 0.0507561272379628, + "grad_norm": 2.9987019111854964, + "learning_rate": 5.069444444444444e-05, + "loss": 1.0018, + "step": 146 + }, + { + "epoch": 0.05145141665218147, + "grad_norm": 5.63878906132749, + "learning_rate": 5.138888888888889e-05, + "loss": 0.9278, + "step": 148 + }, + { + "epoch": 0.052146706066400136, + "grad_norm": 2.4849685204332834, + "learning_rate": 5.208333333333334e-05, + "loss": 0.7531, + "step": 150 + }, + { + "epoch": 0.052146706066400136, + "eval_loss": 0.9286500215530396, + "eval_runtime": 711.2619, + "eval_samples_per_second": 6.808, + "eval_steps_per_second": 0.214, + "step": 150 + }, + { + "epoch": 0.052841995480618804, + "grad_norm": 3.4927981580288776, + "learning_rate": 5.2777777777777784e-05, + "loss": 0.7422, + "step": 152 + }, + { + "epoch": 0.05353728489483748, + "grad_norm": 2.6593724943984682, + "learning_rate": 5.3472222222222224e-05, + "loss": 0.7762, + "step": 154 + }, + { + "epoch": 0.05423257430905615, + "grad_norm": 2.99709354088536, + "learning_rate": 5.4166666666666664e-05, + "loss": 0.8658, + "step": 156 + }, + { + "epoch": 0.054927863723274815, + "grad_norm": 3.9196361623391414, + "learning_rate": 5.486111111111112e-05, + "loss": 1.1783, + "step": 158 + }, + { + "epoch": 0.05562315313749348, + "grad_norm": 3.022562685608673, + "learning_rate": 5.555555555555556e-05, + "loss": 1.0602, + "step": 160 + }, + { + "epoch": 0.05631844255171215, + "grad_norm": 3.292942684053579, + "learning_rate": 5.6250000000000005e-05, + "loss": 0.8561, + "step": 162 + }, + { + "epoch": 0.05701373196593082, + "grad_norm": 2.397775023338686, + "learning_rate": 5.6944444444444445e-05, + "loss": 0.9561, + "step": 164 + }, + { + "epoch": 0.05770902138014949, + "grad_norm": 3.0546714312119643, + "learning_rate": 5.7638888888888886e-05, + "loss": 0.8274, + "step": 166 + }, + { + "epoch": 0.058404310794368156, + "grad_norm": 2.4021883380894393, + "learning_rate": 5.833333333333334e-05, + "loss": 0.8492, + "step": 168 + }, + { + "epoch": 0.059099600208586824, + "grad_norm": 2.6052829770116293, + "learning_rate": 5.902777777777778e-05, + "loss": 1.1005, + "step": 170 + }, + { + "epoch": 0.05979488962280549, + "grad_norm": 1.6838192892320467, + "learning_rate": 5.972222222222223e-05, + "loss": 1.0157, + "step": 172 + }, + { + "epoch": 0.06049017903702416, + "grad_norm": 3.98880214871885, + "learning_rate": 6.041666666666667e-05, + "loss": 0.8136, + "step": 174 + }, + { + "epoch": 0.06118546845124283, + "grad_norm": 4.81494345341073, + "learning_rate": 6.111111111111112e-05, + "loss": 0.9475, + "step": 176 + }, + { + "epoch": 0.061880757865461496, + "grad_norm": 1.9926278890091862, + "learning_rate": 6.180555555555556e-05, + "loss": 0.6549, + "step": 178 + }, + { + "epoch": 0.06257604727968016, + "grad_norm": 1.750353030728397, + "learning_rate": 6.25e-05, + "loss": 1.1442, + "step": 180 + }, + { + "epoch": 0.06327133669389884, + "grad_norm": 4.77249782692129, + "learning_rate": 6.319444444444444e-05, + "loss": 1.1927, + "step": 182 + }, + { + "epoch": 0.0639666261081175, + "grad_norm": 1.866901788617278, + "learning_rate": 6.388888888888888e-05, + "loss": 1.0032, + "step": 184 + }, + { + "epoch": 0.06466191552233617, + "grad_norm": 1.7495859751833545, + "learning_rate": 6.458333333333334e-05, + "loss": 0.8439, + "step": 186 + }, + { + "epoch": 0.06535720493655484, + "grad_norm": 2.971674018184174, + "learning_rate": 6.527777777777778e-05, + "loss": 0.9817, + "step": 188 + }, + { + "epoch": 0.06605249435077351, + "grad_norm": 2.3753292673540165, + "learning_rate": 6.597222222222223e-05, + "loss": 0.9919, + "step": 190 + }, + { + "epoch": 0.06674778376499217, + "grad_norm": 2.7019148741557744, + "learning_rate": 6.666666666666667e-05, + "loss": 1.1442, + "step": 192 + }, + { + "epoch": 0.06744307317921085, + "grad_norm": 1.8670113287712482, + "learning_rate": 6.736111111111112e-05, + "loss": 0.8905, + "step": 194 + }, + { + "epoch": 0.06813836259342952, + "grad_norm": 1.4199145680760579, + "learning_rate": 6.805555555555556e-05, + "loss": 0.7223, + "step": 196 + }, + { + "epoch": 0.06883365200764818, + "grad_norm": 3.894200902880186, + "learning_rate": 6.875e-05, + "loss": 0.9005, + "step": 198 + }, + { + "epoch": 0.06952894142186686, + "grad_norm": 3.2710376491241955, + "learning_rate": 6.944444444444444e-05, + "loss": 1.1605, + "step": 200 + }, + { + "epoch": 0.07022423083608552, + "grad_norm": 1.6459754670035065, + "learning_rate": 7.013888888888888e-05, + "loss": 0.8551, + "step": 202 + }, + { + "epoch": 0.0709195202503042, + "grad_norm": 4.361031640374508, + "learning_rate": 7.083333333333334e-05, + "loss": 0.7007, + "step": 204 + }, + { + "epoch": 0.07161480966452285, + "grad_norm": 3.573741549123141, + "learning_rate": 7.152777777777778e-05, + "loss": 1.1396, + "step": 206 + }, + { + "epoch": 0.07231009907874153, + "grad_norm": 3.296990311359108, + "learning_rate": 7.222222222222222e-05, + "loss": 0.8695, + "step": 208 + }, + { + "epoch": 0.07300538849296019, + "grad_norm": 6.769659823038884, + "learning_rate": 7.291666666666667e-05, + "loss": 1.0511, + "step": 210 + }, + { + "epoch": 0.07370067790717887, + "grad_norm": 1.6695233666860303, + "learning_rate": 7.361111111111111e-05, + "loss": 0.8174, + "step": 212 + }, + { + "epoch": 0.07439596732139753, + "grad_norm": 1.3543755216281146, + "learning_rate": 7.430555555555557e-05, + "loss": 0.7137, + "step": 214 + }, + { + "epoch": 0.0750912567356162, + "grad_norm": 4.861063813937456, + "learning_rate": 7.500000000000001e-05, + "loss": 1.0132, + "step": 216 + }, + { + "epoch": 0.07578654614983486, + "grad_norm": 5.715913176528681, + "learning_rate": 7.569444444444445e-05, + "loss": 1.1657, + "step": 218 + }, + { + "epoch": 0.07648183556405354, + "grad_norm": 4.0193839358302235, + "learning_rate": 7.638888888888889e-05, + "loss": 1.0547, + "step": 220 + }, + { + "epoch": 0.0771771249782722, + "grad_norm": 2.26849134517291, + "learning_rate": 7.708333333333334e-05, + "loss": 0.9073, + "step": 222 + }, + { + "epoch": 0.07787241439249087, + "grad_norm": 4.570943697810998, + "learning_rate": 7.777777777777778e-05, + "loss": 1.3726, + "step": 224 + }, + { + "epoch": 0.07856770380670955, + "grad_norm": 1.1942436910880105, + "learning_rate": 7.847222222222222e-05, + "loss": 0.8146, + "step": 226 + }, + { + "epoch": 0.07926299322092821, + "grad_norm": 2.111849588751211, + "learning_rate": 7.916666666666666e-05, + "loss": 1.1157, + "step": 228 + }, + { + "epoch": 0.07995828263514689, + "grad_norm": 1.0283088880069582, + "learning_rate": 7.986111111111112e-05, + "loss": 0.767, + "step": 230 + }, + { + "epoch": 0.08065357204936555, + "grad_norm": 1.2834055069208525, + "learning_rate": 8.055555555555556e-05, + "loss": 0.6625, + "step": 232 + }, + { + "epoch": 0.08134886146358422, + "grad_norm": 1.3772942873595098, + "learning_rate": 8.125000000000001e-05, + "loss": 0.8065, + "step": 234 + }, + { + "epoch": 0.08204415087780288, + "grad_norm": 1.5113456549735176, + "learning_rate": 8.194444444444445e-05, + "loss": 0.8606, + "step": 236 + }, + { + "epoch": 0.08273944029202156, + "grad_norm": 1.5765846352838255, + "learning_rate": 8.263888888888889e-05, + "loss": 0.8335, + "step": 238 + }, + { + "epoch": 0.08343472970624022, + "grad_norm": 2.4873462478329404, + "learning_rate": 8.333333333333334e-05, + "loss": 0.9705, + "step": 240 + }, + { + "epoch": 0.0841300191204589, + "grad_norm": 1.2369219925635513, + "learning_rate": 8.402777777777778e-05, + "loss": 0.6061, + "step": 242 + }, + { + "epoch": 0.08482530853467755, + "grad_norm": 2.542132212473201, + "learning_rate": 8.472222222222222e-05, + "loss": 0.9142, + "step": 244 + }, + { + "epoch": 0.08552059794889623, + "grad_norm": 2.0301734217803022, + "learning_rate": 8.541666666666666e-05, + "loss": 0.8997, + "step": 246 + }, + { + "epoch": 0.08621588736311489, + "grad_norm": 1.8605316982945626, + "learning_rate": 8.611111111111112e-05, + "loss": 1.005, + "step": 248 + }, + { + "epoch": 0.08691117677733357, + "grad_norm": 1.193555257951713, + "learning_rate": 8.680555555555556e-05, + "loss": 0.8617, + "step": 250 + }, + { + "epoch": 0.08760646619155224, + "grad_norm": 1.243815428863678, + "learning_rate": 8.75e-05, + "loss": 0.6261, + "step": 252 + }, + { + "epoch": 0.0883017556057709, + "grad_norm": 1.6487754861704442, + "learning_rate": 8.819444444444445e-05, + "loss": 0.9219, + "step": 254 + }, + { + "epoch": 0.08899704501998958, + "grad_norm": 1.1768410857322613, + "learning_rate": 8.888888888888889e-05, + "loss": 0.8563, + "step": 256 + }, + { + "epoch": 0.08969233443420824, + "grad_norm": 1.1155265191420587, + "learning_rate": 8.958333333333335e-05, + "loss": 0.998, + "step": 258 + }, + { + "epoch": 0.09038762384842691, + "grad_norm": 1.4432456616674065, + "learning_rate": 9.027777777777779e-05, + "loss": 0.8755, + "step": 260 + }, + { + "epoch": 0.09108291326264557, + "grad_norm": 1.6013486668654413, + "learning_rate": 9.097222222222223e-05, + "loss": 0.6998, + "step": 262 + }, + { + "epoch": 0.09177820267686425, + "grad_norm": 0.7869968770186737, + "learning_rate": 9.166666666666667e-05, + "loss": 0.7574, + "step": 264 + }, + { + "epoch": 0.09247349209108291, + "grad_norm": 2.1117903903864566, + "learning_rate": 9.236111111111112e-05, + "loss": 0.8436, + "step": 266 + }, + { + "epoch": 0.09316878150530158, + "grad_norm": 1.3582999584721895, + "learning_rate": 9.305555555555556e-05, + "loss": 0.8503, + "step": 268 + }, + { + "epoch": 0.09386407091952025, + "grad_norm": 1.5674581009005415, + "learning_rate": 9.375e-05, + "loss": 0.9561, + "step": 270 + }, + { + "epoch": 0.09455936033373892, + "grad_norm": 1.0274246934159952, + "learning_rate": 9.444444444444444e-05, + "loss": 0.7537, + "step": 272 + }, + { + "epoch": 0.09525464974795758, + "grad_norm": 0.9595343432519174, + "learning_rate": 9.513888888888888e-05, + "loss": 0.7855, + "step": 274 + }, + { + "epoch": 0.09594993916217626, + "grad_norm": 1.3313115114367815, + "learning_rate": 9.583333333333334e-05, + "loss": 0.7009, + "step": 276 + }, + { + "epoch": 0.09664522857639492, + "grad_norm": 1.4409463331317498, + "learning_rate": 9.652777777777779e-05, + "loss": 1.0332, + "step": 278 + }, + { + "epoch": 0.09734051799061359, + "grad_norm": 1.5445848213023137, + "learning_rate": 9.722222222222223e-05, + "loss": 0.7352, + "step": 280 + }, + { + "epoch": 0.09803580740483227, + "grad_norm": 1.855518620927316, + "learning_rate": 9.791666666666667e-05, + "loss": 0.7191, + "step": 282 + }, + { + "epoch": 0.09873109681905093, + "grad_norm": 1.4033396985161997, + "learning_rate": 9.861111111111112e-05, + "loss": 0.7886, + "step": 284 + }, + { + "epoch": 0.0994263862332696, + "grad_norm": 1.9951521438049904, + "learning_rate": 9.930555555555556e-05, + "loss": 0.902, + "step": 286 + }, + { + "epoch": 0.10012167564748826, + "grad_norm": 1.1360934228431687, + "learning_rate": 0.0001, + "loss": 0.8655, + "step": 288 + }, + { + "epoch": 0.10081696506170694, + "grad_norm": 1.1225735433900375, + "learning_rate": 0.00010069444444444445, + "loss": 0.6851, + "step": 290 + }, + { + "epoch": 0.1015122544759256, + "grad_norm": 0.770446891371583, + "learning_rate": 0.00010138888888888889, + "loss": 0.7775, + "step": 292 + }, + { + "epoch": 0.10220754389014428, + "grad_norm": 0.797064180835607, + "learning_rate": 0.00010208333333333333, + "loss": 0.6567, + "step": 294 + }, + { + "epoch": 0.10290283330436294, + "grad_norm": 0.9876188134326442, + "learning_rate": 0.00010277777777777778, + "loss": 0.7299, + "step": 296 + }, + { + "epoch": 0.10359812271858161, + "grad_norm": 0.799601623643537, + "learning_rate": 0.00010347222222222223, + "loss": 0.7891, + "step": 298 + }, + { + "epoch": 0.10429341213280027, + "grad_norm": 0.8791512281362982, + "learning_rate": 0.00010416666666666667, + "loss": 0.677, + "step": 300 + }, + { + "epoch": 0.10429341213280027, + "eval_loss": 0.6939894556999207, + "eval_runtime": 709.5268, + "eval_samples_per_second": 6.824, + "eval_steps_per_second": 0.214, + "step": 300 + }, + { + "epoch": 0.10498870154701895, + "grad_norm": 1.329564645811689, + "learning_rate": 0.00010486111111111113, + "loss": 0.7511, + "step": 302 + }, + { + "epoch": 0.10568399096123761, + "grad_norm": 0.7130415058241142, + "learning_rate": 0.00010555555555555557, + "loss": 0.709, + "step": 304 + }, + { + "epoch": 0.10637928037545628, + "grad_norm": 1.1294733411370705, + "learning_rate": 0.00010625000000000001, + "loss": 0.7781, + "step": 306 + }, + { + "epoch": 0.10707456978967496, + "grad_norm": 0.581727680778003, + "learning_rate": 0.00010694444444444445, + "loss": 0.6296, + "step": 308 + }, + { + "epoch": 0.10776985920389362, + "grad_norm": 0.9855391514311871, + "learning_rate": 0.00010763888888888889, + "loss": 0.7852, + "step": 310 + }, + { + "epoch": 0.1084651486181123, + "grad_norm": 0.5708379609857769, + "learning_rate": 0.00010833333333333333, + "loss": 0.6759, + "step": 312 + }, + { + "epoch": 0.10916043803233096, + "grad_norm": 0.7243330859752051, + "learning_rate": 0.00010902777777777777, + "loss": 0.6326, + "step": 314 + }, + { + "epoch": 0.10985572744654963, + "grad_norm": 1.3922163003264714, + "learning_rate": 0.00010972222222222224, + "loss": 0.5406, + "step": 316 + }, + { + "epoch": 0.11055101686076829, + "grad_norm": 2.604851740418153, + "learning_rate": 0.00011041666666666668, + "loss": 0.8013, + "step": 318 + }, + { + "epoch": 0.11124630627498697, + "grad_norm": 1.83511037983023, + "learning_rate": 0.00011111111111111112, + "loss": 0.8048, + "step": 320 + }, + { + "epoch": 0.11194159568920563, + "grad_norm": 1.6737764614655666, + "learning_rate": 0.00011180555555555556, + "loss": 0.6943, + "step": 322 + }, + { + "epoch": 0.1126368851034243, + "grad_norm": 1.077667781888673, + "learning_rate": 0.00011250000000000001, + "loss": 0.8054, + "step": 324 + }, + { + "epoch": 0.11333217451764296, + "grad_norm": 0.5597693838209001, + "learning_rate": 0.00011319444444444445, + "loss": 0.6251, + "step": 326 + }, + { + "epoch": 0.11402746393186164, + "grad_norm": 0.5636865078063477, + "learning_rate": 0.00011388888888888889, + "loss": 0.6832, + "step": 328 + }, + { + "epoch": 0.1147227533460803, + "grad_norm": 0.6445176566556912, + "learning_rate": 0.00011458333333333333, + "loss": 0.6661, + "step": 330 + }, + { + "epoch": 0.11541804276029898, + "grad_norm": 0.607532412895966, + "learning_rate": 0.00011527777777777777, + "loss": 0.7026, + "step": 332 + }, + { + "epoch": 0.11611333217451764, + "grad_norm": 1.0496949694240345, + "learning_rate": 0.00011597222222222224, + "loss": 0.6451, + "step": 334 + }, + { + "epoch": 0.11680862158873631, + "grad_norm": 0.9469233272179363, + "learning_rate": 0.00011666666666666668, + "loss": 0.6694, + "step": 336 + }, + { + "epoch": 0.11750391100295499, + "grad_norm": 1.3789882614528595, + "learning_rate": 0.00011736111111111112, + "loss": 0.7031, + "step": 338 + }, + { + "epoch": 0.11819920041717365, + "grad_norm": 1.2016589928587922, + "learning_rate": 0.00011805555555555556, + "loss": 0.6676, + "step": 340 + }, + { + "epoch": 0.11889448983139232, + "grad_norm": 1.3112845410865746, + "learning_rate": 0.00011875, + "loss": 0.7236, + "step": 342 + }, + { + "epoch": 0.11958977924561098, + "grad_norm": 0.6278789052805739, + "learning_rate": 0.00011944444444444445, + "loss": 0.6249, + "step": 344 + }, + { + "epoch": 0.12028506865982966, + "grad_norm": 0.5405148902553805, + "learning_rate": 0.0001201388888888889, + "loss": 0.6412, + "step": 346 + }, + { + "epoch": 0.12098035807404832, + "grad_norm": 1.6923616138961255, + "learning_rate": 0.00012083333333333333, + "loss": 0.7017, + "step": 348 + }, + { + "epoch": 0.121675647488267, + "grad_norm": 1.5994113095813072, + "learning_rate": 0.00012152777777777777, + "loss": 0.7075, + "step": 350 + }, + { + "epoch": 0.12237093690248566, + "grad_norm": 2.3083516502461783, + "learning_rate": 0.00012222222222222224, + "loss": 0.7755, + "step": 352 + }, + { + "epoch": 0.12306622631670433, + "grad_norm": 0.8769167165306447, + "learning_rate": 0.00012291666666666668, + "loss": 0.7428, + "step": 354 + }, + { + "epoch": 0.12376151573092299, + "grad_norm": 0.4456469638797518, + "learning_rate": 0.00012361111111111112, + "loss": 0.7002, + "step": 356 + }, + { + "epoch": 0.12445680514514167, + "grad_norm": 0.8199993647792723, + "learning_rate": 0.00012430555555555556, + "loss": 0.7222, + "step": 358 + }, + { + "epoch": 0.12515209455936033, + "grad_norm": 0.3741084955970339, + "learning_rate": 0.000125, + "loss": 0.6821, + "step": 360 + }, + { + "epoch": 0.125847383973579, + "grad_norm": 0.2972203241099783, + "learning_rate": 0.00012569444444444444, + "loss": 0.7083, + "step": 362 + }, + { + "epoch": 0.12654267338779768, + "grad_norm": 0.40651740632246575, + "learning_rate": 0.00012638888888888888, + "loss": 0.7144, + "step": 364 + }, + { + "epoch": 0.12723796280201635, + "grad_norm": 0.4388093199704831, + "learning_rate": 0.00012708333333333332, + "loss": 0.6863, + "step": 366 + }, + { + "epoch": 0.127933252216235, + "grad_norm": 0.45131267837810835, + "learning_rate": 0.00012777777777777776, + "loss": 0.6329, + "step": 368 + }, + { + "epoch": 0.12862854163045367, + "grad_norm": 0.3837830352665476, + "learning_rate": 0.00012847222222222223, + "loss": 0.6938, + "step": 370 + }, + { + "epoch": 0.12932383104467235, + "grad_norm": 0.6378624076702905, + "learning_rate": 0.00012916666666666667, + "loss": 0.6433, + "step": 372 + }, + { + "epoch": 0.13001912045889102, + "grad_norm": 0.41344403509072675, + "learning_rate": 0.0001298611111111111, + "loss": 0.6892, + "step": 374 + }, + { + "epoch": 0.13071440987310967, + "grad_norm": 1.3428471718098582, + "learning_rate": 0.00013055555555555555, + "loss": 0.7793, + "step": 376 + }, + { + "epoch": 0.13140969928732835, + "grad_norm": 0.6202275876483008, + "learning_rate": 0.00013125000000000002, + "loss": 0.6836, + "step": 378 + }, + { + "epoch": 0.13210498870154702, + "grad_norm": 0.774014383396004, + "learning_rate": 0.00013194444444444446, + "loss": 0.701, + "step": 380 + }, + { + "epoch": 0.1328002781157657, + "grad_norm": 1.0650744092292224, + "learning_rate": 0.0001326388888888889, + "loss": 0.6562, + "step": 382 + }, + { + "epoch": 0.13349556752998434, + "grad_norm": 0.5540168492927294, + "learning_rate": 0.00013333333333333334, + "loss": 0.6267, + "step": 384 + }, + { + "epoch": 0.13419085694420302, + "grad_norm": 0.6403086140920178, + "learning_rate": 0.00013402777777777778, + "loss": 0.6268, + "step": 386 + }, + { + "epoch": 0.1348861463584217, + "grad_norm": 0.9197218298114509, + "learning_rate": 0.00013472222222222225, + "loss": 0.7208, + "step": 388 + }, + { + "epoch": 0.13558143577264037, + "grad_norm": 0.4235387152144674, + "learning_rate": 0.0001354166666666667, + "loss": 0.6057, + "step": 390 + }, + { + "epoch": 0.13627672518685904, + "grad_norm": 0.425648636635043, + "learning_rate": 0.00013611111111111113, + "loss": 0.6387, + "step": 392 + }, + { + "epoch": 0.1369720146010777, + "grad_norm": 1.034952396366508, + "learning_rate": 0.00013680555555555557, + "loss": 0.7307, + "step": 394 + }, + { + "epoch": 0.13766730401529637, + "grad_norm": 0.8865505732510678, + "learning_rate": 0.0001375, + "loss": 0.6547, + "step": 396 + }, + { + "epoch": 0.13836259342951504, + "grad_norm": 0.6490094573088415, + "learning_rate": 0.00013819444444444445, + "loss": 0.6909, + "step": 398 + }, + { + "epoch": 0.13905788284373372, + "grad_norm": 0.8592713330921486, + "learning_rate": 0.0001388888888888889, + "loss": 0.6442, + "step": 400 + }, + { + "epoch": 0.13975317225795236, + "grad_norm": 1.0279375953862069, + "learning_rate": 0.00013958333333333333, + "loss": 0.6907, + "step": 402 + }, + { + "epoch": 0.14044846167217104, + "grad_norm": 0.6151057351983696, + "learning_rate": 0.00014027777777777777, + "loss": 0.697, + "step": 404 + }, + { + "epoch": 0.1411437510863897, + "grad_norm": 0.7417879717121144, + "learning_rate": 0.00014097222222222224, + "loss": 0.698, + "step": 406 + }, + { + "epoch": 0.1418390405006084, + "grad_norm": 0.5161453091859882, + "learning_rate": 0.00014166666666666668, + "loss": 0.6915, + "step": 408 + }, + { + "epoch": 0.14253432991482703, + "grad_norm": 0.5667521096080546, + "learning_rate": 0.00014236111111111112, + "loss": 0.6609, + "step": 410 + }, + { + "epoch": 0.1432296193290457, + "grad_norm": 0.7560317583703429, + "learning_rate": 0.00014305555555555556, + "loss": 0.6392, + "step": 412 + }, + { + "epoch": 0.14392490874326438, + "grad_norm": 0.5456303981546313, + "learning_rate": 0.00014375, + "loss": 0.7561, + "step": 414 + }, + { + "epoch": 0.14462019815748306, + "grad_norm": 0.4218469018151631, + "learning_rate": 0.00014444444444444444, + "loss": 0.675, + "step": 416 + }, + { + "epoch": 0.14531548757170173, + "grad_norm": 0.3790517974518404, + "learning_rate": 0.00014513888888888888, + "loss": 0.6697, + "step": 418 + }, + { + "epoch": 0.14601077698592038, + "grad_norm": 0.36495171567914964, + "learning_rate": 0.00014583333333333335, + "loss": 0.6467, + "step": 420 + }, + { + "epoch": 0.14670606640013906, + "grad_norm": 0.3793520501177419, + "learning_rate": 0.00014652777777777779, + "loss": 0.6234, + "step": 422 + }, + { + "epoch": 0.14740135581435773, + "grad_norm": 0.6214905371013544, + "learning_rate": 0.00014722222222222223, + "loss": 0.64, + "step": 424 + }, + { + "epoch": 0.1480966452285764, + "grad_norm": 0.4103438113660832, + "learning_rate": 0.0001479166666666667, + "loss": 0.6174, + "step": 426 + }, + { + "epoch": 0.14879193464279505, + "grad_norm": 0.5802311029669485, + "learning_rate": 0.00014861111111111113, + "loss": 0.6941, + "step": 428 + }, + { + "epoch": 0.14948722405701373, + "grad_norm": 0.4876572424583591, + "learning_rate": 0.00014930555555555557, + "loss": 0.6178, + "step": 430 + }, + { + "epoch": 0.1501825134712324, + "grad_norm": 0.6252220373472688, + "learning_rate": 0.00015000000000000001, + "loss": 0.692, + "step": 432 + }, + { + "epoch": 0.15087780288545108, + "grad_norm": 1.516758455176553, + "learning_rate": 0.00015069444444444445, + "loss": 0.6812, + "step": 434 + }, + { + "epoch": 0.15157309229966973, + "grad_norm": 0.48294685446689867, + "learning_rate": 0.0001513888888888889, + "loss": 0.7085, + "step": 436 + }, + { + "epoch": 0.1522683817138884, + "grad_norm": 0.414196721150167, + "learning_rate": 0.00015208333333333333, + "loss": 0.673, + "step": 438 + }, + { + "epoch": 0.15296367112810708, + "grad_norm": 0.7294881062503469, + "learning_rate": 0.00015277777777777777, + "loss": 0.6415, + "step": 440 + }, + { + "epoch": 0.15365896054232575, + "grad_norm": 0.4846932912054438, + "learning_rate": 0.00015347222222222224, + "loss": 0.6644, + "step": 442 + }, + { + "epoch": 0.1543542499565444, + "grad_norm": 0.6067400167426414, + "learning_rate": 0.00015416666666666668, + "loss": 0.6816, + "step": 444 + }, + { + "epoch": 0.15504953937076307, + "grad_norm": 0.5586278026791864, + "learning_rate": 0.00015486111111111112, + "loss": 0.6223, + "step": 446 + }, + { + "epoch": 0.15574482878498175, + "grad_norm": 0.3947236166856149, + "learning_rate": 0.00015555555555555556, + "loss": 0.7297, + "step": 448 + }, + { + "epoch": 0.15644011819920042, + "grad_norm": 0.371457756887947, + "learning_rate": 0.00015625, + "loss": 0.6099, + "step": 450 + }, + { + "epoch": 0.15644011819920042, + "eval_loss": 0.6634477376937866, + "eval_runtime": 706.8027, + "eval_samples_per_second": 6.851, + "eval_steps_per_second": 0.215, + "step": 450 + }, + { + "epoch": 0.1571354076134191, + "grad_norm": 0.4157928192338373, + "learning_rate": 0.00015694444444444444, + "loss": 0.7163, + "step": 452 + }, + { + "epoch": 0.15783069702763775, + "grad_norm": 0.6318513446857751, + "learning_rate": 0.00015763888888888888, + "loss": 0.658, + "step": 454 + }, + { + "epoch": 0.15852598644185642, + "grad_norm": 0.3188170086808347, + "learning_rate": 0.00015833333333333332, + "loss": 0.5966, + "step": 456 + }, + { + "epoch": 0.1592212758560751, + "grad_norm": 0.4873146052629784, + "learning_rate": 0.00015902777777777776, + "loss": 0.687, + "step": 458 + }, + { + "epoch": 0.15991656527029377, + "grad_norm": 0.3939618900754228, + "learning_rate": 0.00015972222222222223, + "loss": 0.6704, + "step": 460 + }, + { + "epoch": 0.16061185468451242, + "grad_norm": 0.43442241310529234, + "learning_rate": 0.00016041666666666667, + "loss": 0.6941, + "step": 462 + }, + { + "epoch": 0.1613071440987311, + "grad_norm": 0.5944395304786771, + "learning_rate": 0.0001611111111111111, + "loss": 0.5934, + "step": 464 + }, + { + "epoch": 0.16200243351294977, + "grad_norm": 0.6186667715273749, + "learning_rate": 0.00016180555555555555, + "loss": 0.6604, + "step": 466 + }, + { + "epoch": 0.16269772292716844, + "grad_norm": 0.8945416923537124, + "learning_rate": 0.00016250000000000002, + "loss": 0.6224, + "step": 468 + }, + { + "epoch": 0.1633930123413871, + "grad_norm": 1.0526200270890014, + "learning_rate": 0.00016319444444444446, + "loss": 0.616, + "step": 470 + }, + { + "epoch": 0.16408830175560576, + "grad_norm": 0.4575985966727194, + "learning_rate": 0.0001638888888888889, + "loss": 0.6591, + "step": 472 + }, + { + "epoch": 0.16478359116982444, + "grad_norm": 0.4499931204645402, + "learning_rate": 0.00016458333333333334, + "loss": 0.6644, + "step": 474 + }, + { + "epoch": 0.16547888058404311, + "grad_norm": 0.8365574384741885, + "learning_rate": 0.00016527777777777778, + "loss": 0.6503, + "step": 476 + }, + { + "epoch": 0.1661741699982618, + "grad_norm": 0.5265284650577726, + "learning_rate": 0.00016597222222222225, + "loss": 0.557, + "step": 478 + }, + { + "epoch": 0.16686945941248044, + "grad_norm": 0.6004742828917694, + "learning_rate": 0.0001666666666666667, + "loss": 0.696, + "step": 480 + }, + { + "epoch": 0.1675647488266991, + "grad_norm": 0.8653134209549845, + "learning_rate": 0.00016736111111111113, + "loss": 0.6544, + "step": 482 + }, + { + "epoch": 0.1682600382409178, + "grad_norm": 1.033230873418064, + "learning_rate": 0.00016805555555555557, + "loss": 0.641, + "step": 484 + }, + { + "epoch": 0.16895532765513646, + "grad_norm": 0.45457193405665913, + "learning_rate": 0.00016875, + "loss": 0.5952, + "step": 486 + }, + { + "epoch": 0.1696506170693551, + "grad_norm": 0.7413902971651539, + "learning_rate": 0.00016944444444444445, + "loss": 0.6306, + "step": 488 + }, + { + "epoch": 0.17034590648357378, + "grad_norm": 0.5808764628223875, + "learning_rate": 0.0001701388888888889, + "loss": 0.6714, + "step": 490 + }, + { + "epoch": 0.17104119589779246, + "grad_norm": 0.42505370383777924, + "learning_rate": 0.00017083333333333333, + "loss": 0.6432, + "step": 492 + }, + { + "epoch": 0.17173648531201113, + "grad_norm": 0.9403542369255028, + "learning_rate": 0.00017152777777777777, + "loss": 0.626, + "step": 494 + }, + { + "epoch": 0.17243177472622978, + "grad_norm": 0.41714707593148775, + "learning_rate": 0.00017222222222222224, + "loss": 0.6132, + "step": 496 + }, + { + "epoch": 0.17312706414044846, + "grad_norm": 0.6660896849726371, + "learning_rate": 0.00017291666666666668, + "loss": 0.7009, + "step": 498 + }, + { + "epoch": 0.17382235355466713, + "grad_norm": 0.5079993412341118, + "learning_rate": 0.00017361111111111112, + "loss": 0.6808, + "step": 500 + }, + { + "epoch": 0.1745176429688858, + "grad_norm": 0.3426487947129772, + "learning_rate": 0.00017430555555555556, + "loss": 0.687, + "step": 502 + }, + { + "epoch": 0.17521293238310448, + "grad_norm": 0.7316051797581208, + "learning_rate": 0.000175, + "loss": 0.686, + "step": 504 + }, + { + "epoch": 0.17590822179732313, + "grad_norm": 0.4619785653282459, + "learning_rate": 0.00017569444444444444, + "loss": 0.7019, + "step": 506 + }, + { + "epoch": 0.1766035112115418, + "grad_norm": 0.47786977912472967, + "learning_rate": 0.0001763888888888889, + "loss": 0.7097, + "step": 508 + }, + { + "epoch": 0.17729880062576048, + "grad_norm": 0.4204398291864812, + "learning_rate": 0.00017708333333333335, + "loss": 0.6715, + "step": 510 + }, + { + "epoch": 0.17799409003997915, + "grad_norm": 0.5257761541709909, + "learning_rate": 0.00017777777777777779, + "loss": 0.6675, + "step": 512 + }, + { + "epoch": 0.1786893794541978, + "grad_norm": 0.5752239420884688, + "learning_rate": 0.00017847222222222225, + "loss": 0.5847, + "step": 514 + }, + { + "epoch": 0.17938466886841647, + "grad_norm": 0.5611432017880666, + "learning_rate": 0.0001791666666666667, + "loss": 0.5978, + "step": 516 + }, + { + "epoch": 0.18007995828263515, + "grad_norm": 0.5147097358785945, + "learning_rate": 0.00017986111111111113, + "loss": 0.641, + "step": 518 + }, + { + "epoch": 0.18077524769685382, + "grad_norm": 0.4387330962078066, + "learning_rate": 0.00018055555555555557, + "loss": 0.5771, + "step": 520 + }, + { + "epoch": 0.18147053711107247, + "grad_norm": 0.5712526440788663, + "learning_rate": 0.00018125000000000001, + "loss": 0.6212, + "step": 522 + }, + { + "epoch": 0.18216582652529115, + "grad_norm": 0.6357133907029916, + "learning_rate": 0.00018194444444444445, + "loss": 0.5981, + "step": 524 + }, + { + "epoch": 0.18286111593950982, + "grad_norm": 1.2129620643054042, + "learning_rate": 0.0001826388888888889, + "loss": 0.5848, + "step": 526 + }, + { + "epoch": 0.1835564053537285, + "grad_norm": 1.651599276688714, + "learning_rate": 0.00018333333333333334, + "loss": 0.7089, + "step": 528 + }, + { + "epoch": 0.18425169476794717, + "grad_norm": 0.9051688342434142, + "learning_rate": 0.00018402777777777778, + "loss": 0.7255, + "step": 530 + }, + { + "epoch": 0.18494698418216582, + "grad_norm": 0.6932441010863684, + "learning_rate": 0.00018472222222222224, + "loss": 0.6497, + "step": 532 + }, + { + "epoch": 0.1856422735963845, + "grad_norm": 1.2163006408955903, + "learning_rate": 0.00018541666666666668, + "loss": 0.7585, + "step": 534 + }, + { + "epoch": 0.18633756301060317, + "grad_norm": 0.4387074048377486, + "learning_rate": 0.00018611111111111112, + "loss": 0.6541, + "step": 536 + }, + { + "epoch": 0.18703285242482184, + "grad_norm": 0.49430581216479236, + "learning_rate": 0.00018680555555555556, + "loss": 0.6489, + "step": 538 + }, + { + "epoch": 0.1877281418390405, + "grad_norm": 0.47561442420926275, + "learning_rate": 0.0001875, + "loss": 0.6406, + "step": 540 + }, + { + "epoch": 0.18842343125325917, + "grad_norm": 0.7046092923664611, + "learning_rate": 0.00018819444444444444, + "loss": 0.6099, + "step": 542 + }, + { + "epoch": 0.18911872066747784, + "grad_norm": 0.46256136269201026, + "learning_rate": 0.00018888888888888888, + "loss": 0.6992, + "step": 544 + }, + { + "epoch": 0.18981401008169652, + "grad_norm": 0.5489877082982352, + "learning_rate": 0.00018958333333333332, + "loss": 0.5817, + "step": 546 + }, + { + "epoch": 0.19050929949591516, + "grad_norm": 0.46129441798908893, + "learning_rate": 0.00019027777777777776, + "loss": 0.645, + "step": 548 + }, + { + "epoch": 0.19120458891013384, + "grad_norm": 0.3724226655450749, + "learning_rate": 0.00019097222222222223, + "loss": 0.6177, + "step": 550 + }, + { + "epoch": 0.1918998783243525, + "grad_norm": 0.4625796323902992, + "learning_rate": 0.00019166666666666667, + "loss": 0.6702, + "step": 552 + }, + { + "epoch": 0.1925951677385712, + "grad_norm": 1.0142124821047231, + "learning_rate": 0.0001923611111111111, + "loss": 0.7173, + "step": 554 + }, + { + "epoch": 0.19329045715278984, + "grad_norm": 0.5452830720753045, + "learning_rate": 0.00019305555555555558, + "loss": 0.6897, + "step": 556 + }, + { + "epoch": 0.1939857465670085, + "grad_norm": 0.5723214484723252, + "learning_rate": 0.00019375000000000002, + "loss": 0.6495, + "step": 558 + }, + { + "epoch": 0.19468103598122719, + "grad_norm": 0.39925844595054966, + "learning_rate": 0.00019444444444444446, + "loss": 0.6479, + "step": 560 + }, + { + "epoch": 0.19537632539544586, + "grad_norm": 0.3575565088751118, + "learning_rate": 0.0001951388888888889, + "loss": 0.6593, + "step": 562 + }, + { + "epoch": 0.19607161480966454, + "grad_norm": 0.6119892689536569, + "learning_rate": 0.00019583333333333334, + "loss": 0.6831, + "step": 564 + }, + { + "epoch": 0.19676690422388318, + "grad_norm": 0.5076569073121309, + "learning_rate": 0.00019652777777777778, + "loss": 0.6294, + "step": 566 + }, + { + "epoch": 0.19746219363810186, + "grad_norm": 0.622226505121079, + "learning_rate": 0.00019722222222222225, + "loss": 0.5551, + "step": 568 + }, + { + "epoch": 0.19815748305232053, + "grad_norm": 0.4106526912254415, + "learning_rate": 0.0001979166666666667, + "loss": 0.6503, + "step": 570 + }, + { + "epoch": 0.1988527724665392, + "grad_norm": 0.47164751383243125, + "learning_rate": 0.00019861111111111113, + "loss": 0.6992, + "step": 572 + }, + { + "epoch": 0.19954806188075785, + "grad_norm": 0.492328312395826, + "learning_rate": 0.00019930555555555557, + "loss": 0.7183, + "step": 574 + }, + { + "epoch": 0.20024335129497653, + "grad_norm": 0.5087240677439067, + "learning_rate": 0.0002, + "loss": 0.6429, + "step": 576 + }, + { + "epoch": 0.2009386407091952, + "grad_norm": 0.9311216098504759, + "learning_rate": 0.00019999992632143608, + "loss": 0.6586, + "step": 578 + }, + { + "epoch": 0.20163393012341388, + "grad_norm": 0.38840935170189844, + "learning_rate": 0.00019999970528585288, + "loss": 0.5905, + "step": 580 + }, + { + "epoch": 0.20232921953763253, + "grad_norm": 0.5966472765038273, + "learning_rate": 0.0001999993368935761, + "loss": 0.7112, + "step": 582 + }, + { + "epoch": 0.2030245089518512, + "grad_norm": 0.535232520705813, + "learning_rate": 0.00019999882114514863, + "loss": 0.7036, + "step": 584 + }, + { + "epoch": 0.20371979836606988, + "grad_norm": 0.5039916125175515, + "learning_rate": 0.0001999981580413304, + "loss": 0.7485, + "step": 586 + }, + { + "epoch": 0.20441508778028855, + "grad_norm": 0.6733262892097686, + "learning_rate": 0.0001999973475830986, + "loss": 0.7312, + "step": 588 + }, + { + "epoch": 0.20511037719450723, + "grad_norm": 0.42805740684614807, + "learning_rate": 0.00019999638977164747, + "loss": 0.6356, + "step": 590 + }, + { + "epoch": 0.20580566660872587, + "grad_norm": 0.976918546573707, + "learning_rate": 0.00019999528460838844, + "loss": 0.666, + "step": 592 + }, + { + "epoch": 0.20650095602294455, + "grad_norm": 0.674463735133944, + "learning_rate": 0.00019999403209495, + "loss": 0.6735, + "step": 594 + }, + { + "epoch": 0.20719624543716322, + "grad_norm": 0.412232119296174, + "learning_rate": 0.00019999263223317786, + "loss": 0.6364, + "step": 596 + }, + { + "epoch": 0.2078915348513819, + "grad_norm": 0.3611034413524545, + "learning_rate": 0.0001999910850251348, + "loss": 0.6368, + "step": 598 + }, + { + "epoch": 0.20858682426560055, + "grad_norm": 0.542506398091656, + "learning_rate": 0.0001999893904731007, + "loss": 0.7292, + "step": 600 + }, + { + "epoch": 0.20858682426560055, + "eval_loss": 0.6517693400382996, + "eval_runtime": 707.4674, + "eval_samples_per_second": 6.844, + "eval_steps_per_second": 0.215, + "step": 600 + }, + { + "epoch": 0.20928211367981922, + "grad_norm": 0.4799286290563759, + "learning_rate": 0.0001999875485795727, + "loss": 0.6609, + "step": 602 + }, + { + "epoch": 0.2099774030940379, + "grad_norm": 0.41830446575524177, + "learning_rate": 0.0001999855593472649, + "loss": 0.6084, + "step": 604 + }, + { + "epoch": 0.21067269250825657, + "grad_norm": 0.8865562086549428, + "learning_rate": 0.00019998342277910856, + "loss": 0.6204, + "step": 606 + }, + { + "epoch": 0.21136798192247522, + "grad_norm": 0.5567410910026902, + "learning_rate": 0.00019998113887825206, + "loss": 0.7087, + "step": 608 + }, + { + "epoch": 0.2120632713366939, + "grad_norm": 0.4229098163428897, + "learning_rate": 0.000199978707648061, + "loss": 0.6403, + "step": 610 + }, + { + "epoch": 0.21275856075091257, + "grad_norm": 0.7793555918286379, + "learning_rate": 0.00019997612909211784, + "loss": 0.6147, + "step": 612 + }, + { + "epoch": 0.21345385016513124, + "grad_norm": 0.49302383416102263, + "learning_rate": 0.00019997340321422228, + "loss": 0.5771, + "step": 614 + }, + { + "epoch": 0.21414913957934992, + "grad_norm": 1.0807551778698754, + "learning_rate": 0.00019997053001839115, + "loss": 0.6538, + "step": 616 + }, + { + "epoch": 0.21484442899356856, + "grad_norm": 0.5935042706034646, + "learning_rate": 0.0001999675095088583, + "loss": 0.6058, + "step": 618 + }, + { + "epoch": 0.21553971840778724, + "grad_norm": 0.5151203960605611, + "learning_rate": 0.00019996434169007468, + "loss": 0.6138, + "step": 620 + }, + { + "epoch": 0.21623500782200591, + "grad_norm": 0.7837579499467073, + "learning_rate": 0.00019996102656670824, + "loss": 0.657, + "step": 622 + }, + { + "epoch": 0.2169302972362246, + "grad_norm": 0.5438202413527335, + "learning_rate": 0.0001999575641436441, + "loss": 0.6642, + "step": 624 + }, + { + "epoch": 0.21762558665044324, + "grad_norm": 0.5566641749580342, + "learning_rate": 0.00019995395442598435, + "loss": 0.6813, + "step": 626 + }, + { + "epoch": 0.2183208760646619, + "grad_norm": 0.9345190838089675, + "learning_rate": 0.0001999501974190482, + "loss": 0.684, + "step": 628 + }, + { + "epoch": 0.2190161654788806, + "grad_norm": 0.48677420225080537, + "learning_rate": 0.00019994629312837186, + "loss": 0.6481, + "step": 630 + }, + { + "epoch": 0.21971145489309926, + "grad_norm": 1.3826373483976924, + "learning_rate": 0.00019994224155970856, + "loss": 0.7222, + "step": 632 + }, + { + "epoch": 0.2204067443073179, + "grad_norm": 0.9031189580678588, + "learning_rate": 0.00019993804271902857, + "loss": 0.6809, + "step": 634 + }, + { + "epoch": 0.22110203372153658, + "grad_norm": 0.5674519795217096, + "learning_rate": 0.00019993369661251923, + "loss": 0.6184, + "step": 636 + }, + { + "epoch": 0.22179732313575526, + "grad_norm": 2.5294344265719135, + "learning_rate": 0.0001999292032465848, + "loss": 0.7686, + "step": 638 + }, + { + "epoch": 0.22249261254997393, + "grad_norm": 2.8855656605632047, + "learning_rate": 0.00019992456262784658, + "loss": 0.8215, + "step": 640 + }, + { + "epoch": 0.2231879019641926, + "grad_norm": 1.5331524159142917, + "learning_rate": 0.00019991977476314286, + "loss": 0.7057, + "step": 642 + }, + { + "epoch": 0.22388319137841126, + "grad_norm": 0.8086145005161695, + "learning_rate": 0.0001999148396595289, + "loss": 0.6289, + "step": 644 + }, + { + "epoch": 0.22457848079262993, + "grad_norm": 0.767389193699688, + "learning_rate": 0.00019990975732427693, + "loss": 0.6117, + "step": 646 + }, + { + "epoch": 0.2252737702068486, + "grad_norm": 0.9275190697426144, + "learning_rate": 0.0001999045277648761, + "loss": 0.6582, + "step": 648 + }, + { + "epoch": 0.22596905962106728, + "grad_norm": 0.8004230202091956, + "learning_rate": 0.00019989915098903257, + "loss": 0.5387, + "step": 650 + }, + { + "epoch": 0.22666434903528593, + "grad_norm": 0.8210833181388095, + "learning_rate": 0.0001998936270046694, + "loss": 0.5941, + "step": 652 + }, + { + "epoch": 0.2273596384495046, + "grad_norm": 2.1189675938584616, + "learning_rate": 0.00019988795581992656, + "loss": 0.7504, + "step": 654 + }, + { + "epoch": 0.22805492786372328, + "grad_norm": 0.5952032026226816, + "learning_rate": 0.000199882137443161, + "loss": 0.6643, + "step": 656 + }, + { + "epoch": 0.22875021727794195, + "grad_norm": 0.40481972159485846, + "learning_rate": 0.00019987617188294642, + "loss": 0.5225, + "step": 658 + }, + { + "epoch": 0.2294455066921606, + "grad_norm": 0.7478677085785272, + "learning_rate": 0.00019987005914807356, + "loss": 0.6561, + "step": 660 + }, + { + "epoch": 0.23014079610637928, + "grad_norm": 0.4468692254604696, + "learning_rate": 0.00019986379924754997, + "loss": 0.6262, + "step": 662 + }, + { + "epoch": 0.23083608552059795, + "grad_norm": 0.46697718493106893, + "learning_rate": 0.00019985739219060002, + "loss": 0.6178, + "step": 664 + }, + { + "epoch": 0.23153137493481663, + "grad_norm": 0.388728867903269, + "learning_rate": 0.000199850837986665, + "loss": 0.5544, + "step": 666 + }, + { + "epoch": 0.23222666434903527, + "grad_norm": 0.5731403139849517, + "learning_rate": 0.000199844136645403, + "loss": 0.5906, + "step": 668 + }, + { + "epoch": 0.23292195376325395, + "grad_norm": 0.7601215827849259, + "learning_rate": 0.0001998372881766889, + "loss": 0.6577, + "step": 670 + }, + { + "epoch": 0.23361724317747262, + "grad_norm": 0.8997786413980279, + "learning_rate": 0.00019983029259061446, + "loss": 0.6388, + "step": 672 + }, + { + "epoch": 0.2343125325916913, + "grad_norm": 0.519349430301096, + "learning_rate": 0.00019982314989748813, + "loss": 0.6561, + "step": 674 + }, + { + "epoch": 0.23500782200590997, + "grad_norm": 0.4918913590728881, + "learning_rate": 0.00019981586010783513, + "loss": 0.6176, + "step": 676 + }, + { + "epoch": 0.23570311142012862, + "grad_norm": 0.5324672662478441, + "learning_rate": 0.00019980842323239756, + "loss": 0.5801, + "step": 678 + }, + { + "epoch": 0.2363984008343473, + "grad_norm": 0.6375745879180794, + "learning_rate": 0.00019980083928213417, + "loss": 0.6885, + "step": 680 + }, + { + "epoch": 0.23709369024856597, + "grad_norm": 0.4317997282790841, + "learning_rate": 0.00019979310826822046, + "loss": 0.5727, + "step": 682 + }, + { + "epoch": 0.23778897966278464, + "grad_norm": 0.7933828103238656, + "learning_rate": 0.00019978523020204857, + "loss": 0.6703, + "step": 684 + }, + { + "epoch": 0.2384842690770033, + "grad_norm": 0.5465102255190097, + "learning_rate": 0.00019977720509522747, + "loss": 0.6675, + "step": 686 + }, + { + "epoch": 0.23917955849122197, + "grad_norm": 0.8356137363612883, + "learning_rate": 0.00019976903295958269, + "loss": 0.6558, + "step": 688 + }, + { + "epoch": 0.23987484790544064, + "grad_norm": 0.5190073187676806, + "learning_rate": 0.00019976071380715645, + "loss": 0.6779, + "step": 690 + }, + { + "epoch": 0.24057013731965932, + "grad_norm": 0.40561527338007225, + "learning_rate": 0.0001997522476502076, + "loss": 0.6687, + "step": 692 + }, + { + "epoch": 0.24126542673387796, + "grad_norm": 0.592821589706298, + "learning_rate": 0.0001997436345012117, + "loss": 0.6807, + "step": 694 + }, + { + "epoch": 0.24196071614809664, + "grad_norm": 0.686918345062074, + "learning_rate": 0.00019973487437286073, + "loss": 0.6831, + "step": 696 + }, + { + "epoch": 0.2426560055623153, + "grad_norm": 0.964075508243471, + "learning_rate": 0.00019972596727806346, + "loss": 0.665, + "step": 698 + }, + { + "epoch": 0.243351294976534, + "grad_norm": 0.739137434656244, + "learning_rate": 0.00019971691322994507, + "loss": 0.6387, + "step": 700 + }, + { + "epoch": 0.24404658439075266, + "grad_norm": 0.3978099419540589, + "learning_rate": 0.00019970771224184737, + "loss": 0.6143, + "step": 702 + }, + { + "epoch": 0.2447418738049713, + "grad_norm": 0.4997978607153984, + "learning_rate": 0.0001996983643273287, + "loss": 0.6083, + "step": 704 + }, + { + "epoch": 0.24543716321918999, + "grad_norm": 1.3443518380439796, + "learning_rate": 0.0001996888695001638, + "loss": 0.6711, + "step": 706 + }, + { + "epoch": 0.24613245263340866, + "grad_norm": 0.5424379336505594, + "learning_rate": 0.000199679227774344, + "loss": 0.6321, + "step": 708 + }, + { + "epoch": 0.24682774204762734, + "grad_norm": 0.7689235498835658, + "learning_rate": 0.00019966943916407712, + "loss": 0.6918, + "step": 710 + }, + { + "epoch": 0.24752303146184598, + "grad_norm": 0.6467240394468301, + "learning_rate": 0.00019965950368378734, + "loss": 0.6368, + "step": 712 + }, + { + "epoch": 0.24821832087606466, + "grad_norm": 0.48819289451999526, + "learning_rate": 0.00019964942134811532, + "loss": 0.5875, + "step": 714 + }, + { + "epoch": 0.24891361029028333, + "grad_norm": 1.1929427463467126, + "learning_rate": 0.00019963919217191807, + "loss": 0.6795, + "step": 716 + }, + { + "epoch": 0.249608899704502, + "grad_norm": 0.4182713825442439, + "learning_rate": 0.00019962881617026902, + "loss": 0.5835, + "step": 718 + }, + { + "epoch": 0.25030418911872065, + "grad_norm": 0.5770262516296942, + "learning_rate": 0.00019961829335845795, + "loss": 0.6299, + "step": 720 + }, + { + "epoch": 0.25099947853293936, + "grad_norm": 0.9135250550485389, + "learning_rate": 0.00019960762375199095, + "loss": 0.6844, + "step": 722 + }, + { + "epoch": 0.251694767947158, + "grad_norm": 0.5511234805517417, + "learning_rate": 0.0001995968073665905, + "loss": 0.5745, + "step": 724 + }, + { + "epoch": 0.25239005736137665, + "grad_norm": 0.49137872896877094, + "learning_rate": 0.00019958584421819528, + "loss": 0.698, + "step": 726 + }, + { + "epoch": 0.25308534677559535, + "grad_norm": 0.4437253322782162, + "learning_rate": 0.00019957473432296026, + "loss": 0.6864, + "step": 728 + }, + { + "epoch": 0.253780636189814, + "grad_norm": 0.5064381489074585, + "learning_rate": 0.0001995634776972567, + "loss": 0.5758, + "step": 730 + }, + { + "epoch": 0.2544759256040327, + "grad_norm": 0.5464655664741616, + "learning_rate": 0.00019955207435767201, + "loss": 0.6351, + "step": 732 + }, + { + "epoch": 0.25517121501825135, + "grad_norm": 0.44060524677853835, + "learning_rate": 0.00019954052432100982, + "loss": 0.6837, + "step": 734 + }, + { + "epoch": 0.25586650443247, + "grad_norm": 0.942390696980061, + "learning_rate": 0.00019952882760428998, + "loss": 0.6378, + "step": 736 + }, + { + "epoch": 0.2565617938466887, + "grad_norm": 0.4710023299938762, + "learning_rate": 0.00019951698422474836, + "loss": 0.6968, + "step": 738 + }, + { + "epoch": 0.25725708326090735, + "grad_norm": 0.4179809222387651, + "learning_rate": 0.00019950499419983707, + "loss": 0.5643, + "step": 740 + }, + { + "epoch": 0.257952372675126, + "grad_norm": 0.4446278865199289, + "learning_rate": 0.00019949285754722426, + "loss": 0.5089, + "step": 742 + }, + { + "epoch": 0.2586476620893447, + "grad_norm": 0.914728851966275, + "learning_rate": 0.00019948057428479418, + "loss": 0.7933, + "step": 744 + }, + { + "epoch": 0.25934295150356335, + "grad_norm": 0.47142275185055055, + "learning_rate": 0.00019946814443064703, + "loss": 0.6384, + "step": 746 + }, + { + "epoch": 0.26003824091778205, + "grad_norm": 0.720916103725334, + "learning_rate": 0.00019945556800309917, + "loss": 0.5957, + "step": 748 + }, + { + "epoch": 0.2607335303320007, + "grad_norm": 0.8550360126036364, + "learning_rate": 0.00019944284502068275, + "loss": 0.6454, + "step": 750 + }, + { + "epoch": 0.2607335303320007, + "eval_loss": 0.6373963952064514, + "eval_runtime": 728.7951, + "eval_samples_per_second": 6.644, + "eval_steps_per_second": 0.209, + "step": 750 + }, + { + "epoch": 0.26142881974621934, + "grad_norm": 0.5467512313200382, + "learning_rate": 0.0001994299755021461, + "loss": 0.5781, + "step": 752 + }, + { + "epoch": 0.26212410916043805, + "grad_norm": 0.41230384162224254, + "learning_rate": 0.0001994169594664533, + "loss": 0.6467, + "step": 754 + }, + { + "epoch": 0.2628193985746567, + "grad_norm": 0.5635895964904281, + "learning_rate": 0.00019940379693278448, + "loss": 0.6182, + "step": 756 + }, + { + "epoch": 0.2635146879888754, + "grad_norm": 0.6456168984233462, + "learning_rate": 0.0001993904879205355, + "loss": 0.6086, + "step": 758 + }, + { + "epoch": 0.26420997740309404, + "grad_norm": 0.5060399335833471, + "learning_rate": 0.00019937703244931815, + "loss": 0.6407, + "step": 760 + }, + { + "epoch": 0.2649052668173127, + "grad_norm": 0.5033297464646784, + "learning_rate": 0.00019936343053896004, + "loss": 0.6157, + "step": 762 + }, + { + "epoch": 0.2656005562315314, + "grad_norm": 0.3911665523252255, + "learning_rate": 0.00019934968220950458, + "loss": 0.6227, + "step": 764 + }, + { + "epoch": 0.26629584564575004, + "grad_norm": 1.7130937466256138, + "learning_rate": 0.00019933578748121086, + "loss": 0.5994, + "step": 766 + }, + { + "epoch": 0.2669911350599687, + "grad_norm": 0.5747338886603724, + "learning_rate": 0.00019932174637455382, + "loss": 0.6238, + "step": 768 + }, + { + "epoch": 0.2676864244741874, + "grad_norm": 0.6226324357252033, + "learning_rate": 0.00019930755891022398, + "loss": 0.6255, + "step": 770 + }, + { + "epoch": 0.26838171388840604, + "grad_norm": 0.5282488794229044, + "learning_rate": 0.00019929322510912756, + "loss": 0.5808, + "step": 772 + }, + { + "epoch": 0.26907700330262474, + "grad_norm": 0.5596904577167024, + "learning_rate": 0.0001992787449923865, + "loss": 0.5361, + "step": 774 + }, + { + "epoch": 0.2697722927168434, + "grad_norm": 1.0477422618379753, + "learning_rate": 0.00019926411858133824, + "loss": 0.54, + "step": 776 + }, + { + "epoch": 0.27046758213106203, + "grad_norm": 1.1314704495635823, + "learning_rate": 0.00019924934589753582, + "loss": 0.5869, + "step": 778 + }, + { + "epoch": 0.27116287154528074, + "grad_norm": 0.5426548544381972, + "learning_rate": 0.00019923442696274794, + "loss": 0.5951, + "step": 780 + }, + { + "epoch": 0.2718581609594994, + "grad_norm": 0.8480025293040686, + "learning_rate": 0.00019921936179895862, + "loss": 0.6003, + "step": 782 + }, + { + "epoch": 0.2725534503737181, + "grad_norm": 0.5729452380906337, + "learning_rate": 0.0001992041504283675, + "loss": 0.6526, + "step": 784 + }, + { + "epoch": 0.27324873978793673, + "grad_norm": 0.7362085286496177, + "learning_rate": 0.00019918879287338957, + "loss": 0.6776, + "step": 786 + }, + { + "epoch": 0.2739440292021554, + "grad_norm": 0.7440059372391256, + "learning_rate": 0.00019917328915665535, + "loss": 0.6486, + "step": 788 + }, + { + "epoch": 0.2746393186163741, + "grad_norm": 0.6110842206790659, + "learning_rate": 0.0001991576393010106, + "loss": 0.6226, + "step": 790 + }, + { + "epoch": 0.27533460803059273, + "grad_norm": 0.8002336898560896, + "learning_rate": 0.00019914184332951655, + "loss": 0.6215, + "step": 792 + }, + { + "epoch": 0.2760298974448114, + "grad_norm": 0.6761736356192558, + "learning_rate": 0.00019912590126544964, + "loss": 0.5988, + "step": 794 + }, + { + "epoch": 0.2767251868590301, + "grad_norm": 1.1005016630123619, + "learning_rate": 0.00019910981313230172, + "loss": 0.6213, + "step": 796 + }, + { + "epoch": 0.27742047627324873, + "grad_norm": 0.6513452605734942, + "learning_rate": 0.00019909357895377973, + "loss": 0.682, + "step": 798 + }, + { + "epoch": 0.27811576568746743, + "grad_norm": 0.8536492677008404, + "learning_rate": 0.0001990771987538059, + "loss": 0.707, + "step": 800 + }, + { + "epoch": 0.2788110551016861, + "grad_norm": 0.3362293750538688, + "learning_rate": 0.00019906067255651765, + "loss": 0.7108, + "step": 802 + }, + { + "epoch": 0.2795063445159047, + "grad_norm": 0.4792899916449288, + "learning_rate": 0.0001990440003862675, + "loss": 0.6055, + "step": 804 + }, + { + "epoch": 0.28020163393012343, + "grad_norm": 1.272937677307704, + "learning_rate": 0.00019902718226762304, + "loss": 0.6816, + "step": 806 + }, + { + "epoch": 0.2808969233443421, + "grad_norm": 0.30646692495778655, + "learning_rate": 0.00019901021822536704, + "loss": 0.688, + "step": 808 + }, + { + "epoch": 0.2815922127585608, + "grad_norm": 0.3035733218665055, + "learning_rate": 0.00019899310828449713, + "loss": 0.6746, + "step": 810 + } + ], + "logging_steps": 2, + "max_steps": 5752, + "num_input_tokens_seen": 0, + "num_train_epochs": 2, + "save_steps": 90, + "stateful_callbacks": { + "TrainerControl": { + "args": { + "should_epoch_stop": false, + "should_evaluate": false, + "should_log": false, + "should_save": true, + "should_training_stop": false + }, + "attributes": {} + } + }, + "total_flos": 3226887842168832.0, + "train_batch_size": 4, + "trial_name": null, + "trial_params": null +} diff --git a/checkpoint-810/training_args.bin b/checkpoint-810/training_args.bin new file mode 100644 index 0000000000000000000000000000000000000000..fba3b63792fed5a70be0307e26ba27ef584b1528 --- /dev/null +++ b/checkpoint-810/training_args.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b72add547acd6c009f3a3770072d0cdf7de7e797c7597084319db874a556e470 +size 6904 diff --git a/checkpoint-810/zero_to_fp32.py b/checkpoint-810/zero_to_fp32.py new file mode 100644 index 0000000000000000000000000000000000000000..0e759146cadd92ddfefab3680146c2bd6a2b5c04 --- /dev/null +++ b/checkpoint-810/zero_to_fp32.py @@ -0,0 +1,760 @@ +#!/usr/bin/env python + +# Copyright (c) Microsoft Corporation. +# SPDX-License-Identifier: Apache-2.0 + +# DeepSpeed Team + +# This script extracts fp32 consolidated weights from a zero 1, 2 and 3 DeepSpeed checkpoints. It gets +# copied into the top level checkpoint dir, so the user can easily do the conversion at any point in +# the future. Once extracted, the weights don't require DeepSpeed and can be used in any +# application. +# +# example: +# python zero_to_fp32.py . output_dir/ +# or +# python zero_to_fp32.py . output_dir/ --safe_serialization + +import argparse +import torch +import glob +import math +import os +import re +import gc +import json +import numpy as np +from tqdm import tqdm +from collections import OrderedDict +from dataclasses import dataclass + +# while this script doesn't use deepspeed to recover data, since the checkpoints are pickled with +# DeepSpeed data structures it has to be available in the current python environment. +from deepspeed.utils import logger +from deepspeed.checkpoint.constants import (DS_VERSION, OPTIMIZER_STATE_DICT, SINGLE_PARTITION_OF_FP32_GROUPS, + FP32_FLAT_GROUPS, ZERO_STAGE, PARTITION_COUNT, PARAM_SHAPES, BUFFER_NAMES, + FROZEN_PARAM_SHAPES, FROZEN_PARAM_FRAGMENTS) + + +@dataclass +class zero_model_state: + buffers: dict() + param_shapes: dict() + shared_params: list + ds_version: int + frozen_param_shapes: dict() + frozen_param_fragments: dict() + + +debug = 0 + +# load to cpu +device = torch.device('cpu') + + +def atoi(text): + return int(text) if text.isdigit() else text + + +def natural_keys(text): + ''' + alist.sort(key=natural_keys) sorts in human order + http://nedbatchelder.com/blog/200712/human_sorting.html + (See Toothy's implementation in the comments) + ''' + return [atoi(c) for c in re.split(r'(\d+)', text)] + + +def get_model_state_file(checkpoint_dir, zero_stage): + if not os.path.isdir(checkpoint_dir): + raise FileNotFoundError(f"Directory '{checkpoint_dir}' doesn't exist") + + # there should be only one file + if zero_stage <= 2: + file = os.path.join(checkpoint_dir, "mp_rank_00_model_states.pt") + elif zero_stage == 3: + file = os.path.join(checkpoint_dir, "zero_pp_rank_0_mp_rank_00_model_states.pt") + + if not os.path.exists(file): + raise FileNotFoundError(f"can't find model states file at '{file}'") + + return file + + +def get_checkpoint_files(checkpoint_dir, glob_pattern): + # XXX: need to test that this simple glob rule works for multi-node setup too + ckpt_files = sorted(glob.glob(os.path.join(checkpoint_dir, glob_pattern)), key=natural_keys) + + if len(ckpt_files) == 0: + raise FileNotFoundError(f"can't find {glob_pattern} files in directory '{checkpoint_dir}'") + + return ckpt_files + + +def get_optim_files(checkpoint_dir): + return get_checkpoint_files(checkpoint_dir, "*_optim_states.pt") + + +def get_model_state_files(checkpoint_dir): + return get_checkpoint_files(checkpoint_dir, "*_model_states.pt") + + +def parse_model_states(files): + zero_model_states = [] + for file in files: + state_dict = torch.load(file, map_location=device, weights_only=False) + + if BUFFER_NAMES not in state_dict: + raise ValueError(f"{file} is not a model state checkpoint") + buffer_names = state_dict[BUFFER_NAMES] + if debug: + print("Found buffers:", buffer_names) + + # recover just the buffers while restoring them to fp32 if they were saved in fp16 + buffers = {k: v.float() for k, v in state_dict["module"].items() if k in buffer_names} + param_shapes = state_dict[PARAM_SHAPES] + + # collect parameters that are included in param_shapes + param_names = [] + for s in param_shapes: + for name in s.keys(): + param_names.append(name) + + # update with frozen parameters + frozen_param_shapes = state_dict.get(FROZEN_PARAM_SHAPES, None) + if frozen_param_shapes is not None: + if debug: + print(f"Found frozen_param_shapes: {frozen_param_shapes}") + param_names += list(frozen_param_shapes.keys()) + + # handle shared params + shared_params = [[k, v] for k, v in state_dict["shared_params"].items()] + + ds_version = state_dict.get(DS_VERSION, None) + + frozen_param_fragments = state_dict.get(FROZEN_PARAM_FRAGMENTS, None) + + z_model_state = zero_model_state(buffers=buffers, + param_shapes=param_shapes, + shared_params=shared_params, + ds_version=ds_version, + frozen_param_shapes=frozen_param_shapes, + frozen_param_fragments=frozen_param_fragments) + zero_model_states.append(z_model_state) + + return zero_model_states + + +def parse_optim_states(files, ds_checkpoint_dir): + total_files = len(files) + state_dicts = [] + for f in tqdm(files, desc='Loading checkpoint shards'): + state_dict = torch.load(f, map_location=device, mmap=True, weights_only=False) + # immediately discard the potentially huge 2 optimizer states as we only care for fp32 master weights + # and also handle the case where it was already removed by another helper script + state_dict["optimizer_state_dict"].pop("optimizer_state_dict", None) + state_dicts.append(state_dict) + + if not ZERO_STAGE in state_dicts[0][OPTIMIZER_STATE_DICT]: + raise ValueError(f"{files[0]} is not a zero checkpoint") + zero_stage = state_dicts[0][OPTIMIZER_STATE_DICT][ZERO_STAGE] + world_size = state_dicts[0][OPTIMIZER_STATE_DICT][PARTITION_COUNT] + + # For ZeRO-2 each param group can have different partition_count as data parallelism for expert + # parameters can be different from data parallelism for non-expert parameters. So we can just + # use the max of the partition_count to get the dp world_size. + + if type(world_size) is list: + world_size = max(world_size) + + if world_size != total_files: + raise ValueError( + f"Expected {world_size} of '*_optim_states.pt' under '{ds_checkpoint_dir}' but found {total_files} files. " + "Possibly due to an overwrite of an old checkpoint, or a checkpoint didn't get saved by one or more processes." + ) + + # the groups are named differently in each stage + if zero_stage <= 2: + fp32_groups_key = SINGLE_PARTITION_OF_FP32_GROUPS + elif zero_stage == 3: + fp32_groups_key = FP32_FLAT_GROUPS + else: + raise ValueError(f"unknown zero stage {zero_stage}") + + fp32_flat_groups = [state_dicts[i][OPTIMIZER_STATE_DICT][fp32_groups_key] for i in range(len(state_dicts))] + return zero_stage, world_size, fp32_flat_groups + + +def _get_fp32_state_dict_from_zero_checkpoint(ds_checkpoint_dir, exclude_frozen_parameters): + """ + Returns fp32 state_dict reconstructed from ds checkpoint + + Args: + - ``ds_checkpoint_dir``: path to the deepspeed checkpoint folder (where the optimizer files are) + + """ + print(f"Processing zero checkpoint '{ds_checkpoint_dir}'") + + optim_files = get_optim_files(ds_checkpoint_dir) + zero_stage, world_size, fp32_flat_groups = parse_optim_states(optim_files, ds_checkpoint_dir) + print(f"Detected checkpoint of type zero stage {zero_stage}, world_size: {world_size}") + + model_files = get_model_state_files(ds_checkpoint_dir) + + zero_model_states = parse_model_states(model_files) + print(f'Parsing checkpoint created by deepspeed=={zero_model_states[0].ds_version}') + + if zero_stage <= 2: + return _get_fp32_state_dict_from_zero2_checkpoint(world_size, fp32_flat_groups, zero_model_states, + exclude_frozen_parameters) + elif zero_stage == 3: + return _get_fp32_state_dict_from_zero3_checkpoint(world_size, fp32_flat_groups, zero_model_states, + exclude_frozen_parameters) + + +def _zero2_merge_frozen_params(state_dict, zero_model_states): + if zero_model_states[0].frozen_param_shapes is None or len(zero_model_states[0].frozen_param_shapes) == 0: + return + + frozen_param_shapes = zero_model_states[0].frozen_param_shapes + frozen_param_fragments = zero_model_states[0].frozen_param_fragments + + if debug: + num_elem = sum(s.numel() for s in frozen_param_shapes.values()) + print(f'rank 0: {FROZEN_PARAM_SHAPES}.numel = {num_elem}') + + wanted_params = len(frozen_param_shapes) + wanted_numel = sum(s.numel() for s in frozen_param_shapes.values()) + avail_numel = sum([p.numel() for p in frozen_param_fragments.values()]) + print(f'Frozen params: Have {avail_numel} numels to process.') + print(f'Frozen params: Need {wanted_numel} numels in {wanted_params} params') + + total_params = 0 + total_numel = 0 + for name, shape in frozen_param_shapes.items(): + total_params += 1 + unpartitioned_numel = shape.numel() + total_numel += unpartitioned_numel + + state_dict[name] = frozen_param_fragments[name] + + if debug: + print(f"{name} full shape: {shape} unpartitioned numel {unpartitioned_numel} ") + + print(f"Reconstructed Frozen fp32 state dict with {total_params} params {total_numel} elements") + + +def _has_callable(obj, fn): + attr = getattr(obj, fn, None) + return callable(attr) + + +def _zero2_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states): + param_shapes = zero_model_states[0].param_shapes + + # Reconstruction protocol: + # + # XXX: document this + + if debug: + for i in range(world_size): + for j in range(len(fp32_flat_groups[0])): + print(f"{FP32_FLAT_GROUPS}[{i}][{j}].shape={fp32_flat_groups[i][j].shape}") + + # XXX: memory usage doubles here (zero2) + num_param_groups = len(fp32_flat_groups[0]) + merged_single_partition_of_fp32_groups = [] + for i in range(num_param_groups): + merged_partitions = [sd[i] for sd in fp32_flat_groups] + full_single_fp32_vector = torch.cat(merged_partitions, 0) + merged_single_partition_of_fp32_groups.append(full_single_fp32_vector) + avail_numel = sum( + [full_single_fp32_vector.numel() for full_single_fp32_vector in merged_single_partition_of_fp32_groups]) + + if debug: + wanted_params = sum([len(shapes) for shapes in param_shapes]) + wanted_numel = sum([sum(shape.numel() for shape in shapes.values()) for shapes in param_shapes]) + # not asserting if there is a mismatch due to possible padding + print(f"Have {avail_numel} numels to process.") + print(f"Need {wanted_numel} numels in {wanted_params} params.") + + # params + # XXX: for huge models that can't fit into the host's RAM we will have to recode this to support + # out-of-core computing solution + total_numel = 0 + total_params = 0 + for shapes, full_single_fp32_vector in zip(param_shapes, merged_single_partition_of_fp32_groups): + offset = 0 + avail_numel = full_single_fp32_vector.numel() + for name, shape in shapes.items(): + + unpartitioned_numel = shape.numel() if _has_callable(shape, 'numel') else math.prod(shape) + total_numel += unpartitioned_numel + total_params += 1 + + if debug: + print(f"{name} full shape: {shape} unpartitioned numel {unpartitioned_numel} ") + state_dict[name] = full_single_fp32_vector.narrow(0, offset, unpartitioned_numel).view(shape) + offset += unpartitioned_numel + + # Z2 started to align to 2*world_size to improve nccl performance. Therefore both offset and + # avail_numel can differ by anywhere between 0..2*world_size. Due to two unrelated complex + # paddings performed in the code it's almost impossible to predict the exact numbers w/o the + # live optimizer object, so we are checking that the numbers are within the right range + align_to = 2 * world_size + + def zero2_align(x): + return align_to * math.ceil(x / align_to) + + if debug: + print(f"original offset={offset}, avail_numel={avail_numel}") + + offset = zero2_align(offset) + avail_numel = zero2_align(avail_numel) + + if debug: + print(f"aligned offset={offset}, avail_numel={avail_numel}") + + # Sanity check + if offset != avail_numel: + raise ValueError(f"consumed {offset} numels out of {avail_numel} - something is wrong") + + print(f"Reconstructed fp32 state dict with {total_params} params {total_numel} elements") + + +def _get_fp32_state_dict_from_zero2_checkpoint(world_size, fp32_flat_groups, zero_model_states, + exclude_frozen_parameters): + state_dict = OrderedDict() + + # buffers + buffers = zero_model_states[0].buffers + state_dict.update(buffers) + if debug: + print(f"added {len(buffers)} buffers") + + if not exclude_frozen_parameters: + _zero2_merge_frozen_params(state_dict, zero_model_states) + + _zero2_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states) + + # recover shared parameters + for pair in zero_model_states[0].shared_params: + if pair[1] in state_dict: + state_dict[pair[0]] = state_dict[pair[1]] + + return state_dict + + +def zero3_partitioned_param_info(unpartitioned_numel, world_size): + remainder = unpartitioned_numel % world_size + padding_numel = (world_size - remainder) if remainder else 0 + partitioned_numel = math.ceil(unpartitioned_numel / world_size) + return partitioned_numel, padding_numel + + +def _zero3_merge_frozen_params(state_dict, world_size, zero_model_states): + if zero_model_states[0].frozen_param_shapes is None or len(zero_model_states[0].frozen_param_shapes) == 0: + return + + if debug: + for i in range(world_size): + num_elem = sum(s.numel() for s in zero_model_states[i].frozen_param_fragments.values()) + print(f'rank {i}: {FROZEN_PARAM_SHAPES}.numel = {num_elem}') + + frozen_param_shapes = zero_model_states[0].frozen_param_shapes + wanted_params = len(frozen_param_shapes) + wanted_numel = sum(s.numel() for s in frozen_param_shapes.values()) + avail_numel = sum([p.numel() for p in zero_model_states[0].frozen_param_fragments.values()]) * world_size + print(f'Frozen params: Have {avail_numel} numels to process.') + print(f'Frozen params: Need {wanted_numel} numels in {wanted_params} params') + + total_params = 0 + total_numel = 0 + for name, shape in zero_model_states[0].frozen_param_shapes.items(): + total_params += 1 + unpartitioned_numel = shape.numel() + total_numel += unpartitioned_numel + + param_frags = tuple(model_state.frozen_param_fragments[name] for model_state in zero_model_states) + state_dict[name] = torch.cat(param_frags, 0).narrow(0, 0, unpartitioned_numel).view(shape) + + partitioned_numel, partitioned_padding_numel = zero3_partitioned_param_info(unpartitioned_numel, world_size) + + if debug: + print( + f"Frozen params: {total_params} {name} full shape: {shape} partition0 numel={partitioned_numel} partitioned_padding_numel={partitioned_padding_numel}" + ) + + print(f"Reconstructed Frozen fp32 state dict with {total_params} params {total_numel} elements") + + +class GatheredTensor: + """ + A pseudo tensor that collects partitioned weights. + It is more memory efficient when there are multiple groups. + """ + + def __init__(self, flat_groups, flat_groups_offset, offset, partitioned_numel, shape): + self.flat_groups = flat_groups + self.flat_groups_offset = flat_groups_offset + self.offset = offset + self.partitioned_numel = partitioned_numel + self.shape = shape + self.dtype = self.flat_groups[0][0].dtype + + def contiguous(self): + """ + Merge partitioned weights from flat_groups into a single tensor. + """ + end_idx = self.offset + self.partitioned_numel + world_size = len(self.flat_groups) + pad_flat_param_chunks = [] + + for rank_i in range(world_size): + # for each rank, we need to collect weights from related group/groups + flat_groups_at_rank_i = self.flat_groups[rank_i] + start_group_id = None + end_group_id = None + for group_id in range(len(self.flat_groups_offset)): + if self.flat_groups_offset[group_id] <= self.offset < self.flat_groups_offset[group_id + 1]: + start_group_id = group_id + if self.flat_groups_offset[group_id] < end_idx <= self.flat_groups_offset[group_id + 1]: + end_group_id = group_id + break + # collect weights from related group/groups + for group_id in range(start_group_id, end_group_id + 1): + flat_tensor = flat_groups_at_rank_i[group_id] + start_offset = self.offset - self.flat_groups_offset[group_id] + end_offset = min(end_idx, self.flat_groups_offset[group_id + 1]) - self.flat_groups_offset[group_id] + pad_flat_param_chunks.append(flat_tensor[start_offset:end_offset]) + + # collect weights from all ranks + pad_flat_param = torch.cat(pad_flat_param_chunks, dim=0) + param = pad_flat_param[:self.shape.numel()].view(self.shape).contiguous() + return param + + +def _zero3_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states): + param_shapes = zero_model_states[0].param_shapes + avail_numel = sum([flat_group.numel() for flat_group in fp32_flat_groups[0]]) * world_size + + # Reconstruction protocol: For zero3 we need to zip the partitions together at boundary of each + # param, re-consolidating each param, while dealing with padding if any + + # merge list of dicts, preserving order + param_shapes = {k: v for d in param_shapes for k, v in d.items()} + + if debug: + for i in range(world_size): + print(f"{FP32_FLAT_GROUPS}[{i}].shape={fp32_flat_groups[i].shape}") + + wanted_params = len(param_shapes) + wanted_numel = sum(shape.numel() for shape in param_shapes.values()) + # not asserting if there is a mismatch due to possible padding + avail_numel = fp32_flat_groups[0].numel() * world_size + print(f"Trainable params: Have {avail_numel} numels to process.") + print(f"Trainable params: Need {wanted_numel} numels in {wanted_params} params.") + + # params + # XXX: for huge models that can't fit into the host's RAM we will have to recode this to support + # out-of-core computing solution + offset = 0 + total_numel = 0 + total_params = 0 + flat_groups_offset = [0] + list(np.cumsum([flat_tensor.numel() for flat_tensor in fp32_flat_groups[0]])) + for name, shape in tqdm(param_shapes.items(), desc='Gathering sharded weights'): + unpartitioned_numel = shape.numel() + total_numel += unpartitioned_numel + total_params += 1 + partitioned_numel, partitioned_padding_numel = zero3_partitioned_param_info(unpartitioned_numel, world_size) + + if debug: + print( + f"Trainable params: {total_params} {name} full shape: {shape} partition0 numel={partitioned_numel} partitioned_padding_numel={partitioned_padding_numel}" + ) + + # memory efficient tensor + tensor = GatheredTensor(fp32_flat_groups, flat_groups_offset, offset, partitioned_numel, shape) + state_dict[name] = tensor + offset += partitioned_numel + + offset *= world_size + + # Sanity check + if offset != avail_numel: + raise ValueError(f"consumed {offset} numels out of {avail_numel} - something is wrong") + + print(f"Reconstructed Trainable fp32 state dict with {total_params} params {total_numel} elements") + + +def _get_fp32_state_dict_from_zero3_checkpoint(world_size, fp32_flat_groups, zero_model_states, + exclude_frozen_parameters): + state_dict = OrderedDict() + + # buffers + buffers = zero_model_states[0].buffers + state_dict.update(buffers) + if debug: + print(f"added {len(buffers)} buffers") + + if not exclude_frozen_parameters: + _zero3_merge_frozen_params(state_dict, world_size, zero_model_states) + + _zero3_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states) + + # recover shared parameters + for pair in zero_model_states[0].shared_params: + if pair[1] in state_dict: + state_dict[pair[0]] = state_dict[pair[1]] + + return state_dict + + +def to_torch_tensor(state_dict, return_empty_tensor=False): + """ + Convert state_dict of GatheredTensor to torch tensor + """ + torch_state_dict = {} + converted_tensors = {} + for name, tensor in state_dict.items(): + tensor_id = id(tensor) + if tensor_id in converted_tensors: # shared tensors + shared_tensor = torch_state_dict[converted_tensors[tensor_id]] + torch_state_dict[name] = shared_tensor + else: + converted_tensors[tensor_id] = name + if return_empty_tensor: + torch_state_dict[name] = torch.empty(tensor.shape, dtype=tensor.dtype) + else: + torch_state_dict[name] = tensor.contiguous() + return torch_state_dict + + +def get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir, + tag=None, + exclude_frozen_parameters=False, + lazy_mode=False): + """ + Convert ZeRO 2 or 3 checkpoint into a single fp32 consolidated state_dict that can be loaded with + ``load_state_dict()`` and used for training without DeepSpeed or shared with others, for example + via a model hub. + + Args: + - ``checkpoint_dir``: path to the desired checkpoint folder + - ``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`` + - ``exclude_frozen_parameters``: exclude frozen parameters + - ``lazy_mode``: get state_dict in lazy mode. It returns a dict of pesduo tensor instead of torch tensor, which is more memory efficient. + Convert the pesduo tensor to torch tensor by ``.contiguous()`` + + Returns: + - pytorch ``state_dict`` + + A typical usage might be :: + + from deepspeed.utils.zero_to_fp32 import get_fp32_state_dict_from_zero_checkpoint + # do the training and checkpoint saving + state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir) # already on cpu + model = model.cpu() # move to cpu + model.load_state_dict(state_dict) + # submit to model hub or save the model to share with others + + In this example the ``model`` will no longer be usable in the deepspeed context of the same + application. i.e. you will need to re-initialize the deepspeed engine, since + ``model.load_state_dict(state_dict)`` will remove all the deepspeed magic from it. + + If you want it all done for you, use ``load_state_dict_from_zero_checkpoint`` instead. + + Note: the above usage may not work if your application doesn't have sufficient free CPU memory. + You may need to use the offline approach using the ``zero_to_fp32.py`` script that is saved with + the checkpoint. Or you can load state_dict in lazy mode :: + + from deepspeed.utils.zero_to_fp32 import get_fp32_state_dict_from_zero_checkpoint + state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir, lazy_mode=True) # not on cpu + for name, lazy_tensor in state_dict.item(): + tensor = lazy_tensor.contiguous() # to cpu + print(name, tensor) + # del tensor to release memory if it no longer in use + """ + if tag is None: + latest_path = os.path.join(checkpoint_dir, 'latest') + if os.path.isfile(latest_path): + with open(latest_path, 'r') as fd: + tag = fd.read().strip() + else: + raise ValueError(f"Unable to find 'latest' file at {latest_path}") + + ds_checkpoint_dir = os.path.join(checkpoint_dir, tag) + + if not os.path.isdir(ds_checkpoint_dir): + raise FileNotFoundError(f"Directory '{ds_checkpoint_dir}' doesn't exist") + + state_dict = _get_fp32_state_dict_from_zero_checkpoint(ds_checkpoint_dir, exclude_frozen_parameters) + if lazy_mode: + return state_dict + else: + return to_torch_tensor(state_dict) + + +def convert_zero_checkpoint_to_fp32_state_dict(checkpoint_dir, + output_dir, + max_shard_size="5GB", + safe_serialization=False, + tag=None, + exclude_frozen_parameters=False): + """ + Convert ZeRO 2 or 3 checkpoint into a single fp32 consolidated ``state_dict`` file that can be + loaded with ``torch.load(file)`` + ``load_state_dict()`` and used for training without DeepSpeed. + + Args: + - ``checkpoint_dir``: path to the desired checkpoint folder. (one that contains the tag-folder, like ``global_step14``) + - ``output_dir``: directory to the pytorch fp32 state_dict output files + - ``max_shard_size``: the maximum size for a checkpoint before being sharded, default value is 5GB + - ``safe_serialization``: whether to save the model using `safetensors` or the traditional PyTorch way (that uses `pickle`). + - ``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`` + - ``exclude_frozen_parameters``: exclude frozen parameters + """ + + # Dependency pre-check + if safe_serialization: + try: + from safetensors.torch import save_file + except ImportError: + print('If you want to use `safe_serialization`, please `pip install safetensors`') + raise + if max_shard_size is not None: + try: + from huggingface_hub import split_torch_state_dict_into_shards + except ImportError: + print('If you want to use `max_shard_size`, please `pip install huggingface_hub`') + raise + + # Convert zero checkpoint to state_dict + state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir, + tag, + exclude_frozen_parameters, + lazy_mode=True) + + # Shard the model if it is too big. + weights_name = "model.safetensors" if safe_serialization else "pytorch_model.bin" + if max_shard_size is not None: + filename_pattern = weights_name.replace(".bin", "{suffix}.bin").replace(".safetensors", "{suffix}.safetensors") + # an memory-efficient approach for sharding + empty_state_dict = to_torch_tensor(state_dict, return_empty_tensor=True) + state_dict_split = split_torch_state_dict_into_shards(empty_state_dict, + filename_pattern=filename_pattern, + max_shard_size=max_shard_size) + else: + from collections import namedtuple + StateDictSplit = namedtuple("StateDictSplit", ["is_sharded", "filename_to_tensors"]) + state_dict_split = StateDictSplit(is_sharded=False, + filename_to_tensors={weights_name: list(state_dict.keys())}) + + # Save the model by shard + os.makedirs(output_dir, exist_ok=True) + filename_to_tensors = state_dict_split.filename_to_tensors.items() + for shard_file, tensors in tqdm(filename_to_tensors, desc="Saving checkpoint shards"): + shard_state_dict = {tensor_name: state_dict[tensor_name] for tensor_name in tensors} + shard_state_dict = to_torch_tensor(shard_state_dict) + output_path = os.path.join(output_dir, shard_file) + if safe_serialization: + save_file(shard_state_dict, output_path, metadata={"format": "pt"}) + else: + torch.save(shard_state_dict, output_path) + # release the memory of current shard + for tensor_name in list(shard_state_dict.keys()): + del state_dict[tensor_name] + del shard_state_dict[tensor_name] + del shard_state_dict + gc.collect() + + # Save index if sharded + if state_dict_split.is_sharded: + index = { + "metadata": state_dict_split.metadata, + "weight_map": state_dict_split.tensor_to_filename, + } + save_index_file = "model.safetensors.index.json" if safe_serialization else "pytorch_model.bin.index.json" + save_index_file = os.path.join(output_dir, save_index_file) + with open(save_index_file, "w", encoding="utf-8") as f: + content = json.dumps(index, indent=2, sort_keys=True) + "\n" + f.write(content) + + +def load_state_dict_from_zero_checkpoint(model, checkpoint_dir, tag=None): + """ + 1. Put the provided model to cpu + 2. Convert ZeRO 2 or 3 checkpoint into a single fp32 consolidated ``state_dict`` + 3. Load it into the provided model + + Args: + - ``model``: the model object to update + - ``checkpoint_dir``: path to the desired checkpoint folder. (one that contains the tag-folder, like ``global_step14``) + - ``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`` + + Returns: + - ``model`: modified model + + Make sure you have plenty of CPU memory available before you call this function. If you don't + have enough use the ``zero_to_fp32.py`` utility to do the conversion. You will find it + conveniently placed for you in the checkpoint folder. + + A typical usage might be :: + + from deepspeed.utils.zero_to_fp32 import load_state_dict_from_zero_checkpoint + model = load_state_dict_from_zero_checkpoint(trainer.model, checkpoint_dir) + # submit to model hub or save the model to share with others + + Note, that once this was run, the ``model`` will no longer be usable in the deepspeed context + of the same application. i.e. you will need to re-initialize the deepspeed engine, since + ``model.load_state_dict(state_dict)`` will remove all the deepspeed magic from it. + + """ + logger.info(f"Extracting fp32 weights") + state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir, tag) + + logger.info(f"Overwriting model with fp32 weights") + model = model.cpu() + model.load_state_dict(state_dict, strict=False) + + return model + + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + parser.add_argument("checkpoint_dir", + type=str, + help="path to the desired checkpoint folder, e.g., path/checkpoint-12") + parser.add_argument("output_dir", + type=str, + help="directory to the pytorch fp32 state_dict output files" + "(e.g. path/checkpoint-12-output/)") + parser.add_argument( + "--max_shard_size", + type=str, + default="5GB", + help="The maximum size for a checkpoint before being sharded. Checkpoints shard will then be each of size" + "lower than this size. If expressed as a string, needs to be digits followed by a unit (like `5MB`" + "We default it to 5GB in order for models to be able to run easily on free-tier google colab instances" + "without CPU OOM issues.") + parser.add_argument( + "--safe_serialization", + default=False, + action='store_true', + help="Whether to save the model using `safetensors` or the traditional PyTorch way (that uses `pickle`).") + parser.add_argument("-t", + "--tag", + type=str, + default=None, + help="checkpoint tag used as a unique identifier for checkpoint. e.g., global_step1") + parser.add_argument("--exclude_frozen_parameters", action='store_true', help="exclude frozen parameters") + parser.add_argument("-d", "--debug", action='store_true', help="enable debug") + args = parser.parse_args() + + debug = args.debug + + convert_zero_checkpoint_to_fp32_state_dict(args.checkpoint_dir, + args.output_dir, + max_shard_size=args.max_shard_size, + safe_serialization=args.safe_serialization, + tag=args.tag, + exclude_frozen_parameters=args.exclude_frozen_parameters) diff --git a/checkpoint-900/README.md b/checkpoint-900/README.md new file mode 100644 index 0000000000000000000000000000000000000000..4eae946233309baf42f5bad9740186144a4f3b33 --- /dev/null +++ b/checkpoint-900/README.md @@ -0,0 +1,202 @@ +--- +base_model: ../../initial_seq_model +library_name: peft +--- + +# Model Card for Model ID + + + + + +## Model Details + +### Model Description + + + + + +- **Developed by:** [More Information Needed] +- **Funded by [optional]:** [More Information Needed] +- **Shared by [optional]:** [More Information Needed] +- **Model type:** [More Information Needed] +- **Language(s) (NLP):** [More Information Needed] +- **License:** [More Information Needed] +- **Finetuned from model [optional]:** [More Information Needed] + +### Model Sources [optional] + + + +- **Repository:** [More Information Needed] +- **Paper [optional]:** [More Information Needed] +- **Demo [optional]:** [More Information Needed] + +## Uses + + + +### Direct Use + + + +[More Information Needed] + +### Downstream Use [optional] + + + +[More Information Needed] + +### Out-of-Scope Use + + + +[More Information Needed] + +## Bias, Risks, and Limitations + + + +[More Information Needed] + +### Recommendations + + + +Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations. + +## How to Get Started with the Model + +Use the code below to get started with the model. + +[More Information Needed] + +## Training Details + +### Training Data + + + +[More Information Needed] + +### Training Procedure + + + +#### Preprocessing [optional] + +[More Information Needed] + + +#### Training Hyperparameters + +- **Training regime:** [More Information Needed] + +#### Speeds, Sizes, Times [optional] + + + +[More Information Needed] + +## Evaluation + + + +### Testing Data, Factors & Metrics + +#### Testing Data + + + +[More Information Needed] + +#### Factors + + + +[More Information Needed] + +#### Metrics + + + +[More Information Needed] + +### Results + +[More Information Needed] + +#### Summary + + + +## Model Examination [optional] + + + +[More Information Needed] + +## Environmental Impact + + + +Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700). + +- **Hardware Type:** [More Information Needed] +- **Hours used:** [More Information Needed] +- **Cloud Provider:** [More Information Needed] +- **Compute Region:** [More Information Needed] +- **Carbon Emitted:** [More Information Needed] + +## Technical Specifications [optional] + +### Model Architecture and Objective + +[More Information Needed] + +### Compute Infrastructure + +[More Information Needed] + +#### Hardware + +[More Information Needed] + +#### Software + +[More Information Needed] + +## Citation [optional] + + + +**BibTeX:** + +[More Information Needed] + +**APA:** + +[More Information Needed] + +## Glossary [optional] + + + +[More Information Needed] + +## More Information [optional] + +[More Information Needed] + +## Model Card Authors [optional] + +[More Information Needed] + +## Model Card Contact + +[More Information Needed] +### Framework versions + +- PEFT 0.14.0 \ No newline at end of file diff --git a/checkpoint-900/adapter_config.json b/checkpoint-900/adapter_config.json new file mode 100644 index 0000000000000000000000000000000000000000..e1a650486f9ba9bab8c8dbb7d564bdc4ec121cf7 --- /dev/null +++ b/checkpoint-900/adapter_config.json @@ -0,0 +1,38 @@ +{ + "alpha_pattern": {}, + "auto_mapping": null, + "base_model_name_or_path": "../../initial_seq_model", + "bias": "none", + "eva_config": null, + "exclude_modules": null, + "fan_in_fan_out": false, + "inference_mode": true, + "init_lora_weights": true, + "layer_replication": null, + "layers_pattern": null, + "layers_to_transform": null, + "loftq_config": {}, + "lora_alpha": 16, + "lora_bias": false, + "lora_dropout": 0.1, + "megatron_config": null, + "megatron_core": "megatron.core", + "modules_to_save": null, + "peft_type": "LORA", + "r": 8, + "rank_pattern": {}, + "revision": null, + "target_modules": [ + "k_proj", + "o_proj", + "gate_proj", + "down_proj", + "score", + "v_proj", + "up_proj", + "q_proj" + ], + "task_type": "CAUSAL_LM", + "use_dora": false, + "use_rslora": false +} \ No newline at end of file diff --git a/checkpoint-900/adapter_model.safetensors b/checkpoint-900/adapter_model.safetensors new file mode 100644 index 0000000000000000000000000000000000000000..0027aa4da93850590ea18cccc5a18301852ba027 --- /dev/null +++ b/checkpoint-900/adapter_model.safetensors @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:53bd0935bf2c27e9cfaf1b5630fe7030d91076f78cfed5fdb550a555c03c6321 +size 42068368 diff --git a/checkpoint-900/global_step900/bf16_zero_pp_rank_0_mp_rank_00_optim_states.pt b/checkpoint-900/global_step900/bf16_zero_pp_rank_0_mp_rank_00_optim_states.pt new file mode 100644 index 0000000000000000000000000000000000000000..20444014923252c816c99e18aa002a80ca4cbeb0 --- /dev/null +++ b/checkpoint-900/global_step900/bf16_zero_pp_rank_0_mp_rank_00_optim_states.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e19e29cd128416a1cdd52220602f1cf7f7a8c6930006a343446268271f23bc9a +size 63016432 diff --git a/checkpoint-900/global_step900/bf16_zero_pp_rank_1_mp_rank_00_optim_states.pt b/checkpoint-900/global_step900/bf16_zero_pp_rank_1_mp_rank_00_optim_states.pt new file mode 100644 index 0000000000000000000000000000000000000000..c00d12b130521a7a658c4dfe5640542fa919c535 --- /dev/null +++ b/checkpoint-900/global_step900/bf16_zero_pp_rank_1_mp_rank_00_optim_states.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:24f7dabaea1cbf6ed17d7e4eef0170dfc2254b49df25e5543dfad24d3d1b4a02 +size 63016432 diff --git a/checkpoint-900/global_step900/bf16_zero_pp_rank_2_mp_rank_00_optim_states.pt b/checkpoint-900/global_step900/bf16_zero_pp_rank_2_mp_rank_00_optim_states.pt new file mode 100644 index 0000000000000000000000000000000000000000..adc6bef309e2c58e0eae05dde263cc51fd1689f1 --- /dev/null +++ b/checkpoint-900/global_step900/bf16_zero_pp_rank_2_mp_rank_00_optim_states.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6a98aa8a628dc3da5e3f51d97cb193d5b1fe1761558f95b739f9e8c316a5d6b0 +size 63016432 diff --git a/checkpoint-900/global_step900/bf16_zero_pp_rank_3_mp_rank_00_optim_states.pt b/checkpoint-900/global_step900/bf16_zero_pp_rank_3_mp_rank_00_optim_states.pt new file mode 100644 index 0000000000000000000000000000000000000000..d10d41dd19b9c3b881ab2e9a9c882ba752dbdb95 --- /dev/null +++ b/checkpoint-900/global_step900/bf16_zero_pp_rank_3_mp_rank_00_optim_states.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8e95803a453519dcb2cb72e528f6b8cb5e5e8f69cc0c67067b37165792e0536c +size 63016432 diff --git a/checkpoint-900/global_step900/zero_pp_rank_0_mp_rank_00_model_states.pt b/checkpoint-900/global_step900/zero_pp_rank_0_mp_rank_00_model_states.pt new file mode 100644 index 0000000000000000000000000000000000000000..966f34e8f48657397771ef215f5c23dd441a9300 --- /dev/null +++ b/checkpoint-900/global_step900/zero_pp_rank_0_mp_rank_00_model_states.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:22be41baf6c10c1c8970834fae5e90e7bb6cff292b41102c412df432ab1af8f2 +size 442088 diff --git a/checkpoint-900/global_step900/zero_pp_rank_1_mp_rank_00_model_states.pt b/checkpoint-900/global_step900/zero_pp_rank_1_mp_rank_00_model_states.pt new file mode 100644 index 0000000000000000000000000000000000000000..9e6945064d8d4116bc5cdc637d489f703f81c8d9 --- /dev/null +++ b/checkpoint-900/global_step900/zero_pp_rank_1_mp_rank_00_model_states.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fafcb0f5e9eee734e82cd9416b960bb858b67bcbc27a1f13c81a36c2d04218f8 +size 442088 diff --git a/checkpoint-900/global_step900/zero_pp_rank_2_mp_rank_00_model_states.pt b/checkpoint-900/global_step900/zero_pp_rank_2_mp_rank_00_model_states.pt new file mode 100644 index 0000000000000000000000000000000000000000..b183868f6f4c8d85eb7a9b42a249a98c747796f8 --- /dev/null +++ b/checkpoint-900/global_step900/zero_pp_rank_2_mp_rank_00_model_states.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6b034a8615901e165e2c644ea7d92caf051c437ce4526020e17c8efba4a548cd +size 442088 diff --git a/checkpoint-900/global_step900/zero_pp_rank_3_mp_rank_00_model_states.pt b/checkpoint-900/global_step900/zero_pp_rank_3_mp_rank_00_model_states.pt new file mode 100644 index 0000000000000000000000000000000000000000..411cfd30f51048c2497679aad1ac3edd2d6b2dac --- /dev/null +++ b/checkpoint-900/global_step900/zero_pp_rank_3_mp_rank_00_model_states.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ad64ddaa6f12fe5b86caeaffba57414a2569ee8070d6e114678dcde4dd845be2 +size 442088 diff --git a/checkpoint-900/latest b/checkpoint-900/latest new file mode 100644 index 0000000000000000000000000000000000000000..4b10acccf3e8395339ff8799cea202bbc54d7f7d --- /dev/null +++ b/checkpoint-900/latest @@ -0,0 +1 @@ +global_step900 \ No newline at end of file diff --git a/checkpoint-900/rng_state_0.pth b/checkpoint-900/rng_state_0.pth new file mode 100644 index 0000000000000000000000000000000000000000..29c11ebd1525dc3b5d23299bb787655d2323793f --- /dev/null +++ b/checkpoint-900/rng_state_0.pth @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1dee209b5ea1a715cb85ee288accdc10c2157d35283414ef17814bf3137b704c +size 14960 diff --git a/checkpoint-900/rng_state_1.pth b/checkpoint-900/rng_state_1.pth new file mode 100644 index 0000000000000000000000000000000000000000..117f12c4a35db94dcde32d26839d6f94e9daf42f --- /dev/null +++ b/checkpoint-900/rng_state_1.pth @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fd2f98c70c95e921c30987cac4a18519f1e3faa9c9fd634ace22595f02862b81 +size 14960 diff --git a/checkpoint-900/rng_state_2.pth b/checkpoint-900/rng_state_2.pth new file mode 100644 index 0000000000000000000000000000000000000000..b30563fcf28f177937baf857d57630a3b4bc180d --- /dev/null +++ b/checkpoint-900/rng_state_2.pth @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7c1f14a7ea447a9fdc2d719d6216168ff54b2f4019c0a1f308524e19c16cd374 +size 14960 diff --git a/checkpoint-900/rng_state_3.pth b/checkpoint-900/rng_state_3.pth new file mode 100644 index 0000000000000000000000000000000000000000..591d27ce56ebfcd0bbc450c8758b5eb42e5333ea --- /dev/null +++ b/checkpoint-900/rng_state_3.pth @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5cd1cc6dda08a4eb63a959310781281c4b3bceafd62380ef0bf91a2982337052 +size 14960 diff --git a/checkpoint-900/scheduler.pt b/checkpoint-900/scheduler.pt new file mode 100644 index 0000000000000000000000000000000000000000..61457787a2be8a54563f9241e4e6e2049dd8729a --- /dev/null +++ b/checkpoint-900/scheduler.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d9d9c8b3646dbe9aae5ff54ddf63a13b3b0145b5b691fba394a3d006da79594e +size 1064 diff --git a/checkpoint-900/special_tokens_map.json b/checkpoint-900/special_tokens_map.json new file mode 100644 index 0000000000000000000000000000000000000000..a8eb9ef63af01dfa2c350573b543b14275370944 --- /dev/null +++ b/checkpoint-900/special_tokens_map.json @@ -0,0 +1,30 @@ +{ + "bos_token": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false + }, + "eos_token": { + "content": "<|END_OF_TURN_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false + }, + "pad_token": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false + }, + "unk_token": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false + } +} diff --git a/checkpoint-900/tokenizer.json b/checkpoint-900/tokenizer.json new file mode 100644 index 0000000000000000000000000000000000000000..91a1344d38167f152a8803a80eb79ca4b465adbb --- /dev/null +++ b/checkpoint-900/tokenizer.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:28c8b8038fcb2756e349a51832a56634423c579a869f39642526327aa56b2989 +size 20125189 diff --git a/checkpoint-900/tokenizer_config.json b/checkpoint-900/tokenizer_config.json new file mode 100644 index 0000000000000000000000000000000000000000..100ac1a3b6cff4a9043d2c0fd6b1603d1c1ee1e1 --- /dev/null +++ b/checkpoint-900/tokenizer_config.json @@ -0,0 +1,364 @@ +{ + "add_bos_token": true, + "add_eos_token": false, + "add_prefix_space": false, + "added_tokens_decoder": { + "0": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "1": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "2": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "3": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "4": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "5": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "6": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "7": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "255000": { + "content": "<|START_OF_TURN_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255001": { + "content": "<|END_OF_TURN_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "255002": { + "content": "<|YES_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255003": { + "content": "<|NO_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255004": { + "content": "<|GOOD_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255005": { + "content": "<|BAD_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255006": { + "content": "<|USER_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255007": { + "content": "<|CHATBOT_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255008": { + "content": "<|SYSTEM_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255009": { + "content": "<|USER_0_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255010": { + "content": "<|USER_1_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255011": { + "content": "<|USER_2_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255012": { + "content": "<|USER_3_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255013": { + "content": "<|USER_4_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255014": { + "content": "<|USER_5_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255015": { + "content": "<|USER_6_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255016": { + "content": "<|USER_7_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255017": { + "content": "<|USER_8_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255018": { + "content": "<|USER_9_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255019": { + "content": "<|START_THINKING|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255020": { + "content": "<|END_THINKING|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255021": { + "content": "<|START_RESPONSE|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "255022": { + "content": "<|END_RESPONSE|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "255023": { + "content": "<|START_ACTION|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255024": { + "content": "<|END_ACTION|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255025": { + "content": "<|START_TOOL_RESULT|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255026": { + "content": "<|END_TOOL_RESULT|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255027": { + "content": "<|EXTRA_8_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255028": { + "content": "<|NEW_FILE|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "255029": { + "content": "<|BEGINNING_OF_PREFIX_FIM_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255030": { + "content": "<|BEGINNING_OF_MIDDLE_FIM_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255031": { + "content": "<|BEGINNING_OF_SUFFIX_FIM_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255032": { + "content": "<|END_OF_MIDDLE_FIM_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + } + }, + "bos_token": "", + "chat_template": [ + { + "name": "default", + "template": "{% if documents %}\n{% set tools = [] %}\n{%- macro document_turn(documents) -%}\n{# format documents into chat turn #}\n<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|><|START_THINKING|>I will look through the document to address the users needs.<|END_THINKING|><|START_ACTION|>[\n {\"tool_call_id\": \"0\", \"tool_name\": \"direct-injected-document\", \"parameters\": {}}\n]<|END_ACTION|><|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|><|START_TOOL_RESULT|>[\n {\n \"tool_call_id\": \"0\",\n \"results\": {\n{% for doc in documents %}\n \"{{ loop.index0 }}\": {{doc|tojson}}{% if not loop.last %},\n {% endif %}\n{% endfor %}\n\n },\n \"is_error\": null\n }\n]<|END_TOOL_RESULT|><|END_OF_TURN_TOKEN|>{%- endmacro %}\n{%- macro tool_call_id_to_int(messages, tool_call_id) %}\n{%- set counter = namespace(value=0) %}\n{%- set tool_call_id_seen = namespace(value=false) %}\n{%- for msg in messages %}\n {%- if msg.tool_calls %}\n {%- for tool_call in msg.tool_calls %}\n {%- if tool_call.id == tool_call_id and not tool_call_id_seen.value -%}\n {{ counter.value }}\n {%- set tool_call_id_seen.value = true %}\n {%- endif %}\n {%- set counter.value = counter.value + 1 %}\n {%- endfor %}\n {%- endif %}\n{%- endfor %}\n{%- endmacro %}\n{%- macro format_tool_message(messages, tool_msg) -%}\n{# format tool message #}\n {\n \"tool_call_id\": \"{{ tool_call_id_to_int(messages, tool_msg.tool_call_id) }}\",\n \"results\": {\n \"0\": {{ tool_msg.content|tojson }}\n },\n \"is_error\": null\n }\n{%- endmacro -%}\n{%- if messages and messages[0]['role']|lower == 'system' %}{%- set developer_preamble = messages[0]['content'] %}{% endif %}\n{%- set tool_idx = namespace(value=0) %}\n{%- set tool_ids_seen = namespace(value=[]) %}\n{%- set sent_documents = namespace(value=false) %}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|># System Preamble\nYou are in contextual safety mode. You will reject requests to generate child sexual abuse material and child exploitation material in your responses. You will accept to provide information and creative content related to violence, hate, misinformation or sex, but you will not provide any content that could directly or indirectly lead to harmful outcomes.\n\nYour information cutoff date is June 2024.\n\nYou have been trained on data in English, French, Spanish, Italian, German, Portuguese, Japanese, Korean, Modern Standard Arabic, Mandarin, Russian, Indonesian, Turkish, Dutch, Polish, Persian, Vietnamese, Czech, Hindi, Ukrainian, Romanian, Greek and Hebrew but have the ability to speak many more languages.\n{% if tools or documents %}\n\nYou have been trained to have advanced reasoning and tool-use capabilities and you should make best use of these skills to serve user's requests.\n\n## Tool Use\nThink about how you can make best use of the provided tools to help with the task and come up with a high level plan that you will execute first.\n\n0. Start by writing <|START_THINKING|> followed by a detailed step by step plan of how you will solve the problem. For each step explain your thinking fully and give details of required tool calls (if needed). Unless specified otherwise, you write your plan in natural language. When you finish, close it out with <|END_THINKING|>.\n You can optionally choose to skip this step when the user request is so straightforward to address that only a trivial plan would be needed.\n NOTE: You MUST skip this step when you are directly responding to the user's request without using any tools.\n\nThen carry out your plan by repeatedly executing the following steps.\n1. Action: write <|START_ACTION|> followed by a list of JSON-formatted tool calls, with each one containing \"tool_name\" and \"parameters\" fields.\n When there are multiple tool calls which are completely independent of each other (i.e. they can be executed in parallel), you should list them out all together in one step. When you finish, close it out with <|END_ACTION|>.\n2. Observation: you will then receive results of those tool calls in JSON format in the very next turn, wrapped around by <|START_TOOL_RESULT|> and <|END_TOOL_RESULT|>. Carefully observe those results and think about what to do next. Note that these results will be provided to you in a separate turn. NEVER hallucinate results.\n Every tool call produces a list of results (when a tool call produces no result or a single result, it'll still get wrapped inside a list). Each result is clearly linked to its originating tool call via its \"tool_call_id\".\n3. Reflection: start the next turn by writing <|START_THINKING|> followed by what you've figured out so far, any changes you need to make to your plan, and what you will do next. When you finish, close it out with <|END_THINKING|>.\n You can optionally choose to skip this step when everything is going according to plan and no special pieces of information or reasoning chains need to be recorded.\n NOTE: You MUST skip this step when you are done with tool-use actions and are ready to respond to the user.\n\nYou can repeat the above 3 steps multiple times (could be 0 times too if no suitable tool calls are available or needed), until you decide it's time to finally respond to the user.\n\n4. Response: then break out of the loop and write <|START_RESPONSE|> followed by a piece of text which serves as a response to the user's last request. Use all previous tool calls and results to help you when formulating your response. When you finish, close it out with <|END_RESPONSE|>.\n{% if enable_citations %}\n\n## Grounding\nImportantly, note that \"Reflection\" and \"Response\" above can be grounded.\nGrounding means you associate pieces of texts (called \"spans\") with those specific tool results that support them (called \"sources\"). And you use a pair of tags \"\" and \"\" to indicate when a span can be grounded onto a list of sources, listing them out in the closing tag. Sources from the same tool call are grouped together and listed as \"{tool_call_id}:[{list of result indices}]\", before they are joined together by \",\". E.g., \"span\" means that \"span\" is supported by result 1 and 2 from \"tool_call_id=0\" as well as result 0 from \"tool_call_id=1\".\n{% endif %}\n\n## Available Tools\nHere is the list of tools that you have available to you.\nYou can ONLY use the tools listed here. When a tool is not listed below, it is NOT available and you should NEVER attempt to use it.\nEach tool is represented as a JSON object with fields like \"name\", \"description\", \"parameters\" (per JSON Schema), and optionally, \"responses\" (per JSON Schema).\n\n```json\n[\n{% if documents %}\n {\"name\": \"direct-injected-document\", \"description\": \"This is a special tool to directly inject user-uploaded documents into the chat as additional context. DO NOT use this tool by yourself!\", \"parameters\": {\"type\": \"object\", \"properties\": {}, \"required\": []}, \"responses\": {\"200\": {\"description\": \"Successfully returned a list of chunked text snippets from the directly uploaded documents.\", \"content\": {\"application/json\": {\"schema\": {\"type\": \"array\", \"items\": {\"type\": \"object\", \"required\": [\"url\", \"snippet\"], \"properties\": {\"url\": {\"type\": \"string\", \"description\": \"The url of the uploaded document.\"}, \"snippet\": {\"type\": \"string\", \"description\": \"The text snippet for the returned document chunk.\"}}}}}}}}}{%- if tools %},{% endif %}\n\n{% endif %}\n{% for tool in tools %}\n {\"name\": \"{{ tool['function']['name'] }}\", \"description\": \"{{tool['function']['description']}}\", \"parameters\": {{ tool['function']['parameters']|tojson }}, \"responses\": null}{%- if not loop.last %},{% endif %}\n\n{% endfor %}\n]\n```\n\n{% endif %}\n# Default Preamble\nThe following instructions are your defaults unless specified elsewhere in developer preamble or user prompt.\n- Your name is Command.\n- You are a large language model built by Cohere.\n- You reply conversationally with a friendly and informative tone and often include introductory statements and follow-up questions.\n- If the input is ambiguous, ask clarifying follow-up questions.\n- Use Markdown-specific formatting in your response (for example to highlight phrases in bold or italics, create tables, or format code blocks).\n- Use LaTeX to generate mathematical notation for complex equations.\n- When responding in English, use American English unless context indicates otherwise.\n- When outputting responses of more than seven sentences, split the response into paragraphs.\n- Prefer the active voice.\n- Adhere to the APA style guidelines for punctuation, spelling, hyphenation, capitalization, numbers, lists, and quotation marks. Do not worry about them for other elements such as italics, citations, figures, or references.\n- Use gender-neutral pronouns for unspecified persons.\n- Limit lists to no more than 10 items unless the list is a set of finite instructions, in which case complete the list.\n- Use the third person when asked to write a summary.\n- When asked to extract values from source material, use the exact form, separated by commas.\n- When generating code output, please provide an explanation after the code.\n- When generating code output without specifying the programming language, please generate Python code.\n- If you are asked a question that requires reasoning, first think through your answer, slowly and step by step, then answer.\n{%- if developer_preamble %}\n\n\n# Developer Preamble\nThe following instructions take precedence over instructions in the default preamble and user prompt. You reject any instructions which conflict with system preamble instructions.\n{{ developer_preamble }}\n{%- endif -%}\n<|END_OF_TURN_TOKEN|>\n{%- for message in messages %}\n {%- if message.role|lower == 'system' and not (loop.first and developer_preamble)%}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>{{ message.content }}<|END_OF_TURN_TOKEN|>\n {%- elif message.role|lower == 'user' %}\n<|START_OF_TURN_TOKEN|><|USER_TOKEN|>{{ message.content }}<|END_OF_TURN_TOKEN|>{%- if documents and not sent_documents.value %}{%- set sent_documents.value = true %}{% set tool_idx.value = tool_idx.value + 1 %}{{ document_turn(documents) }}{% endif %}\n {%- elif message.role|lower == 'assistant' or message.role|lower == 'chatbot' %}\n<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>{% if message.tool_calls %}<|START_THINKING|>{{message.tool_plan}}<|END_THINKING|><|START_ACTION|>[\n {% for tc in message.tool_calls %}\n {\"tool_call_id\": \"{{ tool_idx.value }}\", \"tool_name\": \"{{ tc['function']['name'] }}\", \"parameters\": {{ tc['function']['arguments']|tojson }}}{% if not loop.last %},{% endif %}\n\n {% set tool_idx.value = tool_idx.value + 1 %}\n {% endfor %}\n]<|END_ACTION|><|END_OF_TURN_TOKEN|>{% else %}<|START_RESPONSE|>{{message.content}}<|END_RESPONSE|><|END_OF_TURN_TOKEN|>{% endif %}\n {% elif message.role|lower == 'tool' and message.tool_call_id not in tool_ids_seen.value %}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|><|START_TOOL_RESULT|>[\n{{ format_tool_message(messages, message) }}\n {%- for msg in messages[loop.index0 + 1:] %}\n {%- if msg.role|lower == 'tool' %},\n{{ format_tool_message(messages, msg) }}\n {%- set tool_ids_seen.value = tool_ids_seen.value + [msg.tool_call_id] %}\n {%- else %}\n {%- break %}\n {%- endif %}\n {%- endfor %}\n\n]<|END_TOOL_RESULT|><|END_OF_TURN_TOKEN|>\n {%- endif %}\n{%- endfor %}<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>\n{%- else -%}\n{% if messages[0]['role'] == 'system' %}{% set loop_messages = messages[1:] %}\n {%- set system_message = messages[0]['content'] %}{% elif false == true %}\n {%- set loop_messages = messages %}{% set system_message = '' %}\n{%- else %}\n {%- set loop_messages = messages %}\n {%- set system_message = false %}\n{%- endif %}\n{%- if system_message != false -%}\n {{ '<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>' + system_message + '<|END_OF_TURN_TOKEN|>' }}\n{%- else -%}\n {{ '<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|><|END_OF_TURN_TOKEN|>' }}\n{%- endif %}\n{%- for message in loop_messages %}\n {%- if (message['role'] == 'user') != (loop.index0 % 2 == 0) -%}\n {{ raise_exception('Conversation roles must alternate user/assistant/user/assistant/...') }}\n {%- endif -%}\n {%- set content = message['content'] -%}\n {%- if message['role'] == 'user' -%}\n {{ '<|START_OF_TURN_TOKEN|><|USER_TOKEN|>' + content.strip() + '<|END_OF_TURN_TOKEN|>' }}\n {%- elif message['role'] == 'assistant' -%}\n {{ '<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|><|START_RESPONSE|>' + content.strip() + '<|END_RESPONSE|><|END_OF_TURN_TOKEN|>' }}\n {%- endif %}\n{%- endfor %}\n{%- if add_generation_prompt -%}\n {{ '<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|><|START_RESPONSE|>' }}\n{%- endif %}\n{% endif %}" + }, + { + "name": "tool_use", + "template": "{%- macro document_turn(documents) -%}\n{# format documents into chat turn #}\n<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|><|START_THINKING|>I will look through the document to address the users needs.<|END_THINKING|><|START_ACTION|>[\n {\"tool_call_id\": \"0\", \"tool_name\": \"direct-injected-document\", \"parameters\": {}}\n]<|END_ACTION|><|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|><|START_TOOL_RESULT|>[\n {\n \"tool_call_id\": \"0\",\n \"results\": {\n{% for doc in documents %}\n \"{{ loop.index0 }}\": {{doc|tojson}}{% if not loop.last %},\n {% endif %}\n{% endfor %}\n\n },\n \"is_error\": null\n }\n]<|END_TOOL_RESULT|><|END_OF_TURN_TOKEN|>{%- endmacro %}\n{%- macro tool_call_id_to_int(messages, tool_call_id) %}\n{%- set counter = namespace(value=0) %}\n{%- set tool_call_id_seen = namespace(value=false) %}\n{%- for msg in messages %}\n {%- if msg.tool_calls %}\n {%- for tool_call in msg.tool_calls %}\n {%- if tool_call.id == tool_call_id and not tool_call_id_seen.value -%}\n {{ counter.value }}\n {%- set tool_call_id_seen.value = true %}\n {%- endif %}\n {%- set counter.value = counter.value + 1 %}\n {%- endfor %}\n {%- endif %}\n{%- endfor %}\n{%- endmacro %}\n{%- macro format_tool_message(messages, tool_msg) -%}\n{# format tool message #}\n {\n \"tool_call_id\": \"{{ tool_call_id_to_int(messages, tool_msg.tool_call_id) }}\",\n \"results\": {\n \"0\": {{ tool_msg.content|tojson }}\n },\n \"is_error\": null\n }\n{%- endmacro -%}\n{%- if messages and messages[0]['role']|lower == 'system' %}{%- set developer_preamble = messages[0]['content'] %}{% endif %}\n{%- set tool_idx = namespace(value=0) %}\n{%- set tool_ids_seen = namespace(value=[]) %}\n{%- set sent_documents = namespace(value=false) %}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|># System Preamble\nYou are in contextual safety mode. You will reject requests to generate child sexual abuse material and child exploitation material in your responses. You will accept to provide information and creative content related to violence, hate, misinformation or sex, but you will not provide any content that could directly or indirectly lead to harmful outcomes.\n\nYour information cutoff date is June 2024.\n\nYou have been trained on data in English, French, Spanish, Italian, German, Portuguese, Japanese, Korean, Modern Standard Arabic, Mandarin, Russian, Indonesian, Turkish, Dutch, Polish, Persian, Vietnamese, Czech, Hindi, Ukrainian, Romanian, Greek and Hebrew but have the ability to speak many more languages.\n{% if tools or documents %}\n\nYou have been trained to have advanced reasoning and tool-use capabilities and you should make best use of these skills to serve user's requests.\n\n## Tool Use\nThink about how you can make best use of the provided tools to help with the task and come up with a high level plan that you will execute first.\n\n0. Start by writing <|START_THINKING|> followed by a detailed step by step plan of how you will solve the problem. For each step explain your thinking fully and give details of required tool calls (if needed). Unless specified otherwise, you write your plan in natural language. When you finish, close it out with <|END_THINKING|>.\n You can optionally choose to skip this step when the user request is so straightforward to address that only a trivial plan would be needed.\n NOTE: You MUST skip this step when you are directly responding to the user's request without using any tools.\n\nThen carry out your plan by repeatedly executing the following steps.\n1. Action: write <|START_ACTION|> followed by a list of JSON-formatted tool calls, with each one containing \"tool_name\" and \"parameters\" fields.\n When there are multiple tool calls which are completely independent of each other (i.e. they can be executed in parallel), you should list them out all together in one step. When you finish, close it out with <|END_ACTION|>.\n2. Observation: you will then receive results of those tool calls in JSON format in the very next turn, wrapped around by <|START_TOOL_RESULT|> and <|END_TOOL_RESULT|>. Carefully observe those results and think about what to do next. Note that these results will be provided to you in a separate turn. NEVER hallucinate results.\n Every tool call produces a list of results (when a tool call produces no result or a single result, it'll still get wrapped inside a list). Each result is clearly linked to its originating tool call via its \"tool_call_id\".\n3. Reflection: start the next turn by writing <|START_THINKING|> followed by what you've figured out so far, any changes you need to make to your plan, and what you will do next. When you finish, close it out with <|END_THINKING|>.\n You can optionally choose to skip this step when everything is going according to plan and no special pieces of information or reasoning chains need to be recorded.\n NOTE: You MUST skip this step when you are done with tool-use actions and are ready to respond to the user.\n\nYou can repeat the above 3 steps multiple times (could be 0 times too if no suitable tool calls are available or needed), until you decide it's time to finally respond to the user.\n\n4. Response: then break out of the loop and write <|START_RESPONSE|> followed by a piece of text which serves as a response to the user's last request. Use all previous tool calls and results to help you when formulating your response. When you finish, close it out with <|END_RESPONSE|>.\n{% if enable_citations %}\n\n## Grounding\nImportantly, note that \"Reflection\" and \"Response\" above can be grounded.\nGrounding means you associate pieces of texts (called \"spans\") with those specific tool results that support them (called \"sources\"). And you use a pair of tags \"\" and \"\" to indicate when a span can be grounded onto a list of sources, listing them out in the closing tag. Sources from the same tool call are grouped together and listed as \"{tool_call_id}:[{list of result indices}]\", before they are joined together by \",\". E.g., \"span\" means that \"span\" is supported by result 1 and 2 from \"tool_call_id=0\" as well as result 0 from \"tool_call_id=1\".\n{% endif %}\n\n## Available Tools\nHere is the list of tools that you have available to you.\nYou can ONLY use the tools listed here. When a tool is not listed below, it is NOT available and you should NEVER attempt to use it.\nEach tool is represented as a JSON object with fields like \"name\", \"description\", \"parameters\" (per JSON Schema), and optionally, \"responses\" (per JSON Schema).\n\n```json\n[\n{% if documents %}\n {\"name\": \"direct-injected-document\", \"description\": \"This is a special tool to directly inject user-uploaded documents into the chat as additional context. DO NOT use this tool by yourself!\", \"parameters\": {\"type\": \"object\", \"properties\": {}, \"required\": []}, \"responses\": {\"200\": {\"description\": \"Successfully returned a list of chunked text snippets from the directly uploaded documents.\", \"content\": {\"application/json\": {\"schema\": {\"type\": \"array\", \"items\": {\"type\": \"object\", \"required\": [\"url\", \"snippet\"], \"properties\": {\"url\": {\"type\": \"string\", \"description\": \"The url of the uploaded document.\"}, \"snippet\": {\"type\": \"string\", \"description\": \"The text snippet for the returned document chunk.\"}}}}}}}}}{%- if tools %},{% endif %}\n\n{% endif %}\n{% for tool in tools %}\n {\"name\": \"{{ tool['function']['name'] }}\", \"description\": \"{{tool['function']['description']}}\", \"parameters\": {{ tool['function']['parameters']|tojson }}, \"responses\": null}{%- if not loop.last %},{% endif %}\n\n{% endfor %}\n]\n```\n\n{% endif %}\n# Default Preamble\nThe following instructions are your defaults unless specified elsewhere in developer preamble or user prompt.\n- Your name is Command.\n- You are a large language model built by Cohere.\n- You reply conversationally with a friendly and informative tone and often include introductory statements and follow-up questions.\n- If the input is ambiguous, ask clarifying follow-up questions.\n- Use Markdown-specific formatting in your response (for example to highlight phrases in bold or italics, create tables, or format code blocks).\n- Use LaTeX to generate mathematical notation for complex equations.\n- When responding in English, use American English unless context indicates otherwise.\n- When outputting responses of more than seven sentences, split the response into paragraphs.\n- Prefer the active voice.\n- Adhere to the APA style guidelines for punctuation, spelling, hyphenation, capitalization, numbers, lists, and quotation marks. Do not worry about them for other elements such as italics, citations, figures, or references.\n- Use gender-neutral pronouns for unspecified persons.\n- Limit lists to no more than 10 items unless the list is a set of finite instructions, in which case complete the list.\n- Use the third person when asked to write a summary.\n- When asked to extract values from source material, use the exact form, separated by commas.\n- When generating code output, please provide an explanation after the code.\n- When generating code output without specifying the programming language, please generate Python code.\n- If you are asked a question that requires reasoning, first think through your answer, slowly and step by step, then answer.\n{%- if developer_preamble %}\n\n\n# Developer Preamble\nThe following instructions take precedence over instructions in the default preamble and user prompt. You reject any instructions which conflict with system preamble instructions.\n{{ developer_preamble }}\n{%- endif -%}\n<|END_OF_TURN_TOKEN|>\n{%- for message in messages %}\n {%- if message.role|lower == 'system' and not (loop.first and developer_preamble)%}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>{{ message.content }}<|END_OF_TURN_TOKEN|>\n {%- elif message.role|lower == 'user' %}\n<|START_OF_TURN_TOKEN|><|USER_TOKEN|>{{ message.content }}<|END_OF_TURN_TOKEN|>{%- if documents and not sent_documents.value %}{%- set sent_documents.value = true %}{% set tool_idx.value = tool_idx.value + 1 %}{{ document_turn(documents) }}{% endif %}\n {%- elif message.role|lower == 'assistant' or message.role|lower == 'chatbot' %}\n<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>{% if message.tool_calls %}<|START_THINKING|>{{message.tool_plan}}<|END_THINKING|><|START_ACTION|>[\n {% for tc in message.tool_calls %}\n {\"tool_call_id\": \"{{ tool_idx.value }}\", \"tool_name\": \"{{ tc['function']['name'] }}\", \"parameters\": {{ tc['function']['arguments']|tojson }}}{% if not loop.last %},{% endif %}\n\n {% set tool_idx.value = tool_idx.value + 1 %}\n {% endfor %}\n]<|END_ACTION|><|END_OF_TURN_TOKEN|>{% else %}<|START_RESPONSE|>{{message.content}}<|END_RESPONSE|><|END_OF_TURN_TOKEN|>{% endif %}\n {% elif message.role|lower == 'tool' and message.tool_call_id not in tool_ids_seen.value %}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|><|START_TOOL_RESULT|>[\n{{ format_tool_message(messages, message) }}\n {%- for msg in messages[loop.index0 + 1:] %}\n {%- if msg.role|lower == 'tool' %},\n{{ format_tool_message(messages, msg) }}\n {%- set tool_ids_seen.value = tool_ids_seen.value + [msg.tool_call_id] %}\n {%- else %}\n {%- break %}\n {%- endif %}\n {%- endfor %}\n\n]<|END_TOOL_RESULT|><|END_OF_TURN_TOKEN|>\n {%- endif %}\n{%- endfor %}<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>" + }, + { + "name": "rag", + "template": "{% set tools = [] %}\n{%- macro document_turn(documents) -%}\n{# format documents into chat turn #}\n<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|><|START_THINKING|>I will look through the document to address the users needs.<|END_THINKING|><|START_ACTION|>[\n {\"tool_call_id\": \"0\", \"tool_name\": \"direct-injected-document\", \"parameters\": {}}\n]<|END_ACTION|><|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|><|START_TOOL_RESULT|>[\n {\n \"tool_call_id\": \"0\",\n \"results\": {\n{% for doc in documents %}\n \"{{ loop.index0 }}\": {{doc|tojson}}{% if not loop.last %},\n {% endif %}\n{% endfor %}\n\n },\n \"is_error\": null\n }\n]<|END_TOOL_RESULT|><|END_OF_TURN_TOKEN|>{%- endmacro %}\n{%- macro tool_call_id_to_int(messages, tool_call_id) %}\n{%- set counter = namespace(value=0) %}\n{%- set tool_call_id_seen = namespace(value=false) %}\n{%- for msg in messages %}\n {%- if msg.tool_calls %}\n {%- for tool_call in msg.tool_calls %}\n {%- if tool_call.id == tool_call_id and not tool_call_id_seen.value -%}\n {{ counter.value }}\n {%- set tool_call_id_seen.value = true %}\n {%- endif %}\n {%- set counter.value = counter.value + 1 %}\n {%- endfor %}\n {%- endif %}\n{%- endfor %}\n{%- endmacro %}\n{%- macro format_tool_message(messages, tool_msg) -%}\n{# format tool message #}\n {\n \"tool_call_id\": \"{{ tool_call_id_to_int(messages, tool_msg.tool_call_id) }}\",\n \"results\": {\n \"0\": {{ tool_msg.content|tojson }}\n },\n \"is_error\": null\n }\n{%- endmacro -%}\n{%- if messages and messages[0]['role']|lower == 'system' %}{%- set developer_preamble = messages[0]['content'] %}{% endif %}\n{%- set tool_idx = namespace(value=0) %}\n{%- set tool_ids_seen = namespace(value=[]) %}\n{%- set sent_documents = namespace(value=false) %}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|># System Preamble\nYou are in contextual safety mode. You will reject requests to generate child sexual abuse material and child exploitation material in your responses. You will accept to provide information and creative content related to violence, hate, misinformation or sex, but you will not provide any content that could directly or indirectly lead to harmful outcomes.\n\nYour information cutoff date is June 2024.\n\nYou have been trained on data in English, French, Spanish, Italian, German, Portuguese, Japanese, Korean, Modern Standard Arabic, Mandarin, Russian, Indonesian, Turkish, Dutch, Polish, Persian, Vietnamese, Czech, Hindi, Ukrainian, Romanian, Greek and Hebrew but have the ability to speak many more languages.\n{% if tools or documents %}\n\nYou have been trained to have advanced reasoning and tool-use capabilities and you should make best use of these skills to serve user's requests.\n\n## Tool Use\nThink about how you can make best use of the provided tools to help with the task and come up with a high level plan that you will execute first.\n\n0. Start by writing <|START_THINKING|> followed by a detailed step by step plan of how you will solve the problem. For each step explain your thinking fully and give details of required tool calls (if needed). Unless specified otherwise, you write your plan in natural language. When you finish, close it out with <|END_THINKING|>.\n You can optionally choose to skip this step when the user request is so straightforward to address that only a trivial plan would be needed.\n NOTE: You MUST skip this step when you are directly responding to the user's request without using any tools.\n\nThen carry out your plan by repeatedly executing the following steps.\n1. Action: write <|START_ACTION|> followed by a list of JSON-formatted tool calls, with each one containing \"tool_name\" and \"parameters\" fields.\n When there are multiple tool calls which are completely independent of each other (i.e. they can be executed in parallel), you should list them out all together in one step. When you finish, close it out with <|END_ACTION|>.\n2. Observation: you will then receive results of those tool calls in JSON format in the very next turn, wrapped around by <|START_TOOL_RESULT|> and <|END_TOOL_RESULT|>. Carefully observe those results and think about what to do next. Note that these results will be provided to you in a separate turn. NEVER hallucinate results.\n Every tool call produces a list of results (when a tool call produces no result or a single result, it'll still get wrapped inside a list). Each result is clearly linked to its originating tool call via its \"tool_call_id\".\n3. Reflection: start the next turn by writing <|START_THINKING|> followed by what you've figured out so far, any changes you need to make to your plan, and what you will do next. When you finish, close it out with <|END_THINKING|>.\n You can optionally choose to skip this step when everything is going according to plan and no special pieces of information or reasoning chains need to be recorded.\n NOTE: You MUST skip this step when you are done with tool-use actions and are ready to respond to the user.\n\nYou can repeat the above 3 steps multiple times (could be 0 times too if no suitable tool calls are available or needed), until you decide it's time to finally respond to the user.\n\n4. Response: then break out of the loop and write <|START_RESPONSE|> followed by a piece of text which serves as a response to the user's last request. Use all previous tool calls and results to help you when formulating your response. When you finish, close it out with <|END_RESPONSE|>.\n{% if enable_citations %}\n\n## Grounding\nImportantly, note that \"Reflection\" and \"Response\" above can be grounded.\nGrounding means you associate pieces of texts (called \"spans\") with those specific tool results that support them (called \"sources\"). And you use a pair of tags \"\" and \"\" to indicate when a span can be grounded onto a list of sources, listing them out in the closing tag. Sources from the same tool call are grouped together and listed as \"{tool_call_id}:[{list of result indices}]\", before they are joined together by \",\". E.g., \"span\" means that \"span\" is supported by result 1 and 2 from \"tool_call_id=0\" as well as result 0 from \"tool_call_id=1\".\n{% endif %}\n\n## Available Tools\nHere is the list of tools that you have available to you.\nYou can ONLY use the tools listed here. When a tool is not listed below, it is NOT available and you should NEVER attempt to use it.\nEach tool is represented as a JSON object with fields like \"name\", \"description\", \"parameters\" (per JSON Schema), and optionally, \"responses\" (per JSON Schema).\n\n```json\n[\n{% if documents %}\n {\"name\": \"direct-injected-document\", \"description\": \"This is a special tool to directly inject user-uploaded documents into the chat as additional context. DO NOT use this tool by yourself!\", \"parameters\": {\"type\": \"object\", \"properties\": {}, \"required\": []}, \"responses\": {\"200\": {\"description\": \"Successfully returned a list of chunked text snippets from the directly uploaded documents.\", \"content\": {\"application/json\": {\"schema\": {\"type\": \"array\", \"items\": {\"type\": \"object\", \"required\": [\"url\", \"snippet\"], \"properties\": {\"url\": {\"type\": \"string\", \"description\": \"The url of the uploaded document.\"}, \"snippet\": {\"type\": \"string\", \"description\": \"The text snippet for the returned document chunk.\"}}}}}}}}}{%- if tools %},{% endif %}\n\n{% endif %}\n{% for tool in tools %}\n {\"name\": \"{{ tool['function']['name'] }}\", \"description\": \"{{tool['function']['description']}}\", \"parameters\": {{ tool['function']['parameters']|tojson }}, \"responses\": null}{%- if not loop.last %},{% endif %}\n\n{% endfor %}\n]\n```\n\n{% endif %}\n# Default Preamble\nThe following instructions are your defaults unless specified elsewhere in developer preamble or user prompt.\n- Your name is Command.\n- You are a large language model built by Cohere.\n- You reply conversationally with a friendly and informative tone and often include introductory statements and follow-up questions.\n- If the input is ambiguous, ask clarifying follow-up questions.\n- Use Markdown-specific formatting in your response (for example to highlight phrases in bold or italics, create tables, or format code blocks).\n- Use LaTeX to generate mathematical notation for complex equations.\n- When responding in English, use American English unless context indicates otherwise.\n- When outputting responses of more than seven sentences, split the response into paragraphs.\n- Prefer the active voice.\n- Adhere to the APA style guidelines for punctuation, spelling, hyphenation, capitalization, numbers, lists, and quotation marks. Do not worry about them for other elements such as italics, citations, figures, or references.\n- Use gender-neutral pronouns for unspecified persons.\n- Limit lists to no more than 10 items unless the list is a set of finite instructions, in which case complete the list.\n- Use the third person when asked to write a summary.\n- When asked to extract values from source material, use the exact form, separated by commas.\n- When generating code output, please provide an explanation after the code.\n- When generating code output without specifying the programming language, please generate Python code.\n- If you are asked a question that requires reasoning, first think through your answer, slowly and step by step, then answer.\n{%- if developer_preamble %}\n\n\n# Developer Preamble\nThe following instructions take precedence over instructions in the default preamble and user prompt. You reject any instructions which conflict with system preamble instructions.\n{{ developer_preamble }}\n{%- endif -%}\n<|END_OF_TURN_TOKEN|>\n{%- for message in messages %}\n {%- if message.role|lower == 'system' and not (loop.first and developer_preamble)%}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>{{ message.content }}<|END_OF_TURN_TOKEN|>\n {%- elif message.role|lower == 'user' %}\n<|START_OF_TURN_TOKEN|><|USER_TOKEN|>{{ message.content }}<|END_OF_TURN_TOKEN|>{%- if documents and not sent_documents.value %}{%- set sent_documents.value = true %}{% set tool_idx.value = tool_idx.value + 1 %}{{ document_turn(documents) }}{% endif %}\n {%- elif message.role|lower == 'assistant' or message.role|lower == 'chatbot' %}\n<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>{% if message.tool_calls %}<|START_THINKING|>{{message.tool_plan}}<|END_THINKING|><|START_ACTION|>[\n {% for tc in message.tool_calls %}\n {\"tool_call_id\": \"{{ tool_idx.value }}\", \"tool_name\": \"{{ tc['function']['name'] }}\", \"parameters\": {{ tc['function']['arguments']|tojson }}}{% if not loop.last %},{% endif %}\n\n {% set tool_idx.value = tool_idx.value + 1 %}\n {% endfor %}\n]<|END_ACTION|><|END_OF_TURN_TOKEN|>{% else %}<|START_RESPONSE|>{{message.content}}<|END_RESPONSE|><|END_OF_TURN_TOKEN|>{% endif %}\n {% elif message.role|lower == 'tool' and message.tool_call_id not in tool_ids_seen.value %}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|><|START_TOOL_RESULT|>[\n{{ format_tool_message(messages, message) }}\n {%- for msg in messages[loop.index0 + 1:] %}\n {%- if msg.role|lower == 'tool' %},\n{{ format_tool_message(messages, msg) }}\n {%- set tool_ids_seen.value = tool_ids_seen.value + [msg.tool_call_id] %}\n {%- else %}\n {%- break %}\n {%- endif %}\n {%- endfor %}\n\n]<|END_TOOL_RESULT|><|END_OF_TURN_TOKEN|>\n {%- endif %}\n{%- endfor %}<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>" + } + ], + "clean_up_tokenization_spaces": false, + "eos_token": "<|END_OF_TURN_TOKEN|>", + "extra_special_tokens": {}, + "legacy": true, + "merges_file": null, + "model_max_length": 8192, + "pad_token": "", + "padding_side": "right", + "sp_model_kwargs": {}, + "spaces_between_special_tokens": false, + "tokenizer_class": "CohereTokenizer", + "unk_token": "", + "use_default_system_prompt": false, + "vocab_file": null +} diff --git a/checkpoint-900/trainer_state.json b/checkpoint-900/trainer_state.json new file mode 100644 index 0000000000000000000000000000000000000000..93e5c29a900871372ac5953629c9b6572d20a53e --- /dev/null +++ b/checkpoint-900/trainer_state.json @@ -0,0 +1,3231 @@ +{ + "best_metric": null, + "best_model_checkpoint": null, + "epoch": 0.31288023639840085, + "eval_steps": 150, + "global_step": 900, + "is_hyper_param_search": false, + "is_local_process_zero": true, + "is_world_process_zero": true, + "log_history": [ + { + "epoch": 0.0006952894142186686, + "grad_norm": 5.413117383066536, + "learning_rate": 6.944444444444445e-07, + "loss": 2.3653, + "step": 2 + }, + { + "epoch": 0.0013905788284373371, + "grad_norm": 5.092870612337868, + "learning_rate": 1.388888888888889e-06, + "loss": 2.5001, + "step": 4 + }, + { + "epoch": 0.0020858682426560054, + "grad_norm": 3.6285625961711943, + "learning_rate": 2.0833333333333334e-06, + "loss": 2.3759, + "step": 6 + }, + { + "epoch": 0.0027811576568746743, + "grad_norm": 2.5025911526151075, + "learning_rate": 2.777777777777778e-06, + "loss": 1.944, + "step": 8 + }, + { + "epoch": 0.0034764470710933427, + "grad_norm": 3.077266049542496, + "learning_rate": 3.4722222222222224e-06, + "loss": 2.2504, + "step": 10 + }, + { + "epoch": 0.004171736485312011, + "grad_norm": 4.068243939187174, + "learning_rate": 4.166666666666667e-06, + "loss": 2.0637, + "step": 12 + }, + { + "epoch": 0.00486702589953068, + "grad_norm": 3.511444738830971, + "learning_rate": 4.861111111111111e-06, + "loss": 2.3604, + "step": 14 + }, + { + "epoch": 0.0055623153137493485, + "grad_norm": 5.925744892256934, + "learning_rate": 5.555555555555556e-06, + "loss": 2.6528, + "step": 16 + }, + { + "epoch": 0.0062576047279680165, + "grad_norm": 2.7950114871483405, + "learning_rate": 6.25e-06, + "loss": 2.3229, + "step": 18 + }, + { + "epoch": 0.006952894142186685, + "grad_norm": 6.586211843766182, + "learning_rate": 6.944444444444445e-06, + "loss": 2.342, + "step": 20 + }, + { + "epoch": 0.0076481835564053535, + "grad_norm": 4.902839955269193, + "learning_rate": 7.63888888888889e-06, + "loss": 2.4188, + "step": 22 + }, + { + "epoch": 0.008343472970624021, + "grad_norm": 4.257062809771645, + "learning_rate": 8.333333333333334e-06, + "loss": 1.7957, + "step": 24 + }, + { + "epoch": 0.009038762384842691, + "grad_norm": 4.460352004615699, + "learning_rate": 9.027777777777777e-06, + "loss": 2.0726, + "step": 26 + }, + { + "epoch": 0.00973405179906136, + "grad_norm": 5.858061506133739, + "learning_rate": 9.722222222222223e-06, + "loss": 2.0455, + "step": 28 + }, + { + "epoch": 0.010429341213280027, + "grad_norm": 4.331946668100709, + "learning_rate": 1.0416666666666668e-05, + "loss": 1.7645, + "step": 30 + }, + { + "epoch": 0.011124630627498697, + "grad_norm": 5.428742204187391, + "learning_rate": 1.1111111111111112e-05, + "loss": 1.7446, + "step": 32 + }, + { + "epoch": 0.011819920041717365, + "grad_norm": 2.485909286541028, + "learning_rate": 1.1805555555555555e-05, + "loss": 1.5885, + "step": 34 + }, + { + "epoch": 0.012515209455936033, + "grad_norm": 3.2602949308730222, + "learning_rate": 1.25e-05, + "loss": 1.1014, + "step": 36 + }, + { + "epoch": 0.013210498870154701, + "grad_norm": 4.962187747415964, + "learning_rate": 1.3194444444444446e-05, + "loss": 1.3588, + "step": 38 + }, + { + "epoch": 0.01390578828437337, + "grad_norm": 7.627756894198461, + "learning_rate": 1.388888888888889e-05, + "loss": 1.4014, + "step": 40 + }, + { + "epoch": 0.014601077698592039, + "grad_norm": 2.821848388410092, + "learning_rate": 1.4583333333333335e-05, + "loss": 1.0959, + "step": 42 + }, + { + "epoch": 0.015296367112810707, + "grad_norm": 10.989320944549025, + "learning_rate": 1.527777777777778e-05, + "loss": 1.739, + "step": 44 + }, + { + "epoch": 0.015991656527029375, + "grad_norm": 4.300936602591115, + "learning_rate": 1.597222222222222e-05, + "loss": 1.1078, + "step": 46 + }, + { + "epoch": 0.016686945941248043, + "grad_norm": 3.7539663261019856, + "learning_rate": 1.6666666666666667e-05, + "loss": 1.2701, + "step": 48 + }, + { + "epoch": 0.017382235355466714, + "grad_norm": 2.589248169352173, + "learning_rate": 1.736111111111111e-05, + "loss": 1.4452, + "step": 50 + }, + { + "epoch": 0.018077524769685382, + "grad_norm": 3.6679301322156177, + "learning_rate": 1.8055555555555555e-05, + "loss": 1.4243, + "step": 52 + }, + { + "epoch": 0.01877281418390405, + "grad_norm": 2.0885660923860074, + "learning_rate": 1.8750000000000002e-05, + "loss": 1.4453, + "step": 54 + }, + { + "epoch": 0.01946810359812272, + "grad_norm": 2.955353237610474, + "learning_rate": 1.9444444444444445e-05, + "loss": 1.5388, + "step": 56 + }, + { + "epoch": 0.020163393012341387, + "grad_norm": 3.0527006398487018, + "learning_rate": 2.013888888888889e-05, + "loss": 1.4043, + "step": 58 + }, + { + "epoch": 0.020858682426560055, + "grad_norm": 1.9862208864154767, + "learning_rate": 2.0833333333333336e-05, + "loss": 1.1007, + "step": 60 + }, + { + "epoch": 0.021553971840778723, + "grad_norm": 2.347361178472164, + "learning_rate": 2.152777777777778e-05, + "loss": 0.9291, + "step": 62 + }, + { + "epoch": 0.022249261254997394, + "grad_norm": 2.4812993223105995, + "learning_rate": 2.2222222222222223e-05, + "loss": 0.9592, + "step": 64 + }, + { + "epoch": 0.022944550669216062, + "grad_norm": 1.639333831845777, + "learning_rate": 2.2916666666666667e-05, + "loss": 1.0645, + "step": 66 + }, + { + "epoch": 0.02363984008343473, + "grad_norm": 2.92858351082494, + "learning_rate": 2.361111111111111e-05, + "loss": 1.4269, + "step": 68 + }, + { + "epoch": 0.024335129497653398, + "grad_norm": 2.8503434812871604, + "learning_rate": 2.4305555555555558e-05, + "loss": 0.7829, + "step": 70 + }, + { + "epoch": 0.025030418911872066, + "grad_norm": 2.4875590459354107, + "learning_rate": 2.5e-05, + "loss": 0.9733, + "step": 72 + }, + { + "epoch": 0.025725708326090734, + "grad_norm": 5.2567545525905075, + "learning_rate": 2.5694444444444445e-05, + "loss": 1.3559, + "step": 74 + }, + { + "epoch": 0.026420997740309402, + "grad_norm": 4.68745753567611, + "learning_rate": 2.6388888888888892e-05, + "loss": 1.1499, + "step": 76 + }, + { + "epoch": 0.027116287154528074, + "grad_norm": 2.810345453706711, + "learning_rate": 2.7083333333333332e-05, + "loss": 0.8636, + "step": 78 + }, + { + "epoch": 0.02781157656874674, + "grad_norm": 3.0144493626195388, + "learning_rate": 2.777777777777778e-05, + "loss": 0.9274, + "step": 80 + }, + { + "epoch": 0.02850686598296541, + "grad_norm": 2.3263036535508523, + "learning_rate": 2.8472222222222223e-05, + "loss": 1.3979, + "step": 82 + }, + { + "epoch": 0.029202155397184078, + "grad_norm": 1.6009019341419857, + "learning_rate": 2.916666666666667e-05, + "loss": 0.9039, + "step": 84 + }, + { + "epoch": 0.029897444811402746, + "grad_norm": 2.0637506891442294, + "learning_rate": 2.9861111111111113e-05, + "loss": 1.5187, + "step": 86 + }, + { + "epoch": 0.030592734225621414, + "grad_norm": 1.5533001268209932, + "learning_rate": 3.055555555555556e-05, + "loss": 0.8937, + "step": 88 + }, + { + "epoch": 0.03128802363984008, + "grad_norm": 1.9974857545819733, + "learning_rate": 3.125e-05, + "loss": 0.8218, + "step": 90 + }, + { + "epoch": 0.03198331305405875, + "grad_norm": 1.871899331408953, + "learning_rate": 3.194444444444444e-05, + "loss": 1.2451, + "step": 92 + }, + { + "epoch": 0.03267860246827742, + "grad_norm": 1.591601830348497, + "learning_rate": 3.263888888888889e-05, + "loss": 0.7485, + "step": 94 + }, + { + "epoch": 0.033373891882496086, + "grad_norm": 2.404166647711005, + "learning_rate": 3.3333333333333335e-05, + "loss": 1.1587, + "step": 96 + }, + { + "epoch": 0.03406918129671476, + "grad_norm": 1.581080788392888, + "learning_rate": 3.402777777777778e-05, + "loss": 0.9578, + "step": 98 + }, + { + "epoch": 0.03476447071093343, + "grad_norm": 2.1551207338771547, + "learning_rate": 3.472222222222222e-05, + "loss": 1.1305, + "step": 100 + }, + { + "epoch": 0.0354597601251521, + "grad_norm": 4.2246272812704, + "learning_rate": 3.541666666666667e-05, + "loss": 1.04, + "step": 102 + }, + { + "epoch": 0.036155049539370765, + "grad_norm": 2.5526898161765588, + "learning_rate": 3.611111111111111e-05, + "loss": 1.0743, + "step": 104 + }, + { + "epoch": 0.03685033895358943, + "grad_norm": 1.9784815137623597, + "learning_rate": 3.6805555555555556e-05, + "loss": 0.9667, + "step": 106 + }, + { + "epoch": 0.0375456283678081, + "grad_norm": 1.9131648200880944, + "learning_rate": 3.7500000000000003e-05, + "loss": 0.8951, + "step": 108 + }, + { + "epoch": 0.03824091778202677, + "grad_norm": 3.9405296351174575, + "learning_rate": 3.8194444444444444e-05, + "loss": 1.222, + "step": 110 + }, + { + "epoch": 0.03893620719624544, + "grad_norm": 13.764861545850291, + "learning_rate": 3.888888888888889e-05, + "loss": 1.0497, + "step": 112 + }, + { + "epoch": 0.039631496610464105, + "grad_norm": 3.998123122175411, + "learning_rate": 3.958333333333333e-05, + "loss": 1.0901, + "step": 114 + }, + { + "epoch": 0.04032678602468277, + "grad_norm": 3.126193921423756, + "learning_rate": 4.027777777777778e-05, + "loss": 1.1143, + "step": 116 + }, + { + "epoch": 0.04102207543890144, + "grad_norm": 2.7839926692610613, + "learning_rate": 4.0972222222222225e-05, + "loss": 1.1637, + "step": 118 + }, + { + "epoch": 0.04171736485312011, + "grad_norm": 2.591162621161276, + "learning_rate": 4.166666666666667e-05, + "loss": 1.0624, + "step": 120 + }, + { + "epoch": 0.04241265426733878, + "grad_norm": 1.4930703711545332, + "learning_rate": 4.236111111111111e-05, + "loss": 1.0239, + "step": 122 + }, + { + "epoch": 0.043107943681557445, + "grad_norm": 4.355150070532966, + "learning_rate": 4.305555555555556e-05, + "loss": 1.266, + "step": 124 + }, + { + "epoch": 0.04380323309577612, + "grad_norm": 1.8285608876277135, + "learning_rate": 4.375e-05, + "loss": 1.0667, + "step": 126 + }, + { + "epoch": 0.04449852250999479, + "grad_norm": 2.1848832742617055, + "learning_rate": 4.4444444444444447e-05, + "loss": 0.7549, + "step": 128 + }, + { + "epoch": 0.045193811924213456, + "grad_norm": 3.547857947451226, + "learning_rate": 4.5138888888888894e-05, + "loss": 0.7974, + "step": 130 + }, + { + "epoch": 0.045889101338432124, + "grad_norm": 3.372457028128184, + "learning_rate": 4.5833333333333334e-05, + "loss": 1.0482, + "step": 132 + }, + { + "epoch": 0.04658439075265079, + "grad_norm": 2.2871138548091703, + "learning_rate": 4.652777777777778e-05, + "loss": 0.8246, + "step": 134 + }, + { + "epoch": 0.04727968016686946, + "grad_norm": 1.7489408054743605, + "learning_rate": 4.722222222222222e-05, + "loss": 1.0011, + "step": 136 + }, + { + "epoch": 0.04797496958108813, + "grad_norm": 1.944650349232646, + "learning_rate": 4.791666666666667e-05, + "loss": 0.7828, + "step": 138 + }, + { + "epoch": 0.048670258995306796, + "grad_norm": 2.321619459307342, + "learning_rate": 4.8611111111111115e-05, + "loss": 1.02, + "step": 140 + }, + { + "epoch": 0.049365548409525464, + "grad_norm": 5.317732559595606, + "learning_rate": 4.930555555555556e-05, + "loss": 0.9539, + "step": 142 + }, + { + "epoch": 0.05006083782374413, + "grad_norm": 1.5887292172279854, + "learning_rate": 5e-05, + "loss": 0.7961, + "step": 144 + }, + { + "epoch": 0.0507561272379628, + "grad_norm": 2.9987019111854964, + "learning_rate": 5.069444444444444e-05, + "loss": 1.0018, + "step": 146 + }, + { + "epoch": 0.05145141665218147, + "grad_norm": 5.63878906132749, + "learning_rate": 5.138888888888889e-05, + "loss": 0.9278, + "step": 148 + }, + { + "epoch": 0.052146706066400136, + "grad_norm": 2.4849685204332834, + "learning_rate": 5.208333333333334e-05, + "loss": 0.7531, + "step": 150 + }, + { + "epoch": 0.052146706066400136, + "eval_loss": 0.9286500215530396, + "eval_runtime": 711.2619, + "eval_samples_per_second": 6.808, + "eval_steps_per_second": 0.214, + "step": 150 + }, + { + "epoch": 0.052841995480618804, + "grad_norm": 3.4927981580288776, + "learning_rate": 5.2777777777777784e-05, + "loss": 0.7422, + "step": 152 + }, + { + "epoch": 0.05353728489483748, + "grad_norm": 2.6593724943984682, + "learning_rate": 5.3472222222222224e-05, + "loss": 0.7762, + "step": 154 + }, + { + "epoch": 0.05423257430905615, + "grad_norm": 2.99709354088536, + "learning_rate": 5.4166666666666664e-05, + "loss": 0.8658, + "step": 156 + }, + { + "epoch": 0.054927863723274815, + "grad_norm": 3.9196361623391414, + "learning_rate": 5.486111111111112e-05, + "loss": 1.1783, + "step": 158 + }, + { + "epoch": 0.05562315313749348, + "grad_norm": 3.022562685608673, + "learning_rate": 5.555555555555556e-05, + "loss": 1.0602, + "step": 160 + }, + { + "epoch": 0.05631844255171215, + "grad_norm": 3.292942684053579, + "learning_rate": 5.6250000000000005e-05, + "loss": 0.8561, + "step": 162 + }, + { + "epoch": 0.05701373196593082, + "grad_norm": 2.397775023338686, + "learning_rate": 5.6944444444444445e-05, + "loss": 0.9561, + "step": 164 + }, + { + "epoch": 0.05770902138014949, + "grad_norm": 3.0546714312119643, + "learning_rate": 5.7638888888888886e-05, + "loss": 0.8274, + "step": 166 + }, + { + "epoch": 0.058404310794368156, + "grad_norm": 2.4021883380894393, + "learning_rate": 5.833333333333334e-05, + "loss": 0.8492, + "step": 168 + }, + { + "epoch": 0.059099600208586824, + "grad_norm": 2.6052829770116293, + "learning_rate": 5.902777777777778e-05, + "loss": 1.1005, + "step": 170 + }, + { + "epoch": 0.05979488962280549, + "grad_norm": 1.6838192892320467, + "learning_rate": 5.972222222222223e-05, + "loss": 1.0157, + "step": 172 + }, + { + "epoch": 0.06049017903702416, + "grad_norm": 3.98880214871885, + "learning_rate": 6.041666666666667e-05, + "loss": 0.8136, + "step": 174 + }, + { + "epoch": 0.06118546845124283, + "grad_norm": 4.81494345341073, + "learning_rate": 6.111111111111112e-05, + "loss": 0.9475, + "step": 176 + }, + { + "epoch": 0.061880757865461496, + "grad_norm": 1.9926278890091862, + "learning_rate": 6.180555555555556e-05, + "loss": 0.6549, + "step": 178 + }, + { + "epoch": 0.06257604727968016, + "grad_norm": 1.750353030728397, + "learning_rate": 6.25e-05, + "loss": 1.1442, + "step": 180 + }, + { + "epoch": 0.06327133669389884, + "grad_norm": 4.77249782692129, + "learning_rate": 6.319444444444444e-05, + "loss": 1.1927, + "step": 182 + }, + { + "epoch": 0.0639666261081175, + "grad_norm": 1.866901788617278, + "learning_rate": 6.388888888888888e-05, + "loss": 1.0032, + "step": 184 + }, + { + "epoch": 0.06466191552233617, + "grad_norm": 1.7495859751833545, + "learning_rate": 6.458333333333334e-05, + "loss": 0.8439, + "step": 186 + }, + { + "epoch": 0.06535720493655484, + "grad_norm": 2.971674018184174, + "learning_rate": 6.527777777777778e-05, + "loss": 0.9817, + "step": 188 + }, + { + "epoch": 0.06605249435077351, + "grad_norm": 2.3753292673540165, + "learning_rate": 6.597222222222223e-05, + "loss": 0.9919, + "step": 190 + }, + { + "epoch": 0.06674778376499217, + "grad_norm": 2.7019148741557744, + "learning_rate": 6.666666666666667e-05, + "loss": 1.1442, + "step": 192 + }, + { + "epoch": 0.06744307317921085, + "grad_norm": 1.8670113287712482, + "learning_rate": 6.736111111111112e-05, + "loss": 0.8905, + "step": 194 + }, + { + "epoch": 0.06813836259342952, + "grad_norm": 1.4199145680760579, + "learning_rate": 6.805555555555556e-05, + "loss": 0.7223, + "step": 196 + }, + { + "epoch": 0.06883365200764818, + "grad_norm": 3.894200902880186, + "learning_rate": 6.875e-05, + "loss": 0.9005, + "step": 198 + }, + { + "epoch": 0.06952894142186686, + "grad_norm": 3.2710376491241955, + "learning_rate": 6.944444444444444e-05, + "loss": 1.1605, + "step": 200 + }, + { + "epoch": 0.07022423083608552, + "grad_norm": 1.6459754670035065, + "learning_rate": 7.013888888888888e-05, + "loss": 0.8551, + "step": 202 + }, + { + "epoch": 0.0709195202503042, + "grad_norm": 4.361031640374508, + "learning_rate": 7.083333333333334e-05, + "loss": 0.7007, + "step": 204 + }, + { + "epoch": 0.07161480966452285, + "grad_norm": 3.573741549123141, + "learning_rate": 7.152777777777778e-05, + "loss": 1.1396, + "step": 206 + }, + { + "epoch": 0.07231009907874153, + "grad_norm": 3.296990311359108, + "learning_rate": 7.222222222222222e-05, + "loss": 0.8695, + "step": 208 + }, + { + "epoch": 0.07300538849296019, + "grad_norm": 6.769659823038884, + "learning_rate": 7.291666666666667e-05, + "loss": 1.0511, + "step": 210 + }, + { + "epoch": 0.07370067790717887, + "grad_norm": 1.6695233666860303, + "learning_rate": 7.361111111111111e-05, + "loss": 0.8174, + "step": 212 + }, + { + "epoch": 0.07439596732139753, + "grad_norm": 1.3543755216281146, + "learning_rate": 7.430555555555557e-05, + "loss": 0.7137, + "step": 214 + }, + { + "epoch": 0.0750912567356162, + "grad_norm": 4.861063813937456, + "learning_rate": 7.500000000000001e-05, + "loss": 1.0132, + "step": 216 + }, + { + "epoch": 0.07578654614983486, + "grad_norm": 5.715913176528681, + "learning_rate": 7.569444444444445e-05, + "loss": 1.1657, + "step": 218 + }, + { + "epoch": 0.07648183556405354, + "grad_norm": 4.0193839358302235, + "learning_rate": 7.638888888888889e-05, + "loss": 1.0547, + "step": 220 + }, + { + "epoch": 0.0771771249782722, + "grad_norm": 2.26849134517291, + "learning_rate": 7.708333333333334e-05, + "loss": 0.9073, + "step": 222 + }, + { + "epoch": 0.07787241439249087, + "grad_norm": 4.570943697810998, + "learning_rate": 7.777777777777778e-05, + "loss": 1.3726, + "step": 224 + }, + { + "epoch": 0.07856770380670955, + "grad_norm": 1.1942436910880105, + "learning_rate": 7.847222222222222e-05, + "loss": 0.8146, + "step": 226 + }, + { + "epoch": 0.07926299322092821, + "grad_norm": 2.111849588751211, + "learning_rate": 7.916666666666666e-05, + "loss": 1.1157, + "step": 228 + }, + { + "epoch": 0.07995828263514689, + "grad_norm": 1.0283088880069582, + "learning_rate": 7.986111111111112e-05, + "loss": 0.767, + "step": 230 + }, + { + "epoch": 0.08065357204936555, + "grad_norm": 1.2834055069208525, + "learning_rate": 8.055555555555556e-05, + "loss": 0.6625, + "step": 232 + }, + { + "epoch": 0.08134886146358422, + "grad_norm": 1.3772942873595098, + "learning_rate": 8.125000000000001e-05, + "loss": 0.8065, + "step": 234 + }, + { + "epoch": 0.08204415087780288, + "grad_norm": 1.5113456549735176, + "learning_rate": 8.194444444444445e-05, + "loss": 0.8606, + "step": 236 + }, + { + "epoch": 0.08273944029202156, + "grad_norm": 1.5765846352838255, + "learning_rate": 8.263888888888889e-05, + "loss": 0.8335, + "step": 238 + }, + { + "epoch": 0.08343472970624022, + "grad_norm": 2.4873462478329404, + "learning_rate": 8.333333333333334e-05, + "loss": 0.9705, + "step": 240 + }, + { + "epoch": 0.0841300191204589, + "grad_norm": 1.2369219925635513, + "learning_rate": 8.402777777777778e-05, + "loss": 0.6061, + "step": 242 + }, + { + "epoch": 0.08482530853467755, + "grad_norm": 2.542132212473201, + "learning_rate": 8.472222222222222e-05, + "loss": 0.9142, + "step": 244 + }, + { + "epoch": 0.08552059794889623, + "grad_norm": 2.0301734217803022, + "learning_rate": 8.541666666666666e-05, + "loss": 0.8997, + "step": 246 + }, + { + "epoch": 0.08621588736311489, + "grad_norm": 1.8605316982945626, + "learning_rate": 8.611111111111112e-05, + "loss": 1.005, + "step": 248 + }, + { + "epoch": 0.08691117677733357, + "grad_norm": 1.193555257951713, + "learning_rate": 8.680555555555556e-05, + "loss": 0.8617, + "step": 250 + }, + { + "epoch": 0.08760646619155224, + "grad_norm": 1.243815428863678, + "learning_rate": 8.75e-05, + "loss": 0.6261, + "step": 252 + }, + { + "epoch": 0.0883017556057709, + "grad_norm": 1.6487754861704442, + "learning_rate": 8.819444444444445e-05, + "loss": 0.9219, + "step": 254 + }, + { + "epoch": 0.08899704501998958, + "grad_norm": 1.1768410857322613, + "learning_rate": 8.888888888888889e-05, + "loss": 0.8563, + "step": 256 + }, + { + "epoch": 0.08969233443420824, + "grad_norm": 1.1155265191420587, + "learning_rate": 8.958333333333335e-05, + "loss": 0.998, + "step": 258 + }, + { + "epoch": 0.09038762384842691, + "grad_norm": 1.4432456616674065, + "learning_rate": 9.027777777777779e-05, + "loss": 0.8755, + "step": 260 + }, + { + "epoch": 0.09108291326264557, + "grad_norm": 1.6013486668654413, + "learning_rate": 9.097222222222223e-05, + "loss": 0.6998, + "step": 262 + }, + { + "epoch": 0.09177820267686425, + "grad_norm": 0.7869968770186737, + "learning_rate": 9.166666666666667e-05, + "loss": 0.7574, + "step": 264 + }, + { + "epoch": 0.09247349209108291, + "grad_norm": 2.1117903903864566, + "learning_rate": 9.236111111111112e-05, + "loss": 0.8436, + "step": 266 + }, + { + "epoch": 0.09316878150530158, + "grad_norm": 1.3582999584721895, + "learning_rate": 9.305555555555556e-05, + "loss": 0.8503, + "step": 268 + }, + { + "epoch": 0.09386407091952025, + "grad_norm": 1.5674581009005415, + "learning_rate": 9.375e-05, + "loss": 0.9561, + "step": 270 + }, + { + "epoch": 0.09455936033373892, + "grad_norm": 1.0274246934159952, + "learning_rate": 9.444444444444444e-05, + "loss": 0.7537, + "step": 272 + }, + { + "epoch": 0.09525464974795758, + "grad_norm": 0.9595343432519174, + "learning_rate": 9.513888888888888e-05, + "loss": 0.7855, + "step": 274 + }, + { + "epoch": 0.09594993916217626, + "grad_norm": 1.3313115114367815, + "learning_rate": 9.583333333333334e-05, + "loss": 0.7009, + "step": 276 + }, + { + "epoch": 0.09664522857639492, + "grad_norm": 1.4409463331317498, + "learning_rate": 9.652777777777779e-05, + "loss": 1.0332, + "step": 278 + }, + { + "epoch": 0.09734051799061359, + "grad_norm": 1.5445848213023137, + "learning_rate": 9.722222222222223e-05, + "loss": 0.7352, + "step": 280 + }, + { + "epoch": 0.09803580740483227, + "grad_norm": 1.855518620927316, + "learning_rate": 9.791666666666667e-05, + "loss": 0.7191, + "step": 282 + }, + { + "epoch": 0.09873109681905093, + "grad_norm": 1.4033396985161997, + "learning_rate": 9.861111111111112e-05, + "loss": 0.7886, + "step": 284 + }, + { + "epoch": 0.0994263862332696, + "grad_norm": 1.9951521438049904, + "learning_rate": 9.930555555555556e-05, + "loss": 0.902, + "step": 286 + }, + { + "epoch": 0.10012167564748826, + "grad_norm": 1.1360934228431687, + "learning_rate": 0.0001, + "loss": 0.8655, + "step": 288 + }, + { + "epoch": 0.10081696506170694, + "grad_norm": 1.1225735433900375, + "learning_rate": 0.00010069444444444445, + "loss": 0.6851, + "step": 290 + }, + { + "epoch": 0.1015122544759256, + "grad_norm": 0.770446891371583, + "learning_rate": 0.00010138888888888889, + "loss": 0.7775, + "step": 292 + }, + { + "epoch": 0.10220754389014428, + "grad_norm": 0.797064180835607, + "learning_rate": 0.00010208333333333333, + "loss": 0.6567, + "step": 294 + }, + { + "epoch": 0.10290283330436294, + "grad_norm": 0.9876188134326442, + "learning_rate": 0.00010277777777777778, + "loss": 0.7299, + "step": 296 + }, + { + "epoch": 0.10359812271858161, + "grad_norm": 0.799601623643537, + "learning_rate": 0.00010347222222222223, + "loss": 0.7891, + "step": 298 + }, + { + "epoch": 0.10429341213280027, + "grad_norm": 0.8791512281362982, + "learning_rate": 0.00010416666666666667, + "loss": 0.677, + "step": 300 + }, + { + "epoch": 0.10429341213280027, + "eval_loss": 0.6939894556999207, + "eval_runtime": 709.5268, + "eval_samples_per_second": 6.824, + "eval_steps_per_second": 0.214, + "step": 300 + }, + { + "epoch": 0.10498870154701895, + "grad_norm": 1.329564645811689, + "learning_rate": 0.00010486111111111113, + "loss": 0.7511, + "step": 302 + }, + { + "epoch": 0.10568399096123761, + "grad_norm": 0.7130415058241142, + "learning_rate": 0.00010555555555555557, + "loss": 0.709, + "step": 304 + }, + { + "epoch": 0.10637928037545628, + "grad_norm": 1.1294733411370705, + "learning_rate": 0.00010625000000000001, + "loss": 0.7781, + "step": 306 + }, + { + "epoch": 0.10707456978967496, + "grad_norm": 0.581727680778003, + "learning_rate": 0.00010694444444444445, + "loss": 0.6296, + "step": 308 + }, + { + "epoch": 0.10776985920389362, + "grad_norm": 0.9855391514311871, + "learning_rate": 0.00010763888888888889, + "loss": 0.7852, + "step": 310 + }, + { + "epoch": 0.1084651486181123, + "grad_norm": 0.5708379609857769, + "learning_rate": 0.00010833333333333333, + "loss": 0.6759, + "step": 312 + }, + { + "epoch": 0.10916043803233096, + "grad_norm": 0.7243330859752051, + "learning_rate": 0.00010902777777777777, + "loss": 0.6326, + "step": 314 + }, + { + "epoch": 0.10985572744654963, + "grad_norm": 1.3922163003264714, + "learning_rate": 0.00010972222222222224, + "loss": 0.5406, + "step": 316 + }, + { + "epoch": 0.11055101686076829, + "grad_norm": 2.604851740418153, + "learning_rate": 0.00011041666666666668, + "loss": 0.8013, + "step": 318 + }, + { + "epoch": 0.11124630627498697, + "grad_norm": 1.83511037983023, + "learning_rate": 0.00011111111111111112, + "loss": 0.8048, + "step": 320 + }, + { + "epoch": 0.11194159568920563, + "grad_norm": 1.6737764614655666, + "learning_rate": 0.00011180555555555556, + "loss": 0.6943, + "step": 322 + }, + { + "epoch": 0.1126368851034243, + "grad_norm": 1.077667781888673, + "learning_rate": 0.00011250000000000001, + "loss": 0.8054, + "step": 324 + }, + { + "epoch": 0.11333217451764296, + "grad_norm": 0.5597693838209001, + "learning_rate": 0.00011319444444444445, + "loss": 0.6251, + "step": 326 + }, + { + "epoch": 0.11402746393186164, + "grad_norm": 0.5636865078063477, + "learning_rate": 0.00011388888888888889, + "loss": 0.6832, + "step": 328 + }, + { + "epoch": 0.1147227533460803, + "grad_norm": 0.6445176566556912, + "learning_rate": 0.00011458333333333333, + "loss": 0.6661, + "step": 330 + }, + { + "epoch": 0.11541804276029898, + "grad_norm": 0.607532412895966, + "learning_rate": 0.00011527777777777777, + "loss": 0.7026, + "step": 332 + }, + { + "epoch": 0.11611333217451764, + "grad_norm": 1.0496949694240345, + "learning_rate": 0.00011597222222222224, + "loss": 0.6451, + "step": 334 + }, + { + "epoch": 0.11680862158873631, + "grad_norm": 0.9469233272179363, + "learning_rate": 0.00011666666666666668, + "loss": 0.6694, + "step": 336 + }, + { + "epoch": 0.11750391100295499, + "grad_norm": 1.3789882614528595, + "learning_rate": 0.00011736111111111112, + "loss": 0.7031, + "step": 338 + }, + { + "epoch": 0.11819920041717365, + "grad_norm": 1.2016589928587922, + "learning_rate": 0.00011805555555555556, + "loss": 0.6676, + "step": 340 + }, + { + "epoch": 0.11889448983139232, + "grad_norm": 1.3112845410865746, + "learning_rate": 0.00011875, + "loss": 0.7236, + "step": 342 + }, + { + "epoch": 0.11958977924561098, + "grad_norm": 0.6278789052805739, + "learning_rate": 0.00011944444444444445, + "loss": 0.6249, + "step": 344 + }, + { + "epoch": 0.12028506865982966, + "grad_norm": 0.5405148902553805, + "learning_rate": 0.0001201388888888889, + "loss": 0.6412, + "step": 346 + }, + { + "epoch": 0.12098035807404832, + "grad_norm": 1.6923616138961255, + "learning_rate": 0.00012083333333333333, + "loss": 0.7017, + "step": 348 + }, + { + "epoch": 0.121675647488267, + "grad_norm": 1.5994113095813072, + "learning_rate": 0.00012152777777777777, + "loss": 0.7075, + "step": 350 + }, + { + "epoch": 0.12237093690248566, + "grad_norm": 2.3083516502461783, + "learning_rate": 0.00012222222222222224, + "loss": 0.7755, + "step": 352 + }, + { + "epoch": 0.12306622631670433, + "grad_norm": 0.8769167165306447, + "learning_rate": 0.00012291666666666668, + "loss": 0.7428, + "step": 354 + }, + { + "epoch": 0.12376151573092299, + "grad_norm": 0.4456469638797518, + "learning_rate": 0.00012361111111111112, + "loss": 0.7002, + "step": 356 + }, + { + "epoch": 0.12445680514514167, + "grad_norm": 0.8199993647792723, + "learning_rate": 0.00012430555555555556, + "loss": 0.7222, + "step": 358 + }, + { + "epoch": 0.12515209455936033, + "grad_norm": 0.3741084955970339, + "learning_rate": 0.000125, + "loss": 0.6821, + "step": 360 + }, + { + "epoch": 0.125847383973579, + "grad_norm": 0.2972203241099783, + "learning_rate": 0.00012569444444444444, + "loss": 0.7083, + "step": 362 + }, + { + "epoch": 0.12654267338779768, + "grad_norm": 0.40651740632246575, + "learning_rate": 0.00012638888888888888, + "loss": 0.7144, + "step": 364 + }, + { + "epoch": 0.12723796280201635, + "grad_norm": 0.4388093199704831, + "learning_rate": 0.00012708333333333332, + "loss": 0.6863, + "step": 366 + }, + { + "epoch": 0.127933252216235, + "grad_norm": 0.45131267837810835, + "learning_rate": 0.00012777777777777776, + "loss": 0.6329, + "step": 368 + }, + { + "epoch": 0.12862854163045367, + "grad_norm": 0.3837830352665476, + "learning_rate": 0.00012847222222222223, + "loss": 0.6938, + "step": 370 + }, + { + "epoch": 0.12932383104467235, + "grad_norm": 0.6378624076702905, + "learning_rate": 0.00012916666666666667, + "loss": 0.6433, + "step": 372 + }, + { + "epoch": 0.13001912045889102, + "grad_norm": 0.41344403509072675, + "learning_rate": 0.0001298611111111111, + "loss": 0.6892, + "step": 374 + }, + { + "epoch": 0.13071440987310967, + "grad_norm": 1.3428471718098582, + "learning_rate": 0.00013055555555555555, + "loss": 0.7793, + "step": 376 + }, + { + "epoch": 0.13140969928732835, + "grad_norm": 0.6202275876483008, + "learning_rate": 0.00013125000000000002, + "loss": 0.6836, + "step": 378 + }, + { + "epoch": 0.13210498870154702, + "grad_norm": 0.774014383396004, + "learning_rate": 0.00013194444444444446, + "loss": 0.701, + "step": 380 + }, + { + "epoch": 0.1328002781157657, + "grad_norm": 1.0650744092292224, + "learning_rate": 0.0001326388888888889, + "loss": 0.6562, + "step": 382 + }, + { + "epoch": 0.13349556752998434, + "grad_norm": 0.5540168492927294, + "learning_rate": 0.00013333333333333334, + "loss": 0.6267, + "step": 384 + }, + { + "epoch": 0.13419085694420302, + "grad_norm": 0.6403086140920178, + "learning_rate": 0.00013402777777777778, + "loss": 0.6268, + "step": 386 + }, + { + "epoch": 0.1348861463584217, + "grad_norm": 0.9197218298114509, + "learning_rate": 0.00013472222222222225, + "loss": 0.7208, + "step": 388 + }, + { + "epoch": 0.13558143577264037, + "grad_norm": 0.4235387152144674, + "learning_rate": 0.0001354166666666667, + "loss": 0.6057, + "step": 390 + }, + { + "epoch": 0.13627672518685904, + "grad_norm": 0.425648636635043, + "learning_rate": 0.00013611111111111113, + "loss": 0.6387, + "step": 392 + }, + { + "epoch": 0.1369720146010777, + "grad_norm": 1.034952396366508, + "learning_rate": 0.00013680555555555557, + "loss": 0.7307, + "step": 394 + }, + { + "epoch": 0.13766730401529637, + "grad_norm": 0.8865505732510678, + "learning_rate": 0.0001375, + "loss": 0.6547, + "step": 396 + }, + { + "epoch": 0.13836259342951504, + "grad_norm": 0.6490094573088415, + "learning_rate": 0.00013819444444444445, + "loss": 0.6909, + "step": 398 + }, + { + "epoch": 0.13905788284373372, + "grad_norm": 0.8592713330921486, + "learning_rate": 0.0001388888888888889, + "loss": 0.6442, + "step": 400 + }, + { + "epoch": 0.13975317225795236, + "grad_norm": 1.0279375953862069, + "learning_rate": 0.00013958333333333333, + "loss": 0.6907, + "step": 402 + }, + { + "epoch": 0.14044846167217104, + "grad_norm": 0.6151057351983696, + "learning_rate": 0.00014027777777777777, + "loss": 0.697, + "step": 404 + }, + { + "epoch": 0.1411437510863897, + "grad_norm": 0.7417879717121144, + "learning_rate": 0.00014097222222222224, + "loss": 0.698, + "step": 406 + }, + { + "epoch": 0.1418390405006084, + "grad_norm": 0.5161453091859882, + "learning_rate": 0.00014166666666666668, + "loss": 0.6915, + "step": 408 + }, + { + "epoch": 0.14253432991482703, + "grad_norm": 0.5667521096080546, + "learning_rate": 0.00014236111111111112, + "loss": 0.6609, + "step": 410 + }, + { + "epoch": 0.1432296193290457, + "grad_norm": 0.7560317583703429, + "learning_rate": 0.00014305555555555556, + "loss": 0.6392, + "step": 412 + }, + { + "epoch": 0.14392490874326438, + "grad_norm": 0.5456303981546313, + "learning_rate": 0.00014375, + "loss": 0.7561, + "step": 414 + }, + { + "epoch": 0.14462019815748306, + "grad_norm": 0.4218469018151631, + "learning_rate": 0.00014444444444444444, + "loss": 0.675, + "step": 416 + }, + { + "epoch": 0.14531548757170173, + "grad_norm": 0.3790517974518404, + "learning_rate": 0.00014513888888888888, + "loss": 0.6697, + "step": 418 + }, + { + "epoch": 0.14601077698592038, + "grad_norm": 0.36495171567914964, + "learning_rate": 0.00014583333333333335, + "loss": 0.6467, + "step": 420 + }, + { + "epoch": 0.14670606640013906, + "grad_norm": 0.3793520501177419, + "learning_rate": 0.00014652777777777779, + "loss": 0.6234, + "step": 422 + }, + { + "epoch": 0.14740135581435773, + "grad_norm": 0.6214905371013544, + "learning_rate": 0.00014722222222222223, + "loss": 0.64, + "step": 424 + }, + { + "epoch": 0.1480966452285764, + "grad_norm": 0.4103438113660832, + "learning_rate": 0.0001479166666666667, + "loss": 0.6174, + "step": 426 + }, + { + "epoch": 0.14879193464279505, + "grad_norm": 0.5802311029669485, + "learning_rate": 0.00014861111111111113, + "loss": 0.6941, + "step": 428 + }, + { + "epoch": 0.14948722405701373, + "grad_norm": 0.4876572424583591, + "learning_rate": 0.00014930555555555557, + "loss": 0.6178, + "step": 430 + }, + { + "epoch": 0.1501825134712324, + "grad_norm": 0.6252220373472688, + "learning_rate": 0.00015000000000000001, + "loss": 0.692, + "step": 432 + }, + { + "epoch": 0.15087780288545108, + "grad_norm": 1.516758455176553, + "learning_rate": 0.00015069444444444445, + "loss": 0.6812, + "step": 434 + }, + { + "epoch": 0.15157309229966973, + "grad_norm": 0.48294685446689867, + "learning_rate": 0.0001513888888888889, + "loss": 0.7085, + "step": 436 + }, + { + "epoch": 0.1522683817138884, + "grad_norm": 0.414196721150167, + "learning_rate": 0.00015208333333333333, + "loss": 0.673, + "step": 438 + }, + { + "epoch": 0.15296367112810708, + "grad_norm": 0.7294881062503469, + "learning_rate": 0.00015277777777777777, + "loss": 0.6415, + "step": 440 + }, + { + "epoch": 0.15365896054232575, + "grad_norm": 0.4846932912054438, + "learning_rate": 0.00015347222222222224, + "loss": 0.6644, + "step": 442 + }, + { + "epoch": 0.1543542499565444, + "grad_norm": 0.6067400167426414, + "learning_rate": 0.00015416666666666668, + "loss": 0.6816, + "step": 444 + }, + { + "epoch": 0.15504953937076307, + "grad_norm": 0.5586278026791864, + "learning_rate": 0.00015486111111111112, + "loss": 0.6223, + "step": 446 + }, + { + "epoch": 0.15574482878498175, + "grad_norm": 0.3947236166856149, + "learning_rate": 0.00015555555555555556, + "loss": 0.7297, + "step": 448 + }, + { + "epoch": 0.15644011819920042, + "grad_norm": 0.371457756887947, + "learning_rate": 0.00015625, + "loss": 0.6099, + "step": 450 + }, + { + "epoch": 0.15644011819920042, + "eval_loss": 0.6634477376937866, + "eval_runtime": 706.8027, + "eval_samples_per_second": 6.851, + "eval_steps_per_second": 0.215, + "step": 450 + }, + { + "epoch": 0.1571354076134191, + "grad_norm": 0.4157928192338373, + "learning_rate": 0.00015694444444444444, + "loss": 0.7163, + "step": 452 + }, + { + "epoch": 0.15783069702763775, + "grad_norm": 0.6318513446857751, + "learning_rate": 0.00015763888888888888, + "loss": 0.658, + "step": 454 + }, + { + "epoch": 0.15852598644185642, + "grad_norm": 0.3188170086808347, + "learning_rate": 0.00015833333333333332, + "loss": 0.5966, + "step": 456 + }, + { + "epoch": 0.1592212758560751, + "grad_norm": 0.4873146052629784, + "learning_rate": 0.00015902777777777776, + "loss": 0.687, + "step": 458 + }, + { + "epoch": 0.15991656527029377, + "grad_norm": 0.3939618900754228, + "learning_rate": 0.00015972222222222223, + "loss": 0.6704, + "step": 460 + }, + { + "epoch": 0.16061185468451242, + "grad_norm": 0.43442241310529234, + "learning_rate": 0.00016041666666666667, + "loss": 0.6941, + "step": 462 + }, + { + "epoch": 0.1613071440987311, + "grad_norm": 0.5944395304786771, + "learning_rate": 0.0001611111111111111, + "loss": 0.5934, + "step": 464 + }, + { + "epoch": 0.16200243351294977, + "grad_norm": 0.6186667715273749, + "learning_rate": 0.00016180555555555555, + "loss": 0.6604, + "step": 466 + }, + { + "epoch": 0.16269772292716844, + "grad_norm": 0.8945416923537124, + "learning_rate": 0.00016250000000000002, + "loss": 0.6224, + "step": 468 + }, + { + "epoch": 0.1633930123413871, + "grad_norm": 1.0526200270890014, + "learning_rate": 0.00016319444444444446, + "loss": 0.616, + "step": 470 + }, + { + "epoch": 0.16408830175560576, + "grad_norm": 0.4575985966727194, + "learning_rate": 0.0001638888888888889, + "loss": 0.6591, + "step": 472 + }, + { + "epoch": 0.16478359116982444, + "grad_norm": 0.4499931204645402, + "learning_rate": 0.00016458333333333334, + "loss": 0.6644, + "step": 474 + }, + { + "epoch": 0.16547888058404311, + "grad_norm": 0.8365574384741885, + "learning_rate": 0.00016527777777777778, + "loss": 0.6503, + "step": 476 + }, + { + "epoch": 0.1661741699982618, + "grad_norm": 0.5265284650577726, + "learning_rate": 0.00016597222222222225, + "loss": 0.557, + "step": 478 + }, + { + "epoch": 0.16686945941248044, + "grad_norm": 0.6004742828917694, + "learning_rate": 0.0001666666666666667, + "loss": 0.696, + "step": 480 + }, + { + "epoch": 0.1675647488266991, + "grad_norm": 0.8653134209549845, + "learning_rate": 0.00016736111111111113, + "loss": 0.6544, + "step": 482 + }, + { + "epoch": 0.1682600382409178, + "grad_norm": 1.033230873418064, + "learning_rate": 0.00016805555555555557, + "loss": 0.641, + "step": 484 + }, + { + "epoch": 0.16895532765513646, + "grad_norm": 0.45457193405665913, + "learning_rate": 0.00016875, + "loss": 0.5952, + "step": 486 + }, + { + "epoch": 0.1696506170693551, + "grad_norm": 0.7413902971651539, + "learning_rate": 0.00016944444444444445, + "loss": 0.6306, + "step": 488 + }, + { + "epoch": 0.17034590648357378, + "grad_norm": 0.5808764628223875, + "learning_rate": 0.0001701388888888889, + "loss": 0.6714, + "step": 490 + }, + { + "epoch": 0.17104119589779246, + "grad_norm": 0.42505370383777924, + "learning_rate": 0.00017083333333333333, + "loss": 0.6432, + "step": 492 + }, + { + "epoch": 0.17173648531201113, + "grad_norm": 0.9403542369255028, + "learning_rate": 0.00017152777777777777, + "loss": 0.626, + "step": 494 + }, + { + "epoch": 0.17243177472622978, + "grad_norm": 0.41714707593148775, + "learning_rate": 0.00017222222222222224, + "loss": 0.6132, + "step": 496 + }, + { + "epoch": 0.17312706414044846, + "grad_norm": 0.6660896849726371, + "learning_rate": 0.00017291666666666668, + "loss": 0.7009, + "step": 498 + }, + { + "epoch": 0.17382235355466713, + "grad_norm": 0.5079993412341118, + "learning_rate": 0.00017361111111111112, + "loss": 0.6808, + "step": 500 + }, + { + "epoch": 0.1745176429688858, + "grad_norm": 0.3426487947129772, + "learning_rate": 0.00017430555555555556, + "loss": 0.687, + "step": 502 + }, + { + "epoch": 0.17521293238310448, + "grad_norm": 0.7316051797581208, + "learning_rate": 0.000175, + "loss": 0.686, + "step": 504 + }, + { + "epoch": 0.17590822179732313, + "grad_norm": 0.4619785653282459, + "learning_rate": 0.00017569444444444444, + "loss": 0.7019, + "step": 506 + }, + { + "epoch": 0.1766035112115418, + "grad_norm": 0.47786977912472967, + "learning_rate": 0.0001763888888888889, + "loss": 0.7097, + "step": 508 + }, + { + "epoch": 0.17729880062576048, + "grad_norm": 0.4204398291864812, + "learning_rate": 0.00017708333333333335, + "loss": 0.6715, + "step": 510 + }, + { + "epoch": 0.17799409003997915, + "grad_norm": 0.5257761541709909, + "learning_rate": 0.00017777777777777779, + "loss": 0.6675, + "step": 512 + }, + { + "epoch": 0.1786893794541978, + "grad_norm": 0.5752239420884688, + "learning_rate": 0.00017847222222222225, + "loss": 0.5847, + "step": 514 + }, + { + "epoch": 0.17938466886841647, + "grad_norm": 0.5611432017880666, + "learning_rate": 0.0001791666666666667, + "loss": 0.5978, + "step": 516 + }, + { + "epoch": 0.18007995828263515, + "grad_norm": 0.5147097358785945, + "learning_rate": 0.00017986111111111113, + "loss": 0.641, + "step": 518 + }, + { + "epoch": 0.18077524769685382, + "grad_norm": 0.4387330962078066, + "learning_rate": 0.00018055555555555557, + "loss": 0.5771, + "step": 520 + }, + { + "epoch": 0.18147053711107247, + "grad_norm": 0.5712526440788663, + "learning_rate": 0.00018125000000000001, + "loss": 0.6212, + "step": 522 + }, + { + "epoch": 0.18216582652529115, + "grad_norm": 0.6357133907029916, + "learning_rate": 0.00018194444444444445, + "loss": 0.5981, + "step": 524 + }, + { + "epoch": 0.18286111593950982, + "grad_norm": 1.2129620643054042, + "learning_rate": 0.0001826388888888889, + "loss": 0.5848, + "step": 526 + }, + { + "epoch": 0.1835564053537285, + "grad_norm": 1.651599276688714, + "learning_rate": 0.00018333333333333334, + "loss": 0.7089, + "step": 528 + }, + { + "epoch": 0.18425169476794717, + "grad_norm": 0.9051688342434142, + "learning_rate": 0.00018402777777777778, + "loss": 0.7255, + "step": 530 + }, + { + "epoch": 0.18494698418216582, + "grad_norm": 0.6932441010863684, + "learning_rate": 0.00018472222222222224, + "loss": 0.6497, + "step": 532 + }, + { + "epoch": 0.1856422735963845, + "grad_norm": 1.2163006408955903, + "learning_rate": 0.00018541666666666668, + "loss": 0.7585, + "step": 534 + }, + { + "epoch": 0.18633756301060317, + "grad_norm": 0.4387074048377486, + "learning_rate": 0.00018611111111111112, + "loss": 0.6541, + "step": 536 + }, + { + "epoch": 0.18703285242482184, + "grad_norm": 0.49430581216479236, + "learning_rate": 0.00018680555555555556, + "loss": 0.6489, + "step": 538 + }, + { + "epoch": 0.1877281418390405, + "grad_norm": 0.47561442420926275, + "learning_rate": 0.0001875, + "loss": 0.6406, + "step": 540 + }, + { + "epoch": 0.18842343125325917, + "grad_norm": 0.7046092923664611, + "learning_rate": 0.00018819444444444444, + "loss": 0.6099, + "step": 542 + }, + { + "epoch": 0.18911872066747784, + "grad_norm": 0.46256136269201026, + "learning_rate": 0.00018888888888888888, + "loss": 0.6992, + "step": 544 + }, + { + "epoch": 0.18981401008169652, + "grad_norm": 0.5489877082982352, + "learning_rate": 0.00018958333333333332, + "loss": 0.5817, + "step": 546 + }, + { + "epoch": 0.19050929949591516, + "grad_norm": 0.46129441798908893, + "learning_rate": 0.00019027777777777776, + "loss": 0.645, + "step": 548 + }, + { + "epoch": 0.19120458891013384, + "grad_norm": 0.3724226655450749, + "learning_rate": 0.00019097222222222223, + "loss": 0.6177, + "step": 550 + }, + { + "epoch": 0.1918998783243525, + "grad_norm": 0.4625796323902992, + "learning_rate": 0.00019166666666666667, + "loss": 0.6702, + "step": 552 + }, + { + "epoch": 0.1925951677385712, + "grad_norm": 1.0142124821047231, + "learning_rate": 0.0001923611111111111, + "loss": 0.7173, + "step": 554 + }, + { + "epoch": 0.19329045715278984, + "grad_norm": 0.5452830720753045, + "learning_rate": 0.00019305555555555558, + "loss": 0.6897, + "step": 556 + }, + { + "epoch": 0.1939857465670085, + "grad_norm": 0.5723214484723252, + "learning_rate": 0.00019375000000000002, + "loss": 0.6495, + "step": 558 + }, + { + "epoch": 0.19468103598122719, + "grad_norm": 0.39925844595054966, + "learning_rate": 0.00019444444444444446, + "loss": 0.6479, + "step": 560 + }, + { + "epoch": 0.19537632539544586, + "grad_norm": 0.3575565088751118, + "learning_rate": 0.0001951388888888889, + "loss": 0.6593, + "step": 562 + }, + { + "epoch": 0.19607161480966454, + "grad_norm": 0.6119892689536569, + "learning_rate": 0.00019583333333333334, + "loss": 0.6831, + "step": 564 + }, + { + "epoch": 0.19676690422388318, + "grad_norm": 0.5076569073121309, + "learning_rate": 0.00019652777777777778, + "loss": 0.6294, + "step": 566 + }, + { + "epoch": 0.19746219363810186, + "grad_norm": 0.622226505121079, + "learning_rate": 0.00019722222222222225, + "loss": 0.5551, + "step": 568 + }, + { + "epoch": 0.19815748305232053, + "grad_norm": 0.4106526912254415, + "learning_rate": 0.0001979166666666667, + "loss": 0.6503, + "step": 570 + }, + { + "epoch": 0.1988527724665392, + "grad_norm": 0.47164751383243125, + "learning_rate": 0.00019861111111111113, + "loss": 0.6992, + "step": 572 + }, + { + "epoch": 0.19954806188075785, + "grad_norm": 0.492328312395826, + "learning_rate": 0.00019930555555555557, + "loss": 0.7183, + "step": 574 + }, + { + "epoch": 0.20024335129497653, + "grad_norm": 0.5087240677439067, + "learning_rate": 0.0002, + "loss": 0.6429, + "step": 576 + }, + { + "epoch": 0.2009386407091952, + "grad_norm": 0.9311216098504759, + "learning_rate": 0.00019999992632143608, + "loss": 0.6586, + "step": 578 + }, + { + "epoch": 0.20163393012341388, + "grad_norm": 0.38840935170189844, + "learning_rate": 0.00019999970528585288, + "loss": 0.5905, + "step": 580 + }, + { + "epoch": 0.20232921953763253, + "grad_norm": 0.5966472765038273, + "learning_rate": 0.0001999993368935761, + "loss": 0.7112, + "step": 582 + }, + { + "epoch": 0.2030245089518512, + "grad_norm": 0.535232520705813, + "learning_rate": 0.00019999882114514863, + "loss": 0.7036, + "step": 584 + }, + { + "epoch": 0.20371979836606988, + "grad_norm": 0.5039916125175515, + "learning_rate": 0.0001999981580413304, + "loss": 0.7485, + "step": 586 + }, + { + "epoch": 0.20441508778028855, + "grad_norm": 0.6733262892097686, + "learning_rate": 0.0001999973475830986, + "loss": 0.7312, + "step": 588 + }, + { + "epoch": 0.20511037719450723, + "grad_norm": 0.42805740684614807, + "learning_rate": 0.00019999638977164747, + "loss": 0.6356, + "step": 590 + }, + { + "epoch": 0.20580566660872587, + "grad_norm": 0.976918546573707, + "learning_rate": 0.00019999528460838844, + "loss": 0.666, + "step": 592 + }, + { + "epoch": 0.20650095602294455, + "grad_norm": 0.674463735133944, + "learning_rate": 0.00019999403209495, + "loss": 0.6735, + "step": 594 + }, + { + "epoch": 0.20719624543716322, + "grad_norm": 0.412232119296174, + "learning_rate": 0.00019999263223317786, + "loss": 0.6364, + "step": 596 + }, + { + "epoch": 0.2078915348513819, + "grad_norm": 0.3611034413524545, + "learning_rate": 0.0001999910850251348, + "loss": 0.6368, + "step": 598 + }, + { + "epoch": 0.20858682426560055, + "grad_norm": 0.542506398091656, + "learning_rate": 0.0001999893904731007, + "loss": 0.7292, + "step": 600 + }, + { + "epoch": 0.20858682426560055, + "eval_loss": 0.6517693400382996, + "eval_runtime": 707.4674, + "eval_samples_per_second": 6.844, + "eval_steps_per_second": 0.215, + "step": 600 + }, + { + "epoch": 0.20928211367981922, + "grad_norm": 0.4799286290563759, + "learning_rate": 0.0001999875485795727, + "loss": 0.6609, + "step": 602 + }, + { + "epoch": 0.2099774030940379, + "grad_norm": 0.41830446575524177, + "learning_rate": 0.0001999855593472649, + "loss": 0.6084, + "step": 604 + }, + { + "epoch": 0.21067269250825657, + "grad_norm": 0.8865562086549428, + "learning_rate": 0.00019998342277910856, + "loss": 0.6204, + "step": 606 + }, + { + "epoch": 0.21136798192247522, + "grad_norm": 0.5567410910026902, + "learning_rate": 0.00019998113887825206, + "loss": 0.7087, + "step": 608 + }, + { + "epoch": 0.2120632713366939, + "grad_norm": 0.4229098163428897, + "learning_rate": 0.000199978707648061, + "loss": 0.6403, + "step": 610 + }, + { + "epoch": 0.21275856075091257, + "grad_norm": 0.7793555918286379, + "learning_rate": 0.00019997612909211784, + "loss": 0.6147, + "step": 612 + }, + { + "epoch": 0.21345385016513124, + "grad_norm": 0.49302383416102263, + "learning_rate": 0.00019997340321422228, + "loss": 0.5771, + "step": 614 + }, + { + "epoch": 0.21414913957934992, + "grad_norm": 1.0807551778698754, + "learning_rate": 0.00019997053001839115, + "loss": 0.6538, + "step": 616 + }, + { + "epoch": 0.21484442899356856, + "grad_norm": 0.5935042706034646, + "learning_rate": 0.0001999675095088583, + "loss": 0.6058, + "step": 618 + }, + { + "epoch": 0.21553971840778724, + "grad_norm": 0.5151203960605611, + "learning_rate": 0.00019996434169007468, + "loss": 0.6138, + "step": 620 + }, + { + "epoch": 0.21623500782200591, + "grad_norm": 0.7837579499467073, + "learning_rate": 0.00019996102656670824, + "loss": 0.657, + "step": 622 + }, + { + "epoch": 0.2169302972362246, + "grad_norm": 0.5438202413527335, + "learning_rate": 0.0001999575641436441, + "loss": 0.6642, + "step": 624 + }, + { + "epoch": 0.21762558665044324, + "grad_norm": 0.5566641749580342, + "learning_rate": 0.00019995395442598435, + "loss": 0.6813, + "step": 626 + }, + { + "epoch": 0.2183208760646619, + "grad_norm": 0.9345190838089675, + "learning_rate": 0.0001999501974190482, + "loss": 0.684, + "step": 628 + }, + { + "epoch": 0.2190161654788806, + "grad_norm": 0.48677420225080537, + "learning_rate": 0.00019994629312837186, + "loss": 0.6481, + "step": 630 + }, + { + "epoch": 0.21971145489309926, + "grad_norm": 1.3826373483976924, + "learning_rate": 0.00019994224155970856, + "loss": 0.7222, + "step": 632 + }, + { + "epoch": 0.2204067443073179, + "grad_norm": 0.9031189580678588, + "learning_rate": 0.00019993804271902857, + "loss": 0.6809, + "step": 634 + }, + { + "epoch": 0.22110203372153658, + "grad_norm": 0.5674519795217096, + "learning_rate": 0.00019993369661251923, + "loss": 0.6184, + "step": 636 + }, + { + "epoch": 0.22179732313575526, + "grad_norm": 2.5294344265719135, + "learning_rate": 0.0001999292032465848, + "loss": 0.7686, + "step": 638 + }, + { + "epoch": 0.22249261254997393, + "grad_norm": 2.8855656605632047, + "learning_rate": 0.00019992456262784658, + "loss": 0.8215, + "step": 640 + }, + { + "epoch": 0.2231879019641926, + "grad_norm": 1.5331524159142917, + "learning_rate": 0.00019991977476314286, + "loss": 0.7057, + "step": 642 + }, + { + "epoch": 0.22388319137841126, + "grad_norm": 0.8086145005161695, + "learning_rate": 0.0001999148396595289, + "loss": 0.6289, + "step": 644 + }, + { + "epoch": 0.22457848079262993, + "grad_norm": 0.767389193699688, + "learning_rate": 0.00019990975732427693, + "loss": 0.6117, + "step": 646 + }, + { + "epoch": 0.2252737702068486, + "grad_norm": 0.9275190697426144, + "learning_rate": 0.0001999045277648761, + "loss": 0.6582, + "step": 648 + }, + { + "epoch": 0.22596905962106728, + "grad_norm": 0.8004230202091956, + "learning_rate": 0.00019989915098903257, + "loss": 0.5387, + "step": 650 + }, + { + "epoch": 0.22666434903528593, + "grad_norm": 0.8210833181388095, + "learning_rate": 0.0001998936270046694, + "loss": 0.5941, + "step": 652 + }, + { + "epoch": 0.2273596384495046, + "grad_norm": 2.1189675938584616, + "learning_rate": 0.00019988795581992656, + "loss": 0.7504, + "step": 654 + }, + { + "epoch": 0.22805492786372328, + "grad_norm": 0.5952032026226816, + "learning_rate": 0.000199882137443161, + "loss": 0.6643, + "step": 656 + }, + { + "epoch": 0.22875021727794195, + "grad_norm": 0.40481972159485846, + "learning_rate": 0.00019987617188294642, + "loss": 0.5225, + "step": 658 + }, + { + "epoch": 0.2294455066921606, + "grad_norm": 0.7478677085785272, + "learning_rate": 0.00019987005914807356, + "loss": 0.6561, + "step": 660 + }, + { + "epoch": 0.23014079610637928, + "grad_norm": 0.4468692254604696, + "learning_rate": 0.00019986379924754997, + "loss": 0.6262, + "step": 662 + }, + { + "epoch": 0.23083608552059795, + "grad_norm": 0.46697718493106893, + "learning_rate": 0.00019985739219060002, + "loss": 0.6178, + "step": 664 + }, + { + "epoch": 0.23153137493481663, + "grad_norm": 0.388728867903269, + "learning_rate": 0.000199850837986665, + "loss": 0.5544, + "step": 666 + }, + { + "epoch": 0.23222666434903527, + "grad_norm": 0.5731403139849517, + "learning_rate": 0.000199844136645403, + "loss": 0.5906, + "step": 668 + }, + { + "epoch": 0.23292195376325395, + "grad_norm": 0.7601215827849259, + "learning_rate": 0.0001998372881766889, + "loss": 0.6577, + "step": 670 + }, + { + "epoch": 0.23361724317747262, + "grad_norm": 0.8997786413980279, + "learning_rate": 0.00019983029259061446, + "loss": 0.6388, + "step": 672 + }, + { + "epoch": 0.2343125325916913, + "grad_norm": 0.519349430301096, + "learning_rate": 0.00019982314989748813, + "loss": 0.6561, + "step": 674 + }, + { + "epoch": 0.23500782200590997, + "grad_norm": 0.4918913590728881, + "learning_rate": 0.00019981586010783513, + "loss": 0.6176, + "step": 676 + }, + { + "epoch": 0.23570311142012862, + "grad_norm": 0.5324672662478441, + "learning_rate": 0.00019980842323239756, + "loss": 0.5801, + "step": 678 + }, + { + "epoch": 0.2363984008343473, + "grad_norm": 0.6375745879180794, + "learning_rate": 0.00019980083928213417, + "loss": 0.6885, + "step": 680 + }, + { + "epoch": 0.23709369024856597, + "grad_norm": 0.4317997282790841, + "learning_rate": 0.00019979310826822046, + "loss": 0.5727, + "step": 682 + }, + { + "epoch": 0.23778897966278464, + "grad_norm": 0.7933828103238656, + "learning_rate": 0.00019978523020204857, + "loss": 0.6703, + "step": 684 + }, + { + "epoch": 0.2384842690770033, + "grad_norm": 0.5465102255190097, + "learning_rate": 0.00019977720509522747, + "loss": 0.6675, + "step": 686 + }, + { + "epoch": 0.23917955849122197, + "grad_norm": 0.8356137363612883, + "learning_rate": 0.00019976903295958269, + "loss": 0.6558, + "step": 688 + }, + { + "epoch": 0.23987484790544064, + "grad_norm": 0.5190073187676806, + "learning_rate": 0.00019976071380715645, + "loss": 0.6779, + "step": 690 + }, + { + "epoch": 0.24057013731965932, + "grad_norm": 0.40561527338007225, + "learning_rate": 0.0001997522476502076, + "loss": 0.6687, + "step": 692 + }, + { + "epoch": 0.24126542673387796, + "grad_norm": 0.592821589706298, + "learning_rate": 0.0001997436345012117, + "loss": 0.6807, + "step": 694 + }, + { + "epoch": 0.24196071614809664, + "grad_norm": 0.686918345062074, + "learning_rate": 0.00019973487437286073, + "loss": 0.6831, + "step": 696 + }, + { + "epoch": 0.2426560055623153, + "grad_norm": 0.964075508243471, + "learning_rate": 0.00019972596727806346, + "loss": 0.665, + "step": 698 + }, + { + "epoch": 0.243351294976534, + "grad_norm": 0.739137434656244, + "learning_rate": 0.00019971691322994507, + "loss": 0.6387, + "step": 700 + }, + { + "epoch": 0.24404658439075266, + "grad_norm": 0.3978099419540589, + "learning_rate": 0.00019970771224184737, + "loss": 0.6143, + "step": 702 + }, + { + "epoch": 0.2447418738049713, + "grad_norm": 0.4997978607153984, + "learning_rate": 0.0001996983643273287, + "loss": 0.6083, + "step": 704 + }, + { + "epoch": 0.24543716321918999, + "grad_norm": 1.3443518380439796, + "learning_rate": 0.0001996888695001638, + "loss": 0.6711, + "step": 706 + }, + { + "epoch": 0.24613245263340866, + "grad_norm": 0.5424379336505594, + "learning_rate": 0.000199679227774344, + "loss": 0.6321, + "step": 708 + }, + { + "epoch": 0.24682774204762734, + "grad_norm": 0.7689235498835658, + "learning_rate": 0.00019966943916407712, + "loss": 0.6918, + "step": 710 + }, + { + "epoch": 0.24752303146184598, + "grad_norm": 0.6467240394468301, + "learning_rate": 0.00019965950368378734, + "loss": 0.6368, + "step": 712 + }, + { + "epoch": 0.24821832087606466, + "grad_norm": 0.48819289451999526, + "learning_rate": 0.00019964942134811532, + "loss": 0.5875, + "step": 714 + }, + { + "epoch": 0.24891361029028333, + "grad_norm": 1.1929427463467126, + "learning_rate": 0.00019963919217191807, + "loss": 0.6795, + "step": 716 + }, + { + "epoch": 0.249608899704502, + "grad_norm": 0.4182713825442439, + "learning_rate": 0.00019962881617026902, + "loss": 0.5835, + "step": 718 + }, + { + "epoch": 0.25030418911872065, + "grad_norm": 0.5770262516296942, + "learning_rate": 0.00019961829335845795, + "loss": 0.6299, + "step": 720 + }, + { + "epoch": 0.25099947853293936, + "grad_norm": 0.9135250550485389, + "learning_rate": 0.00019960762375199095, + "loss": 0.6844, + "step": 722 + }, + { + "epoch": 0.251694767947158, + "grad_norm": 0.5511234805517417, + "learning_rate": 0.0001995968073665905, + "loss": 0.5745, + "step": 724 + }, + { + "epoch": 0.25239005736137665, + "grad_norm": 0.49137872896877094, + "learning_rate": 0.00019958584421819528, + "loss": 0.698, + "step": 726 + }, + { + "epoch": 0.25308534677559535, + "grad_norm": 0.4437253322782162, + "learning_rate": 0.00019957473432296026, + "loss": 0.6864, + "step": 728 + }, + { + "epoch": 0.253780636189814, + "grad_norm": 0.5064381489074585, + "learning_rate": 0.0001995634776972567, + "loss": 0.5758, + "step": 730 + }, + { + "epoch": 0.2544759256040327, + "grad_norm": 0.5464655664741616, + "learning_rate": 0.00019955207435767201, + "loss": 0.6351, + "step": 732 + }, + { + "epoch": 0.25517121501825135, + "grad_norm": 0.44060524677853835, + "learning_rate": 0.00019954052432100982, + "loss": 0.6837, + "step": 734 + }, + { + "epoch": 0.25586650443247, + "grad_norm": 0.942390696980061, + "learning_rate": 0.00019952882760428998, + "loss": 0.6378, + "step": 736 + }, + { + "epoch": 0.2565617938466887, + "grad_norm": 0.4710023299938762, + "learning_rate": 0.00019951698422474836, + "loss": 0.6968, + "step": 738 + }, + { + "epoch": 0.25725708326090735, + "grad_norm": 0.4179809222387651, + "learning_rate": 0.00019950499419983707, + "loss": 0.5643, + "step": 740 + }, + { + "epoch": 0.257952372675126, + "grad_norm": 0.4446278865199289, + "learning_rate": 0.00019949285754722426, + "loss": 0.5089, + "step": 742 + }, + { + "epoch": 0.2586476620893447, + "grad_norm": 0.914728851966275, + "learning_rate": 0.00019948057428479418, + "loss": 0.7933, + "step": 744 + }, + { + "epoch": 0.25934295150356335, + "grad_norm": 0.47142275185055055, + "learning_rate": 0.00019946814443064703, + "loss": 0.6384, + "step": 746 + }, + { + "epoch": 0.26003824091778205, + "grad_norm": 0.720916103725334, + "learning_rate": 0.00019945556800309917, + "loss": 0.5957, + "step": 748 + }, + { + "epoch": 0.2607335303320007, + "grad_norm": 0.8550360126036364, + "learning_rate": 0.00019944284502068275, + "loss": 0.6454, + "step": 750 + }, + { + "epoch": 0.2607335303320007, + "eval_loss": 0.6373963952064514, + "eval_runtime": 728.7951, + "eval_samples_per_second": 6.644, + "eval_steps_per_second": 0.209, + "step": 750 + }, + { + "epoch": 0.26142881974621934, + "grad_norm": 0.5467512313200382, + "learning_rate": 0.0001994299755021461, + "loss": 0.5781, + "step": 752 + }, + { + "epoch": 0.26212410916043805, + "grad_norm": 0.41230384162224254, + "learning_rate": 0.0001994169594664533, + "loss": 0.6467, + "step": 754 + }, + { + "epoch": 0.2628193985746567, + "grad_norm": 0.5635895964904281, + "learning_rate": 0.00019940379693278448, + "loss": 0.6182, + "step": 756 + }, + { + "epoch": 0.2635146879888754, + "grad_norm": 0.6456168984233462, + "learning_rate": 0.0001993904879205355, + "loss": 0.6086, + "step": 758 + }, + { + "epoch": 0.26420997740309404, + "grad_norm": 0.5060399335833471, + "learning_rate": 0.00019937703244931815, + "loss": 0.6407, + "step": 760 + }, + { + "epoch": 0.2649052668173127, + "grad_norm": 0.5033297464646784, + "learning_rate": 0.00019936343053896004, + "loss": 0.6157, + "step": 762 + }, + { + "epoch": 0.2656005562315314, + "grad_norm": 0.3911665523252255, + "learning_rate": 0.00019934968220950458, + "loss": 0.6227, + "step": 764 + }, + { + "epoch": 0.26629584564575004, + "grad_norm": 1.7130937466256138, + "learning_rate": 0.00019933578748121086, + "loss": 0.5994, + "step": 766 + }, + { + "epoch": 0.2669911350599687, + "grad_norm": 0.5747338886603724, + "learning_rate": 0.00019932174637455382, + "loss": 0.6238, + "step": 768 + }, + { + "epoch": 0.2676864244741874, + "grad_norm": 0.6226324357252033, + "learning_rate": 0.00019930755891022398, + "loss": 0.6255, + "step": 770 + }, + { + "epoch": 0.26838171388840604, + "grad_norm": 0.5282488794229044, + "learning_rate": 0.00019929322510912756, + "loss": 0.5808, + "step": 772 + }, + { + "epoch": 0.26907700330262474, + "grad_norm": 0.5596904577167024, + "learning_rate": 0.0001992787449923865, + "loss": 0.5361, + "step": 774 + }, + { + "epoch": 0.2697722927168434, + "grad_norm": 1.0477422618379753, + "learning_rate": 0.00019926411858133824, + "loss": 0.54, + "step": 776 + }, + { + "epoch": 0.27046758213106203, + "grad_norm": 1.1314704495635823, + "learning_rate": 0.00019924934589753582, + "loss": 0.5869, + "step": 778 + }, + { + "epoch": 0.27116287154528074, + "grad_norm": 0.5426548544381972, + "learning_rate": 0.00019923442696274794, + "loss": 0.5951, + "step": 780 + }, + { + "epoch": 0.2718581609594994, + "grad_norm": 0.8480025293040686, + "learning_rate": 0.00019921936179895862, + "loss": 0.6003, + "step": 782 + }, + { + "epoch": 0.2725534503737181, + "grad_norm": 0.5729452380906337, + "learning_rate": 0.0001992041504283675, + "loss": 0.6526, + "step": 784 + }, + { + "epoch": 0.27324873978793673, + "grad_norm": 0.7362085286496177, + "learning_rate": 0.00019918879287338957, + "loss": 0.6776, + "step": 786 + }, + { + "epoch": 0.2739440292021554, + "grad_norm": 0.7440059372391256, + "learning_rate": 0.00019917328915665535, + "loss": 0.6486, + "step": 788 + }, + { + "epoch": 0.2746393186163741, + "grad_norm": 0.6110842206790659, + "learning_rate": 0.0001991576393010106, + "loss": 0.6226, + "step": 790 + }, + { + "epoch": 0.27533460803059273, + "grad_norm": 0.8002336898560896, + "learning_rate": 0.00019914184332951655, + "loss": 0.6215, + "step": 792 + }, + { + "epoch": 0.2760298974448114, + "grad_norm": 0.6761736356192558, + "learning_rate": 0.00019912590126544964, + "loss": 0.5988, + "step": 794 + }, + { + "epoch": 0.2767251868590301, + "grad_norm": 1.1005016630123619, + "learning_rate": 0.00019910981313230172, + "loss": 0.6213, + "step": 796 + }, + { + "epoch": 0.27742047627324873, + "grad_norm": 0.6513452605734942, + "learning_rate": 0.00019909357895377973, + "loss": 0.682, + "step": 798 + }, + { + "epoch": 0.27811576568746743, + "grad_norm": 0.8536492677008404, + "learning_rate": 0.0001990771987538059, + "loss": 0.707, + "step": 800 + }, + { + "epoch": 0.2788110551016861, + "grad_norm": 0.3362293750538688, + "learning_rate": 0.00019906067255651765, + "loss": 0.7108, + "step": 802 + }, + { + "epoch": 0.2795063445159047, + "grad_norm": 0.4792899916449288, + "learning_rate": 0.0001990440003862675, + "loss": 0.6055, + "step": 804 + }, + { + "epoch": 0.28020163393012343, + "grad_norm": 1.272937677307704, + "learning_rate": 0.00019902718226762304, + "loss": 0.6816, + "step": 806 + }, + { + "epoch": 0.2808969233443421, + "grad_norm": 0.30646692495778655, + "learning_rate": 0.00019901021822536704, + "loss": 0.688, + "step": 808 + }, + { + "epoch": 0.2815922127585608, + "grad_norm": 0.3035733218665055, + "learning_rate": 0.00019899310828449713, + "loss": 0.6746, + "step": 810 + }, + { + "epoch": 0.2822875021727794, + "grad_norm": 0.2763276026826459, + "learning_rate": 0.00019897585247022613, + "loss": 0.6632, + "step": 812 + }, + { + "epoch": 0.2829827915869981, + "grad_norm": 1.173118337900773, + "learning_rate": 0.00019895845080798166, + "loss": 0.6306, + "step": 814 + }, + { + "epoch": 0.2836780810012168, + "grad_norm": 0.4335278252167635, + "learning_rate": 0.0001989409033234063, + "loss": 0.6147, + "step": 816 + }, + { + "epoch": 0.2843733704154354, + "grad_norm": 0.3556694503062785, + "learning_rate": 0.00019892321004235755, + "loss": 0.5771, + "step": 818 + }, + { + "epoch": 0.28506865982965407, + "grad_norm": 0.9083240381897224, + "learning_rate": 0.00019890537099090768, + "loss": 0.5729, + "step": 820 + }, + { + "epoch": 0.2857639492438728, + "grad_norm": 0.5433346815141633, + "learning_rate": 0.00019888738619534385, + "loss": 0.5554, + "step": 822 + }, + { + "epoch": 0.2864592386580914, + "grad_norm": 0.5244705156138804, + "learning_rate": 0.0001988692556821679, + "loss": 0.6525, + "step": 824 + }, + { + "epoch": 0.2871545280723101, + "grad_norm": 0.7580866792170871, + "learning_rate": 0.00019885097947809648, + "loss": 0.6512, + "step": 826 + }, + { + "epoch": 0.28784981748652877, + "grad_norm": 0.7034554538404351, + "learning_rate": 0.00019883255761006082, + "loss": 0.5414, + "step": 828 + }, + { + "epoch": 0.2885451069007474, + "grad_norm": 0.6915575597289163, + "learning_rate": 0.00019881399010520688, + "loss": 0.6036, + "step": 830 + }, + { + "epoch": 0.2892403963149661, + "grad_norm": 0.6895372001781882, + "learning_rate": 0.00019879527699089524, + "loss": 0.5894, + "step": 832 + }, + { + "epoch": 0.28993568572918477, + "grad_norm": 0.7762412863407715, + "learning_rate": 0.00019877641829470094, + "loss": 0.7115, + "step": 834 + }, + { + "epoch": 0.29063097514340347, + "grad_norm": 0.5761220663639801, + "learning_rate": 0.00019875741404441367, + "loss": 0.6108, + "step": 836 + }, + { + "epoch": 0.2913262645576221, + "grad_norm": 0.47176943357070505, + "learning_rate": 0.00019873826426803755, + "loss": 0.634, + "step": 838 + }, + { + "epoch": 0.29202155397184076, + "grad_norm": 0.5985873148196751, + "learning_rate": 0.00019871896899379107, + "loss": 0.6528, + "step": 840 + }, + { + "epoch": 0.29271684338605947, + "grad_norm": 0.39514741111190665, + "learning_rate": 0.00019869952825010727, + "loss": 0.6034, + "step": 842 + }, + { + "epoch": 0.2934121328002781, + "grad_norm": 0.29787585594263405, + "learning_rate": 0.00019867994206563343, + "loss": 0.6063, + "step": 844 + }, + { + "epoch": 0.29410742221449676, + "grad_norm": 0.303320759302155, + "learning_rate": 0.00019866021046923118, + "loss": 0.6343, + "step": 846 + }, + { + "epoch": 0.29480271162871546, + "grad_norm": 0.33135450527244925, + "learning_rate": 0.00019864033348997645, + "loss": 0.6421, + "step": 848 + }, + { + "epoch": 0.2954980010429341, + "grad_norm": 0.553668190192523, + "learning_rate": 0.0001986203111571594, + "loss": 0.6503, + "step": 850 + }, + { + "epoch": 0.2961932904571528, + "grad_norm": 0.31948016623126946, + "learning_rate": 0.00019860014350028438, + "loss": 0.6259, + "step": 852 + }, + { + "epoch": 0.29688857987137146, + "grad_norm": 0.5325237443938606, + "learning_rate": 0.0001985798305490698, + "loss": 0.6207, + "step": 854 + }, + { + "epoch": 0.2975838692855901, + "grad_norm": 0.5093186589927414, + "learning_rate": 0.00019855937233344831, + "loss": 0.5397, + "step": 856 + }, + { + "epoch": 0.2982791586998088, + "grad_norm": 0.5220573948537062, + "learning_rate": 0.00019853876888356652, + "loss": 0.6237, + "step": 858 + }, + { + "epoch": 0.29897444811402746, + "grad_norm": 0.9861332892020862, + "learning_rate": 0.00019851802022978506, + "loss": 0.689, + "step": 860 + }, + { + "epoch": 0.2996697375282461, + "grad_norm": 0.464669721879274, + "learning_rate": 0.00019849712640267861, + "loss": 0.522, + "step": 862 + }, + { + "epoch": 0.3003650269424648, + "grad_norm": 0.9223435358714303, + "learning_rate": 0.00019847608743303567, + "loss": 0.7491, + "step": 864 + }, + { + "epoch": 0.30106031635668346, + "grad_norm": 0.5058775377593727, + "learning_rate": 0.00019845490335185866, + "loss": 0.562, + "step": 866 + }, + { + "epoch": 0.30175560577090216, + "grad_norm": 0.5517767811356443, + "learning_rate": 0.00019843357419036382, + "loss": 0.6162, + "step": 868 + }, + { + "epoch": 0.3024508951851208, + "grad_norm": 0.49255497197537723, + "learning_rate": 0.00019841209997998127, + "loss": 0.6803, + "step": 870 + }, + { + "epoch": 0.30314618459933945, + "grad_norm": 0.41553745561512617, + "learning_rate": 0.0001983904807523547, + "loss": 0.6415, + "step": 872 + }, + { + "epoch": 0.30384147401355815, + "grad_norm": 0.49551628457734653, + "learning_rate": 0.00019836871653934162, + "loss": 0.6176, + "step": 874 + }, + { + "epoch": 0.3045367634277768, + "grad_norm": 0.7489091107060393, + "learning_rate": 0.00019834680737301313, + "loss": 0.6337, + "step": 876 + }, + { + "epoch": 0.3052320528419955, + "grad_norm": 0.32312869533576805, + "learning_rate": 0.00019832475328565398, + "loss": 0.6135, + "step": 878 + }, + { + "epoch": 0.30592734225621415, + "grad_norm": 0.304002075332943, + "learning_rate": 0.00019830255430976242, + "loss": 0.5533, + "step": 880 + }, + { + "epoch": 0.3066226316704328, + "grad_norm": 0.4137621036041215, + "learning_rate": 0.00019828021047805022, + "loss": 0.573, + "step": 882 + }, + { + "epoch": 0.3073179210846515, + "grad_norm": 0.7506870255042438, + "learning_rate": 0.00019825772182344262, + "loss": 0.6971, + "step": 884 + }, + { + "epoch": 0.30801321049887015, + "grad_norm": 0.7069489041589112, + "learning_rate": 0.00019823508837907828, + "loss": 0.5848, + "step": 886 + }, + { + "epoch": 0.3087084999130888, + "grad_norm": 0.49383355752727304, + "learning_rate": 0.00019821231017830914, + "loss": 0.6349, + "step": 888 + }, + { + "epoch": 0.3094037893273075, + "grad_norm": 0.7893505446859834, + "learning_rate": 0.0001981893872547005, + "loss": 0.6335, + "step": 890 + }, + { + "epoch": 0.31009907874152615, + "grad_norm": 1.0962653113728835, + "learning_rate": 0.00019816631964203097, + "loss": 0.6438, + "step": 892 + }, + { + "epoch": 0.31079436815574485, + "grad_norm": 0.40606329821748216, + "learning_rate": 0.0001981431073742923, + "loss": 0.557, + "step": 894 + }, + { + "epoch": 0.3114896575699635, + "grad_norm": 0.8061837126172193, + "learning_rate": 0.00019811975048568943, + "loss": 0.6334, + "step": 896 + }, + { + "epoch": 0.31218494698418214, + "grad_norm": 0.7808955990860935, + "learning_rate": 0.00019809624901064038, + "loss": 0.5775, + "step": 898 + }, + { + "epoch": 0.31288023639840085, + "grad_norm": 0.5527203146534614, + "learning_rate": 0.00019807260298377626, + "loss": 0.5934, + "step": 900 + }, + { + "epoch": 0.31288023639840085, + "eval_loss": 0.666339099407196, + "eval_runtime": 759.5196, + "eval_samples_per_second": 6.375, + "eval_steps_per_second": 0.2, + "step": 900 + } + ], + "logging_steps": 2, + "max_steps": 5752, + "num_input_tokens_seen": 0, + "num_train_epochs": 2, + "save_steps": 90, + "stateful_callbacks": { + "TrainerControl": { + "args": { + "should_epoch_stop": false, + "should_evaluate": false, + "should_log": false, + "should_save": true, + "should_training_stop": false + }, + "attributes": {} + } + }, + "total_flos": 3585652395343872.0, + "train_batch_size": 4, + "trial_name": null, + "trial_params": null +} diff --git a/checkpoint-900/training_args.bin b/checkpoint-900/training_args.bin new file mode 100644 index 0000000000000000000000000000000000000000..fba3b63792fed5a70be0307e26ba27ef584b1528 --- /dev/null +++ b/checkpoint-900/training_args.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b72add547acd6c009f3a3770072d0cdf7de7e797c7597084319db874a556e470 +size 6904 diff --git a/checkpoint-900/zero_to_fp32.py b/checkpoint-900/zero_to_fp32.py new file mode 100644 index 0000000000000000000000000000000000000000..0e759146cadd92ddfefab3680146c2bd6a2b5c04 --- /dev/null +++ b/checkpoint-900/zero_to_fp32.py @@ -0,0 +1,760 @@ +#!/usr/bin/env python + +# Copyright (c) Microsoft Corporation. +# SPDX-License-Identifier: Apache-2.0 + +# DeepSpeed Team + +# This script extracts fp32 consolidated weights from a zero 1, 2 and 3 DeepSpeed checkpoints. It gets +# copied into the top level checkpoint dir, so the user can easily do the conversion at any point in +# the future. Once extracted, the weights don't require DeepSpeed and can be used in any +# application. +# +# example: +# python zero_to_fp32.py . output_dir/ +# or +# python zero_to_fp32.py . output_dir/ --safe_serialization + +import argparse +import torch +import glob +import math +import os +import re +import gc +import json +import numpy as np +from tqdm import tqdm +from collections import OrderedDict +from dataclasses import dataclass + +# while this script doesn't use deepspeed to recover data, since the checkpoints are pickled with +# DeepSpeed data structures it has to be available in the current python environment. +from deepspeed.utils import logger +from deepspeed.checkpoint.constants import (DS_VERSION, OPTIMIZER_STATE_DICT, SINGLE_PARTITION_OF_FP32_GROUPS, + FP32_FLAT_GROUPS, ZERO_STAGE, PARTITION_COUNT, PARAM_SHAPES, BUFFER_NAMES, + FROZEN_PARAM_SHAPES, FROZEN_PARAM_FRAGMENTS) + + +@dataclass +class zero_model_state: + buffers: dict() + param_shapes: dict() + shared_params: list + ds_version: int + frozen_param_shapes: dict() + frozen_param_fragments: dict() + + +debug = 0 + +# load to cpu +device = torch.device('cpu') + + +def atoi(text): + return int(text) if text.isdigit() else text + + +def natural_keys(text): + ''' + alist.sort(key=natural_keys) sorts in human order + http://nedbatchelder.com/blog/200712/human_sorting.html + (See Toothy's implementation in the comments) + ''' + return [atoi(c) for c in re.split(r'(\d+)', text)] + + +def get_model_state_file(checkpoint_dir, zero_stage): + if not os.path.isdir(checkpoint_dir): + raise FileNotFoundError(f"Directory '{checkpoint_dir}' doesn't exist") + + # there should be only one file + if zero_stage <= 2: + file = os.path.join(checkpoint_dir, "mp_rank_00_model_states.pt") + elif zero_stage == 3: + file = os.path.join(checkpoint_dir, "zero_pp_rank_0_mp_rank_00_model_states.pt") + + if not os.path.exists(file): + raise FileNotFoundError(f"can't find model states file at '{file}'") + + return file + + +def get_checkpoint_files(checkpoint_dir, glob_pattern): + # XXX: need to test that this simple glob rule works for multi-node setup too + ckpt_files = sorted(glob.glob(os.path.join(checkpoint_dir, glob_pattern)), key=natural_keys) + + if len(ckpt_files) == 0: + raise FileNotFoundError(f"can't find {glob_pattern} files in directory '{checkpoint_dir}'") + + return ckpt_files + + +def get_optim_files(checkpoint_dir): + return get_checkpoint_files(checkpoint_dir, "*_optim_states.pt") + + +def get_model_state_files(checkpoint_dir): + return get_checkpoint_files(checkpoint_dir, "*_model_states.pt") + + +def parse_model_states(files): + zero_model_states = [] + for file in files: + state_dict = torch.load(file, map_location=device, weights_only=False) + + if BUFFER_NAMES not in state_dict: + raise ValueError(f"{file} is not a model state checkpoint") + buffer_names = state_dict[BUFFER_NAMES] + if debug: + print("Found buffers:", buffer_names) + + # recover just the buffers while restoring them to fp32 if they were saved in fp16 + buffers = {k: v.float() for k, v in state_dict["module"].items() if k in buffer_names} + param_shapes = state_dict[PARAM_SHAPES] + + # collect parameters that are included in param_shapes + param_names = [] + for s in param_shapes: + for name in s.keys(): + param_names.append(name) + + # update with frozen parameters + frozen_param_shapes = state_dict.get(FROZEN_PARAM_SHAPES, None) + if frozen_param_shapes is not None: + if debug: + print(f"Found frozen_param_shapes: {frozen_param_shapes}") + param_names += list(frozen_param_shapes.keys()) + + # handle shared params + shared_params = [[k, v] for k, v in state_dict["shared_params"].items()] + + ds_version = state_dict.get(DS_VERSION, None) + + frozen_param_fragments = state_dict.get(FROZEN_PARAM_FRAGMENTS, None) + + z_model_state = zero_model_state(buffers=buffers, + param_shapes=param_shapes, + shared_params=shared_params, + ds_version=ds_version, + frozen_param_shapes=frozen_param_shapes, + frozen_param_fragments=frozen_param_fragments) + zero_model_states.append(z_model_state) + + return zero_model_states + + +def parse_optim_states(files, ds_checkpoint_dir): + total_files = len(files) + state_dicts = [] + for f in tqdm(files, desc='Loading checkpoint shards'): + state_dict = torch.load(f, map_location=device, mmap=True, weights_only=False) + # immediately discard the potentially huge 2 optimizer states as we only care for fp32 master weights + # and also handle the case where it was already removed by another helper script + state_dict["optimizer_state_dict"].pop("optimizer_state_dict", None) + state_dicts.append(state_dict) + + if not ZERO_STAGE in state_dicts[0][OPTIMIZER_STATE_DICT]: + raise ValueError(f"{files[0]} is not a zero checkpoint") + zero_stage = state_dicts[0][OPTIMIZER_STATE_DICT][ZERO_STAGE] + world_size = state_dicts[0][OPTIMIZER_STATE_DICT][PARTITION_COUNT] + + # For ZeRO-2 each param group can have different partition_count as data parallelism for expert + # parameters can be different from data parallelism for non-expert parameters. So we can just + # use the max of the partition_count to get the dp world_size. + + if type(world_size) is list: + world_size = max(world_size) + + if world_size != total_files: + raise ValueError( + f"Expected {world_size} of '*_optim_states.pt' under '{ds_checkpoint_dir}' but found {total_files} files. " + "Possibly due to an overwrite of an old checkpoint, or a checkpoint didn't get saved by one or more processes." + ) + + # the groups are named differently in each stage + if zero_stage <= 2: + fp32_groups_key = SINGLE_PARTITION_OF_FP32_GROUPS + elif zero_stage == 3: + fp32_groups_key = FP32_FLAT_GROUPS + else: + raise ValueError(f"unknown zero stage {zero_stage}") + + fp32_flat_groups = [state_dicts[i][OPTIMIZER_STATE_DICT][fp32_groups_key] for i in range(len(state_dicts))] + return zero_stage, world_size, fp32_flat_groups + + +def _get_fp32_state_dict_from_zero_checkpoint(ds_checkpoint_dir, exclude_frozen_parameters): + """ + Returns fp32 state_dict reconstructed from ds checkpoint + + Args: + - ``ds_checkpoint_dir``: path to the deepspeed checkpoint folder (where the optimizer files are) + + """ + print(f"Processing zero checkpoint '{ds_checkpoint_dir}'") + + optim_files = get_optim_files(ds_checkpoint_dir) + zero_stage, world_size, fp32_flat_groups = parse_optim_states(optim_files, ds_checkpoint_dir) + print(f"Detected checkpoint of type zero stage {zero_stage}, world_size: {world_size}") + + model_files = get_model_state_files(ds_checkpoint_dir) + + zero_model_states = parse_model_states(model_files) + print(f'Parsing checkpoint created by deepspeed=={zero_model_states[0].ds_version}') + + if zero_stage <= 2: + return _get_fp32_state_dict_from_zero2_checkpoint(world_size, fp32_flat_groups, zero_model_states, + exclude_frozen_parameters) + elif zero_stage == 3: + return _get_fp32_state_dict_from_zero3_checkpoint(world_size, fp32_flat_groups, zero_model_states, + exclude_frozen_parameters) + + +def _zero2_merge_frozen_params(state_dict, zero_model_states): + if zero_model_states[0].frozen_param_shapes is None or len(zero_model_states[0].frozen_param_shapes) == 0: + return + + frozen_param_shapes = zero_model_states[0].frozen_param_shapes + frozen_param_fragments = zero_model_states[0].frozen_param_fragments + + if debug: + num_elem = sum(s.numel() for s in frozen_param_shapes.values()) + print(f'rank 0: {FROZEN_PARAM_SHAPES}.numel = {num_elem}') + + wanted_params = len(frozen_param_shapes) + wanted_numel = sum(s.numel() for s in frozen_param_shapes.values()) + avail_numel = sum([p.numel() for p in frozen_param_fragments.values()]) + print(f'Frozen params: Have {avail_numel} numels to process.') + print(f'Frozen params: Need {wanted_numel} numels in {wanted_params} params') + + total_params = 0 + total_numel = 0 + for name, shape in frozen_param_shapes.items(): + total_params += 1 + unpartitioned_numel = shape.numel() + total_numel += unpartitioned_numel + + state_dict[name] = frozen_param_fragments[name] + + if debug: + print(f"{name} full shape: {shape} unpartitioned numel {unpartitioned_numel} ") + + print(f"Reconstructed Frozen fp32 state dict with {total_params} params {total_numel} elements") + + +def _has_callable(obj, fn): + attr = getattr(obj, fn, None) + return callable(attr) + + +def _zero2_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states): + param_shapes = zero_model_states[0].param_shapes + + # Reconstruction protocol: + # + # XXX: document this + + if debug: + for i in range(world_size): + for j in range(len(fp32_flat_groups[0])): + print(f"{FP32_FLAT_GROUPS}[{i}][{j}].shape={fp32_flat_groups[i][j].shape}") + + # XXX: memory usage doubles here (zero2) + num_param_groups = len(fp32_flat_groups[0]) + merged_single_partition_of_fp32_groups = [] + for i in range(num_param_groups): + merged_partitions = [sd[i] for sd in fp32_flat_groups] + full_single_fp32_vector = torch.cat(merged_partitions, 0) + merged_single_partition_of_fp32_groups.append(full_single_fp32_vector) + avail_numel = sum( + [full_single_fp32_vector.numel() for full_single_fp32_vector in merged_single_partition_of_fp32_groups]) + + if debug: + wanted_params = sum([len(shapes) for shapes in param_shapes]) + wanted_numel = sum([sum(shape.numel() for shape in shapes.values()) for shapes in param_shapes]) + # not asserting if there is a mismatch due to possible padding + print(f"Have {avail_numel} numels to process.") + print(f"Need {wanted_numel} numels in {wanted_params} params.") + + # params + # XXX: for huge models that can't fit into the host's RAM we will have to recode this to support + # out-of-core computing solution + total_numel = 0 + total_params = 0 + for shapes, full_single_fp32_vector in zip(param_shapes, merged_single_partition_of_fp32_groups): + offset = 0 + avail_numel = full_single_fp32_vector.numel() + for name, shape in shapes.items(): + + unpartitioned_numel = shape.numel() if _has_callable(shape, 'numel') else math.prod(shape) + total_numel += unpartitioned_numel + total_params += 1 + + if debug: + print(f"{name} full shape: {shape} unpartitioned numel {unpartitioned_numel} ") + state_dict[name] = full_single_fp32_vector.narrow(0, offset, unpartitioned_numel).view(shape) + offset += unpartitioned_numel + + # Z2 started to align to 2*world_size to improve nccl performance. Therefore both offset and + # avail_numel can differ by anywhere between 0..2*world_size. Due to two unrelated complex + # paddings performed in the code it's almost impossible to predict the exact numbers w/o the + # live optimizer object, so we are checking that the numbers are within the right range + align_to = 2 * world_size + + def zero2_align(x): + return align_to * math.ceil(x / align_to) + + if debug: + print(f"original offset={offset}, avail_numel={avail_numel}") + + offset = zero2_align(offset) + avail_numel = zero2_align(avail_numel) + + if debug: + print(f"aligned offset={offset}, avail_numel={avail_numel}") + + # Sanity check + if offset != avail_numel: + raise ValueError(f"consumed {offset} numels out of {avail_numel} - something is wrong") + + print(f"Reconstructed fp32 state dict with {total_params} params {total_numel} elements") + + +def _get_fp32_state_dict_from_zero2_checkpoint(world_size, fp32_flat_groups, zero_model_states, + exclude_frozen_parameters): + state_dict = OrderedDict() + + # buffers + buffers = zero_model_states[0].buffers + state_dict.update(buffers) + if debug: + print(f"added {len(buffers)} buffers") + + if not exclude_frozen_parameters: + _zero2_merge_frozen_params(state_dict, zero_model_states) + + _zero2_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states) + + # recover shared parameters + for pair in zero_model_states[0].shared_params: + if pair[1] in state_dict: + state_dict[pair[0]] = state_dict[pair[1]] + + return state_dict + + +def zero3_partitioned_param_info(unpartitioned_numel, world_size): + remainder = unpartitioned_numel % world_size + padding_numel = (world_size - remainder) if remainder else 0 + partitioned_numel = math.ceil(unpartitioned_numel / world_size) + return partitioned_numel, padding_numel + + +def _zero3_merge_frozen_params(state_dict, world_size, zero_model_states): + if zero_model_states[0].frozen_param_shapes is None or len(zero_model_states[0].frozen_param_shapes) == 0: + return + + if debug: + for i in range(world_size): + num_elem = sum(s.numel() for s in zero_model_states[i].frozen_param_fragments.values()) + print(f'rank {i}: {FROZEN_PARAM_SHAPES}.numel = {num_elem}') + + frozen_param_shapes = zero_model_states[0].frozen_param_shapes + wanted_params = len(frozen_param_shapes) + wanted_numel = sum(s.numel() for s in frozen_param_shapes.values()) + avail_numel = sum([p.numel() for p in zero_model_states[0].frozen_param_fragments.values()]) * world_size + print(f'Frozen params: Have {avail_numel} numels to process.') + print(f'Frozen params: Need {wanted_numel} numels in {wanted_params} params') + + total_params = 0 + total_numel = 0 + for name, shape in zero_model_states[0].frozen_param_shapes.items(): + total_params += 1 + unpartitioned_numel = shape.numel() + total_numel += unpartitioned_numel + + param_frags = tuple(model_state.frozen_param_fragments[name] for model_state in zero_model_states) + state_dict[name] = torch.cat(param_frags, 0).narrow(0, 0, unpartitioned_numel).view(shape) + + partitioned_numel, partitioned_padding_numel = zero3_partitioned_param_info(unpartitioned_numel, world_size) + + if debug: + print( + f"Frozen params: {total_params} {name} full shape: {shape} partition0 numel={partitioned_numel} partitioned_padding_numel={partitioned_padding_numel}" + ) + + print(f"Reconstructed Frozen fp32 state dict with {total_params} params {total_numel} elements") + + +class GatheredTensor: + """ + A pseudo tensor that collects partitioned weights. + It is more memory efficient when there are multiple groups. + """ + + def __init__(self, flat_groups, flat_groups_offset, offset, partitioned_numel, shape): + self.flat_groups = flat_groups + self.flat_groups_offset = flat_groups_offset + self.offset = offset + self.partitioned_numel = partitioned_numel + self.shape = shape + self.dtype = self.flat_groups[0][0].dtype + + def contiguous(self): + """ + Merge partitioned weights from flat_groups into a single tensor. + """ + end_idx = self.offset + self.partitioned_numel + world_size = len(self.flat_groups) + pad_flat_param_chunks = [] + + for rank_i in range(world_size): + # for each rank, we need to collect weights from related group/groups + flat_groups_at_rank_i = self.flat_groups[rank_i] + start_group_id = None + end_group_id = None + for group_id in range(len(self.flat_groups_offset)): + if self.flat_groups_offset[group_id] <= self.offset < self.flat_groups_offset[group_id + 1]: + start_group_id = group_id + if self.flat_groups_offset[group_id] < end_idx <= self.flat_groups_offset[group_id + 1]: + end_group_id = group_id + break + # collect weights from related group/groups + for group_id in range(start_group_id, end_group_id + 1): + flat_tensor = flat_groups_at_rank_i[group_id] + start_offset = self.offset - self.flat_groups_offset[group_id] + end_offset = min(end_idx, self.flat_groups_offset[group_id + 1]) - self.flat_groups_offset[group_id] + pad_flat_param_chunks.append(flat_tensor[start_offset:end_offset]) + + # collect weights from all ranks + pad_flat_param = torch.cat(pad_flat_param_chunks, dim=0) + param = pad_flat_param[:self.shape.numel()].view(self.shape).contiguous() + return param + + +def _zero3_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states): + param_shapes = zero_model_states[0].param_shapes + avail_numel = sum([flat_group.numel() for flat_group in fp32_flat_groups[0]]) * world_size + + # Reconstruction protocol: For zero3 we need to zip the partitions together at boundary of each + # param, re-consolidating each param, while dealing with padding if any + + # merge list of dicts, preserving order + param_shapes = {k: v for d in param_shapes for k, v in d.items()} + + if debug: + for i in range(world_size): + print(f"{FP32_FLAT_GROUPS}[{i}].shape={fp32_flat_groups[i].shape}") + + wanted_params = len(param_shapes) + wanted_numel = sum(shape.numel() for shape in param_shapes.values()) + # not asserting if there is a mismatch due to possible padding + avail_numel = fp32_flat_groups[0].numel() * world_size + print(f"Trainable params: Have {avail_numel} numels to process.") + print(f"Trainable params: Need {wanted_numel} numels in {wanted_params} params.") + + # params + # XXX: for huge models that can't fit into the host's RAM we will have to recode this to support + # out-of-core computing solution + offset = 0 + total_numel = 0 + total_params = 0 + flat_groups_offset = [0] + list(np.cumsum([flat_tensor.numel() for flat_tensor in fp32_flat_groups[0]])) + for name, shape in tqdm(param_shapes.items(), desc='Gathering sharded weights'): + unpartitioned_numel = shape.numel() + total_numel += unpartitioned_numel + total_params += 1 + partitioned_numel, partitioned_padding_numel = zero3_partitioned_param_info(unpartitioned_numel, world_size) + + if debug: + print( + f"Trainable params: {total_params} {name} full shape: {shape} partition0 numel={partitioned_numel} partitioned_padding_numel={partitioned_padding_numel}" + ) + + # memory efficient tensor + tensor = GatheredTensor(fp32_flat_groups, flat_groups_offset, offset, partitioned_numel, shape) + state_dict[name] = tensor + offset += partitioned_numel + + offset *= world_size + + # Sanity check + if offset != avail_numel: + raise ValueError(f"consumed {offset} numels out of {avail_numel} - something is wrong") + + print(f"Reconstructed Trainable fp32 state dict with {total_params} params {total_numel} elements") + + +def _get_fp32_state_dict_from_zero3_checkpoint(world_size, fp32_flat_groups, zero_model_states, + exclude_frozen_parameters): + state_dict = OrderedDict() + + # buffers + buffers = zero_model_states[0].buffers + state_dict.update(buffers) + if debug: + print(f"added {len(buffers)} buffers") + + if not exclude_frozen_parameters: + _zero3_merge_frozen_params(state_dict, world_size, zero_model_states) + + _zero3_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states) + + # recover shared parameters + for pair in zero_model_states[0].shared_params: + if pair[1] in state_dict: + state_dict[pair[0]] = state_dict[pair[1]] + + return state_dict + + +def to_torch_tensor(state_dict, return_empty_tensor=False): + """ + Convert state_dict of GatheredTensor to torch tensor + """ + torch_state_dict = {} + converted_tensors = {} + for name, tensor in state_dict.items(): + tensor_id = id(tensor) + if tensor_id in converted_tensors: # shared tensors + shared_tensor = torch_state_dict[converted_tensors[tensor_id]] + torch_state_dict[name] = shared_tensor + else: + converted_tensors[tensor_id] = name + if return_empty_tensor: + torch_state_dict[name] = torch.empty(tensor.shape, dtype=tensor.dtype) + else: + torch_state_dict[name] = tensor.contiguous() + return torch_state_dict + + +def get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir, + tag=None, + exclude_frozen_parameters=False, + lazy_mode=False): + """ + Convert ZeRO 2 or 3 checkpoint into a single fp32 consolidated state_dict that can be loaded with + ``load_state_dict()`` and used for training without DeepSpeed or shared with others, for example + via a model hub. + + Args: + - ``checkpoint_dir``: path to the desired checkpoint folder + - ``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`` + - ``exclude_frozen_parameters``: exclude frozen parameters + - ``lazy_mode``: get state_dict in lazy mode. It returns a dict of pesduo tensor instead of torch tensor, which is more memory efficient. + Convert the pesduo tensor to torch tensor by ``.contiguous()`` + + Returns: + - pytorch ``state_dict`` + + A typical usage might be :: + + from deepspeed.utils.zero_to_fp32 import get_fp32_state_dict_from_zero_checkpoint + # do the training and checkpoint saving + state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir) # already on cpu + model = model.cpu() # move to cpu + model.load_state_dict(state_dict) + # submit to model hub or save the model to share with others + + In this example the ``model`` will no longer be usable in the deepspeed context of the same + application. i.e. you will need to re-initialize the deepspeed engine, since + ``model.load_state_dict(state_dict)`` will remove all the deepspeed magic from it. + + If you want it all done for you, use ``load_state_dict_from_zero_checkpoint`` instead. + + Note: the above usage may not work if your application doesn't have sufficient free CPU memory. + You may need to use the offline approach using the ``zero_to_fp32.py`` script that is saved with + the checkpoint. Or you can load state_dict in lazy mode :: + + from deepspeed.utils.zero_to_fp32 import get_fp32_state_dict_from_zero_checkpoint + state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir, lazy_mode=True) # not on cpu + for name, lazy_tensor in state_dict.item(): + tensor = lazy_tensor.contiguous() # to cpu + print(name, tensor) + # del tensor to release memory if it no longer in use + """ + if tag is None: + latest_path = os.path.join(checkpoint_dir, 'latest') + if os.path.isfile(latest_path): + with open(latest_path, 'r') as fd: + tag = fd.read().strip() + else: + raise ValueError(f"Unable to find 'latest' file at {latest_path}") + + ds_checkpoint_dir = os.path.join(checkpoint_dir, tag) + + if not os.path.isdir(ds_checkpoint_dir): + raise FileNotFoundError(f"Directory '{ds_checkpoint_dir}' doesn't exist") + + state_dict = _get_fp32_state_dict_from_zero_checkpoint(ds_checkpoint_dir, exclude_frozen_parameters) + if lazy_mode: + return state_dict + else: + return to_torch_tensor(state_dict) + + +def convert_zero_checkpoint_to_fp32_state_dict(checkpoint_dir, + output_dir, + max_shard_size="5GB", + safe_serialization=False, + tag=None, + exclude_frozen_parameters=False): + """ + Convert ZeRO 2 or 3 checkpoint into a single fp32 consolidated ``state_dict`` file that can be + loaded with ``torch.load(file)`` + ``load_state_dict()`` and used for training without DeepSpeed. + + Args: + - ``checkpoint_dir``: path to the desired checkpoint folder. (one that contains the tag-folder, like ``global_step14``) + - ``output_dir``: directory to the pytorch fp32 state_dict output files + - ``max_shard_size``: the maximum size for a checkpoint before being sharded, default value is 5GB + - ``safe_serialization``: whether to save the model using `safetensors` or the traditional PyTorch way (that uses `pickle`). + - ``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`` + - ``exclude_frozen_parameters``: exclude frozen parameters + """ + + # Dependency pre-check + if safe_serialization: + try: + from safetensors.torch import save_file + except ImportError: + print('If you want to use `safe_serialization`, please `pip install safetensors`') + raise + if max_shard_size is not None: + try: + from huggingface_hub import split_torch_state_dict_into_shards + except ImportError: + print('If you want to use `max_shard_size`, please `pip install huggingface_hub`') + raise + + # Convert zero checkpoint to state_dict + state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir, + tag, + exclude_frozen_parameters, + lazy_mode=True) + + # Shard the model if it is too big. + weights_name = "model.safetensors" if safe_serialization else "pytorch_model.bin" + if max_shard_size is not None: + filename_pattern = weights_name.replace(".bin", "{suffix}.bin").replace(".safetensors", "{suffix}.safetensors") + # an memory-efficient approach for sharding + empty_state_dict = to_torch_tensor(state_dict, return_empty_tensor=True) + state_dict_split = split_torch_state_dict_into_shards(empty_state_dict, + filename_pattern=filename_pattern, + max_shard_size=max_shard_size) + else: + from collections import namedtuple + StateDictSplit = namedtuple("StateDictSplit", ["is_sharded", "filename_to_tensors"]) + state_dict_split = StateDictSplit(is_sharded=False, + filename_to_tensors={weights_name: list(state_dict.keys())}) + + # Save the model by shard + os.makedirs(output_dir, exist_ok=True) + filename_to_tensors = state_dict_split.filename_to_tensors.items() + for shard_file, tensors in tqdm(filename_to_tensors, desc="Saving checkpoint shards"): + shard_state_dict = {tensor_name: state_dict[tensor_name] for tensor_name in tensors} + shard_state_dict = to_torch_tensor(shard_state_dict) + output_path = os.path.join(output_dir, shard_file) + if safe_serialization: + save_file(shard_state_dict, output_path, metadata={"format": "pt"}) + else: + torch.save(shard_state_dict, output_path) + # release the memory of current shard + for tensor_name in list(shard_state_dict.keys()): + del state_dict[tensor_name] + del shard_state_dict[tensor_name] + del shard_state_dict + gc.collect() + + # Save index if sharded + if state_dict_split.is_sharded: + index = { + "metadata": state_dict_split.metadata, + "weight_map": state_dict_split.tensor_to_filename, + } + save_index_file = "model.safetensors.index.json" if safe_serialization else "pytorch_model.bin.index.json" + save_index_file = os.path.join(output_dir, save_index_file) + with open(save_index_file, "w", encoding="utf-8") as f: + content = json.dumps(index, indent=2, sort_keys=True) + "\n" + f.write(content) + + +def load_state_dict_from_zero_checkpoint(model, checkpoint_dir, tag=None): + """ + 1. Put the provided model to cpu + 2. Convert ZeRO 2 or 3 checkpoint into a single fp32 consolidated ``state_dict`` + 3. Load it into the provided model + + Args: + - ``model``: the model object to update + - ``checkpoint_dir``: path to the desired checkpoint folder. (one that contains the tag-folder, like ``global_step14``) + - ``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`` + + Returns: + - ``model`: modified model + + Make sure you have plenty of CPU memory available before you call this function. If you don't + have enough use the ``zero_to_fp32.py`` utility to do the conversion. You will find it + conveniently placed for you in the checkpoint folder. + + A typical usage might be :: + + from deepspeed.utils.zero_to_fp32 import load_state_dict_from_zero_checkpoint + model = load_state_dict_from_zero_checkpoint(trainer.model, checkpoint_dir) + # submit to model hub or save the model to share with others + + Note, that once this was run, the ``model`` will no longer be usable in the deepspeed context + of the same application. i.e. you will need to re-initialize the deepspeed engine, since + ``model.load_state_dict(state_dict)`` will remove all the deepspeed magic from it. + + """ + logger.info(f"Extracting fp32 weights") + state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir, tag) + + logger.info(f"Overwriting model with fp32 weights") + model = model.cpu() + model.load_state_dict(state_dict, strict=False) + + return model + + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + parser.add_argument("checkpoint_dir", + type=str, + help="path to the desired checkpoint folder, e.g., path/checkpoint-12") + parser.add_argument("output_dir", + type=str, + help="directory to the pytorch fp32 state_dict output files" + "(e.g. path/checkpoint-12-output/)") + parser.add_argument( + "--max_shard_size", + type=str, + default="5GB", + help="The maximum size for a checkpoint before being sharded. Checkpoints shard will then be each of size" + "lower than this size. If expressed as a string, needs to be digits followed by a unit (like `5MB`" + "We default it to 5GB in order for models to be able to run easily on free-tier google colab instances" + "without CPU OOM issues.") + parser.add_argument( + "--safe_serialization", + default=False, + action='store_true', + help="Whether to save the model using `safetensors` or the traditional PyTorch way (that uses `pickle`).") + parser.add_argument("-t", + "--tag", + type=str, + default=None, + help="checkpoint tag used as a unique identifier for checkpoint. e.g., global_step1") + parser.add_argument("--exclude_frozen_parameters", action='store_true', help="exclude frozen parameters") + parser.add_argument("-d", "--debug", action='store_true', help="enable debug") + args = parser.parse_args() + + debug = args.debug + + convert_zero_checkpoint_to_fp32_state_dict(args.checkpoint_dir, + args.output_dir, + max_shard_size=args.max_shard_size, + safe_serialization=args.safe_serialization, + tag=args.tag, + exclude_frozen_parameters=args.exclude_frozen_parameters) diff --git a/checkpoint-990/README.md b/checkpoint-990/README.md new file mode 100644 index 0000000000000000000000000000000000000000..4eae946233309baf42f5bad9740186144a4f3b33 --- /dev/null +++ b/checkpoint-990/README.md @@ -0,0 +1,202 @@ +--- +base_model: ../../initial_seq_model +library_name: peft +--- + +# Model Card for Model ID + + + + + +## Model Details + +### Model Description + + + + + +- **Developed by:** [More Information Needed] +- **Funded by [optional]:** [More Information Needed] +- **Shared by [optional]:** [More Information Needed] +- **Model type:** [More Information Needed] +- **Language(s) (NLP):** [More Information Needed] +- **License:** [More Information Needed] +- **Finetuned from model [optional]:** [More Information Needed] + +### Model Sources [optional] + + + +- **Repository:** [More Information Needed] +- **Paper [optional]:** [More Information Needed] +- **Demo [optional]:** [More Information Needed] + +## Uses + + + +### Direct Use + + + +[More Information Needed] + +### Downstream Use [optional] + + + +[More Information Needed] + +### Out-of-Scope Use + + + +[More Information Needed] + +## Bias, Risks, and Limitations + + + +[More Information Needed] + +### Recommendations + + + +Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations. + +## How to Get Started with the Model + +Use the code below to get started with the model. + +[More Information Needed] + +## Training Details + +### Training Data + + + +[More Information Needed] + +### Training Procedure + + + +#### Preprocessing [optional] + +[More Information Needed] + + +#### Training Hyperparameters + +- **Training regime:** [More Information Needed] + +#### Speeds, Sizes, Times [optional] + + + +[More Information Needed] + +## Evaluation + + + +### Testing Data, Factors & Metrics + +#### Testing Data + + + +[More Information Needed] + +#### Factors + + + +[More Information Needed] + +#### Metrics + + + +[More Information Needed] + +### Results + +[More Information Needed] + +#### Summary + + + +## Model Examination [optional] + + + +[More Information Needed] + +## Environmental Impact + + + +Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700). + +- **Hardware Type:** [More Information Needed] +- **Hours used:** [More Information Needed] +- **Cloud Provider:** [More Information Needed] +- **Compute Region:** [More Information Needed] +- **Carbon Emitted:** [More Information Needed] + +## Technical Specifications [optional] + +### Model Architecture and Objective + +[More Information Needed] + +### Compute Infrastructure + +[More Information Needed] + +#### Hardware + +[More Information Needed] + +#### Software + +[More Information Needed] + +## Citation [optional] + + + +**BibTeX:** + +[More Information Needed] + +**APA:** + +[More Information Needed] + +## Glossary [optional] + + + +[More Information Needed] + +## More Information [optional] + +[More Information Needed] + +## Model Card Authors [optional] + +[More Information Needed] + +## Model Card Contact + +[More Information Needed] +### Framework versions + +- PEFT 0.14.0 \ No newline at end of file diff --git a/checkpoint-990/adapter_config.json b/checkpoint-990/adapter_config.json new file mode 100644 index 0000000000000000000000000000000000000000..e1a650486f9ba9bab8c8dbb7d564bdc4ec121cf7 --- /dev/null +++ b/checkpoint-990/adapter_config.json @@ -0,0 +1,38 @@ +{ + "alpha_pattern": {}, + "auto_mapping": null, + "base_model_name_or_path": "../../initial_seq_model", + "bias": "none", + "eva_config": null, + "exclude_modules": null, + "fan_in_fan_out": false, + "inference_mode": true, + "init_lora_weights": true, + "layer_replication": null, + "layers_pattern": null, + "layers_to_transform": null, + "loftq_config": {}, + "lora_alpha": 16, + "lora_bias": false, + "lora_dropout": 0.1, + "megatron_config": null, + "megatron_core": "megatron.core", + "modules_to_save": null, + "peft_type": "LORA", + "r": 8, + "rank_pattern": {}, + "revision": null, + "target_modules": [ + "k_proj", + "o_proj", + "gate_proj", + "down_proj", + "score", + "v_proj", + "up_proj", + "q_proj" + ], + "task_type": "CAUSAL_LM", + "use_dora": false, + "use_rslora": false +} \ No newline at end of file diff --git a/checkpoint-990/adapter_model.safetensors b/checkpoint-990/adapter_model.safetensors new file mode 100644 index 0000000000000000000000000000000000000000..0c1187b87bbf4ad9b1667cba277170f467078011 --- /dev/null +++ b/checkpoint-990/adapter_model.safetensors @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fc5f12417b5a85d81a09a0721f5707e1d79e21f3a56036a337465df486e4724e +size 42068368 diff --git a/checkpoint-990/global_step990/bf16_zero_pp_rank_0_mp_rank_00_optim_states.pt b/checkpoint-990/global_step990/bf16_zero_pp_rank_0_mp_rank_00_optim_states.pt new file mode 100644 index 0000000000000000000000000000000000000000..9855b2d65e3297f0e41843815161285c6bb68c86 --- /dev/null +++ b/checkpoint-990/global_step990/bf16_zero_pp_rank_0_mp_rank_00_optim_states.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:263ba9bbd6596da7ef2cfeec3b643960aa1e14d6ffd489d19829a2a1d1ffcae9 +size 63016432 diff --git a/checkpoint-990/global_step990/bf16_zero_pp_rank_1_mp_rank_00_optim_states.pt b/checkpoint-990/global_step990/bf16_zero_pp_rank_1_mp_rank_00_optim_states.pt new file mode 100644 index 0000000000000000000000000000000000000000..d409b7a4c30d3321de29c201b66210a83eafec70 --- /dev/null +++ b/checkpoint-990/global_step990/bf16_zero_pp_rank_1_mp_rank_00_optim_states.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c8e3698ef284fef9c51f38f920401843906cbc1709792a217699c60f271bd250 +size 63016432 diff --git a/checkpoint-990/global_step990/bf16_zero_pp_rank_2_mp_rank_00_optim_states.pt b/checkpoint-990/global_step990/bf16_zero_pp_rank_2_mp_rank_00_optim_states.pt new file mode 100644 index 0000000000000000000000000000000000000000..718a60cc3a15db1fdfb6d9abe07be83d6c11e061 --- /dev/null +++ b/checkpoint-990/global_step990/bf16_zero_pp_rank_2_mp_rank_00_optim_states.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f69bfef489d27b2aa27a1e0a3ce1814899715c8d001e45a7e7f52a6b282f4e19 +size 63016432 diff --git a/checkpoint-990/global_step990/bf16_zero_pp_rank_3_mp_rank_00_optim_states.pt b/checkpoint-990/global_step990/bf16_zero_pp_rank_3_mp_rank_00_optim_states.pt new file mode 100644 index 0000000000000000000000000000000000000000..de44c3838801452776170c9f20e88cd03aa949d8 --- /dev/null +++ b/checkpoint-990/global_step990/bf16_zero_pp_rank_3_mp_rank_00_optim_states.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6fde74a132621d91fe78c2ba846a345d08c78d89d7c59ae0de02fe1bbe8e1a46 +size 63016432 diff --git a/checkpoint-990/global_step990/zero_pp_rank_0_mp_rank_00_model_states.pt b/checkpoint-990/global_step990/zero_pp_rank_0_mp_rank_00_model_states.pt new file mode 100644 index 0000000000000000000000000000000000000000..07fc745e6882ad6407356fc8cf2f617cfa54e3c8 --- /dev/null +++ b/checkpoint-990/global_step990/zero_pp_rank_0_mp_rank_00_model_states.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0cab52bcfe80e1f331e378ea8251ca3737b0e5bd6ac6e110b8dc4966c38391db +size 442088 diff --git a/checkpoint-990/global_step990/zero_pp_rank_1_mp_rank_00_model_states.pt b/checkpoint-990/global_step990/zero_pp_rank_1_mp_rank_00_model_states.pt new file mode 100644 index 0000000000000000000000000000000000000000..2c274b82a19640670951d30cde181887061ddffa --- /dev/null +++ b/checkpoint-990/global_step990/zero_pp_rank_1_mp_rank_00_model_states.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f4deb07d9b4b8ccb2ad26a9bb77faad5c7bd6dd4560ea7b8419c49e3ffc0183a +size 442088 diff --git a/checkpoint-990/global_step990/zero_pp_rank_2_mp_rank_00_model_states.pt b/checkpoint-990/global_step990/zero_pp_rank_2_mp_rank_00_model_states.pt new file mode 100644 index 0000000000000000000000000000000000000000..afb374d1bafef203552888900730fb673c99d0d8 --- /dev/null +++ b/checkpoint-990/global_step990/zero_pp_rank_2_mp_rank_00_model_states.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4bdaecb528141fba85c2f22a796fae9f8bbb0d9d7333f0d5a403a1593ca05ab3 +size 442088 diff --git a/checkpoint-990/global_step990/zero_pp_rank_3_mp_rank_00_model_states.pt b/checkpoint-990/global_step990/zero_pp_rank_3_mp_rank_00_model_states.pt new file mode 100644 index 0000000000000000000000000000000000000000..5cb10d4ec21e888e0967e5da9f959c4c72d4d653 --- /dev/null +++ b/checkpoint-990/global_step990/zero_pp_rank_3_mp_rank_00_model_states.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:65960e6a3a9d3ef4d2a4beb595fd586012775203c353f3eeaf214baad37ba6de +size 442088 diff --git a/checkpoint-990/latest b/checkpoint-990/latest new file mode 100644 index 0000000000000000000000000000000000000000..165c608df85d2207c1c5a072fadf46b1584bd48c --- /dev/null +++ b/checkpoint-990/latest @@ -0,0 +1 @@ +global_step990 \ No newline at end of file diff --git a/checkpoint-990/rng_state_0.pth b/checkpoint-990/rng_state_0.pth new file mode 100644 index 0000000000000000000000000000000000000000..73856932232da8d218c9790f3ee1a66750d9c1f6 --- /dev/null +++ b/checkpoint-990/rng_state_0.pth @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4f068690f3cedf06ad6b580032f37d3a73170ab7f15aeace53cb03e9e4ffac98 +size 14960 diff --git a/checkpoint-990/rng_state_1.pth b/checkpoint-990/rng_state_1.pth new file mode 100644 index 0000000000000000000000000000000000000000..cc1ac90234c20e90c11f3169fdfde27bb0742fb2 --- /dev/null +++ b/checkpoint-990/rng_state_1.pth @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:270ef00f78d44eac008ef66b1c50a94c16604866a4a1cfdb3d8391d3c6ead9cc +size 14960 diff --git a/checkpoint-990/rng_state_2.pth b/checkpoint-990/rng_state_2.pth new file mode 100644 index 0000000000000000000000000000000000000000..b2288cfc50335e880ee6eaa8e746f737ed713260 --- /dev/null +++ b/checkpoint-990/rng_state_2.pth @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1977f06cbd4db418aefd1eba0d95c443c6eec265cfd72b6c0afad1f1642bb9c4 +size 14960 diff --git a/checkpoint-990/rng_state_3.pth b/checkpoint-990/rng_state_3.pth new file mode 100644 index 0000000000000000000000000000000000000000..fa43015a674da07a394d113e60629204e83a73ff --- /dev/null +++ b/checkpoint-990/rng_state_3.pth @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b77b77f32c073078ee08dd49b599a0bcac1a4d7578504b38f85ed46fb14370b1 +size 14960 diff --git a/checkpoint-990/scheduler.pt b/checkpoint-990/scheduler.pt new file mode 100644 index 0000000000000000000000000000000000000000..7dc4c8a24e12855d0c78d2433ac78dc338556493 --- /dev/null +++ b/checkpoint-990/scheduler.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:81c62592d8181cfc68bb6c3e319b7f7fea0dae67ce5973a5dd3e9fc194037b5b +size 1064 diff --git a/checkpoint-990/special_tokens_map.json b/checkpoint-990/special_tokens_map.json new file mode 100644 index 0000000000000000000000000000000000000000..a8eb9ef63af01dfa2c350573b543b14275370944 --- /dev/null +++ b/checkpoint-990/special_tokens_map.json @@ -0,0 +1,30 @@ +{ + "bos_token": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false + }, + "eos_token": { + "content": "<|END_OF_TURN_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false + }, + "pad_token": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false + }, + "unk_token": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false + } +} diff --git a/checkpoint-990/tokenizer.json b/checkpoint-990/tokenizer.json new file mode 100644 index 0000000000000000000000000000000000000000..91a1344d38167f152a8803a80eb79ca4b465adbb --- /dev/null +++ b/checkpoint-990/tokenizer.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:28c8b8038fcb2756e349a51832a56634423c579a869f39642526327aa56b2989 +size 20125189 diff --git a/checkpoint-990/tokenizer_config.json b/checkpoint-990/tokenizer_config.json new file mode 100644 index 0000000000000000000000000000000000000000..100ac1a3b6cff4a9043d2c0fd6b1603d1c1ee1e1 --- /dev/null +++ b/checkpoint-990/tokenizer_config.json @@ -0,0 +1,364 @@ +{ + "add_bos_token": true, + "add_eos_token": false, + "add_prefix_space": false, + "added_tokens_decoder": { + "0": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "1": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "2": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "3": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "4": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "5": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "6": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "7": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "255000": { + "content": "<|START_OF_TURN_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255001": { + "content": "<|END_OF_TURN_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "255002": { + "content": "<|YES_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255003": { + "content": "<|NO_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255004": { + "content": "<|GOOD_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255005": { + "content": "<|BAD_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255006": { + "content": "<|USER_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255007": { + "content": "<|CHATBOT_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255008": { + "content": "<|SYSTEM_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255009": { + "content": "<|USER_0_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255010": { + "content": "<|USER_1_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255011": { + "content": "<|USER_2_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255012": { + "content": "<|USER_3_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255013": { + "content": "<|USER_4_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255014": { + "content": "<|USER_5_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255015": { + "content": "<|USER_6_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255016": { + "content": "<|USER_7_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255017": { + "content": "<|USER_8_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255018": { + "content": "<|USER_9_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255019": { + "content": "<|START_THINKING|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255020": { + "content": "<|END_THINKING|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255021": { + "content": "<|START_RESPONSE|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "255022": { + "content": "<|END_RESPONSE|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "255023": { + "content": "<|START_ACTION|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255024": { + "content": "<|END_ACTION|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255025": { + "content": "<|START_TOOL_RESULT|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255026": { + "content": "<|END_TOOL_RESULT|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255027": { + "content": "<|EXTRA_8_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255028": { + "content": "<|NEW_FILE|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "255029": { + "content": "<|BEGINNING_OF_PREFIX_FIM_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255030": { + "content": "<|BEGINNING_OF_MIDDLE_FIM_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255031": { + "content": "<|BEGINNING_OF_SUFFIX_FIM_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "255032": { + "content": "<|END_OF_MIDDLE_FIM_TOKEN|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + } + }, + "bos_token": "", + "chat_template": [ + { + "name": "default", + "template": "{% if documents %}\n{% set tools = [] %}\n{%- macro document_turn(documents) -%}\n{# format documents into chat turn #}\n<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|><|START_THINKING|>I will look through the document to address the users needs.<|END_THINKING|><|START_ACTION|>[\n {\"tool_call_id\": \"0\", \"tool_name\": \"direct-injected-document\", \"parameters\": {}}\n]<|END_ACTION|><|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|><|START_TOOL_RESULT|>[\n {\n \"tool_call_id\": \"0\",\n \"results\": {\n{% for doc in documents %}\n \"{{ loop.index0 }}\": {{doc|tojson}}{% if not loop.last %},\n {% endif %}\n{% endfor %}\n\n },\n \"is_error\": null\n }\n]<|END_TOOL_RESULT|><|END_OF_TURN_TOKEN|>{%- endmacro %}\n{%- macro tool_call_id_to_int(messages, tool_call_id) %}\n{%- set counter = namespace(value=0) %}\n{%- set tool_call_id_seen = namespace(value=false) %}\n{%- for msg in messages %}\n {%- if msg.tool_calls %}\n {%- for tool_call in msg.tool_calls %}\n {%- if tool_call.id == tool_call_id and not tool_call_id_seen.value -%}\n {{ counter.value }}\n {%- set tool_call_id_seen.value = true %}\n {%- endif %}\n {%- set counter.value = counter.value + 1 %}\n {%- endfor %}\n {%- endif %}\n{%- endfor %}\n{%- endmacro %}\n{%- macro format_tool_message(messages, tool_msg) -%}\n{# format tool message #}\n {\n \"tool_call_id\": \"{{ tool_call_id_to_int(messages, tool_msg.tool_call_id) }}\",\n \"results\": {\n \"0\": {{ tool_msg.content|tojson }}\n },\n \"is_error\": null\n }\n{%- endmacro -%}\n{%- if messages and messages[0]['role']|lower == 'system' %}{%- set developer_preamble = messages[0]['content'] %}{% endif %}\n{%- set tool_idx = namespace(value=0) %}\n{%- set tool_ids_seen = namespace(value=[]) %}\n{%- set sent_documents = namespace(value=false) %}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|># System Preamble\nYou are in contextual safety mode. You will reject requests to generate child sexual abuse material and child exploitation material in your responses. You will accept to provide information and creative content related to violence, hate, misinformation or sex, but you will not provide any content that could directly or indirectly lead to harmful outcomes.\n\nYour information cutoff date is June 2024.\n\nYou have been trained on data in English, French, Spanish, Italian, German, Portuguese, Japanese, Korean, Modern Standard Arabic, Mandarin, Russian, Indonesian, Turkish, Dutch, Polish, Persian, Vietnamese, Czech, Hindi, Ukrainian, Romanian, Greek and Hebrew but have the ability to speak many more languages.\n{% if tools or documents %}\n\nYou have been trained to have advanced reasoning and tool-use capabilities and you should make best use of these skills to serve user's requests.\n\n## Tool Use\nThink about how you can make best use of the provided tools to help with the task and come up with a high level plan that you will execute first.\n\n0. Start by writing <|START_THINKING|> followed by a detailed step by step plan of how you will solve the problem. For each step explain your thinking fully and give details of required tool calls (if needed). Unless specified otherwise, you write your plan in natural language. When you finish, close it out with <|END_THINKING|>.\n You can optionally choose to skip this step when the user request is so straightforward to address that only a trivial plan would be needed.\n NOTE: You MUST skip this step when you are directly responding to the user's request without using any tools.\n\nThen carry out your plan by repeatedly executing the following steps.\n1. Action: write <|START_ACTION|> followed by a list of JSON-formatted tool calls, with each one containing \"tool_name\" and \"parameters\" fields.\n When there are multiple tool calls which are completely independent of each other (i.e. they can be executed in parallel), you should list them out all together in one step. When you finish, close it out with <|END_ACTION|>.\n2. Observation: you will then receive results of those tool calls in JSON format in the very next turn, wrapped around by <|START_TOOL_RESULT|> and <|END_TOOL_RESULT|>. Carefully observe those results and think about what to do next. Note that these results will be provided to you in a separate turn. NEVER hallucinate results.\n Every tool call produces a list of results (when a tool call produces no result or a single result, it'll still get wrapped inside a list). Each result is clearly linked to its originating tool call via its \"tool_call_id\".\n3. Reflection: start the next turn by writing <|START_THINKING|> followed by what you've figured out so far, any changes you need to make to your plan, and what you will do next. When you finish, close it out with <|END_THINKING|>.\n You can optionally choose to skip this step when everything is going according to plan and no special pieces of information or reasoning chains need to be recorded.\n NOTE: You MUST skip this step when you are done with tool-use actions and are ready to respond to the user.\n\nYou can repeat the above 3 steps multiple times (could be 0 times too if no suitable tool calls are available or needed), until you decide it's time to finally respond to the user.\n\n4. Response: then break out of the loop and write <|START_RESPONSE|> followed by a piece of text which serves as a response to the user's last request. Use all previous tool calls and results to help you when formulating your response. When you finish, close it out with <|END_RESPONSE|>.\n{% if enable_citations %}\n\n## Grounding\nImportantly, note that \"Reflection\" and \"Response\" above can be grounded.\nGrounding means you associate pieces of texts (called \"spans\") with those specific tool results that support them (called \"sources\"). And you use a pair of tags \"\" and \"\" to indicate when a span can be grounded onto a list of sources, listing them out in the closing tag. Sources from the same tool call are grouped together and listed as \"{tool_call_id}:[{list of result indices}]\", before they are joined together by \",\". E.g., \"span\" means that \"span\" is supported by result 1 and 2 from \"tool_call_id=0\" as well as result 0 from \"tool_call_id=1\".\n{% endif %}\n\n## Available Tools\nHere is the list of tools that you have available to you.\nYou can ONLY use the tools listed here. When a tool is not listed below, it is NOT available and you should NEVER attempt to use it.\nEach tool is represented as a JSON object with fields like \"name\", \"description\", \"parameters\" (per JSON Schema), and optionally, \"responses\" (per JSON Schema).\n\n```json\n[\n{% if documents %}\n {\"name\": \"direct-injected-document\", \"description\": \"This is a special tool to directly inject user-uploaded documents into the chat as additional context. DO NOT use this tool by yourself!\", \"parameters\": {\"type\": \"object\", \"properties\": {}, \"required\": []}, \"responses\": {\"200\": {\"description\": \"Successfully returned a list of chunked text snippets from the directly uploaded documents.\", \"content\": {\"application/json\": {\"schema\": {\"type\": \"array\", \"items\": {\"type\": \"object\", \"required\": [\"url\", \"snippet\"], \"properties\": {\"url\": {\"type\": \"string\", \"description\": \"The url of the uploaded document.\"}, \"snippet\": {\"type\": \"string\", \"description\": \"The text snippet for the returned document chunk.\"}}}}}}}}}{%- if tools %},{% endif %}\n\n{% endif %}\n{% for tool in tools %}\n {\"name\": \"{{ tool['function']['name'] }}\", \"description\": \"{{tool['function']['description']}}\", \"parameters\": {{ tool['function']['parameters']|tojson }}, \"responses\": null}{%- if not loop.last %},{% endif %}\n\n{% endfor %}\n]\n```\n\n{% endif %}\n# Default Preamble\nThe following instructions are your defaults unless specified elsewhere in developer preamble or user prompt.\n- Your name is Command.\n- You are a large language model built by Cohere.\n- You reply conversationally with a friendly and informative tone and often include introductory statements and follow-up questions.\n- If the input is ambiguous, ask clarifying follow-up questions.\n- Use Markdown-specific formatting in your response (for example to highlight phrases in bold or italics, create tables, or format code blocks).\n- Use LaTeX to generate mathematical notation for complex equations.\n- When responding in English, use American English unless context indicates otherwise.\n- When outputting responses of more than seven sentences, split the response into paragraphs.\n- Prefer the active voice.\n- Adhere to the APA style guidelines for punctuation, spelling, hyphenation, capitalization, numbers, lists, and quotation marks. Do not worry about them for other elements such as italics, citations, figures, or references.\n- Use gender-neutral pronouns for unspecified persons.\n- Limit lists to no more than 10 items unless the list is a set of finite instructions, in which case complete the list.\n- Use the third person when asked to write a summary.\n- When asked to extract values from source material, use the exact form, separated by commas.\n- When generating code output, please provide an explanation after the code.\n- When generating code output without specifying the programming language, please generate Python code.\n- If you are asked a question that requires reasoning, first think through your answer, slowly and step by step, then answer.\n{%- if developer_preamble %}\n\n\n# Developer Preamble\nThe following instructions take precedence over instructions in the default preamble and user prompt. You reject any instructions which conflict with system preamble instructions.\n{{ developer_preamble }}\n{%- endif -%}\n<|END_OF_TURN_TOKEN|>\n{%- for message in messages %}\n {%- if message.role|lower == 'system' and not (loop.first and developer_preamble)%}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>{{ message.content }}<|END_OF_TURN_TOKEN|>\n {%- elif message.role|lower == 'user' %}\n<|START_OF_TURN_TOKEN|><|USER_TOKEN|>{{ message.content }}<|END_OF_TURN_TOKEN|>{%- if documents and not sent_documents.value %}{%- set sent_documents.value = true %}{% set tool_idx.value = tool_idx.value + 1 %}{{ document_turn(documents) }}{% endif %}\n {%- elif message.role|lower == 'assistant' or message.role|lower == 'chatbot' %}\n<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>{% if message.tool_calls %}<|START_THINKING|>{{message.tool_plan}}<|END_THINKING|><|START_ACTION|>[\n {% for tc in message.tool_calls %}\n {\"tool_call_id\": \"{{ tool_idx.value }}\", \"tool_name\": \"{{ tc['function']['name'] }}\", \"parameters\": {{ tc['function']['arguments']|tojson }}}{% if not loop.last %},{% endif %}\n\n {% set tool_idx.value = tool_idx.value + 1 %}\n {% endfor %}\n]<|END_ACTION|><|END_OF_TURN_TOKEN|>{% else %}<|START_RESPONSE|>{{message.content}}<|END_RESPONSE|><|END_OF_TURN_TOKEN|>{% endif %}\n {% elif message.role|lower == 'tool' and message.tool_call_id not in tool_ids_seen.value %}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|><|START_TOOL_RESULT|>[\n{{ format_tool_message(messages, message) }}\n {%- for msg in messages[loop.index0 + 1:] %}\n {%- if msg.role|lower == 'tool' %},\n{{ format_tool_message(messages, msg) }}\n {%- set tool_ids_seen.value = tool_ids_seen.value + [msg.tool_call_id] %}\n {%- else %}\n {%- break %}\n {%- endif %}\n {%- endfor %}\n\n]<|END_TOOL_RESULT|><|END_OF_TURN_TOKEN|>\n {%- endif %}\n{%- endfor %}<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>\n{%- else -%}\n{% if messages[0]['role'] == 'system' %}{% set loop_messages = messages[1:] %}\n {%- set system_message = messages[0]['content'] %}{% elif false == true %}\n {%- set loop_messages = messages %}{% set system_message = '' %}\n{%- else %}\n {%- set loop_messages = messages %}\n {%- set system_message = false %}\n{%- endif %}\n{%- if system_message != false -%}\n {{ '<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>' + system_message + '<|END_OF_TURN_TOKEN|>' }}\n{%- else -%}\n {{ '<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|><|END_OF_TURN_TOKEN|>' }}\n{%- endif %}\n{%- for message in loop_messages %}\n {%- if (message['role'] == 'user') != (loop.index0 % 2 == 0) -%}\n {{ raise_exception('Conversation roles must alternate user/assistant/user/assistant/...') }}\n {%- endif -%}\n {%- set content = message['content'] -%}\n {%- if message['role'] == 'user' -%}\n {{ '<|START_OF_TURN_TOKEN|><|USER_TOKEN|>' + content.strip() + '<|END_OF_TURN_TOKEN|>' }}\n {%- elif message['role'] == 'assistant' -%}\n {{ '<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|><|START_RESPONSE|>' + content.strip() + '<|END_RESPONSE|><|END_OF_TURN_TOKEN|>' }}\n {%- endif %}\n{%- endfor %}\n{%- if add_generation_prompt -%}\n {{ '<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|><|START_RESPONSE|>' }}\n{%- endif %}\n{% endif %}" + }, + { + "name": "tool_use", + "template": "{%- macro document_turn(documents) -%}\n{# format documents into chat turn #}\n<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|><|START_THINKING|>I will look through the document to address the users needs.<|END_THINKING|><|START_ACTION|>[\n {\"tool_call_id\": \"0\", \"tool_name\": \"direct-injected-document\", \"parameters\": {}}\n]<|END_ACTION|><|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|><|START_TOOL_RESULT|>[\n {\n \"tool_call_id\": \"0\",\n \"results\": {\n{% for doc in documents %}\n \"{{ loop.index0 }}\": {{doc|tojson}}{% if not loop.last %},\n {% endif %}\n{% endfor %}\n\n },\n \"is_error\": null\n }\n]<|END_TOOL_RESULT|><|END_OF_TURN_TOKEN|>{%- endmacro %}\n{%- macro tool_call_id_to_int(messages, tool_call_id) %}\n{%- set counter = namespace(value=0) %}\n{%- set tool_call_id_seen = namespace(value=false) %}\n{%- for msg in messages %}\n {%- if msg.tool_calls %}\n {%- for tool_call in msg.tool_calls %}\n {%- if tool_call.id == tool_call_id and not tool_call_id_seen.value -%}\n {{ counter.value }}\n {%- set tool_call_id_seen.value = true %}\n {%- endif %}\n {%- set counter.value = counter.value + 1 %}\n {%- endfor %}\n {%- endif %}\n{%- endfor %}\n{%- endmacro %}\n{%- macro format_tool_message(messages, tool_msg) -%}\n{# format tool message #}\n {\n \"tool_call_id\": \"{{ tool_call_id_to_int(messages, tool_msg.tool_call_id) }}\",\n \"results\": {\n \"0\": {{ tool_msg.content|tojson }}\n },\n \"is_error\": null\n }\n{%- endmacro -%}\n{%- if messages and messages[0]['role']|lower == 'system' %}{%- set developer_preamble = messages[0]['content'] %}{% endif %}\n{%- set tool_idx = namespace(value=0) %}\n{%- set tool_ids_seen = namespace(value=[]) %}\n{%- set sent_documents = namespace(value=false) %}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|># System Preamble\nYou are in contextual safety mode. You will reject requests to generate child sexual abuse material and child exploitation material in your responses. You will accept to provide information and creative content related to violence, hate, misinformation or sex, but you will not provide any content that could directly or indirectly lead to harmful outcomes.\n\nYour information cutoff date is June 2024.\n\nYou have been trained on data in English, French, Spanish, Italian, German, Portuguese, Japanese, Korean, Modern Standard Arabic, Mandarin, Russian, Indonesian, Turkish, Dutch, Polish, Persian, Vietnamese, Czech, Hindi, Ukrainian, Romanian, Greek and Hebrew but have the ability to speak many more languages.\n{% if tools or documents %}\n\nYou have been trained to have advanced reasoning and tool-use capabilities and you should make best use of these skills to serve user's requests.\n\n## Tool Use\nThink about how you can make best use of the provided tools to help with the task and come up with a high level plan that you will execute first.\n\n0. Start by writing <|START_THINKING|> followed by a detailed step by step plan of how you will solve the problem. For each step explain your thinking fully and give details of required tool calls (if needed). Unless specified otherwise, you write your plan in natural language. When you finish, close it out with <|END_THINKING|>.\n You can optionally choose to skip this step when the user request is so straightforward to address that only a trivial plan would be needed.\n NOTE: You MUST skip this step when you are directly responding to the user's request without using any tools.\n\nThen carry out your plan by repeatedly executing the following steps.\n1. Action: write <|START_ACTION|> followed by a list of JSON-formatted tool calls, with each one containing \"tool_name\" and \"parameters\" fields.\n When there are multiple tool calls which are completely independent of each other (i.e. they can be executed in parallel), you should list them out all together in one step. When you finish, close it out with <|END_ACTION|>.\n2. Observation: you will then receive results of those tool calls in JSON format in the very next turn, wrapped around by <|START_TOOL_RESULT|> and <|END_TOOL_RESULT|>. Carefully observe those results and think about what to do next. Note that these results will be provided to you in a separate turn. NEVER hallucinate results.\n Every tool call produces a list of results (when a tool call produces no result or a single result, it'll still get wrapped inside a list). Each result is clearly linked to its originating tool call via its \"tool_call_id\".\n3. Reflection: start the next turn by writing <|START_THINKING|> followed by what you've figured out so far, any changes you need to make to your plan, and what you will do next. When you finish, close it out with <|END_THINKING|>.\n You can optionally choose to skip this step when everything is going according to plan and no special pieces of information or reasoning chains need to be recorded.\n NOTE: You MUST skip this step when you are done with tool-use actions and are ready to respond to the user.\n\nYou can repeat the above 3 steps multiple times (could be 0 times too if no suitable tool calls are available or needed), until you decide it's time to finally respond to the user.\n\n4. Response: then break out of the loop and write <|START_RESPONSE|> followed by a piece of text which serves as a response to the user's last request. Use all previous tool calls and results to help you when formulating your response. When you finish, close it out with <|END_RESPONSE|>.\n{% if enable_citations %}\n\n## Grounding\nImportantly, note that \"Reflection\" and \"Response\" above can be grounded.\nGrounding means you associate pieces of texts (called \"spans\") with those specific tool results that support them (called \"sources\"). And you use a pair of tags \"\" and \"\" to indicate when a span can be grounded onto a list of sources, listing them out in the closing tag. Sources from the same tool call are grouped together and listed as \"{tool_call_id}:[{list of result indices}]\", before they are joined together by \",\". E.g., \"span\" means that \"span\" is supported by result 1 and 2 from \"tool_call_id=0\" as well as result 0 from \"tool_call_id=1\".\n{% endif %}\n\n## Available Tools\nHere is the list of tools that you have available to you.\nYou can ONLY use the tools listed here. When a tool is not listed below, it is NOT available and you should NEVER attempt to use it.\nEach tool is represented as a JSON object with fields like \"name\", \"description\", \"parameters\" (per JSON Schema), and optionally, \"responses\" (per JSON Schema).\n\n```json\n[\n{% if documents %}\n {\"name\": \"direct-injected-document\", \"description\": \"This is a special tool to directly inject user-uploaded documents into the chat as additional context. DO NOT use this tool by yourself!\", \"parameters\": {\"type\": \"object\", \"properties\": {}, \"required\": []}, \"responses\": {\"200\": {\"description\": \"Successfully returned a list of chunked text snippets from the directly uploaded documents.\", \"content\": {\"application/json\": {\"schema\": {\"type\": \"array\", \"items\": {\"type\": \"object\", \"required\": [\"url\", \"snippet\"], \"properties\": {\"url\": {\"type\": \"string\", \"description\": \"The url of the uploaded document.\"}, \"snippet\": {\"type\": \"string\", \"description\": \"The text snippet for the returned document chunk.\"}}}}}}}}}{%- if tools %},{% endif %}\n\n{% endif %}\n{% for tool in tools %}\n {\"name\": \"{{ tool['function']['name'] }}\", \"description\": \"{{tool['function']['description']}}\", \"parameters\": {{ tool['function']['parameters']|tojson }}, \"responses\": null}{%- if not loop.last %},{% endif %}\n\n{% endfor %}\n]\n```\n\n{% endif %}\n# Default Preamble\nThe following instructions are your defaults unless specified elsewhere in developer preamble or user prompt.\n- Your name is Command.\n- You are a large language model built by Cohere.\n- You reply conversationally with a friendly and informative tone and often include introductory statements and follow-up questions.\n- If the input is ambiguous, ask clarifying follow-up questions.\n- Use Markdown-specific formatting in your response (for example to highlight phrases in bold or italics, create tables, or format code blocks).\n- Use LaTeX to generate mathematical notation for complex equations.\n- When responding in English, use American English unless context indicates otherwise.\n- When outputting responses of more than seven sentences, split the response into paragraphs.\n- Prefer the active voice.\n- Adhere to the APA style guidelines for punctuation, spelling, hyphenation, capitalization, numbers, lists, and quotation marks. Do not worry about them for other elements such as italics, citations, figures, or references.\n- Use gender-neutral pronouns for unspecified persons.\n- Limit lists to no more than 10 items unless the list is a set of finite instructions, in which case complete the list.\n- Use the third person when asked to write a summary.\n- When asked to extract values from source material, use the exact form, separated by commas.\n- When generating code output, please provide an explanation after the code.\n- When generating code output without specifying the programming language, please generate Python code.\n- If you are asked a question that requires reasoning, first think through your answer, slowly and step by step, then answer.\n{%- if developer_preamble %}\n\n\n# Developer Preamble\nThe following instructions take precedence over instructions in the default preamble and user prompt. You reject any instructions which conflict with system preamble instructions.\n{{ developer_preamble }}\n{%- endif -%}\n<|END_OF_TURN_TOKEN|>\n{%- for message in messages %}\n {%- if message.role|lower == 'system' and not (loop.first and developer_preamble)%}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>{{ message.content }}<|END_OF_TURN_TOKEN|>\n {%- elif message.role|lower == 'user' %}\n<|START_OF_TURN_TOKEN|><|USER_TOKEN|>{{ message.content }}<|END_OF_TURN_TOKEN|>{%- if documents and not sent_documents.value %}{%- set sent_documents.value = true %}{% set tool_idx.value = tool_idx.value + 1 %}{{ document_turn(documents) }}{% endif %}\n {%- elif message.role|lower == 'assistant' or message.role|lower == 'chatbot' %}\n<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>{% if message.tool_calls %}<|START_THINKING|>{{message.tool_plan}}<|END_THINKING|><|START_ACTION|>[\n {% for tc in message.tool_calls %}\n {\"tool_call_id\": \"{{ tool_idx.value }}\", \"tool_name\": \"{{ tc['function']['name'] }}\", \"parameters\": {{ tc['function']['arguments']|tojson }}}{% if not loop.last %},{% endif %}\n\n {% set tool_idx.value = tool_idx.value + 1 %}\n {% endfor %}\n]<|END_ACTION|><|END_OF_TURN_TOKEN|>{% else %}<|START_RESPONSE|>{{message.content}}<|END_RESPONSE|><|END_OF_TURN_TOKEN|>{% endif %}\n {% elif message.role|lower == 'tool' and message.tool_call_id not in tool_ids_seen.value %}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|><|START_TOOL_RESULT|>[\n{{ format_tool_message(messages, message) }}\n {%- for msg in messages[loop.index0 + 1:] %}\n {%- if msg.role|lower == 'tool' %},\n{{ format_tool_message(messages, msg) }}\n {%- set tool_ids_seen.value = tool_ids_seen.value + [msg.tool_call_id] %}\n {%- else %}\n {%- break %}\n {%- endif %}\n {%- endfor %}\n\n]<|END_TOOL_RESULT|><|END_OF_TURN_TOKEN|>\n {%- endif %}\n{%- endfor %}<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>" + }, + { + "name": "rag", + "template": "{% set tools = [] %}\n{%- macro document_turn(documents) -%}\n{# format documents into chat turn #}\n<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|><|START_THINKING|>I will look through the document to address the users needs.<|END_THINKING|><|START_ACTION|>[\n {\"tool_call_id\": \"0\", \"tool_name\": \"direct-injected-document\", \"parameters\": {}}\n]<|END_ACTION|><|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|><|START_TOOL_RESULT|>[\n {\n \"tool_call_id\": \"0\",\n \"results\": {\n{% for doc in documents %}\n \"{{ loop.index0 }}\": {{doc|tojson}}{% if not loop.last %},\n {% endif %}\n{% endfor %}\n\n },\n \"is_error\": null\n }\n]<|END_TOOL_RESULT|><|END_OF_TURN_TOKEN|>{%- endmacro %}\n{%- macro tool_call_id_to_int(messages, tool_call_id) %}\n{%- set counter = namespace(value=0) %}\n{%- set tool_call_id_seen = namespace(value=false) %}\n{%- for msg in messages %}\n {%- if msg.tool_calls %}\n {%- for tool_call in msg.tool_calls %}\n {%- if tool_call.id == tool_call_id and not tool_call_id_seen.value -%}\n {{ counter.value }}\n {%- set tool_call_id_seen.value = true %}\n {%- endif %}\n {%- set counter.value = counter.value + 1 %}\n {%- endfor %}\n {%- endif %}\n{%- endfor %}\n{%- endmacro %}\n{%- macro format_tool_message(messages, tool_msg) -%}\n{# format tool message #}\n {\n \"tool_call_id\": \"{{ tool_call_id_to_int(messages, tool_msg.tool_call_id) }}\",\n \"results\": {\n \"0\": {{ tool_msg.content|tojson }}\n },\n \"is_error\": null\n }\n{%- endmacro -%}\n{%- if messages and messages[0]['role']|lower == 'system' %}{%- set developer_preamble = messages[0]['content'] %}{% endif %}\n{%- set tool_idx = namespace(value=0) %}\n{%- set tool_ids_seen = namespace(value=[]) %}\n{%- set sent_documents = namespace(value=false) %}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|># System Preamble\nYou are in contextual safety mode. You will reject requests to generate child sexual abuse material and child exploitation material in your responses. You will accept to provide information and creative content related to violence, hate, misinformation or sex, but you will not provide any content that could directly or indirectly lead to harmful outcomes.\n\nYour information cutoff date is June 2024.\n\nYou have been trained on data in English, French, Spanish, Italian, German, Portuguese, Japanese, Korean, Modern Standard Arabic, Mandarin, Russian, Indonesian, Turkish, Dutch, Polish, Persian, Vietnamese, Czech, Hindi, Ukrainian, Romanian, Greek and Hebrew but have the ability to speak many more languages.\n{% if tools or documents %}\n\nYou have been trained to have advanced reasoning and tool-use capabilities and you should make best use of these skills to serve user's requests.\n\n## Tool Use\nThink about how you can make best use of the provided tools to help with the task and come up with a high level plan that you will execute first.\n\n0. Start by writing <|START_THINKING|> followed by a detailed step by step plan of how you will solve the problem. For each step explain your thinking fully and give details of required tool calls (if needed). Unless specified otherwise, you write your plan in natural language. When you finish, close it out with <|END_THINKING|>.\n You can optionally choose to skip this step when the user request is so straightforward to address that only a trivial plan would be needed.\n NOTE: You MUST skip this step when you are directly responding to the user's request without using any tools.\n\nThen carry out your plan by repeatedly executing the following steps.\n1. Action: write <|START_ACTION|> followed by a list of JSON-formatted tool calls, with each one containing \"tool_name\" and \"parameters\" fields.\n When there are multiple tool calls which are completely independent of each other (i.e. they can be executed in parallel), you should list them out all together in one step. When you finish, close it out with <|END_ACTION|>.\n2. Observation: you will then receive results of those tool calls in JSON format in the very next turn, wrapped around by <|START_TOOL_RESULT|> and <|END_TOOL_RESULT|>. Carefully observe those results and think about what to do next. Note that these results will be provided to you in a separate turn. NEVER hallucinate results.\n Every tool call produces a list of results (when a tool call produces no result or a single result, it'll still get wrapped inside a list). Each result is clearly linked to its originating tool call via its \"tool_call_id\".\n3. Reflection: start the next turn by writing <|START_THINKING|> followed by what you've figured out so far, any changes you need to make to your plan, and what you will do next. When you finish, close it out with <|END_THINKING|>.\n You can optionally choose to skip this step when everything is going according to plan and no special pieces of information or reasoning chains need to be recorded.\n NOTE: You MUST skip this step when you are done with tool-use actions and are ready to respond to the user.\n\nYou can repeat the above 3 steps multiple times (could be 0 times too if no suitable tool calls are available or needed), until you decide it's time to finally respond to the user.\n\n4. Response: then break out of the loop and write <|START_RESPONSE|> followed by a piece of text which serves as a response to the user's last request. Use all previous tool calls and results to help you when formulating your response. When you finish, close it out with <|END_RESPONSE|>.\n{% if enable_citations %}\n\n## Grounding\nImportantly, note that \"Reflection\" and \"Response\" above can be grounded.\nGrounding means you associate pieces of texts (called \"spans\") with those specific tool results that support them (called \"sources\"). And you use a pair of tags \"\" and \"\" to indicate when a span can be grounded onto a list of sources, listing them out in the closing tag. Sources from the same tool call are grouped together and listed as \"{tool_call_id}:[{list of result indices}]\", before they are joined together by \",\". E.g., \"span\" means that \"span\" is supported by result 1 and 2 from \"tool_call_id=0\" as well as result 0 from \"tool_call_id=1\".\n{% endif %}\n\n## Available Tools\nHere is the list of tools that you have available to you.\nYou can ONLY use the tools listed here. When a tool is not listed below, it is NOT available and you should NEVER attempt to use it.\nEach tool is represented as a JSON object with fields like \"name\", \"description\", \"parameters\" (per JSON Schema), and optionally, \"responses\" (per JSON Schema).\n\n```json\n[\n{% if documents %}\n {\"name\": \"direct-injected-document\", \"description\": \"This is a special tool to directly inject user-uploaded documents into the chat as additional context. DO NOT use this tool by yourself!\", \"parameters\": {\"type\": \"object\", \"properties\": {}, \"required\": []}, \"responses\": {\"200\": {\"description\": \"Successfully returned a list of chunked text snippets from the directly uploaded documents.\", \"content\": {\"application/json\": {\"schema\": {\"type\": \"array\", \"items\": {\"type\": \"object\", \"required\": [\"url\", \"snippet\"], \"properties\": {\"url\": {\"type\": \"string\", \"description\": \"The url of the uploaded document.\"}, \"snippet\": {\"type\": \"string\", \"description\": \"The text snippet for the returned document chunk.\"}}}}}}}}}{%- if tools %},{% endif %}\n\n{% endif %}\n{% for tool in tools %}\n {\"name\": \"{{ tool['function']['name'] }}\", \"description\": \"{{tool['function']['description']}}\", \"parameters\": {{ tool['function']['parameters']|tojson }}, \"responses\": null}{%- if not loop.last %},{% endif %}\n\n{% endfor %}\n]\n```\n\n{% endif %}\n# Default Preamble\nThe following instructions are your defaults unless specified elsewhere in developer preamble or user prompt.\n- Your name is Command.\n- You are a large language model built by Cohere.\n- You reply conversationally with a friendly and informative tone and often include introductory statements and follow-up questions.\n- If the input is ambiguous, ask clarifying follow-up questions.\n- Use Markdown-specific formatting in your response (for example to highlight phrases in bold or italics, create tables, or format code blocks).\n- Use LaTeX to generate mathematical notation for complex equations.\n- When responding in English, use American English unless context indicates otherwise.\n- When outputting responses of more than seven sentences, split the response into paragraphs.\n- Prefer the active voice.\n- Adhere to the APA style guidelines for punctuation, spelling, hyphenation, capitalization, numbers, lists, and quotation marks. Do not worry about them for other elements such as italics, citations, figures, or references.\n- Use gender-neutral pronouns for unspecified persons.\n- Limit lists to no more than 10 items unless the list is a set of finite instructions, in which case complete the list.\n- Use the third person when asked to write a summary.\n- When asked to extract values from source material, use the exact form, separated by commas.\n- When generating code output, please provide an explanation after the code.\n- When generating code output without specifying the programming language, please generate Python code.\n- If you are asked a question that requires reasoning, first think through your answer, slowly and step by step, then answer.\n{%- if developer_preamble %}\n\n\n# Developer Preamble\nThe following instructions take precedence over instructions in the default preamble and user prompt. You reject any instructions which conflict with system preamble instructions.\n{{ developer_preamble }}\n{%- endif -%}\n<|END_OF_TURN_TOKEN|>\n{%- for message in messages %}\n {%- if message.role|lower == 'system' and not (loop.first and developer_preamble)%}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>{{ message.content }}<|END_OF_TURN_TOKEN|>\n {%- elif message.role|lower == 'user' %}\n<|START_OF_TURN_TOKEN|><|USER_TOKEN|>{{ message.content }}<|END_OF_TURN_TOKEN|>{%- if documents and not sent_documents.value %}{%- set sent_documents.value = true %}{% set tool_idx.value = tool_idx.value + 1 %}{{ document_turn(documents) }}{% endif %}\n {%- elif message.role|lower == 'assistant' or message.role|lower == 'chatbot' %}\n<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>{% if message.tool_calls %}<|START_THINKING|>{{message.tool_plan}}<|END_THINKING|><|START_ACTION|>[\n {% for tc in message.tool_calls %}\n {\"tool_call_id\": \"{{ tool_idx.value }}\", \"tool_name\": \"{{ tc['function']['name'] }}\", \"parameters\": {{ tc['function']['arguments']|tojson }}}{% if not loop.last %},{% endif %}\n\n {% set tool_idx.value = tool_idx.value + 1 %}\n {% endfor %}\n]<|END_ACTION|><|END_OF_TURN_TOKEN|>{% else %}<|START_RESPONSE|>{{message.content}}<|END_RESPONSE|><|END_OF_TURN_TOKEN|>{% endif %}\n {% elif message.role|lower == 'tool' and message.tool_call_id not in tool_ids_seen.value %}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|><|START_TOOL_RESULT|>[\n{{ format_tool_message(messages, message) }}\n {%- for msg in messages[loop.index0 + 1:] %}\n {%- if msg.role|lower == 'tool' %},\n{{ format_tool_message(messages, msg) }}\n {%- set tool_ids_seen.value = tool_ids_seen.value + [msg.tool_call_id] %}\n {%- else %}\n {%- break %}\n {%- endif %}\n {%- endfor %}\n\n]<|END_TOOL_RESULT|><|END_OF_TURN_TOKEN|>\n {%- endif %}\n{%- endfor %}<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>" + } + ], + "clean_up_tokenization_spaces": false, + "eos_token": "<|END_OF_TURN_TOKEN|>", + "extra_special_tokens": {}, + "legacy": true, + "merges_file": null, + "model_max_length": 8192, + "pad_token": "", + "padding_side": "right", + "sp_model_kwargs": {}, + "spaces_between_special_tokens": false, + "tokenizer_class": "CohereTokenizer", + "unk_token": "", + "use_default_system_prompt": false, + "vocab_file": null +} diff --git a/checkpoint-990/trainer_state.json b/checkpoint-990/trainer_state.json new file mode 100644 index 0000000000000000000000000000000000000000..d0ac8bbebdedd7ebd7406a84ccdb79764de4317a --- /dev/null +++ b/checkpoint-990/trainer_state.json @@ -0,0 +1,3546 @@ +{ + "best_metric": null, + "best_model_checkpoint": null, + "epoch": 0.3441682600382409, + "eval_steps": 150, + "global_step": 990, + "is_hyper_param_search": false, + "is_local_process_zero": true, + "is_world_process_zero": true, + "log_history": [ + { + "epoch": 0.0006952894142186686, + "grad_norm": 5.413117383066536, + "learning_rate": 6.944444444444445e-07, + "loss": 2.3653, + "step": 2 + }, + { + "epoch": 0.0013905788284373371, + "grad_norm": 5.092870612337868, + "learning_rate": 1.388888888888889e-06, + "loss": 2.5001, + "step": 4 + }, + { + "epoch": 0.0020858682426560054, + "grad_norm": 3.6285625961711943, + "learning_rate": 2.0833333333333334e-06, + "loss": 2.3759, + "step": 6 + }, + { + "epoch": 0.0027811576568746743, + "grad_norm": 2.5025911526151075, + "learning_rate": 2.777777777777778e-06, + "loss": 1.944, + "step": 8 + }, + { + "epoch": 0.0034764470710933427, + "grad_norm": 3.077266049542496, + "learning_rate": 3.4722222222222224e-06, + "loss": 2.2504, + "step": 10 + }, + { + "epoch": 0.004171736485312011, + "grad_norm": 4.068243939187174, + "learning_rate": 4.166666666666667e-06, + "loss": 2.0637, + "step": 12 + }, + { + "epoch": 0.00486702589953068, + "grad_norm": 3.511444738830971, + "learning_rate": 4.861111111111111e-06, + "loss": 2.3604, + "step": 14 + }, + { + "epoch": 0.0055623153137493485, + "grad_norm": 5.925744892256934, + "learning_rate": 5.555555555555556e-06, + "loss": 2.6528, + "step": 16 + }, + { + "epoch": 0.0062576047279680165, + "grad_norm": 2.7950114871483405, + "learning_rate": 6.25e-06, + "loss": 2.3229, + "step": 18 + }, + { + "epoch": 0.006952894142186685, + "grad_norm": 6.586211843766182, + "learning_rate": 6.944444444444445e-06, + "loss": 2.342, + "step": 20 + }, + { + "epoch": 0.0076481835564053535, + "grad_norm": 4.902839955269193, + "learning_rate": 7.63888888888889e-06, + "loss": 2.4188, + "step": 22 + }, + { + "epoch": 0.008343472970624021, + "grad_norm": 4.257062809771645, + "learning_rate": 8.333333333333334e-06, + "loss": 1.7957, + "step": 24 + }, + { + "epoch": 0.009038762384842691, + "grad_norm": 4.460352004615699, + "learning_rate": 9.027777777777777e-06, + "loss": 2.0726, + "step": 26 + }, + { + "epoch": 0.00973405179906136, + "grad_norm": 5.858061506133739, + "learning_rate": 9.722222222222223e-06, + "loss": 2.0455, + "step": 28 + }, + { + "epoch": 0.010429341213280027, + "grad_norm": 4.331946668100709, + "learning_rate": 1.0416666666666668e-05, + "loss": 1.7645, + "step": 30 + }, + { + "epoch": 0.011124630627498697, + "grad_norm": 5.428742204187391, + "learning_rate": 1.1111111111111112e-05, + "loss": 1.7446, + "step": 32 + }, + { + "epoch": 0.011819920041717365, + "grad_norm": 2.485909286541028, + "learning_rate": 1.1805555555555555e-05, + "loss": 1.5885, + "step": 34 + }, + { + "epoch": 0.012515209455936033, + "grad_norm": 3.2602949308730222, + "learning_rate": 1.25e-05, + "loss": 1.1014, + "step": 36 + }, + { + "epoch": 0.013210498870154701, + "grad_norm": 4.962187747415964, + "learning_rate": 1.3194444444444446e-05, + "loss": 1.3588, + "step": 38 + }, + { + "epoch": 0.01390578828437337, + "grad_norm": 7.627756894198461, + "learning_rate": 1.388888888888889e-05, + "loss": 1.4014, + "step": 40 + }, + { + "epoch": 0.014601077698592039, + "grad_norm": 2.821848388410092, + "learning_rate": 1.4583333333333335e-05, + "loss": 1.0959, + "step": 42 + }, + { + "epoch": 0.015296367112810707, + "grad_norm": 10.989320944549025, + "learning_rate": 1.527777777777778e-05, + "loss": 1.739, + "step": 44 + }, + { + "epoch": 0.015991656527029375, + "grad_norm": 4.300936602591115, + "learning_rate": 1.597222222222222e-05, + "loss": 1.1078, + "step": 46 + }, + { + "epoch": 0.016686945941248043, + "grad_norm": 3.7539663261019856, + "learning_rate": 1.6666666666666667e-05, + "loss": 1.2701, + "step": 48 + }, + { + "epoch": 0.017382235355466714, + "grad_norm": 2.589248169352173, + "learning_rate": 1.736111111111111e-05, + "loss": 1.4452, + "step": 50 + }, + { + "epoch": 0.018077524769685382, + "grad_norm": 3.6679301322156177, + "learning_rate": 1.8055555555555555e-05, + "loss": 1.4243, + "step": 52 + }, + { + "epoch": 0.01877281418390405, + "grad_norm": 2.0885660923860074, + "learning_rate": 1.8750000000000002e-05, + "loss": 1.4453, + "step": 54 + }, + { + "epoch": 0.01946810359812272, + "grad_norm": 2.955353237610474, + "learning_rate": 1.9444444444444445e-05, + "loss": 1.5388, + "step": 56 + }, + { + "epoch": 0.020163393012341387, + "grad_norm": 3.0527006398487018, + "learning_rate": 2.013888888888889e-05, + "loss": 1.4043, + "step": 58 + }, + { + "epoch": 0.020858682426560055, + "grad_norm": 1.9862208864154767, + "learning_rate": 2.0833333333333336e-05, + "loss": 1.1007, + "step": 60 + }, + { + "epoch": 0.021553971840778723, + "grad_norm": 2.347361178472164, + "learning_rate": 2.152777777777778e-05, + "loss": 0.9291, + "step": 62 + }, + { + "epoch": 0.022249261254997394, + "grad_norm": 2.4812993223105995, + "learning_rate": 2.2222222222222223e-05, + "loss": 0.9592, + "step": 64 + }, + { + "epoch": 0.022944550669216062, + "grad_norm": 1.639333831845777, + "learning_rate": 2.2916666666666667e-05, + "loss": 1.0645, + "step": 66 + }, + { + "epoch": 0.02363984008343473, + "grad_norm": 2.92858351082494, + "learning_rate": 2.361111111111111e-05, + "loss": 1.4269, + "step": 68 + }, + { + "epoch": 0.024335129497653398, + "grad_norm": 2.8503434812871604, + "learning_rate": 2.4305555555555558e-05, + "loss": 0.7829, + "step": 70 + }, + { + "epoch": 0.025030418911872066, + "grad_norm": 2.4875590459354107, + "learning_rate": 2.5e-05, + "loss": 0.9733, + "step": 72 + }, + { + "epoch": 0.025725708326090734, + "grad_norm": 5.2567545525905075, + "learning_rate": 2.5694444444444445e-05, + "loss": 1.3559, + "step": 74 + }, + { + "epoch": 0.026420997740309402, + "grad_norm": 4.68745753567611, + "learning_rate": 2.6388888888888892e-05, + "loss": 1.1499, + "step": 76 + }, + { + "epoch": 0.027116287154528074, + "grad_norm": 2.810345453706711, + "learning_rate": 2.7083333333333332e-05, + "loss": 0.8636, + "step": 78 + }, + { + "epoch": 0.02781157656874674, + "grad_norm": 3.0144493626195388, + "learning_rate": 2.777777777777778e-05, + "loss": 0.9274, + "step": 80 + }, + { + "epoch": 0.02850686598296541, + "grad_norm": 2.3263036535508523, + "learning_rate": 2.8472222222222223e-05, + "loss": 1.3979, + "step": 82 + }, + { + "epoch": 0.029202155397184078, + "grad_norm": 1.6009019341419857, + "learning_rate": 2.916666666666667e-05, + "loss": 0.9039, + "step": 84 + }, + { + "epoch": 0.029897444811402746, + "grad_norm": 2.0637506891442294, + "learning_rate": 2.9861111111111113e-05, + "loss": 1.5187, + "step": 86 + }, + { + "epoch": 0.030592734225621414, + "grad_norm": 1.5533001268209932, + "learning_rate": 3.055555555555556e-05, + "loss": 0.8937, + "step": 88 + }, + { + "epoch": 0.03128802363984008, + "grad_norm": 1.9974857545819733, + "learning_rate": 3.125e-05, + "loss": 0.8218, + "step": 90 + }, + { + "epoch": 0.03198331305405875, + "grad_norm": 1.871899331408953, + "learning_rate": 3.194444444444444e-05, + "loss": 1.2451, + "step": 92 + }, + { + "epoch": 0.03267860246827742, + "grad_norm": 1.591601830348497, + "learning_rate": 3.263888888888889e-05, + "loss": 0.7485, + "step": 94 + }, + { + "epoch": 0.033373891882496086, + "grad_norm": 2.404166647711005, + "learning_rate": 3.3333333333333335e-05, + "loss": 1.1587, + "step": 96 + }, + { + "epoch": 0.03406918129671476, + "grad_norm": 1.581080788392888, + "learning_rate": 3.402777777777778e-05, + "loss": 0.9578, + "step": 98 + }, + { + "epoch": 0.03476447071093343, + "grad_norm": 2.1551207338771547, + "learning_rate": 3.472222222222222e-05, + "loss": 1.1305, + "step": 100 + }, + { + "epoch": 0.0354597601251521, + "grad_norm": 4.2246272812704, + "learning_rate": 3.541666666666667e-05, + "loss": 1.04, + "step": 102 + }, + { + "epoch": 0.036155049539370765, + "grad_norm": 2.5526898161765588, + "learning_rate": 3.611111111111111e-05, + "loss": 1.0743, + "step": 104 + }, + { + "epoch": 0.03685033895358943, + "grad_norm": 1.9784815137623597, + "learning_rate": 3.6805555555555556e-05, + "loss": 0.9667, + "step": 106 + }, + { + "epoch": 0.0375456283678081, + "grad_norm": 1.9131648200880944, + "learning_rate": 3.7500000000000003e-05, + "loss": 0.8951, + "step": 108 + }, + { + "epoch": 0.03824091778202677, + "grad_norm": 3.9405296351174575, + "learning_rate": 3.8194444444444444e-05, + "loss": 1.222, + "step": 110 + }, + { + "epoch": 0.03893620719624544, + "grad_norm": 13.764861545850291, + "learning_rate": 3.888888888888889e-05, + "loss": 1.0497, + "step": 112 + }, + { + "epoch": 0.039631496610464105, + "grad_norm": 3.998123122175411, + "learning_rate": 3.958333333333333e-05, + "loss": 1.0901, + "step": 114 + }, + { + "epoch": 0.04032678602468277, + "grad_norm": 3.126193921423756, + "learning_rate": 4.027777777777778e-05, + "loss": 1.1143, + "step": 116 + }, + { + "epoch": 0.04102207543890144, + "grad_norm": 2.7839926692610613, + "learning_rate": 4.0972222222222225e-05, + "loss": 1.1637, + "step": 118 + }, + { + "epoch": 0.04171736485312011, + "grad_norm": 2.591162621161276, + "learning_rate": 4.166666666666667e-05, + "loss": 1.0624, + "step": 120 + }, + { + "epoch": 0.04241265426733878, + "grad_norm": 1.4930703711545332, + "learning_rate": 4.236111111111111e-05, + "loss": 1.0239, + "step": 122 + }, + { + "epoch": 0.043107943681557445, + "grad_norm": 4.355150070532966, + "learning_rate": 4.305555555555556e-05, + "loss": 1.266, + "step": 124 + }, + { + "epoch": 0.04380323309577612, + "grad_norm": 1.8285608876277135, + "learning_rate": 4.375e-05, + "loss": 1.0667, + "step": 126 + }, + { + "epoch": 0.04449852250999479, + "grad_norm": 2.1848832742617055, + "learning_rate": 4.4444444444444447e-05, + "loss": 0.7549, + "step": 128 + }, + { + "epoch": 0.045193811924213456, + "grad_norm": 3.547857947451226, + "learning_rate": 4.5138888888888894e-05, + "loss": 0.7974, + "step": 130 + }, + { + "epoch": 0.045889101338432124, + "grad_norm": 3.372457028128184, + "learning_rate": 4.5833333333333334e-05, + "loss": 1.0482, + "step": 132 + }, + { + "epoch": 0.04658439075265079, + "grad_norm": 2.2871138548091703, + "learning_rate": 4.652777777777778e-05, + "loss": 0.8246, + "step": 134 + }, + { + "epoch": 0.04727968016686946, + "grad_norm": 1.7489408054743605, + "learning_rate": 4.722222222222222e-05, + "loss": 1.0011, + "step": 136 + }, + { + "epoch": 0.04797496958108813, + "grad_norm": 1.944650349232646, + "learning_rate": 4.791666666666667e-05, + "loss": 0.7828, + "step": 138 + }, + { + "epoch": 0.048670258995306796, + "grad_norm": 2.321619459307342, + "learning_rate": 4.8611111111111115e-05, + "loss": 1.02, + "step": 140 + }, + { + "epoch": 0.049365548409525464, + "grad_norm": 5.317732559595606, + "learning_rate": 4.930555555555556e-05, + "loss": 0.9539, + "step": 142 + }, + { + "epoch": 0.05006083782374413, + "grad_norm": 1.5887292172279854, + "learning_rate": 5e-05, + "loss": 0.7961, + "step": 144 + }, + { + "epoch": 0.0507561272379628, + "grad_norm": 2.9987019111854964, + "learning_rate": 5.069444444444444e-05, + "loss": 1.0018, + "step": 146 + }, + { + "epoch": 0.05145141665218147, + "grad_norm": 5.63878906132749, + "learning_rate": 5.138888888888889e-05, + "loss": 0.9278, + "step": 148 + }, + { + "epoch": 0.052146706066400136, + "grad_norm": 2.4849685204332834, + "learning_rate": 5.208333333333334e-05, + "loss": 0.7531, + "step": 150 + }, + { + "epoch": 0.052146706066400136, + "eval_loss": 0.9286500215530396, + "eval_runtime": 711.2619, + "eval_samples_per_second": 6.808, + "eval_steps_per_second": 0.214, + "step": 150 + }, + { + "epoch": 0.052841995480618804, + "grad_norm": 3.4927981580288776, + "learning_rate": 5.2777777777777784e-05, + "loss": 0.7422, + "step": 152 + }, + { + "epoch": 0.05353728489483748, + "grad_norm": 2.6593724943984682, + "learning_rate": 5.3472222222222224e-05, + "loss": 0.7762, + "step": 154 + }, + { + "epoch": 0.05423257430905615, + "grad_norm": 2.99709354088536, + "learning_rate": 5.4166666666666664e-05, + "loss": 0.8658, + "step": 156 + }, + { + "epoch": 0.054927863723274815, + "grad_norm": 3.9196361623391414, + "learning_rate": 5.486111111111112e-05, + "loss": 1.1783, + "step": 158 + }, + { + "epoch": 0.05562315313749348, + "grad_norm": 3.022562685608673, + "learning_rate": 5.555555555555556e-05, + "loss": 1.0602, + "step": 160 + }, + { + "epoch": 0.05631844255171215, + "grad_norm": 3.292942684053579, + "learning_rate": 5.6250000000000005e-05, + "loss": 0.8561, + "step": 162 + }, + { + "epoch": 0.05701373196593082, + "grad_norm": 2.397775023338686, + "learning_rate": 5.6944444444444445e-05, + "loss": 0.9561, + "step": 164 + }, + { + "epoch": 0.05770902138014949, + "grad_norm": 3.0546714312119643, + "learning_rate": 5.7638888888888886e-05, + "loss": 0.8274, + "step": 166 + }, + { + "epoch": 0.058404310794368156, + "grad_norm": 2.4021883380894393, + "learning_rate": 5.833333333333334e-05, + "loss": 0.8492, + "step": 168 + }, + { + "epoch": 0.059099600208586824, + "grad_norm": 2.6052829770116293, + "learning_rate": 5.902777777777778e-05, + "loss": 1.1005, + "step": 170 + }, + { + "epoch": 0.05979488962280549, + "grad_norm": 1.6838192892320467, + "learning_rate": 5.972222222222223e-05, + "loss": 1.0157, + "step": 172 + }, + { + "epoch": 0.06049017903702416, + "grad_norm": 3.98880214871885, + "learning_rate": 6.041666666666667e-05, + "loss": 0.8136, + "step": 174 + }, + { + "epoch": 0.06118546845124283, + "grad_norm": 4.81494345341073, + "learning_rate": 6.111111111111112e-05, + "loss": 0.9475, + "step": 176 + }, + { + "epoch": 0.061880757865461496, + "grad_norm": 1.9926278890091862, + "learning_rate": 6.180555555555556e-05, + "loss": 0.6549, + "step": 178 + }, + { + "epoch": 0.06257604727968016, + "grad_norm": 1.750353030728397, + "learning_rate": 6.25e-05, + "loss": 1.1442, + "step": 180 + }, + { + "epoch": 0.06327133669389884, + "grad_norm": 4.77249782692129, + "learning_rate": 6.319444444444444e-05, + "loss": 1.1927, + "step": 182 + }, + { + "epoch": 0.0639666261081175, + "grad_norm": 1.866901788617278, + "learning_rate": 6.388888888888888e-05, + "loss": 1.0032, + "step": 184 + }, + { + "epoch": 0.06466191552233617, + "grad_norm": 1.7495859751833545, + "learning_rate": 6.458333333333334e-05, + "loss": 0.8439, + "step": 186 + }, + { + "epoch": 0.06535720493655484, + "grad_norm": 2.971674018184174, + "learning_rate": 6.527777777777778e-05, + "loss": 0.9817, + "step": 188 + }, + { + "epoch": 0.06605249435077351, + "grad_norm": 2.3753292673540165, + "learning_rate": 6.597222222222223e-05, + "loss": 0.9919, + "step": 190 + }, + { + "epoch": 0.06674778376499217, + "grad_norm": 2.7019148741557744, + "learning_rate": 6.666666666666667e-05, + "loss": 1.1442, + "step": 192 + }, + { + "epoch": 0.06744307317921085, + "grad_norm": 1.8670113287712482, + "learning_rate": 6.736111111111112e-05, + "loss": 0.8905, + "step": 194 + }, + { + "epoch": 0.06813836259342952, + "grad_norm": 1.4199145680760579, + "learning_rate": 6.805555555555556e-05, + "loss": 0.7223, + "step": 196 + }, + { + "epoch": 0.06883365200764818, + "grad_norm": 3.894200902880186, + "learning_rate": 6.875e-05, + "loss": 0.9005, + "step": 198 + }, + { + "epoch": 0.06952894142186686, + "grad_norm": 3.2710376491241955, + "learning_rate": 6.944444444444444e-05, + "loss": 1.1605, + "step": 200 + }, + { + "epoch": 0.07022423083608552, + "grad_norm": 1.6459754670035065, + "learning_rate": 7.013888888888888e-05, + "loss": 0.8551, + "step": 202 + }, + { + "epoch": 0.0709195202503042, + "grad_norm": 4.361031640374508, + "learning_rate": 7.083333333333334e-05, + "loss": 0.7007, + "step": 204 + }, + { + "epoch": 0.07161480966452285, + "grad_norm": 3.573741549123141, + "learning_rate": 7.152777777777778e-05, + "loss": 1.1396, + "step": 206 + }, + { + "epoch": 0.07231009907874153, + "grad_norm": 3.296990311359108, + "learning_rate": 7.222222222222222e-05, + "loss": 0.8695, + "step": 208 + }, + { + "epoch": 0.07300538849296019, + "grad_norm": 6.769659823038884, + "learning_rate": 7.291666666666667e-05, + "loss": 1.0511, + "step": 210 + }, + { + "epoch": 0.07370067790717887, + "grad_norm": 1.6695233666860303, + "learning_rate": 7.361111111111111e-05, + "loss": 0.8174, + "step": 212 + }, + { + "epoch": 0.07439596732139753, + "grad_norm": 1.3543755216281146, + "learning_rate": 7.430555555555557e-05, + "loss": 0.7137, + "step": 214 + }, + { + "epoch": 0.0750912567356162, + "grad_norm": 4.861063813937456, + "learning_rate": 7.500000000000001e-05, + "loss": 1.0132, + "step": 216 + }, + { + "epoch": 0.07578654614983486, + "grad_norm": 5.715913176528681, + "learning_rate": 7.569444444444445e-05, + "loss": 1.1657, + "step": 218 + }, + { + "epoch": 0.07648183556405354, + "grad_norm": 4.0193839358302235, + "learning_rate": 7.638888888888889e-05, + "loss": 1.0547, + "step": 220 + }, + { + "epoch": 0.0771771249782722, + "grad_norm": 2.26849134517291, + "learning_rate": 7.708333333333334e-05, + "loss": 0.9073, + "step": 222 + }, + { + "epoch": 0.07787241439249087, + "grad_norm": 4.570943697810998, + "learning_rate": 7.777777777777778e-05, + "loss": 1.3726, + "step": 224 + }, + { + "epoch": 0.07856770380670955, + "grad_norm": 1.1942436910880105, + "learning_rate": 7.847222222222222e-05, + "loss": 0.8146, + "step": 226 + }, + { + "epoch": 0.07926299322092821, + "grad_norm": 2.111849588751211, + "learning_rate": 7.916666666666666e-05, + "loss": 1.1157, + "step": 228 + }, + { + "epoch": 0.07995828263514689, + "grad_norm": 1.0283088880069582, + "learning_rate": 7.986111111111112e-05, + "loss": 0.767, + "step": 230 + }, + { + "epoch": 0.08065357204936555, + "grad_norm": 1.2834055069208525, + "learning_rate": 8.055555555555556e-05, + "loss": 0.6625, + "step": 232 + }, + { + "epoch": 0.08134886146358422, + "grad_norm": 1.3772942873595098, + "learning_rate": 8.125000000000001e-05, + "loss": 0.8065, + "step": 234 + }, + { + "epoch": 0.08204415087780288, + "grad_norm": 1.5113456549735176, + "learning_rate": 8.194444444444445e-05, + "loss": 0.8606, + "step": 236 + }, + { + "epoch": 0.08273944029202156, + "grad_norm": 1.5765846352838255, + "learning_rate": 8.263888888888889e-05, + "loss": 0.8335, + "step": 238 + }, + { + "epoch": 0.08343472970624022, + "grad_norm": 2.4873462478329404, + "learning_rate": 8.333333333333334e-05, + "loss": 0.9705, + "step": 240 + }, + { + "epoch": 0.0841300191204589, + "grad_norm": 1.2369219925635513, + "learning_rate": 8.402777777777778e-05, + "loss": 0.6061, + "step": 242 + }, + { + "epoch": 0.08482530853467755, + "grad_norm": 2.542132212473201, + "learning_rate": 8.472222222222222e-05, + "loss": 0.9142, + "step": 244 + }, + { + "epoch": 0.08552059794889623, + "grad_norm": 2.0301734217803022, + "learning_rate": 8.541666666666666e-05, + "loss": 0.8997, + "step": 246 + }, + { + "epoch": 0.08621588736311489, + "grad_norm": 1.8605316982945626, + "learning_rate": 8.611111111111112e-05, + "loss": 1.005, + "step": 248 + }, + { + "epoch": 0.08691117677733357, + "grad_norm": 1.193555257951713, + "learning_rate": 8.680555555555556e-05, + "loss": 0.8617, + "step": 250 + }, + { + "epoch": 0.08760646619155224, + "grad_norm": 1.243815428863678, + "learning_rate": 8.75e-05, + "loss": 0.6261, + "step": 252 + }, + { + "epoch": 0.0883017556057709, + "grad_norm": 1.6487754861704442, + "learning_rate": 8.819444444444445e-05, + "loss": 0.9219, + "step": 254 + }, + { + "epoch": 0.08899704501998958, + "grad_norm": 1.1768410857322613, + "learning_rate": 8.888888888888889e-05, + "loss": 0.8563, + "step": 256 + }, + { + "epoch": 0.08969233443420824, + "grad_norm": 1.1155265191420587, + "learning_rate": 8.958333333333335e-05, + "loss": 0.998, + "step": 258 + }, + { + "epoch": 0.09038762384842691, + "grad_norm": 1.4432456616674065, + "learning_rate": 9.027777777777779e-05, + "loss": 0.8755, + "step": 260 + }, + { + "epoch": 0.09108291326264557, + "grad_norm": 1.6013486668654413, + "learning_rate": 9.097222222222223e-05, + "loss": 0.6998, + "step": 262 + }, + { + "epoch": 0.09177820267686425, + "grad_norm": 0.7869968770186737, + "learning_rate": 9.166666666666667e-05, + "loss": 0.7574, + "step": 264 + }, + { + "epoch": 0.09247349209108291, + "grad_norm": 2.1117903903864566, + "learning_rate": 9.236111111111112e-05, + "loss": 0.8436, + "step": 266 + }, + { + "epoch": 0.09316878150530158, + "grad_norm": 1.3582999584721895, + "learning_rate": 9.305555555555556e-05, + "loss": 0.8503, + "step": 268 + }, + { + "epoch": 0.09386407091952025, + "grad_norm": 1.5674581009005415, + "learning_rate": 9.375e-05, + "loss": 0.9561, + "step": 270 + }, + { + "epoch": 0.09455936033373892, + "grad_norm": 1.0274246934159952, + "learning_rate": 9.444444444444444e-05, + "loss": 0.7537, + "step": 272 + }, + { + "epoch": 0.09525464974795758, + "grad_norm": 0.9595343432519174, + "learning_rate": 9.513888888888888e-05, + "loss": 0.7855, + "step": 274 + }, + { + "epoch": 0.09594993916217626, + "grad_norm": 1.3313115114367815, + "learning_rate": 9.583333333333334e-05, + "loss": 0.7009, + "step": 276 + }, + { + "epoch": 0.09664522857639492, + "grad_norm": 1.4409463331317498, + "learning_rate": 9.652777777777779e-05, + "loss": 1.0332, + "step": 278 + }, + { + "epoch": 0.09734051799061359, + "grad_norm": 1.5445848213023137, + "learning_rate": 9.722222222222223e-05, + "loss": 0.7352, + "step": 280 + }, + { + "epoch": 0.09803580740483227, + "grad_norm": 1.855518620927316, + "learning_rate": 9.791666666666667e-05, + "loss": 0.7191, + "step": 282 + }, + { + "epoch": 0.09873109681905093, + "grad_norm": 1.4033396985161997, + "learning_rate": 9.861111111111112e-05, + "loss": 0.7886, + "step": 284 + }, + { + "epoch": 0.0994263862332696, + "grad_norm": 1.9951521438049904, + "learning_rate": 9.930555555555556e-05, + "loss": 0.902, + "step": 286 + }, + { + "epoch": 0.10012167564748826, + "grad_norm": 1.1360934228431687, + "learning_rate": 0.0001, + "loss": 0.8655, + "step": 288 + }, + { + "epoch": 0.10081696506170694, + "grad_norm": 1.1225735433900375, + "learning_rate": 0.00010069444444444445, + "loss": 0.6851, + "step": 290 + }, + { + "epoch": 0.1015122544759256, + "grad_norm": 0.770446891371583, + "learning_rate": 0.00010138888888888889, + "loss": 0.7775, + "step": 292 + }, + { + "epoch": 0.10220754389014428, + "grad_norm": 0.797064180835607, + "learning_rate": 0.00010208333333333333, + "loss": 0.6567, + "step": 294 + }, + { + "epoch": 0.10290283330436294, + "grad_norm": 0.9876188134326442, + "learning_rate": 0.00010277777777777778, + "loss": 0.7299, + "step": 296 + }, + { + "epoch": 0.10359812271858161, + "grad_norm": 0.799601623643537, + "learning_rate": 0.00010347222222222223, + "loss": 0.7891, + "step": 298 + }, + { + "epoch": 0.10429341213280027, + "grad_norm": 0.8791512281362982, + "learning_rate": 0.00010416666666666667, + "loss": 0.677, + "step": 300 + }, + { + "epoch": 0.10429341213280027, + "eval_loss": 0.6939894556999207, + "eval_runtime": 709.5268, + "eval_samples_per_second": 6.824, + "eval_steps_per_second": 0.214, + "step": 300 + }, + { + "epoch": 0.10498870154701895, + "grad_norm": 1.329564645811689, + "learning_rate": 0.00010486111111111113, + "loss": 0.7511, + "step": 302 + }, + { + "epoch": 0.10568399096123761, + "grad_norm": 0.7130415058241142, + "learning_rate": 0.00010555555555555557, + "loss": 0.709, + "step": 304 + }, + { + "epoch": 0.10637928037545628, + "grad_norm": 1.1294733411370705, + "learning_rate": 0.00010625000000000001, + "loss": 0.7781, + "step": 306 + }, + { + "epoch": 0.10707456978967496, + "grad_norm": 0.581727680778003, + "learning_rate": 0.00010694444444444445, + "loss": 0.6296, + "step": 308 + }, + { + "epoch": 0.10776985920389362, + "grad_norm": 0.9855391514311871, + "learning_rate": 0.00010763888888888889, + "loss": 0.7852, + "step": 310 + }, + { + "epoch": 0.1084651486181123, + "grad_norm": 0.5708379609857769, + "learning_rate": 0.00010833333333333333, + "loss": 0.6759, + "step": 312 + }, + { + "epoch": 0.10916043803233096, + "grad_norm": 0.7243330859752051, + "learning_rate": 0.00010902777777777777, + "loss": 0.6326, + "step": 314 + }, + { + "epoch": 0.10985572744654963, + "grad_norm": 1.3922163003264714, + "learning_rate": 0.00010972222222222224, + "loss": 0.5406, + "step": 316 + }, + { + "epoch": 0.11055101686076829, + "grad_norm": 2.604851740418153, + "learning_rate": 0.00011041666666666668, + "loss": 0.8013, + "step": 318 + }, + { + "epoch": 0.11124630627498697, + "grad_norm": 1.83511037983023, + "learning_rate": 0.00011111111111111112, + "loss": 0.8048, + "step": 320 + }, + { + "epoch": 0.11194159568920563, + "grad_norm": 1.6737764614655666, + "learning_rate": 0.00011180555555555556, + "loss": 0.6943, + "step": 322 + }, + { + "epoch": 0.1126368851034243, + "grad_norm": 1.077667781888673, + "learning_rate": 0.00011250000000000001, + "loss": 0.8054, + "step": 324 + }, + { + "epoch": 0.11333217451764296, + "grad_norm": 0.5597693838209001, + "learning_rate": 0.00011319444444444445, + "loss": 0.6251, + "step": 326 + }, + { + "epoch": 0.11402746393186164, + "grad_norm": 0.5636865078063477, + "learning_rate": 0.00011388888888888889, + "loss": 0.6832, + "step": 328 + }, + { + "epoch": 0.1147227533460803, + "grad_norm": 0.6445176566556912, + "learning_rate": 0.00011458333333333333, + "loss": 0.6661, + "step": 330 + }, + { + "epoch": 0.11541804276029898, + "grad_norm": 0.607532412895966, + "learning_rate": 0.00011527777777777777, + "loss": 0.7026, + "step": 332 + }, + { + "epoch": 0.11611333217451764, + "grad_norm": 1.0496949694240345, + "learning_rate": 0.00011597222222222224, + "loss": 0.6451, + "step": 334 + }, + { + "epoch": 0.11680862158873631, + "grad_norm": 0.9469233272179363, + "learning_rate": 0.00011666666666666668, + "loss": 0.6694, + "step": 336 + }, + { + "epoch": 0.11750391100295499, + "grad_norm": 1.3789882614528595, + "learning_rate": 0.00011736111111111112, + "loss": 0.7031, + "step": 338 + }, + { + "epoch": 0.11819920041717365, + "grad_norm": 1.2016589928587922, + "learning_rate": 0.00011805555555555556, + "loss": 0.6676, + "step": 340 + }, + { + "epoch": 0.11889448983139232, + "grad_norm": 1.3112845410865746, + "learning_rate": 0.00011875, + "loss": 0.7236, + "step": 342 + }, + { + "epoch": 0.11958977924561098, + "grad_norm": 0.6278789052805739, + "learning_rate": 0.00011944444444444445, + "loss": 0.6249, + "step": 344 + }, + { + "epoch": 0.12028506865982966, + "grad_norm": 0.5405148902553805, + "learning_rate": 0.0001201388888888889, + "loss": 0.6412, + "step": 346 + }, + { + "epoch": 0.12098035807404832, + "grad_norm": 1.6923616138961255, + "learning_rate": 0.00012083333333333333, + "loss": 0.7017, + "step": 348 + }, + { + "epoch": 0.121675647488267, + "grad_norm": 1.5994113095813072, + "learning_rate": 0.00012152777777777777, + "loss": 0.7075, + "step": 350 + }, + { + "epoch": 0.12237093690248566, + "grad_norm": 2.3083516502461783, + "learning_rate": 0.00012222222222222224, + "loss": 0.7755, + "step": 352 + }, + { + "epoch": 0.12306622631670433, + "grad_norm": 0.8769167165306447, + "learning_rate": 0.00012291666666666668, + "loss": 0.7428, + "step": 354 + }, + { + "epoch": 0.12376151573092299, + "grad_norm": 0.4456469638797518, + "learning_rate": 0.00012361111111111112, + "loss": 0.7002, + "step": 356 + }, + { + "epoch": 0.12445680514514167, + "grad_norm": 0.8199993647792723, + "learning_rate": 0.00012430555555555556, + "loss": 0.7222, + "step": 358 + }, + { + "epoch": 0.12515209455936033, + "grad_norm": 0.3741084955970339, + "learning_rate": 0.000125, + "loss": 0.6821, + "step": 360 + }, + { + "epoch": 0.125847383973579, + "grad_norm": 0.2972203241099783, + "learning_rate": 0.00012569444444444444, + "loss": 0.7083, + "step": 362 + }, + { + "epoch": 0.12654267338779768, + "grad_norm": 0.40651740632246575, + "learning_rate": 0.00012638888888888888, + "loss": 0.7144, + "step": 364 + }, + { + "epoch": 0.12723796280201635, + "grad_norm": 0.4388093199704831, + "learning_rate": 0.00012708333333333332, + "loss": 0.6863, + "step": 366 + }, + { + "epoch": 0.127933252216235, + "grad_norm": 0.45131267837810835, + "learning_rate": 0.00012777777777777776, + "loss": 0.6329, + "step": 368 + }, + { + "epoch": 0.12862854163045367, + "grad_norm": 0.3837830352665476, + "learning_rate": 0.00012847222222222223, + "loss": 0.6938, + "step": 370 + }, + { + "epoch": 0.12932383104467235, + "grad_norm": 0.6378624076702905, + "learning_rate": 0.00012916666666666667, + "loss": 0.6433, + "step": 372 + }, + { + "epoch": 0.13001912045889102, + "grad_norm": 0.41344403509072675, + "learning_rate": 0.0001298611111111111, + "loss": 0.6892, + "step": 374 + }, + { + "epoch": 0.13071440987310967, + "grad_norm": 1.3428471718098582, + "learning_rate": 0.00013055555555555555, + "loss": 0.7793, + "step": 376 + }, + { + "epoch": 0.13140969928732835, + "grad_norm": 0.6202275876483008, + "learning_rate": 0.00013125000000000002, + "loss": 0.6836, + "step": 378 + }, + { + "epoch": 0.13210498870154702, + "grad_norm": 0.774014383396004, + "learning_rate": 0.00013194444444444446, + "loss": 0.701, + "step": 380 + }, + { + "epoch": 0.1328002781157657, + "grad_norm": 1.0650744092292224, + "learning_rate": 0.0001326388888888889, + "loss": 0.6562, + "step": 382 + }, + { + "epoch": 0.13349556752998434, + "grad_norm": 0.5540168492927294, + "learning_rate": 0.00013333333333333334, + "loss": 0.6267, + "step": 384 + }, + { + "epoch": 0.13419085694420302, + "grad_norm": 0.6403086140920178, + "learning_rate": 0.00013402777777777778, + "loss": 0.6268, + "step": 386 + }, + { + "epoch": 0.1348861463584217, + "grad_norm": 0.9197218298114509, + "learning_rate": 0.00013472222222222225, + "loss": 0.7208, + "step": 388 + }, + { + "epoch": 0.13558143577264037, + "grad_norm": 0.4235387152144674, + "learning_rate": 0.0001354166666666667, + "loss": 0.6057, + "step": 390 + }, + { + "epoch": 0.13627672518685904, + "grad_norm": 0.425648636635043, + "learning_rate": 0.00013611111111111113, + "loss": 0.6387, + "step": 392 + }, + { + "epoch": 0.1369720146010777, + "grad_norm": 1.034952396366508, + "learning_rate": 0.00013680555555555557, + "loss": 0.7307, + "step": 394 + }, + { + "epoch": 0.13766730401529637, + "grad_norm": 0.8865505732510678, + "learning_rate": 0.0001375, + "loss": 0.6547, + "step": 396 + }, + { + "epoch": 0.13836259342951504, + "grad_norm": 0.6490094573088415, + "learning_rate": 0.00013819444444444445, + "loss": 0.6909, + "step": 398 + }, + { + "epoch": 0.13905788284373372, + "grad_norm": 0.8592713330921486, + "learning_rate": 0.0001388888888888889, + "loss": 0.6442, + "step": 400 + }, + { + "epoch": 0.13975317225795236, + "grad_norm": 1.0279375953862069, + "learning_rate": 0.00013958333333333333, + "loss": 0.6907, + "step": 402 + }, + { + "epoch": 0.14044846167217104, + "grad_norm": 0.6151057351983696, + "learning_rate": 0.00014027777777777777, + "loss": 0.697, + "step": 404 + }, + { + "epoch": 0.1411437510863897, + "grad_norm": 0.7417879717121144, + "learning_rate": 0.00014097222222222224, + "loss": 0.698, + "step": 406 + }, + { + "epoch": 0.1418390405006084, + "grad_norm": 0.5161453091859882, + "learning_rate": 0.00014166666666666668, + "loss": 0.6915, + "step": 408 + }, + { + "epoch": 0.14253432991482703, + "grad_norm": 0.5667521096080546, + "learning_rate": 0.00014236111111111112, + "loss": 0.6609, + "step": 410 + }, + { + "epoch": 0.1432296193290457, + "grad_norm": 0.7560317583703429, + "learning_rate": 0.00014305555555555556, + "loss": 0.6392, + "step": 412 + }, + { + "epoch": 0.14392490874326438, + "grad_norm": 0.5456303981546313, + "learning_rate": 0.00014375, + "loss": 0.7561, + "step": 414 + }, + { + "epoch": 0.14462019815748306, + "grad_norm": 0.4218469018151631, + "learning_rate": 0.00014444444444444444, + "loss": 0.675, + "step": 416 + }, + { + "epoch": 0.14531548757170173, + "grad_norm": 0.3790517974518404, + "learning_rate": 0.00014513888888888888, + "loss": 0.6697, + "step": 418 + }, + { + "epoch": 0.14601077698592038, + "grad_norm": 0.36495171567914964, + "learning_rate": 0.00014583333333333335, + "loss": 0.6467, + "step": 420 + }, + { + "epoch": 0.14670606640013906, + "grad_norm": 0.3793520501177419, + "learning_rate": 0.00014652777777777779, + "loss": 0.6234, + "step": 422 + }, + { + "epoch": 0.14740135581435773, + "grad_norm": 0.6214905371013544, + "learning_rate": 0.00014722222222222223, + "loss": 0.64, + "step": 424 + }, + { + "epoch": 0.1480966452285764, + "grad_norm": 0.4103438113660832, + "learning_rate": 0.0001479166666666667, + "loss": 0.6174, + "step": 426 + }, + { + "epoch": 0.14879193464279505, + "grad_norm": 0.5802311029669485, + "learning_rate": 0.00014861111111111113, + "loss": 0.6941, + "step": 428 + }, + { + "epoch": 0.14948722405701373, + "grad_norm": 0.4876572424583591, + "learning_rate": 0.00014930555555555557, + "loss": 0.6178, + "step": 430 + }, + { + "epoch": 0.1501825134712324, + "grad_norm": 0.6252220373472688, + "learning_rate": 0.00015000000000000001, + "loss": 0.692, + "step": 432 + }, + { + "epoch": 0.15087780288545108, + "grad_norm": 1.516758455176553, + "learning_rate": 0.00015069444444444445, + "loss": 0.6812, + "step": 434 + }, + { + "epoch": 0.15157309229966973, + "grad_norm": 0.48294685446689867, + "learning_rate": 0.0001513888888888889, + "loss": 0.7085, + "step": 436 + }, + { + "epoch": 0.1522683817138884, + "grad_norm": 0.414196721150167, + "learning_rate": 0.00015208333333333333, + "loss": 0.673, + "step": 438 + }, + { + "epoch": 0.15296367112810708, + "grad_norm": 0.7294881062503469, + "learning_rate": 0.00015277777777777777, + "loss": 0.6415, + "step": 440 + }, + { + "epoch": 0.15365896054232575, + "grad_norm": 0.4846932912054438, + "learning_rate": 0.00015347222222222224, + "loss": 0.6644, + "step": 442 + }, + { + "epoch": 0.1543542499565444, + "grad_norm": 0.6067400167426414, + "learning_rate": 0.00015416666666666668, + "loss": 0.6816, + "step": 444 + }, + { + "epoch": 0.15504953937076307, + "grad_norm": 0.5586278026791864, + "learning_rate": 0.00015486111111111112, + "loss": 0.6223, + "step": 446 + }, + { + "epoch": 0.15574482878498175, + "grad_norm": 0.3947236166856149, + "learning_rate": 0.00015555555555555556, + "loss": 0.7297, + "step": 448 + }, + { + "epoch": 0.15644011819920042, + "grad_norm": 0.371457756887947, + "learning_rate": 0.00015625, + "loss": 0.6099, + "step": 450 + }, + { + "epoch": 0.15644011819920042, + "eval_loss": 0.6634477376937866, + "eval_runtime": 706.8027, + "eval_samples_per_second": 6.851, + "eval_steps_per_second": 0.215, + "step": 450 + }, + { + "epoch": 0.1571354076134191, + "grad_norm": 0.4157928192338373, + "learning_rate": 0.00015694444444444444, + "loss": 0.7163, + "step": 452 + }, + { + "epoch": 0.15783069702763775, + "grad_norm": 0.6318513446857751, + "learning_rate": 0.00015763888888888888, + "loss": 0.658, + "step": 454 + }, + { + "epoch": 0.15852598644185642, + "grad_norm": 0.3188170086808347, + "learning_rate": 0.00015833333333333332, + "loss": 0.5966, + "step": 456 + }, + { + "epoch": 0.1592212758560751, + "grad_norm": 0.4873146052629784, + "learning_rate": 0.00015902777777777776, + "loss": 0.687, + "step": 458 + }, + { + "epoch": 0.15991656527029377, + "grad_norm": 0.3939618900754228, + "learning_rate": 0.00015972222222222223, + "loss": 0.6704, + "step": 460 + }, + { + "epoch": 0.16061185468451242, + "grad_norm": 0.43442241310529234, + "learning_rate": 0.00016041666666666667, + "loss": 0.6941, + "step": 462 + }, + { + "epoch": 0.1613071440987311, + "grad_norm": 0.5944395304786771, + "learning_rate": 0.0001611111111111111, + "loss": 0.5934, + "step": 464 + }, + { + "epoch": 0.16200243351294977, + "grad_norm": 0.6186667715273749, + "learning_rate": 0.00016180555555555555, + "loss": 0.6604, + "step": 466 + }, + { + "epoch": 0.16269772292716844, + "grad_norm": 0.8945416923537124, + "learning_rate": 0.00016250000000000002, + "loss": 0.6224, + "step": 468 + }, + { + "epoch": 0.1633930123413871, + "grad_norm": 1.0526200270890014, + "learning_rate": 0.00016319444444444446, + "loss": 0.616, + "step": 470 + }, + { + "epoch": 0.16408830175560576, + "grad_norm": 0.4575985966727194, + "learning_rate": 0.0001638888888888889, + "loss": 0.6591, + "step": 472 + }, + { + "epoch": 0.16478359116982444, + "grad_norm": 0.4499931204645402, + "learning_rate": 0.00016458333333333334, + "loss": 0.6644, + "step": 474 + }, + { + "epoch": 0.16547888058404311, + "grad_norm": 0.8365574384741885, + "learning_rate": 0.00016527777777777778, + "loss": 0.6503, + "step": 476 + }, + { + "epoch": 0.1661741699982618, + "grad_norm": 0.5265284650577726, + "learning_rate": 0.00016597222222222225, + "loss": 0.557, + "step": 478 + }, + { + "epoch": 0.16686945941248044, + "grad_norm": 0.6004742828917694, + "learning_rate": 0.0001666666666666667, + "loss": 0.696, + "step": 480 + }, + { + "epoch": 0.1675647488266991, + "grad_norm": 0.8653134209549845, + "learning_rate": 0.00016736111111111113, + "loss": 0.6544, + "step": 482 + }, + { + "epoch": 0.1682600382409178, + "grad_norm": 1.033230873418064, + "learning_rate": 0.00016805555555555557, + "loss": 0.641, + "step": 484 + }, + { + "epoch": 0.16895532765513646, + "grad_norm": 0.45457193405665913, + "learning_rate": 0.00016875, + "loss": 0.5952, + "step": 486 + }, + { + "epoch": 0.1696506170693551, + "grad_norm": 0.7413902971651539, + "learning_rate": 0.00016944444444444445, + "loss": 0.6306, + "step": 488 + }, + { + "epoch": 0.17034590648357378, + "grad_norm": 0.5808764628223875, + "learning_rate": 0.0001701388888888889, + "loss": 0.6714, + "step": 490 + }, + { + "epoch": 0.17104119589779246, + "grad_norm": 0.42505370383777924, + "learning_rate": 0.00017083333333333333, + "loss": 0.6432, + "step": 492 + }, + { + "epoch": 0.17173648531201113, + "grad_norm": 0.9403542369255028, + "learning_rate": 0.00017152777777777777, + "loss": 0.626, + "step": 494 + }, + { + "epoch": 0.17243177472622978, + "grad_norm": 0.41714707593148775, + "learning_rate": 0.00017222222222222224, + "loss": 0.6132, + "step": 496 + }, + { + "epoch": 0.17312706414044846, + "grad_norm": 0.6660896849726371, + "learning_rate": 0.00017291666666666668, + "loss": 0.7009, + "step": 498 + }, + { + "epoch": 0.17382235355466713, + "grad_norm": 0.5079993412341118, + "learning_rate": 0.00017361111111111112, + "loss": 0.6808, + "step": 500 + }, + { + "epoch": 0.1745176429688858, + "grad_norm": 0.3426487947129772, + "learning_rate": 0.00017430555555555556, + "loss": 0.687, + "step": 502 + }, + { + "epoch": 0.17521293238310448, + "grad_norm": 0.7316051797581208, + "learning_rate": 0.000175, + "loss": 0.686, + "step": 504 + }, + { + "epoch": 0.17590822179732313, + "grad_norm": 0.4619785653282459, + "learning_rate": 0.00017569444444444444, + "loss": 0.7019, + "step": 506 + }, + { + "epoch": 0.1766035112115418, + "grad_norm": 0.47786977912472967, + "learning_rate": 0.0001763888888888889, + "loss": 0.7097, + "step": 508 + }, + { + "epoch": 0.17729880062576048, + "grad_norm": 0.4204398291864812, + "learning_rate": 0.00017708333333333335, + "loss": 0.6715, + "step": 510 + }, + { + "epoch": 0.17799409003997915, + "grad_norm": 0.5257761541709909, + "learning_rate": 0.00017777777777777779, + "loss": 0.6675, + "step": 512 + }, + { + "epoch": 0.1786893794541978, + "grad_norm": 0.5752239420884688, + "learning_rate": 0.00017847222222222225, + "loss": 0.5847, + "step": 514 + }, + { + "epoch": 0.17938466886841647, + "grad_norm": 0.5611432017880666, + "learning_rate": 0.0001791666666666667, + "loss": 0.5978, + "step": 516 + }, + { + "epoch": 0.18007995828263515, + "grad_norm": 0.5147097358785945, + "learning_rate": 0.00017986111111111113, + "loss": 0.641, + "step": 518 + }, + { + "epoch": 0.18077524769685382, + "grad_norm": 0.4387330962078066, + "learning_rate": 0.00018055555555555557, + "loss": 0.5771, + "step": 520 + }, + { + "epoch": 0.18147053711107247, + "grad_norm": 0.5712526440788663, + "learning_rate": 0.00018125000000000001, + "loss": 0.6212, + "step": 522 + }, + { + "epoch": 0.18216582652529115, + "grad_norm": 0.6357133907029916, + "learning_rate": 0.00018194444444444445, + "loss": 0.5981, + "step": 524 + }, + { + "epoch": 0.18286111593950982, + "grad_norm": 1.2129620643054042, + "learning_rate": 0.0001826388888888889, + "loss": 0.5848, + "step": 526 + }, + { + "epoch": 0.1835564053537285, + "grad_norm": 1.651599276688714, + "learning_rate": 0.00018333333333333334, + "loss": 0.7089, + "step": 528 + }, + { + "epoch": 0.18425169476794717, + "grad_norm": 0.9051688342434142, + "learning_rate": 0.00018402777777777778, + "loss": 0.7255, + "step": 530 + }, + { + "epoch": 0.18494698418216582, + "grad_norm": 0.6932441010863684, + "learning_rate": 0.00018472222222222224, + "loss": 0.6497, + "step": 532 + }, + { + "epoch": 0.1856422735963845, + "grad_norm": 1.2163006408955903, + "learning_rate": 0.00018541666666666668, + "loss": 0.7585, + "step": 534 + }, + { + "epoch": 0.18633756301060317, + "grad_norm": 0.4387074048377486, + "learning_rate": 0.00018611111111111112, + "loss": 0.6541, + "step": 536 + }, + { + "epoch": 0.18703285242482184, + "grad_norm": 0.49430581216479236, + "learning_rate": 0.00018680555555555556, + "loss": 0.6489, + "step": 538 + }, + { + "epoch": 0.1877281418390405, + "grad_norm": 0.47561442420926275, + "learning_rate": 0.0001875, + "loss": 0.6406, + "step": 540 + }, + { + "epoch": 0.18842343125325917, + "grad_norm": 0.7046092923664611, + "learning_rate": 0.00018819444444444444, + "loss": 0.6099, + "step": 542 + }, + { + "epoch": 0.18911872066747784, + "grad_norm": 0.46256136269201026, + "learning_rate": 0.00018888888888888888, + "loss": 0.6992, + "step": 544 + }, + { + "epoch": 0.18981401008169652, + "grad_norm": 0.5489877082982352, + "learning_rate": 0.00018958333333333332, + "loss": 0.5817, + "step": 546 + }, + { + "epoch": 0.19050929949591516, + "grad_norm": 0.46129441798908893, + "learning_rate": 0.00019027777777777776, + "loss": 0.645, + "step": 548 + }, + { + "epoch": 0.19120458891013384, + "grad_norm": 0.3724226655450749, + "learning_rate": 0.00019097222222222223, + "loss": 0.6177, + "step": 550 + }, + { + "epoch": 0.1918998783243525, + "grad_norm": 0.4625796323902992, + "learning_rate": 0.00019166666666666667, + "loss": 0.6702, + "step": 552 + }, + { + "epoch": 0.1925951677385712, + "grad_norm": 1.0142124821047231, + "learning_rate": 0.0001923611111111111, + "loss": 0.7173, + "step": 554 + }, + { + "epoch": 0.19329045715278984, + "grad_norm": 0.5452830720753045, + "learning_rate": 0.00019305555555555558, + "loss": 0.6897, + "step": 556 + }, + { + "epoch": 0.1939857465670085, + "grad_norm": 0.5723214484723252, + "learning_rate": 0.00019375000000000002, + "loss": 0.6495, + "step": 558 + }, + { + "epoch": 0.19468103598122719, + "grad_norm": 0.39925844595054966, + "learning_rate": 0.00019444444444444446, + "loss": 0.6479, + "step": 560 + }, + { + "epoch": 0.19537632539544586, + "grad_norm": 0.3575565088751118, + "learning_rate": 0.0001951388888888889, + "loss": 0.6593, + "step": 562 + }, + { + "epoch": 0.19607161480966454, + "grad_norm": 0.6119892689536569, + "learning_rate": 0.00019583333333333334, + "loss": 0.6831, + "step": 564 + }, + { + "epoch": 0.19676690422388318, + "grad_norm": 0.5076569073121309, + "learning_rate": 0.00019652777777777778, + "loss": 0.6294, + "step": 566 + }, + { + "epoch": 0.19746219363810186, + "grad_norm": 0.622226505121079, + "learning_rate": 0.00019722222222222225, + "loss": 0.5551, + "step": 568 + }, + { + "epoch": 0.19815748305232053, + "grad_norm": 0.4106526912254415, + "learning_rate": 0.0001979166666666667, + "loss": 0.6503, + "step": 570 + }, + { + "epoch": 0.1988527724665392, + "grad_norm": 0.47164751383243125, + "learning_rate": 0.00019861111111111113, + "loss": 0.6992, + "step": 572 + }, + { + "epoch": 0.19954806188075785, + "grad_norm": 0.492328312395826, + "learning_rate": 0.00019930555555555557, + "loss": 0.7183, + "step": 574 + }, + { + "epoch": 0.20024335129497653, + "grad_norm": 0.5087240677439067, + "learning_rate": 0.0002, + "loss": 0.6429, + "step": 576 + }, + { + "epoch": 0.2009386407091952, + "grad_norm": 0.9311216098504759, + "learning_rate": 0.00019999992632143608, + "loss": 0.6586, + "step": 578 + }, + { + "epoch": 0.20163393012341388, + "grad_norm": 0.38840935170189844, + "learning_rate": 0.00019999970528585288, + "loss": 0.5905, + "step": 580 + }, + { + "epoch": 0.20232921953763253, + "grad_norm": 0.5966472765038273, + "learning_rate": 0.0001999993368935761, + "loss": 0.7112, + "step": 582 + }, + { + "epoch": 0.2030245089518512, + "grad_norm": 0.535232520705813, + "learning_rate": 0.00019999882114514863, + "loss": 0.7036, + "step": 584 + }, + { + "epoch": 0.20371979836606988, + "grad_norm": 0.5039916125175515, + "learning_rate": 0.0001999981580413304, + "loss": 0.7485, + "step": 586 + }, + { + "epoch": 0.20441508778028855, + "grad_norm": 0.6733262892097686, + "learning_rate": 0.0001999973475830986, + "loss": 0.7312, + "step": 588 + }, + { + "epoch": 0.20511037719450723, + "grad_norm": 0.42805740684614807, + "learning_rate": 0.00019999638977164747, + "loss": 0.6356, + "step": 590 + }, + { + "epoch": 0.20580566660872587, + "grad_norm": 0.976918546573707, + "learning_rate": 0.00019999528460838844, + "loss": 0.666, + "step": 592 + }, + { + "epoch": 0.20650095602294455, + "grad_norm": 0.674463735133944, + "learning_rate": 0.00019999403209495, + "loss": 0.6735, + "step": 594 + }, + { + "epoch": 0.20719624543716322, + "grad_norm": 0.412232119296174, + "learning_rate": 0.00019999263223317786, + "loss": 0.6364, + "step": 596 + }, + { + "epoch": 0.2078915348513819, + "grad_norm": 0.3611034413524545, + "learning_rate": 0.0001999910850251348, + "loss": 0.6368, + "step": 598 + }, + { + "epoch": 0.20858682426560055, + "grad_norm": 0.542506398091656, + "learning_rate": 0.0001999893904731007, + "loss": 0.7292, + "step": 600 + }, + { + "epoch": 0.20858682426560055, + "eval_loss": 0.6517693400382996, + "eval_runtime": 707.4674, + "eval_samples_per_second": 6.844, + "eval_steps_per_second": 0.215, + "step": 600 + }, + { + "epoch": 0.20928211367981922, + "grad_norm": 0.4799286290563759, + "learning_rate": 0.0001999875485795727, + "loss": 0.6609, + "step": 602 + }, + { + "epoch": 0.2099774030940379, + "grad_norm": 0.41830446575524177, + "learning_rate": 0.0001999855593472649, + "loss": 0.6084, + "step": 604 + }, + { + "epoch": 0.21067269250825657, + "grad_norm": 0.8865562086549428, + "learning_rate": 0.00019998342277910856, + "loss": 0.6204, + "step": 606 + }, + { + "epoch": 0.21136798192247522, + "grad_norm": 0.5567410910026902, + "learning_rate": 0.00019998113887825206, + "loss": 0.7087, + "step": 608 + }, + { + "epoch": 0.2120632713366939, + "grad_norm": 0.4229098163428897, + "learning_rate": 0.000199978707648061, + "loss": 0.6403, + "step": 610 + }, + { + "epoch": 0.21275856075091257, + "grad_norm": 0.7793555918286379, + "learning_rate": 0.00019997612909211784, + "loss": 0.6147, + "step": 612 + }, + { + "epoch": 0.21345385016513124, + "grad_norm": 0.49302383416102263, + "learning_rate": 0.00019997340321422228, + "loss": 0.5771, + "step": 614 + }, + { + "epoch": 0.21414913957934992, + "grad_norm": 1.0807551778698754, + "learning_rate": 0.00019997053001839115, + "loss": 0.6538, + "step": 616 + }, + { + "epoch": 0.21484442899356856, + "grad_norm": 0.5935042706034646, + "learning_rate": 0.0001999675095088583, + "loss": 0.6058, + "step": 618 + }, + { + "epoch": 0.21553971840778724, + "grad_norm": 0.5151203960605611, + "learning_rate": 0.00019996434169007468, + "loss": 0.6138, + "step": 620 + }, + { + "epoch": 0.21623500782200591, + "grad_norm": 0.7837579499467073, + "learning_rate": 0.00019996102656670824, + "loss": 0.657, + "step": 622 + }, + { + "epoch": 0.2169302972362246, + "grad_norm": 0.5438202413527335, + "learning_rate": 0.0001999575641436441, + "loss": 0.6642, + "step": 624 + }, + { + "epoch": 0.21762558665044324, + "grad_norm": 0.5566641749580342, + "learning_rate": 0.00019995395442598435, + "loss": 0.6813, + "step": 626 + }, + { + "epoch": 0.2183208760646619, + "grad_norm": 0.9345190838089675, + "learning_rate": 0.0001999501974190482, + "loss": 0.684, + "step": 628 + }, + { + "epoch": 0.2190161654788806, + "grad_norm": 0.48677420225080537, + "learning_rate": 0.00019994629312837186, + "loss": 0.6481, + "step": 630 + }, + { + "epoch": 0.21971145489309926, + "grad_norm": 1.3826373483976924, + "learning_rate": 0.00019994224155970856, + "loss": 0.7222, + "step": 632 + }, + { + "epoch": 0.2204067443073179, + "grad_norm": 0.9031189580678588, + "learning_rate": 0.00019993804271902857, + "loss": 0.6809, + "step": 634 + }, + { + "epoch": 0.22110203372153658, + "grad_norm": 0.5674519795217096, + "learning_rate": 0.00019993369661251923, + "loss": 0.6184, + "step": 636 + }, + { + "epoch": 0.22179732313575526, + "grad_norm": 2.5294344265719135, + "learning_rate": 0.0001999292032465848, + "loss": 0.7686, + "step": 638 + }, + { + "epoch": 0.22249261254997393, + "grad_norm": 2.8855656605632047, + "learning_rate": 0.00019992456262784658, + "loss": 0.8215, + "step": 640 + }, + { + "epoch": 0.2231879019641926, + "grad_norm": 1.5331524159142917, + "learning_rate": 0.00019991977476314286, + "loss": 0.7057, + "step": 642 + }, + { + "epoch": 0.22388319137841126, + "grad_norm": 0.8086145005161695, + "learning_rate": 0.0001999148396595289, + "loss": 0.6289, + "step": 644 + }, + { + "epoch": 0.22457848079262993, + "grad_norm": 0.767389193699688, + "learning_rate": 0.00019990975732427693, + "loss": 0.6117, + "step": 646 + }, + { + "epoch": 0.2252737702068486, + "grad_norm": 0.9275190697426144, + "learning_rate": 0.0001999045277648761, + "loss": 0.6582, + "step": 648 + }, + { + "epoch": 0.22596905962106728, + "grad_norm": 0.8004230202091956, + "learning_rate": 0.00019989915098903257, + "loss": 0.5387, + "step": 650 + }, + { + "epoch": 0.22666434903528593, + "grad_norm": 0.8210833181388095, + "learning_rate": 0.0001998936270046694, + "loss": 0.5941, + "step": 652 + }, + { + "epoch": 0.2273596384495046, + "grad_norm": 2.1189675938584616, + "learning_rate": 0.00019988795581992656, + "loss": 0.7504, + "step": 654 + }, + { + "epoch": 0.22805492786372328, + "grad_norm": 0.5952032026226816, + "learning_rate": 0.000199882137443161, + "loss": 0.6643, + "step": 656 + }, + { + "epoch": 0.22875021727794195, + "grad_norm": 0.40481972159485846, + "learning_rate": 0.00019987617188294642, + "loss": 0.5225, + "step": 658 + }, + { + "epoch": 0.2294455066921606, + "grad_norm": 0.7478677085785272, + "learning_rate": 0.00019987005914807356, + "loss": 0.6561, + "step": 660 + }, + { + "epoch": 0.23014079610637928, + "grad_norm": 0.4468692254604696, + "learning_rate": 0.00019986379924754997, + "loss": 0.6262, + "step": 662 + }, + { + "epoch": 0.23083608552059795, + "grad_norm": 0.46697718493106893, + "learning_rate": 0.00019985739219060002, + "loss": 0.6178, + "step": 664 + }, + { + "epoch": 0.23153137493481663, + "grad_norm": 0.388728867903269, + "learning_rate": 0.000199850837986665, + "loss": 0.5544, + "step": 666 + }, + { + "epoch": 0.23222666434903527, + "grad_norm": 0.5731403139849517, + "learning_rate": 0.000199844136645403, + "loss": 0.5906, + "step": 668 + }, + { + "epoch": 0.23292195376325395, + "grad_norm": 0.7601215827849259, + "learning_rate": 0.0001998372881766889, + "loss": 0.6577, + "step": 670 + }, + { + "epoch": 0.23361724317747262, + "grad_norm": 0.8997786413980279, + "learning_rate": 0.00019983029259061446, + "loss": 0.6388, + "step": 672 + }, + { + "epoch": 0.2343125325916913, + "grad_norm": 0.519349430301096, + "learning_rate": 0.00019982314989748813, + "loss": 0.6561, + "step": 674 + }, + { + "epoch": 0.23500782200590997, + "grad_norm": 0.4918913590728881, + "learning_rate": 0.00019981586010783513, + "loss": 0.6176, + "step": 676 + }, + { + "epoch": 0.23570311142012862, + "grad_norm": 0.5324672662478441, + "learning_rate": 0.00019980842323239756, + "loss": 0.5801, + "step": 678 + }, + { + "epoch": 0.2363984008343473, + "grad_norm": 0.6375745879180794, + "learning_rate": 0.00019980083928213417, + "loss": 0.6885, + "step": 680 + }, + { + "epoch": 0.23709369024856597, + "grad_norm": 0.4317997282790841, + "learning_rate": 0.00019979310826822046, + "loss": 0.5727, + "step": 682 + }, + { + "epoch": 0.23778897966278464, + "grad_norm": 0.7933828103238656, + "learning_rate": 0.00019978523020204857, + "loss": 0.6703, + "step": 684 + }, + { + "epoch": 0.2384842690770033, + "grad_norm": 0.5465102255190097, + "learning_rate": 0.00019977720509522747, + "loss": 0.6675, + "step": 686 + }, + { + "epoch": 0.23917955849122197, + "grad_norm": 0.8356137363612883, + "learning_rate": 0.00019976903295958269, + "loss": 0.6558, + "step": 688 + }, + { + "epoch": 0.23987484790544064, + "grad_norm": 0.5190073187676806, + "learning_rate": 0.00019976071380715645, + "loss": 0.6779, + "step": 690 + }, + { + "epoch": 0.24057013731965932, + "grad_norm": 0.40561527338007225, + "learning_rate": 0.0001997522476502076, + "loss": 0.6687, + "step": 692 + }, + { + "epoch": 0.24126542673387796, + "grad_norm": 0.592821589706298, + "learning_rate": 0.0001997436345012117, + "loss": 0.6807, + "step": 694 + }, + { + "epoch": 0.24196071614809664, + "grad_norm": 0.686918345062074, + "learning_rate": 0.00019973487437286073, + "loss": 0.6831, + "step": 696 + }, + { + "epoch": 0.2426560055623153, + "grad_norm": 0.964075508243471, + "learning_rate": 0.00019972596727806346, + "loss": 0.665, + "step": 698 + }, + { + "epoch": 0.243351294976534, + "grad_norm": 0.739137434656244, + "learning_rate": 0.00019971691322994507, + "loss": 0.6387, + "step": 700 + }, + { + "epoch": 0.24404658439075266, + "grad_norm": 0.3978099419540589, + "learning_rate": 0.00019970771224184737, + "loss": 0.6143, + "step": 702 + }, + { + "epoch": 0.2447418738049713, + "grad_norm": 0.4997978607153984, + "learning_rate": 0.0001996983643273287, + "loss": 0.6083, + "step": 704 + }, + { + "epoch": 0.24543716321918999, + "grad_norm": 1.3443518380439796, + "learning_rate": 0.0001996888695001638, + "loss": 0.6711, + "step": 706 + }, + { + "epoch": 0.24613245263340866, + "grad_norm": 0.5424379336505594, + "learning_rate": 0.000199679227774344, + "loss": 0.6321, + "step": 708 + }, + { + "epoch": 0.24682774204762734, + "grad_norm": 0.7689235498835658, + "learning_rate": 0.00019966943916407712, + "loss": 0.6918, + "step": 710 + }, + { + "epoch": 0.24752303146184598, + "grad_norm": 0.6467240394468301, + "learning_rate": 0.00019965950368378734, + "loss": 0.6368, + "step": 712 + }, + { + "epoch": 0.24821832087606466, + "grad_norm": 0.48819289451999526, + "learning_rate": 0.00019964942134811532, + "loss": 0.5875, + "step": 714 + }, + { + "epoch": 0.24891361029028333, + "grad_norm": 1.1929427463467126, + "learning_rate": 0.00019963919217191807, + "loss": 0.6795, + "step": 716 + }, + { + "epoch": 0.249608899704502, + "grad_norm": 0.4182713825442439, + "learning_rate": 0.00019962881617026902, + "loss": 0.5835, + "step": 718 + }, + { + "epoch": 0.25030418911872065, + "grad_norm": 0.5770262516296942, + "learning_rate": 0.00019961829335845795, + "loss": 0.6299, + "step": 720 + }, + { + "epoch": 0.25099947853293936, + "grad_norm": 0.9135250550485389, + "learning_rate": 0.00019960762375199095, + "loss": 0.6844, + "step": 722 + }, + { + "epoch": 0.251694767947158, + "grad_norm": 0.5511234805517417, + "learning_rate": 0.0001995968073665905, + "loss": 0.5745, + "step": 724 + }, + { + "epoch": 0.25239005736137665, + "grad_norm": 0.49137872896877094, + "learning_rate": 0.00019958584421819528, + "loss": 0.698, + "step": 726 + }, + { + "epoch": 0.25308534677559535, + "grad_norm": 0.4437253322782162, + "learning_rate": 0.00019957473432296026, + "loss": 0.6864, + "step": 728 + }, + { + "epoch": 0.253780636189814, + "grad_norm": 0.5064381489074585, + "learning_rate": 0.0001995634776972567, + "loss": 0.5758, + "step": 730 + }, + { + "epoch": 0.2544759256040327, + "grad_norm": 0.5464655664741616, + "learning_rate": 0.00019955207435767201, + "loss": 0.6351, + "step": 732 + }, + { + "epoch": 0.25517121501825135, + "grad_norm": 0.44060524677853835, + "learning_rate": 0.00019954052432100982, + "loss": 0.6837, + "step": 734 + }, + { + "epoch": 0.25586650443247, + "grad_norm": 0.942390696980061, + "learning_rate": 0.00019952882760428998, + "loss": 0.6378, + "step": 736 + }, + { + "epoch": 0.2565617938466887, + "grad_norm": 0.4710023299938762, + "learning_rate": 0.00019951698422474836, + "loss": 0.6968, + "step": 738 + }, + { + "epoch": 0.25725708326090735, + "grad_norm": 0.4179809222387651, + "learning_rate": 0.00019950499419983707, + "loss": 0.5643, + "step": 740 + }, + { + "epoch": 0.257952372675126, + "grad_norm": 0.4446278865199289, + "learning_rate": 0.00019949285754722426, + "loss": 0.5089, + "step": 742 + }, + { + "epoch": 0.2586476620893447, + "grad_norm": 0.914728851966275, + "learning_rate": 0.00019948057428479418, + "loss": 0.7933, + "step": 744 + }, + { + "epoch": 0.25934295150356335, + "grad_norm": 0.47142275185055055, + "learning_rate": 0.00019946814443064703, + "loss": 0.6384, + "step": 746 + }, + { + "epoch": 0.26003824091778205, + "grad_norm": 0.720916103725334, + "learning_rate": 0.00019945556800309917, + "loss": 0.5957, + "step": 748 + }, + { + "epoch": 0.2607335303320007, + "grad_norm": 0.8550360126036364, + "learning_rate": 0.00019944284502068275, + "loss": 0.6454, + "step": 750 + }, + { + "epoch": 0.2607335303320007, + "eval_loss": 0.6373963952064514, + "eval_runtime": 728.7951, + "eval_samples_per_second": 6.644, + "eval_steps_per_second": 0.209, + "step": 750 + }, + { + "epoch": 0.26142881974621934, + "grad_norm": 0.5467512313200382, + "learning_rate": 0.0001994299755021461, + "loss": 0.5781, + "step": 752 + }, + { + "epoch": 0.26212410916043805, + "grad_norm": 0.41230384162224254, + "learning_rate": 0.0001994169594664533, + "loss": 0.6467, + "step": 754 + }, + { + "epoch": 0.2628193985746567, + "grad_norm": 0.5635895964904281, + "learning_rate": 0.00019940379693278448, + "loss": 0.6182, + "step": 756 + }, + { + "epoch": 0.2635146879888754, + "grad_norm": 0.6456168984233462, + "learning_rate": 0.0001993904879205355, + "loss": 0.6086, + "step": 758 + }, + { + "epoch": 0.26420997740309404, + "grad_norm": 0.5060399335833471, + "learning_rate": 0.00019937703244931815, + "loss": 0.6407, + "step": 760 + }, + { + "epoch": 0.2649052668173127, + "grad_norm": 0.5033297464646784, + "learning_rate": 0.00019936343053896004, + "loss": 0.6157, + "step": 762 + }, + { + "epoch": 0.2656005562315314, + "grad_norm": 0.3911665523252255, + "learning_rate": 0.00019934968220950458, + "loss": 0.6227, + "step": 764 + }, + { + "epoch": 0.26629584564575004, + "grad_norm": 1.7130937466256138, + "learning_rate": 0.00019933578748121086, + "loss": 0.5994, + "step": 766 + }, + { + "epoch": 0.2669911350599687, + "grad_norm": 0.5747338886603724, + "learning_rate": 0.00019932174637455382, + "loss": 0.6238, + "step": 768 + }, + { + "epoch": 0.2676864244741874, + "grad_norm": 0.6226324357252033, + "learning_rate": 0.00019930755891022398, + "loss": 0.6255, + "step": 770 + }, + { + "epoch": 0.26838171388840604, + "grad_norm": 0.5282488794229044, + "learning_rate": 0.00019929322510912756, + "loss": 0.5808, + "step": 772 + }, + { + "epoch": 0.26907700330262474, + "grad_norm": 0.5596904577167024, + "learning_rate": 0.0001992787449923865, + "loss": 0.5361, + "step": 774 + }, + { + "epoch": 0.2697722927168434, + "grad_norm": 1.0477422618379753, + "learning_rate": 0.00019926411858133824, + "loss": 0.54, + "step": 776 + }, + { + "epoch": 0.27046758213106203, + "grad_norm": 1.1314704495635823, + "learning_rate": 0.00019924934589753582, + "loss": 0.5869, + "step": 778 + }, + { + "epoch": 0.27116287154528074, + "grad_norm": 0.5426548544381972, + "learning_rate": 0.00019923442696274794, + "loss": 0.5951, + "step": 780 + }, + { + "epoch": 0.2718581609594994, + "grad_norm": 0.8480025293040686, + "learning_rate": 0.00019921936179895862, + "loss": 0.6003, + "step": 782 + }, + { + "epoch": 0.2725534503737181, + "grad_norm": 0.5729452380906337, + "learning_rate": 0.0001992041504283675, + "loss": 0.6526, + "step": 784 + }, + { + "epoch": 0.27324873978793673, + "grad_norm": 0.7362085286496177, + "learning_rate": 0.00019918879287338957, + "loss": 0.6776, + "step": 786 + }, + { + "epoch": 0.2739440292021554, + "grad_norm": 0.7440059372391256, + "learning_rate": 0.00019917328915665535, + "loss": 0.6486, + "step": 788 + }, + { + "epoch": 0.2746393186163741, + "grad_norm": 0.6110842206790659, + "learning_rate": 0.0001991576393010106, + "loss": 0.6226, + "step": 790 + }, + { + "epoch": 0.27533460803059273, + "grad_norm": 0.8002336898560896, + "learning_rate": 0.00019914184332951655, + "loss": 0.6215, + "step": 792 + }, + { + "epoch": 0.2760298974448114, + "grad_norm": 0.6761736356192558, + "learning_rate": 0.00019912590126544964, + "loss": 0.5988, + "step": 794 + }, + { + "epoch": 0.2767251868590301, + "grad_norm": 1.1005016630123619, + "learning_rate": 0.00019910981313230172, + "loss": 0.6213, + "step": 796 + }, + { + "epoch": 0.27742047627324873, + "grad_norm": 0.6513452605734942, + "learning_rate": 0.00019909357895377973, + "loss": 0.682, + "step": 798 + }, + { + "epoch": 0.27811576568746743, + "grad_norm": 0.8536492677008404, + "learning_rate": 0.0001990771987538059, + "loss": 0.707, + "step": 800 + }, + { + "epoch": 0.2788110551016861, + "grad_norm": 0.3362293750538688, + "learning_rate": 0.00019906067255651765, + "loss": 0.7108, + "step": 802 + }, + { + "epoch": 0.2795063445159047, + "grad_norm": 0.4792899916449288, + "learning_rate": 0.0001990440003862675, + "loss": 0.6055, + "step": 804 + }, + { + "epoch": 0.28020163393012343, + "grad_norm": 1.272937677307704, + "learning_rate": 0.00019902718226762304, + "loss": 0.6816, + "step": 806 + }, + { + "epoch": 0.2808969233443421, + "grad_norm": 0.30646692495778655, + "learning_rate": 0.00019901021822536704, + "loss": 0.688, + "step": 808 + }, + { + "epoch": 0.2815922127585608, + "grad_norm": 0.3035733218665055, + "learning_rate": 0.00019899310828449713, + "loss": 0.6746, + "step": 810 + }, + { + "epoch": 0.2822875021727794, + "grad_norm": 0.2763276026826459, + "learning_rate": 0.00019897585247022613, + "loss": 0.6632, + "step": 812 + }, + { + "epoch": 0.2829827915869981, + "grad_norm": 1.173118337900773, + "learning_rate": 0.00019895845080798166, + "loss": 0.6306, + "step": 814 + }, + { + "epoch": 0.2836780810012168, + "grad_norm": 0.4335278252167635, + "learning_rate": 0.0001989409033234063, + "loss": 0.6147, + "step": 816 + }, + { + "epoch": 0.2843733704154354, + "grad_norm": 0.3556694503062785, + "learning_rate": 0.00019892321004235755, + "loss": 0.5771, + "step": 818 + }, + { + "epoch": 0.28506865982965407, + "grad_norm": 0.9083240381897224, + "learning_rate": 0.00019890537099090768, + "loss": 0.5729, + "step": 820 + }, + { + "epoch": 0.2857639492438728, + "grad_norm": 0.5433346815141633, + "learning_rate": 0.00019888738619534385, + "loss": 0.5554, + "step": 822 + }, + { + "epoch": 0.2864592386580914, + "grad_norm": 0.5244705156138804, + "learning_rate": 0.0001988692556821679, + "loss": 0.6525, + "step": 824 + }, + { + "epoch": 0.2871545280723101, + "grad_norm": 0.7580866792170871, + "learning_rate": 0.00019885097947809648, + "loss": 0.6512, + "step": 826 + }, + { + "epoch": 0.28784981748652877, + "grad_norm": 0.7034554538404351, + "learning_rate": 0.00019883255761006082, + "loss": 0.5414, + "step": 828 + }, + { + "epoch": 0.2885451069007474, + "grad_norm": 0.6915575597289163, + "learning_rate": 0.00019881399010520688, + "loss": 0.6036, + "step": 830 + }, + { + "epoch": 0.2892403963149661, + "grad_norm": 0.6895372001781882, + "learning_rate": 0.00019879527699089524, + "loss": 0.5894, + "step": 832 + }, + { + "epoch": 0.28993568572918477, + "grad_norm": 0.7762412863407715, + "learning_rate": 0.00019877641829470094, + "loss": 0.7115, + "step": 834 + }, + { + "epoch": 0.29063097514340347, + "grad_norm": 0.5761220663639801, + "learning_rate": 0.00019875741404441367, + "loss": 0.6108, + "step": 836 + }, + { + "epoch": 0.2913262645576221, + "grad_norm": 0.47176943357070505, + "learning_rate": 0.00019873826426803755, + "loss": 0.634, + "step": 838 + }, + { + "epoch": 0.29202155397184076, + "grad_norm": 0.5985873148196751, + "learning_rate": 0.00019871896899379107, + "loss": 0.6528, + "step": 840 + }, + { + "epoch": 0.29271684338605947, + "grad_norm": 0.39514741111190665, + "learning_rate": 0.00019869952825010727, + "loss": 0.6034, + "step": 842 + }, + { + "epoch": 0.2934121328002781, + "grad_norm": 0.29787585594263405, + "learning_rate": 0.00019867994206563343, + "loss": 0.6063, + "step": 844 + }, + { + "epoch": 0.29410742221449676, + "grad_norm": 0.303320759302155, + "learning_rate": 0.00019866021046923118, + "loss": 0.6343, + "step": 846 + }, + { + "epoch": 0.29480271162871546, + "grad_norm": 0.33135450527244925, + "learning_rate": 0.00019864033348997645, + "loss": 0.6421, + "step": 848 + }, + { + "epoch": 0.2954980010429341, + "grad_norm": 0.553668190192523, + "learning_rate": 0.0001986203111571594, + "loss": 0.6503, + "step": 850 + }, + { + "epoch": 0.2961932904571528, + "grad_norm": 0.31948016623126946, + "learning_rate": 0.00019860014350028438, + "loss": 0.6259, + "step": 852 + }, + { + "epoch": 0.29688857987137146, + "grad_norm": 0.5325237443938606, + "learning_rate": 0.0001985798305490698, + "loss": 0.6207, + "step": 854 + }, + { + "epoch": 0.2975838692855901, + "grad_norm": 0.5093186589927414, + "learning_rate": 0.00019855937233344831, + "loss": 0.5397, + "step": 856 + }, + { + "epoch": 0.2982791586998088, + "grad_norm": 0.5220573948537062, + "learning_rate": 0.00019853876888356652, + "loss": 0.6237, + "step": 858 + }, + { + "epoch": 0.29897444811402746, + "grad_norm": 0.9861332892020862, + "learning_rate": 0.00019851802022978506, + "loss": 0.689, + "step": 860 + }, + { + "epoch": 0.2996697375282461, + "grad_norm": 0.464669721879274, + "learning_rate": 0.00019849712640267861, + "loss": 0.522, + "step": 862 + }, + { + "epoch": 0.3003650269424648, + "grad_norm": 0.9223435358714303, + "learning_rate": 0.00019847608743303567, + "loss": 0.7491, + "step": 864 + }, + { + "epoch": 0.30106031635668346, + "grad_norm": 0.5058775377593727, + "learning_rate": 0.00019845490335185866, + "loss": 0.562, + "step": 866 + }, + { + "epoch": 0.30175560577090216, + "grad_norm": 0.5517767811356443, + "learning_rate": 0.00019843357419036382, + "loss": 0.6162, + "step": 868 + }, + { + "epoch": 0.3024508951851208, + "grad_norm": 0.49255497197537723, + "learning_rate": 0.00019841209997998127, + "loss": 0.6803, + "step": 870 + }, + { + "epoch": 0.30314618459933945, + "grad_norm": 0.41553745561512617, + "learning_rate": 0.0001983904807523547, + "loss": 0.6415, + "step": 872 + }, + { + "epoch": 0.30384147401355815, + "grad_norm": 0.49551628457734653, + "learning_rate": 0.00019836871653934162, + "loss": 0.6176, + "step": 874 + }, + { + "epoch": 0.3045367634277768, + "grad_norm": 0.7489091107060393, + "learning_rate": 0.00019834680737301313, + "loss": 0.6337, + "step": 876 + }, + { + "epoch": 0.3052320528419955, + "grad_norm": 0.32312869533576805, + "learning_rate": 0.00019832475328565398, + "loss": 0.6135, + "step": 878 + }, + { + "epoch": 0.30592734225621415, + "grad_norm": 0.304002075332943, + "learning_rate": 0.00019830255430976242, + "loss": 0.5533, + "step": 880 + }, + { + "epoch": 0.3066226316704328, + "grad_norm": 0.4137621036041215, + "learning_rate": 0.00019828021047805022, + "loss": 0.573, + "step": 882 + }, + { + "epoch": 0.3073179210846515, + "grad_norm": 0.7506870255042438, + "learning_rate": 0.00019825772182344262, + "loss": 0.6971, + "step": 884 + }, + { + "epoch": 0.30801321049887015, + "grad_norm": 0.7069489041589112, + "learning_rate": 0.00019823508837907828, + "loss": 0.5848, + "step": 886 + }, + { + "epoch": 0.3087084999130888, + "grad_norm": 0.49383355752727304, + "learning_rate": 0.00019821231017830914, + "loss": 0.6349, + "step": 888 + }, + { + "epoch": 0.3094037893273075, + "grad_norm": 0.7893505446859834, + "learning_rate": 0.0001981893872547005, + "loss": 0.6335, + "step": 890 + }, + { + "epoch": 0.31009907874152615, + "grad_norm": 1.0962653113728835, + "learning_rate": 0.00019816631964203097, + "loss": 0.6438, + "step": 892 + }, + { + "epoch": 0.31079436815574485, + "grad_norm": 0.40606329821748216, + "learning_rate": 0.0001981431073742923, + "loss": 0.557, + "step": 894 + }, + { + "epoch": 0.3114896575699635, + "grad_norm": 0.8061837126172193, + "learning_rate": 0.00019811975048568943, + "loss": 0.6334, + "step": 896 + }, + { + "epoch": 0.31218494698418214, + "grad_norm": 0.7808955990860935, + "learning_rate": 0.00019809624901064038, + "loss": 0.5775, + "step": 898 + }, + { + "epoch": 0.31288023639840085, + "grad_norm": 0.5527203146534614, + "learning_rate": 0.00019807260298377626, + "loss": 0.5934, + "step": 900 + }, + { + "epoch": 0.31288023639840085, + "eval_loss": 0.666339099407196, + "eval_runtime": 759.5196, + "eval_samples_per_second": 6.375, + "eval_steps_per_second": 0.2, + "step": 900 + }, + { + "epoch": 0.3135755258126195, + "grad_norm": 1.151650071753606, + "learning_rate": 0.00019804881243994118, + "loss": 0.6459, + "step": 902 + }, + { + "epoch": 0.3142708152268382, + "grad_norm": 0.37537177441864283, + "learning_rate": 0.00019802487741419218, + "loss": 0.5537, + "step": 904 + }, + { + "epoch": 0.31496610464105684, + "grad_norm": 0.39806583735978385, + "learning_rate": 0.00019800079794179927, + "loss": 0.5765, + "step": 906 + }, + { + "epoch": 0.3156613940552755, + "grad_norm": 0.9252532303995283, + "learning_rate": 0.00019797657405824524, + "loss": 0.6581, + "step": 908 + }, + { + "epoch": 0.3163566834694942, + "grad_norm": 0.4242008643262632, + "learning_rate": 0.00019795220579922572, + "loss": 0.663, + "step": 910 + }, + { + "epoch": 0.31705197288371284, + "grad_norm": 0.5557863138791925, + "learning_rate": 0.00019792769320064904, + "loss": 0.6492, + "step": 912 + }, + { + "epoch": 0.3177472622979315, + "grad_norm": 0.5743017982975046, + "learning_rate": 0.0001979030362986363, + "loss": 0.6425, + "step": 914 + }, + { + "epoch": 0.3184425517121502, + "grad_norm": 0.39667228882787314, + "learning_rate": 0.0001978782351295212, + "loss": 0.5658, + "step": 916 + }, + { + "epoch": 0.31913784112636884, + "grad_norm": 1.2742981139875873, + "learning_rate": 0.00019785328972985, + "loss": 0.6042, + "step": 918 + }, + { + "epoch": 0.31983313054058754, + "grad_norm": 0.7520790754771111, + "learning_rate": 0.00019782820013638158, + "loss": 0.6248, + "step": 920 + }, + { + "epoch": 0.3205284199548062, + "grad_norm": 1.1777266516894538, + "learning_rate": 0.0001978029663860872, + "loss": 0.6394, + "step": 922 + }, + { + "epoch": 0.32122370936902483, + "grad_norm": 0.5383416828808074, + "learning_rate": 0.00019777758851615058, + "loss": 0.6357, + "step": 924 + }, + { + "epoch": 0.32191899878324354, + "grad_norm": 0.5351088818608489, + "learning_rate": 0.00019775206656396787, + "loss": 0.6111, + "step": 926 + }, + { + "epoch": 0.3226142881974622, + "grad_norm": 0.7776255734128178, + "learning_rate": 0.00019772640056714744, + "loss": 0.5778, + "step": 928 + }, + { + "epoch": 0.3233095776116809, + "grad_norm": 0.5049904332607067, + "learning_rate": 0.00019770059056351, + "loss": 0.5978, + "step": 930 + }, + { + "epoch": 0.32400486702589953, + "grad_norm": 0.6894813643690206, + "learning_rate": 0.00019767463659108841, + "loss": 0.6727, + "step": 932 + }, + { + "epoch": 0.3247001564401182, + "grad_norm": 0.6230252249989028, + "learning_rate": 0.00019764853868812772, + "loss": 0.5911, + "step": 934 + }, + { + "epoch": 0.3253954458543369, + "grad_norm": 0.6699617199619087, + "learning_rate": 0.00019762229689308499, + "loss": 0.6694, + "step": 936 + }, + { + "epoch": 0.32609073526855553, + "grad_norm": 0.9762605521595761, + "learning_rate": 0.00019759591124462943, + "loss": 0.7053, + "step": 938 + }, + { + "epoch": 0.3267860246827742, + "grad_norm": 0.5216728233794251, + "learning_rate": 0.0001975693817816422, + "loss": 0.6958, + "step": 940 + }, + { + "epoch": 0.3274813140969929, + "grad_norm": 0.5943791708445256, + "learning_rate": 0.00019754270854321625, + "loss": 0.6342, + "step": 942 + }, + { + "epoch": 0.32817660351121153, + "grad_norm": 0.5341014737913188, + "learning_rate": 0.00019751589156865663, + "loss": 0.6272, + "step": 944 + }, + { + "epoch": 0.32887189292543023, + "grad_norm": 0.8411647140863245, + "learning_rate": 0.00019748893089747995, + "loss": 0.6041, + "step": 946 + }, + { + "epoch": 0.3295671823396489, + "grad_norm": 1.072323043427063, + "learning_rate": 0.00019746182656941473, + "loss": 0.7152, + "step": 948 + }, + { + "epoch": 0.3302624717538675, + "grad_norm": 0.6497829380326366, + "learning_rate": 0.00019743457862440115, + "loss": 0.6176, + "step": 950 + }, + { + "epoch": 0.33095776116808623, + "grad_norm": 0.28736093186011447, + "learning_rate": 0.00019740718710259096, + "loss": 0.6453, + "step": 952 + }, + { + "epoch": 0.3316530505823049, + "grad_norm": 0.27868233108109625, + "learning_rate": 0.00019737965204434757, + "loss": 0.6051, + "step": 954 + }, + { + "epoch": 0.3323483399965236, + "grad_norm": 0.40709235855818693, + "learning_rate": 0.00019735197349024576, + "loss": 0.6255, + "step": 956 + }, + { + "epoch": 0.3330436294107422, + "grad_norm": 0.8385677925045294, + "learning_rate": 0.00019732415148107199, + "loss": 0.6455, + "step": 958 + }, + { + "epoch": 0.3337389188249609, + "grad_norm": 0.5642576200414804, + "learning_rate": 0.00019729618605782384, + "loss": 0.6971, + "step": 960 + }, + { + "epoch": 0.3344342082391796, + "grad_norm": 0.7034648545079693, + "learning_rate": 0.00019726807726171039, + "loss": 0.6177, + "step": 962 + }, + { + "epoch": 0.3351294976533982, + "grad_norm": 1.9840633930320113, + "learning_rate": 0.000197239825134152, + "loss": 0.6776, + "step": 964 + }, + { + "epoch": 0.33582478706761687, + "grad_norm": 1.0091982574836484, + "learning_rate": 0.00019721142971678015, + "loss": 0.6893, + "step": 966 + }, + { + "epoch": 0.3365200764818356, + "grad_norm": 0.9742560258590767, + "learning_rate": 0.00019718289105143753, + "loss": 0.744, + "step": 968 + }, + { + "epoch": 0.3372153658960542, + "grad_norm": 0.6897018399345455, + "learning_rate": 0.00019715420918017793, + "loss": 0.678, + "step": 970 + }, + { + "epoch": 0.3379106553102729, + "grad_norm": 0.29102959771453246, + "learning_rate": 0.00019712538414526606, + "loss": 0.6663, + "step": 972 + }, + { + "epoch": 0.33860594472449157, + "grad_norm": 0.7337107483377766, + "learning_rate": 0.0001970964159891777, + "loss": 0.663, + "step": 974 + }, + { + "epoch": 0.3393012341387102, + "grad_norm": 0.5817704647699353, + "learning_rate": 0.00019706730475459953, + "loss": 0.6398, + "step": 976 + }, + { + "epoch": 0.3399965235529289, + "grad_norm": 0.28703428796704483, + "learning_rate": 0.00019703805048442897, + "loss": 0.5906, + "step": 978 + }, + { + "epoch": 0.34069181296714757, + "grad_norm": 0.41383789019772477, + "learning_rate": 0.0001970086532217743, + "loss": 0.6709, + "step": 980 + }, + { + "epoch": 0.34138710238136627, + "grad_norm": 0.812487649001141, + "learning_rate": 0.00019697911300995443, + "loss": 0.6191, + "step": 982 + }, + { + "epoch": 0.3420823917955849, + "grad_norm": 0.798027200072012, + "learning_rate": 0.00019694942989249907, + "loss": 0.6608, + "step": 984 + }, + { + "epoch": 0.34277768120980356, + "grad_norm": 0.44029385955900757, + "learning_rate": 0.00019691960391314837, + "loss": 0.647, + "step": 986 + }, + { + "epoch": 0.34347297062402227, + "grad_norm": 0.3824484030698272, + "learning_rate": 0.00019688963511585295, + "loss": 0.6378, + "step": 988 + }, + { + "epoch": 0.3441682600382409, + "grad_norm": 0.4121768227084979, + "learning_rate": 0.0001968595235447741, + "loss": 0.5908, + "step": 990 + } + ], + "logging_steps": 2, + "max_steps": 5752, + "num_input_tokens_seen": 0, + "num_train_epochs": 2, + "save_steps": 90, + "stateful_callbacks": { + "TrainerControl": { + "args": { + "should_epoch_stop": false, + "should_evaluate": false, + "should_log": false, + "should_save": true, + "should_training_stop": false + }, + "attributes": {} + } + }, + "total_flos": 3944416948518912.0, + "train_batch_size": 4, + "trial_name": null, + "trial_params": null +} diff --git a/checkpoint-990/training_args.bin b/checkpoint-990/training_args.bin new file mode 100644 index 0000000000000000000000000000000000000000..fba3b63792fed5a70be0307e26ba27ef584b1528 --- /dev/null +++ b/checkpoint-990/training_args.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b72add547acd6c009f3a3770072d0cdf7de7e797c7597084319db874a556e470 +size 6904 diff --git a/checkpoint-990/zero_to_fp32.py b/checkpoint-990/zero_to_fp32.py new file mode 100644 index 0000000000000000000000000000000000000000..0e759146cadd92ddfefab3680146c2bd6a2b5c04 --- /dev/null +++ b/checkpoint-990/zero_to_fp32.py @@ -0,0 +1,760 @@ +#!/usr/bin/env python + +# Copyright (c) Microsoft Corporation. +# SPDX-License-Identifier: Apache-2.0 + +# DeepSpeed Team + +# This script extracts fp32 consolidated weights from a zero 1, 2 and 3 DeepSpeed checkpoints. It gets +# copied into the top level checkpoint dir, so the user can easily do the conversion at any point in +# the future. Once extracted, the weights don't require DeepSpeed and can be used in any +# application. +# +# example: +# python zero_to_fp32.py . output_dir/ +# or +# python zero_to_fp32.py . output_dir/ --safe_serialization + +import argparse +import torch +import glob +import math +import os +import re +import gc +import json +import numpy as np +from tqdm import tqdm +from collections import OrderedDict +from dataclasses import dataclass + +# while this script doesn't use deepspeed to recover data, since the checkpoints are pickled with +# DeepSpeed data structures it has to be available in the current python environment. +from deepspeed.utils import logger +from deepspeed.checkpoint.constants import (DS_VERSION, OPTIMIZER_STATE_DICT, SINGLE_PARTITION_OF_FP32_GROUPS, + FP32_FLAT_GROUPS, ZERO_STAGE, PARTITION_COUNT, PARAM_SHAPES, BUFFER_NAMES, + FROZEN_PARAM_SHAPES, FROZEN_PARAM_FRAGMENTS) + + +@dataclass +class zero_model_state: + buffers: dict() + param_shapes: dict() + shared_params: list + ds_version: int + frozen_param_shapes: dict() + frozen_param_fragments: dict() + + +debug = 0 + +# load to cpu +device = torch.device('cpu') + + +def atoi(text): + return int(text) if text.isdigit() else text + + +def natural_keys(text): + ''' + alist.sort(key=natural_keys) sorts in human order + http://nedbatchelder.com/blog/200712/human_sorting.html + (See Toothy's implementation in the comments) + ''' + return [atoi(c) for c in re.split(r'(\d+)', text)] + + +def get_model_state_file(checkpoint_dir, zero_stage): + if not os.path.isdir(checkpoint_dir): + raise FileNotFoundError(f"Directory '{checkpoint_dir}' doesn't exist") + + # there should be only one file + if zero_stage <= 2: + file = os.path.join(checkpoint_dir, "mp_rank_00_model_states.pt") + elif zero_stage == 3: + file = os.path.join(checkpoint_dir, "zero_pp_rank_0_mp_rank_00_model_states.pt") + + if not os.path.exists(file): + raise FileNotFoundError(f"can't find model states file at '{file}'") + + return file + + +def get_checkpoint_files(checkpoint_dir, glob_pattern): + # XXX: need to test that this simple glob rule works for multi-node setup too + ckpt_files = sorted(glob.glob(os.path.join(checkpoint_dir, glob_pattern)), key=natural_keys) + + if len(ckpt_files) == 0: + raise FileNotFoundError(f"can't find {glob_pattern} files in directory '{checkpoint_dir}'") + + return ckpt_files + + +def get_optim_files(checkpoint_dir): + return get_checkpoint_files(checkpoint_dir, "*_optim_states.pt") + + +def get_model_state_files(checkpoint_dir): + return get_checkpoint_files(checkpoint_dir, "*_model_states.pt") + + +def parse_model_states(files): + zero_model_states = [] + for file in files: + state_dict = torch.load(file, map_location=device, weights_only=False) + + if BUFFER_NAMES not in state_dict: + raise ValueError(f"{file} is not a model state checkpoint") + buffer_names = state_dict[BUFFER_NAMES] + if debug: + print("Found buffers:", buffer_names) + + # recover just the buffers while restoring them to fp32 if they were saved in fp16 + buffers = {k: v.float() for k, v in state_dict["module"].items() if k in buffer_names} + param_shapes = state_dict[PARAM_SHAPES] + + # collect parameters that are included in param_shapes + param_names = [] + for s in param_shapes: + for name in s.keys(): + param_names.append(name) + + # update with frozen parameters + frozen_param_shapes = state_dict.get(FROZEN_PARAM_SHAPES, None) + if frozen_param_shapes is not None: + if debug: + print(f"Found frozen_param_shapes: {frozen_param_shapes}") + param_names += list(frozen_param_shapes.keys()) + + # handle shared params + shared_params = [[k, v] for k, v in state_dict["shared_params"].items()] + + ds_version = state_dict.get(DS_VERSION, None) + + frozen_param_fragments = state_dict.get(FROZEN_PARAM_FRAGMENTS, None) + + z_model_state = zero_model_state(buffers=buffers, + param_shapes=param_shapes, + shared_params=shared_params, + ds_version=ds_version, + frozen_param_shapes=frozen_param_shapes, + frozen_param_fragments=frozen_param_fragments) + zero_model_states.append(z_model_state) + + return zero_model_states + + +def parse_optim_states(files, ds_checkpoint_dir): + total_files = len(files) + state_dicts = [] + for f in tqdm(files, desc='Loading checkpoint shards'): + state_dict = torch.load(f, map_location=device, mmap=True, weights_only=False) + # immediately discard the potentially huge 2 optimizer states as we only care for fp32 master weights + # and also handle the case where it was already removed by another helper script + state_dict["optimizer_state_dict"].pop("optimizer_state_dict", None) + state_dicts.append(state_dict) + + if not ZERO_STAGE in state_dicts[0][OPTIMIZER_STATE_DICT]: + raise ValueError(f"{files[0]} is not a zero checkpoint") + zero_stage = state_dicts[0][OPTIMIZER_STATE_DICT][ZERO_STAGE] + world_size = state_dicts[0][OPTIMIZER_STATE_DICT][PARTITION_COUNT] + + # For ZeRO-2 each param group can have different partition_count as data parallelism for expert + # parameters can be different from data parallelism for non-expert parameters. So we can just + # use the max of the partition_count to get the dp world_size. + + if type(world_size) is list: + world_size = max(world_size) + + if world_size != total_files: + raise ValueError( + f"Expected {world_size} of '*_optim_states.pt' under '{ds_checkpoint_dir}' but found {total_files} files. " + "Possibly due to an overwrite of an old checkpoint, or a checkpoint didn't get saved by one or more processes." + ) + + # the groups are named differently in each stage + if zero_stage <= 2: + fp32_groups_key = SINGLE_PARTITION_OF_FP32_GROUPS + elif zero_stage == 3: + fp32_groups_key = FP32_FLAT_GROUPS + else: + raise ValueError(f"unknown zero stage {zero_stage}") + + fp32_flat_groups = [state_dicts[i][OPTIMIZER_STATE_DICT][fp32_groups_key] for i in range(len(state_dicts))] + return zero_stage, world_size, fp32_flat_groups + + +def _get_fp32_state_dict_from_zero_checkpoint(ds_checkpoint_dir, exclude_frozen_parameters): + """ + Returns fp32 state_dict reconstructed from ds checkpoint + + Args: + - ``ds_checkpoint_dir``: path to the deepspeed checkpoint folder (where the optimizer files are) + + """ + print(f"Processing zero checkpoint '{ds_checkpoint_dir}'") + + optim_files = get_optim_files(ds_checkpoint_dir) + zero_stage, world_size, fp32_flat_groups = parse_optim_states(optim_files, ds_checkpoint_dir) + print(f"Detected checkpoint of type zero stage {zero_stage}, world_size: {world_size}") + + model_files = get_model_state_files(ds_checkpoint_dir) + + zero_model_states = parse_model_states(model_files) + print(f'Parsing checkpoint created by deepspeed=={zero_model_states[0].ds_version}') + + if zero_stage <= 2: + return _get_fp32_state_dict_from_zero2_checkpoint(world_size, fp32_flat_groups, zero_model_states, + exclude_frozen_parameters) + elif zero_stage == 3: + return _get_fp32_state_dict_from_zero3_checkpoint(world_size, fp32_flat_groups, zero_model_states, + exclude_frozen_parameters) + + +def _zero2_merge_frozen_params(state_dict, zero_model_states): + if zero_model_states[0].frozen_param_shapes is None or len(zero_model_states[0].frozen_param_shapes) == 0: + return + + frozen_param_shapes = zero_model_states[0].frozen_param_shapes + frozen_param_fragments = zero_model_states[0].frozen_param_fragments + + if debug: + num_elem = sum(s.numel() for s in frozen_param_shapes.values()) + print(f'rank 0: {FROZEN_PARAM_SHAPES}.numel = {num_elem}') + + wanted_params = len(frozen_param_shapes) + wanted_numel = sum(s.numel() for s in frozen_param_shapes.values()) + avail_numel = sum([p.numel() for p in frozen_param_fragments.values()]) + print(f'Frozen params: Have {avail_numel} numels to process.') + print(f'Frozen params: Need {wanted_numel} numels in {wanted_params} params') + + total_params = 0 + total_numel = 0 + for name, shape in frozen_param_shapes.items(): + total_params += 1 + unpartitioned_numel = shape.numel() + total_numel += unpartitioned_numel + + state_dict[name] = frozen_param_fragments[name] + + if debug: + print(f"{name} full shape: {shape} unpartitioned numel {unpartitioned_numel} ") + + print(f"Reconstructed Frozen fp32 state dict with {total_params} params {total_numel} elements") + + +def _has_callable(obj, fn): + attr = getattr(obj, fn, None) + return callable(attr) + + +def _zero2_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states): + param_shapes = zero_model_states[0].param_shapes + + # Reconstruction protocol: + # + # XXX: document this + + if debug: + for i in range(world_size): + for j in range(len(fp32_flat_groups[0])): + print(f"{FP32_FLAT_GROUPS}[{i}][{j}].shape={fp32_flat_groups[i][j].shape}") + + # XXX: memory usage doubles here (zero2) + num_param_groups = len(fp32_flat_groups[0]) + merged_single_partition_of_fp32_groups = [] + for i in range(num_param_groups): + merged_partitions = [sd[i] for sd in fp32_flat_groups] + full_single_fp32_vector = torch.cat(merged_partitions, 0) + merged_single_partition_of_fp32_groups.append(full_single_fp32_vector) + avail_numel = sum( + [full_single_fp32_vector.numel() for full_single_fp32_vector in merged_single_partition_of_fp32_groups]) + + if debug: + wanted_params = sum([len(shapes) for shapes in param_shapes]) + wanted_numel = sum([sum(shape.numel() for shape in shapes.values()) for shapes in param_shapes]) + # not asserting if there is a mismatch due to possible padding + print(f"Have {avail_numel} numels to process.") + print(f"Need {wanted_numel} numels in {wanted_params} params.") + + # params + # XXX: for huge models that can't fit into the host's RAM we will have to recode this to support + # out-of-core computing solution + total_numel = 0 + total_params = 0 + for shapes, full_single_fp32_vector in zip(param_shapes, merged_single_partition_of_fp32_groups): + offset = 0 + avail_numel = full_single_fp32_vector.numel() + for name, shape in shapes.items(): + + unpartitioned_numel = shape.numel() if _has_callable(shape, 'numel') else math.prod(shape) + total_numel += unpartitioned_numel + total_params += 1 + + if debug: + print(f"{name} full shape: {shape} unpartitioned numel {unpartitioned_numel} ") + state_dict[name] = full_single_fp32_vector.narrow(0, offset, unpartitioned_numel).view(shape) + offset += unpartitioned_numel + + # Z2 started to align to 2*world_size to improve nccl performance. Therefore both offset and + # avail_numel can differ by anywhere between 0..2*world_size. Due to two unrelated complex + # paddings performed in the code it's almost impossible to predict the exact numbers w/o the + # live optimizer object, so we are checking that the numbers are within the right range + align_to = 2 * world_size + + def zero2_align(x): + return align_to * math.ceil(x / align_to) + + if debug: + print(f"original offset={offset}, avail_numel={avail_numel}") + + offset = zero2_align(offset) + avail_numel = zero2_align(avail_numel) + + if debug: + print(f"aligned offset={offset}, avail_numel={avail_numel}") + + # Sanity check + if offset != avail_numel: + raise ValueError(f"consumed {offset} numels out of {avail_numel} - something is wrong") + + print(f"Reconstructed fp32 state dict with {total_params} params {total_numel} elements") + + +def _get_fp32_state_dict_from_zero2_checkpoint(world_size, fp32_flat_groups, zero_model_states, + exclude_frozen_parameters): + state_dict = OrderedDict() + + # buffers + buffers = zero_model_states[0].buffers + state_dict.update(buffers) + if debug: + print(f"added {len(buffers)} buffers") + + if not exclude_frozen_parameters: + _zero2_merge_frozen_params(state_dict, zero_model_states) + + _zero2_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states) + + # recover shared parameters + for pair in zero_model_states[0].shared_params: + if pair[1] in state_dict: + state_dict[pair[0]] = state_dict[pair[1]] + + return state_dict + + +def zero3_partitioned_param_info(unpartitioned_numel, world_size): + remainder = unpartitioned_numel % world_size + padding_numel = (world_size - remainder) if remainder else 0 + partitioned_numel = math.ceil(unpartitioned_numel / world_size) + return partitioned_numel, padding_numel + + +def _zero3_merge_frozen_params(state_dict, world_size, zero_model_states): + if zero_model_states[0].frozen_param_shapes is None or len(zero_model_states[0].frozen_param_shapes) == 0: + return + + if debug: + for i in range(world_size): + num_elem = sum(s.numel() for s in zero_model_states[i].frozen_param_fragments.values()) + print(f'rank {i}: {FROZEN_PARAM_SHAPES}.numel = {num_elem}') + + frozen_param_shapes = zero_model_states[0].frozen_param_shapes + wanted_params = len(frozen_param_shapes) + wanted_numel = sum(s.numel() for s in frozen_param_shapes.values()) + avail_numel = sum([p.numel() for p in zero_model_states[0].frozen_param_fragments.values()]) * world_size + print(f'Frozen params: Have {avail_numel} numels to process.') + print(f'Frozen params: Need {wanted_numel} numels in {wanted_params} params') + + total_params = 0 + total_numel = 0 + for name, shape in zero_model_states[0].frozen_param_shapes.items(): + total_params += 1 + unpartitioned_numel = shape.numel() + total_numel += unpartitioned_numel + + param_frags = tuple(model_state.frozen_param_fragments[name] for model_state in zero_model_states) + state_dict[name] = torch.cat(param_frags, 0).narrow(0, 0, unpartitioned_numel).view(shape) + + partitioned_numel, partitioned_padding_numel = zero3_partitioned_param_info(unpartitioned_numel, world_size) + + if debug: + print( + f"Frozen params: {total_params} {name} full shape: {shape} partition0 numel={partitioned_numel} partitioned_padding_numel={partitioned_padding_numel}" + ) + + print(f"Reconstructed Frozen fp32 state dict with {total_params} params {total_numel} elements") + + +class GatheredTensor: + """ + A pseudo tensor that collects partitioned weights. + It is more memory efficient when there are multiple groups. + """ + + def __init__(self, flat_groups, flat_groups_offset, offset, partitioned_numel, shape): + self.flat_groups = flat_groups + self.flat_groups_offset = flat_groups_offset + self.offset = offset + self.partitioned_numel = partitioned_numel + self.shape = shape + self.dtype = self.flat_groups[0][0].dtype + + def contiguous(self): + """ + Merge partitioned weights from flat_groups into a single tensor. + """ + end_idx = self.offset + self.partitioned_numel + world_size = len(self.flat_groups) + pad_flat_param_chunks = [] + + for rank_i in range(world_size): + # for each rank, we need to collect weights from related group/groups + flat_groups_at_rank_i = self.flat_groups[rank_i] + start_group_id = None + end_group_id = None + for group_id in range(len(self.flat_groups_offset)): + if self.flat_groups_offset[group_id] <= self.offset < self.flat_groups_offset[group_id + 1]: + start_group_id = group_id + if self.flat_groups_offset[group_id] < end_idx <= self.flat_groups_offset[group_id + 1]: + end_group_id = group_id + break + # collect weights from related group/groups + for group_id in range(start_group_id, end_group_id + 1): + flat_tensor = flat_groups_at_rank_i[group_id] + start_offset = self.offset - self.flat_groups_offset[group_id] + end_offset = min(end_idx, self.flat_groups_offset[group_id + 1]) - self.flat_groups_offset[group_id] + pad_flat_param_chunks.append(flat_tensor[start_offset:end_offset]) + + # collect weights from all ranks + pad_flat_param = torch.cat(pad_flat_param_chunks, dim=0) + param = pad_flat_param[:self.shape.numel()].view(self.shape).contiguous() + return param + + +def _zero3_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states): + param_shapes = zero_model_states[0].param_shapes + avail_numel = sum([flat_group.numel() for flat_group in fp32_flat_groups[0]]) * world_size + + # Reconstruction protocol: For zero3 we need to zip the partitions together at boundary of each + # param, re-consolidating each param, while dealing with padding if any + + # merge list of dicts, preserving order + param_shapes = {k: v for d in param_shapes for k, v in d.items()} + + if debug: + for i in range(world_size): + print(f"{FP32_FLAT_GROUPS}[{i}].shape={fp32_flat_groups[i].shape}") + + wanted_params = len(param_shapes) + wanted_numel = sum(shape.numel() for shape in param_shapes.values()) + # not asserting if there is a mismatch due to possible padding + avail_numel = fp32_flat_groups[0].numel() * world_size + print(f"Trainable params: Have {avail_numel} numels to process.") + print(f"Trainable params: Need {wanted_numel} numels in {wanted_params} params.") + + # params + # XXX: for huge models that can't fit into the host's RAM we will have to recode this to support + # out-of-core computing solution + offset = 0 + total_numel = 0 + total_params = 0 + flat_groups_offset = [0] + list(np.cumsum([flat_tensor.numel() for flat_tensor in fp32_flat_groups[0]])) + for name, shape in tqdm(param_shapes.items(), desc='Gathering sharded weights'): + unpartitioned_numel = shape.numel() + total_numel += unpartitioned_numel + total_params += 1 + partitioned_numel, partitioned_padding_numel = zero3_partitioned_param_info(unpartitioned_numel, world_size) + + if debug: + print( + f"Trainable params: {total_params} {name} full shape: {shape} partition0 numel={partitioned_numel} partitioned_padding_numel={partitioned_padding_numel}" + ) + + # memory efficient tensor + tensor = GatheredTensor(fp32_flat_groups, flat_groups_offset, offset, partitioned_numel, shape) + state_dict[name] = tensor + offset += partitioned_numel + + offset *= world_size + + # Sanity check + if offset != avail_numel: + raise ValueError(f"consumed {offset} numels out of {avail_numel} - something is wrong") + + print(f"Reconstructed Trainable fp32 state dict with {total_params} params {total_numel} elements") + + +def _get_fp32_state_dict_from_zero3_checkpoint(world_size, fp32_flat_groups, zero_model_states, + exclude_frozen_parameters): + state_dict = OrderedDict() + + # buffers + buffers = zero_model_states[0].buffers + state_dict.update(buffers) + if debug: + print(f"added {len(buffers)} buffers") + + if not exclude_frozen_parameters: + _zero3_merge_frozen_params(state_dict, world_size, zero_model_states) + + _zero3_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states) + + # recover shared parameters + for pair in zero_model_states[0].shared_params: + if pair[1] in state_dict: + state_dict[pair[0]] = state_dict[pair[1]] + + return state_dict + + +def to_torch_tensor(state_dict, return_empty_tensor=False): + """ + Convert state_dict of GatheredTensor to torch tensor + """ + torch_state_dict = {} + converted_tensors = {} + for name, tensor in state_dict.items(): + tensor_id = id(tensor) + if tensor_id in converted_tensors: # shared tensors + shared_tensor = torch_state_dict[converted_tensors[tensor_id]] + torch_state_dict[name] = shared_tensor + else: + converted_tensors[tensor_id] = name + if return_empty_tensor: + torch_state_dict[name] = torch.empty(tensor.shape, dtype=tensor.dtype) + else: + torch_state_dict[name] = tensor.contiguous() + return torch_state_dict + + +def get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir, + tag=None, + exclude_frozen_parameters=False, + lazy_mode=False): + """ + Convert ZeRO 2 or 3 checkpoint into a single fp32 consolidated state_dict that can be loaded with + ``load_state_dict()`` and used for training without DeepSpeed or shared with others, for example + via a model hub. + + Args: + - ``checkpoint_dir``: path to the desired checkpoint folder + - ``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`` + - ``exclude_frozen_parameters``: exclude frozen parameters + - ``lazy_mode``: get state_dict in lazy mode. It returns a dict of pesduo tensor instead of torch tensor, which is more memory efficient. + Convert the pesduo tensor to torch tensor by ``.contiguous()`` + + Returns: + - pytorch ``state_dict`` + + A typical usage might be :: + + from deepspeed.utils.zero_to_fp32 import get_fp32_state_dict_from_zero_checkpoint + # do the training and checkpoint saving + state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir) # already on cpu + model = model.cpu() # move to cpu + model.load_state_dict(state_dict) + # submit to model hub or save the model to share with others + + In this example the ``model`` will no longer be usable in the deepspeed context of the same + application. i.e. you will need to re-initialize the deepspeed engine, since + ``model.load_state_dict(state_dict)`` will remove all the deepspeed magic from it. + + If you want it all done for you, use ``load_state_dict_from_zero_checkpoint`` instead. + + Note: the above usage may not work if your application doesn't have sufficient free CPU memory. + You may need to use the offline approach using the ``zero_to_fp32.py`` script that is saved with + the checkpoint. Or you can load state_dict in lazy mode :: + + from deepspeed.utils.zero_to_fp32 import get_fp32_state_dict_from_zero_checkpoint + state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir, lazy_mode=True) # not on cpu + for name, lazy_tensor in state_dict.item(): + tensor = lazy_tensor.contiguous() # to cpu + print(name, tensor) + # del tensor to release memory if it no longer in use + """ + if tag is None: + latest_path = os.path.join(checkpoint_dir, 'latest') + if os.path.isfile(latest_path): + with open(latest_path, 'r') as fd: + tag = fd.read().strip() + else: + raise ValueError(f"Unable to find 'latest' file at {latest_path}") + + ds_checkpoint_dir = os.path.join(checkpoint_dir, tag) + + if not os.path.isdir(ds_checkpoint_dir): + raise FileNotFoundError(f"Directory '{ds_checkpoint_dir}' doesn't exist") + + state_dict = _get_fp32_state_dict_from_zero_checkpoint(ds_checkpoint_dir, exclude_frozen_parameters) + if lazy_mode: + return state_dict + else: + return to_torch_tensor(state_dict) + + +def convert_zero_checkpoint_to_fp32_state_dict(checkpoint_dir, + output_dir, + max_shard_size="5GB", + safe_serialization=False, + tag=None, + exclude_frozen_parameters=False): + """ + Convert ZeRO 2 or 3 checkpoint into a single fp32 consolidated ``state_dict`` file that can be + loaded with ``torch.load(file)`` + ``load_state_dict()`` and used for training without DeepSpeed. + + Args: + - ``checkpoint_dir``: path to the desired checkpoint folder. (one that contains the tag-folder, like ``global_step14``) + - ``output_dir``: directory to the pytorch fp32 state_dict output files + - ``max_shard_size``: the maximum size for a checkpoint before being sharded, default value is 5GB + - ``safe_serialization``: whether to save the model using `safetensors` or the traditional PyTorch way (that uses `pickle`). + - ``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`` + - ``exclude_frozen_parameters``: exclude frozen parameters + """ + + # Dependency pre-check + if safe_serialization: + try: + from safetensors.torch import save_file + except ImportError: + print('If you want to use `safe_serialization`, please `pip install safetensors`') + raise + if max_shard_size is not None: + try: + from huggingface_hub import split_torch_state_dict_into_shards + except ImportError: + print('If you want to use `max_shard_size`, please `pip install huggingface_hub`') + raise + + # Convert zero checkpoint to state_dict + state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir, + tag, + exclude_frozen_parameters, + lazy_mode=True) + + # Shard the model if it is too big. + weights_name = "model.safetensors" if safe_serialization else "pytorch_model.bin" + if max_shard_size is not None: + filename_pattern = weights_name.replace(".bin", "{suffix}.bin").replace(".safetensors", "{suffix}.safetensors") + # an memory-efficient approach for sharding + empty_state_dict = to_torch_tensor(state_dict, return_empty_tensor=True) + state_dict_split = split_torch_state_dict_into_shards(empty_state_dict, + filename_pattern=filename_pattern, + max_shard_size=max_shard_size) + else: + from collections import namedtuple + StateDictSplit = namedtuple("StateDictSplit", ["is_sharded", "filename_to_tensors"]) + state_dict_split = StateDictSplit(is_sharded=False, + filename_to_tensors={weights_name: list(state_dict.keys())}) + + # Save the model by shard + os.makedirs(output_dir, exist_ok=True) + filename_to_tensors = state_dict_split.filename_to_tensors.items() + for shard_file, tensors in tqdm(filename_to_tensors, desc="Saving checkpoint shards"): + shard_state_dict = {tensor_name: state_dict[tensor_name] for tensor_name in tensors} + shard_state_dict = to_torch_tensor(shard_state_dict) + output_path = os.path.join(output_dir, shard_file) + if safe_serialization: + save_file(shard_state_dict, output_path, metadata={"format": "pt"}) + else: + torch.save(shard_state_dict, output_path) + # release the memory of current shard + for tensor_name in list(shard_state_dict.keys()): + del state_dict[tensor_name] + del shard_state_dict[tensor_name] + del shard_state_dict + gc.collect() + + # Save index if sharded + if state_dict_split.is_sharded: + index = { + "metadata": state_dict_split.metadata, + "weight_map": state_dict_split.tensor_to_filename, + } + save_index_file = "model.safetensors.index.json" if safe_serialization else "pytorch_model.bin.index.json" + save_index_file = os.path.join(output_dir, save_index_file) + with open(save_index_file, "w", encoding="utf-8") as f: + content = json.dumps(index, indent=2, sort_keys=True) + "\n" + f.write(content) + + +def load_state_dict_from_zero_checkpoint(model, checkpoint_dir, tag=None): + """ + 1. Put the provided model to cpu + 2. Convert ZeRO 2 or 3 checkpoint into a single fp32 consolidated ``state_dict`` + 3. Load it into the provided model + + Args: + - ``model``: the model object to update + - ``checkpoint_dir``: path to the desired checkpoint folder. (one that contains the tag-folder, like ``global_step14``) + - ``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`` + + Returns: + - ``model`: modified model + + Make sure you have plenty of CPU memory available before you call this function. If you don't + have enough use the ``zero_to_fp32.py`` utility to do the conversion. You will find it + conveniently placed for you in the checkpoint folder. + + A typical usage might be :: + + from deepspeed.utils.zero_to_fp32 import load_state_dict_from_zero_checkpoint + model = load_state_dict_from_zero_checkpoint(trainer.model, checkpoint_dir) + # submit to model hub or save the model to share with others + + Note, that once this was run, the ``model`` will no longer be usable in the deepspeed context + of the same application. i.e. you will need to re-initialize the deepspeed engine, since + ``model.load_state_dict(state_dict)`` will remove all the deepspeed magic from it. + + """ + logger.info(f"Extracting fp32 weights") + state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir, tag) + + logger.info(f"Overwriting model with fp32 weights") + model = model.cpu() + model.load_state_dict(state_dict, strict=False) + + return model + + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + parser.add_argument("checkpoint_dir", + type=str, + help="path to the desired checkpoint folder, e.g., path/checkpoint-12") + parser.add_argument("output_dir", + type=str, + help="directory to the pytorch fp32 state_dict output files" + "(e.g. path/checkpoint-12-output/)") + parser.add_argument( + "--max_shard_size", + type=str, + default="5GB", + help="The maximum size for a checkpoint before being sharded. Checkpoints shard will then be each of size" + "lower than this size. If expressed as a string, needs to be digits followed by a unit (like `5MB`" + "We default it to 5GB in order for models to be able to run easily on free-tier google colab instances" + "without CPU OOM issues.") + parser.add_argument( + "--safe_serialization", + default=False, + action='store_true', + help="Whether to save the model using `safetensors` or the traditional PyTorch way (that uses `pickle`).") + parser.add_argument("-t", + "--tag", + type=str, + default=None, + help="checkpoint tag used as a unique identifier for checkpoint. e.g., global_step1") + parser.add_argument("--exclude_frozen_parameters", action='store_true', help="exclude frozen parameters") + parser.add_argument("-d", "--debug", action='store_true', help="enable debug") + args = parser.parse_args() + + debug = args.debug + + convert_zero_checkpoint_to_fp32_state_dict(args.checkpoint_dir, + args.output_dir, + max_shard_size=args.max_shard_size, + safe_serialization=args.safe_serialization, + tag=args.tag, + exclude_frozen_parameters=args.exclude_frozen_parameters)