初始化项目,由ModelHub XC社区提供模型

Model: cjiao/OpenThoughts3-random-groups-openthinker3-1.5B-checkpoint-375-80
Source: Original Platform
This commit is contained in:
ModelHub XC
2026-04-28 10:59:02 +08:00
commit 665c0870aa
49 changed files with 459545 additions and 0 deletions

40
.gitattributes vendored Normal file
View File

@@ -0,0 +1,40 @@
*.7z filter=lfs diff=lfs merge=lfs -text
*.arrow filter=lfs diff=lfs merge=lfs -text
*.bin filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.ckpt filter=lfs diff=lfs merge=lfs -text
*.ftz filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.h5 filter=lfs diff=lfs merge=lfs -text
*.joblib filter=lfs diff=lfs merge=lfs -text
*.lfs.* filter=lfs diff=lfs merge=lfs -text
*.mlmodel filter=lfs diff=lfs merge=lfs -text
*.model filter=lfs diff=lfs merge=lfs -text
*.msgpack filter=lfs diff=lfs merge=lfs -text
*.npy filter=lfs diff=lfs merge=lfs -text
*.npz filter=lfs diff=lfs merge=lfs -text
*.onnx filter=lfs diff=lfs merge=lfs -text
*.ot filter=lfs diff=lfs merge=lfs -text
*.parquet filter=lfs diff=lfs merge=lfs -text
*.pb filter=lfs diff=lfs merge=lfs -text
*.pickle filter=lfs diff=lfs merge=lfs -text
*.pkl filter=lfs diff=lfs merge=lfs -text
*.pt filter=lfs diff=lfs merge=lfs -text
*.pth filter=lfs diff=lfs merge=lfs -text
*.rar filter=lfs diff=lfs merge=lfs -text
*.safetensors filter=lfs diff=lfs merge=lfs -text
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
*.tar.* filter=lfs diff=lfs merge=lfs -text
*.tar filter=lfs diff=lfs merge=lfs -text
*.tflite filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.wasm filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text
*tfevents* filter=lfs diff=lfs merge=lfs -text
tokenizer.json filter=lfs diff=lfs merge=lfs -text
checkpoint-40/tokenizer.json filter=lfs diff=lfs merge=lfs -text
checkpoint-80/tokenizer.json filter=lfs diff=lfs merge=lfs -text
checkpoint-120/tokenizer.json filter=lfs diff=lfs merge=lfs -text
checkpoint-160/tokenizer.json filter=lfs diff=lfs merge=lfs -text

59
README.md Normal file
View File

@@ -0,0 +1,59 @@
---
library_name: transformers
base_model: cjiao/OpenThinker3-1.5B-checkpoint-375
tags:
- llama-factory
- full
- generated_from_trainer
model-index:
- name: OpenThoughts3-random-groups-openthinker3-1.5B-checkpoint-375-80
results: []
---
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
should probably proofread and complete it, then remove this comment. -->
# OpenThoughts3-random-groups-openthinker3-1.5B-checkpoint-375-80
This model is a fine-tuned version of [cjiao/OpenThinker3-1.5B-checkpoint-375](https://huggingface.co/cjiao/OpenThinker3-1.5B-checkpoint-375) on the cjiao/OpenThoughts3-random-groups-openthinker3-1.5B-checkpoint-375-80 dataset.
## Model description
More information needed
## Intended uses & limitations
More information needed
## Training and evaluation data
More information needed
## Training procedure
### Training hyperparameters
The following hyperparameters were used during training:
- learning_rate: 0.00016
- train_batch_size: 8
- eval_batch_size: 8
- seed: 42
- distributed_type: multi-GPU
- num_devices: 2
- gradient_accumulation_steps: 16
- total_train_batch_size: 256
- total_eval_batch_size: 16
- optimizer: Use adamw_torch with betas=(0.9,0.999) and epsilon=1e-08 and optimizer_args=No additional optimizer arguments
- lr_scheduler_type: cosine
- num_epochs: 2
### Training results
### Framework versions
- Transformers 4.46.1
- Pytorch 2.5.1+cu121
- Datasets 3.1.0
- Tokenizers 0.20.3

24
added_tokens.json Normal file
View File

@@ -0,0 +1,24 @@
{
"</tool_call>": 151658,
"<tool_call>": 151657,
"<|box_end|>": 151649,
"<|box_start|>": 151648,
"<|endoftext|>": 151643,
"<|file_sep|>": 151664,
"<|fim_middle|>": 151660,
"<|fim_pad|>": 151662,
"<|fim_prefix|>": 151659,
"<|fim_suffix|>": 151661,
"<|im_end|>": 151645,
"<|im_start|>": 151644,
"<|image_pad|>": 151655,
"<|object_ref_end|>": 151647,
"<|object_ref_start|>": 151646,
"<|quad_end|>": 151651,
"<|quad_start|>": 151650,
"<|repo_name|>": 151663,
"<|video_pad|>": 151656,
"<|vision_end|>": 151653,
"<|vision_pad|>": 151654,
"<|vision_start|>": 151652
}

8
all_results.json Normal file
View File

@@ -0,0 +1,8 @@
{
"epoch": 2.0,
"total_flos": 5.276128179356959e+18,
"train_loss": 0.8005891665816307,
"train_runtime": 11560.7477,
"train_samples_per_second": 3.543,
"train_steps_per_second": 0.014
}

View File

@@ -0,0 +1,24 @@
{
"</tool_call>": 151658,
"<tool_call>": 151657,
"<|box_end|>": 151649,
"<|box_start|>": 151648,
"<|endoftext|>": 151643,
"<|file_sep|>": 151664,
"<|fim_middle|>": 151660,
"<|fim_pad|>": 151662,
"<|fim_prefix|>": 151659,
"<|fim_suffix|>": 151661,
"<|im_end|>": 151645,
"<|im_start|>": 151644,
"<|image_pad|>": 151655,
"<|object_ref_end|>": 151647,
"<|object_ref_start|>": 151646,
"<|quad_end|>": 151651,
"<|quad_start|>": 151650,
"<|repo_name|>": 151663,
"<|video_pad|>": 151656,
"<|vision_end|>": 151653,
"<|vision_pad|>": 151654,
"<|vision_start|>": 151652
}

View File

@@ -0,0 +1,29 @@
{
"_name_or_path": "cjiao/OpenThinker3-1.5B-checkpoint-375",
"architectures": [
"Qwen2ForCausalLM"
],
"attention_dropout": 0.0,
"bos_token_id": 151643,
"eos_token_id": 151645,
"hidden_act": "silu",
"hidden_size": 1536,
"initializer_range": 0.02,
"intermediate_size": 8960,
"max_position_embeddings": 32768,
"max_window_layers": 21,
"model_type": "qwen2",
"num_attention_heads": 12,
"num_hidden_layers": 28,
"num_key_value_heads": 2,
"rms_norm_eps": 1e-06,
"rope_scaling": null,
"rope_theta": 1000000.0,
"sliding_window": null,
"tie_word_embeddings": true,
"torch_dtype": "bfloat16",
"transformers_version": "4.46.1",
"use_cache": false,
"use_sliding_window": false,
"vocab_size": 151936
}

View File

@@ -0,0 +1,14 @@
{
"bos_token_id": 151643,
"do_sample": true,
"eos_token_id": [
151645,
151643
],
"pad_token_id": 151643,
"repetition_penalty": 1.1,
"temperature": 0.7,
"top_k": 20,
"top_p": 0.8,
"transformers_version": "4.46.1"
}

1
checkpoint-160/latest Normal file
View File

@@ -0,0 +1 @@
global_step160

151388
checkpoint-160/merges.txt Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:5937a541c0f8e227816f6c52870fa6691a0c474738d13d246134687d34cf9a86
size 3554214752

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:6cb795a5cea0baa625c50007a6c9da09c6bbb5c16b560424070384a479e7d8a6
size 14512

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:5f19604377bd828eb366c68946ad997a4ff4d69beaeea93ee58915135768ec63
size 14512

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:81840462e3eb8e8bcc49afa617b486d91b996085dcc34d62b25a6c4c0c39458f
size 1064

View File

@@ -0,0 +1,31 @@
{
"additional_special_tokens": [
"<|im_start|>",
"<|im_end|>",
"<|object_ref_start|>",
"<|object_ref_end|>",
"<|box_start|>",
"<|box_end|>",
"<|quad_start|>",
"<|quad_end|>",
"<|vision_start|>",
"<|vision_end|>",
"<|vision_pad|>",
"<|image_pad|>",
"<|video_pad|>"
],
"eos_token": {
"content": "<|endoftext|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false
},
"pad_token": {
"content": "<|endoftext|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false
}
}

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:9c5ae00e602b8860cbd784ba82a8aa14e8feecec692e7076590d014d7b7fdafa
size 11421896

View File

@@ -0,0 +1,208 @@
{
"add_bos_token": false,
"add_prefix_space": false,
"added_tokens_decoder": {
"151643": {
"content": "<|endoftext|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151644": {
"content": "<|im_start|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151645": {
"content": "<|im_end|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151646": {
"content": "<|object_ref_start|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151647": {
"content": "<|object_ref_end|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151648": {
"content": "<|box_start|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151649": {
"content": "<|box_end|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151650": {
"content": "<|quad_start|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151651": {
"content": "<|quad_end|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151652": {
"content": "<|vision_start|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151653": {
"content": "<|vision_end|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151654": {
"content": "<|vision_pad|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151655": {
"content": "<|image_pad|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151656": {
"content": "<|video_pad|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151657": {
"content": "<tool_call>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
},
"151658": {
"content": "</tool_call>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
},
"151659": {
"content": "<|fim_prefix|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
},
"151660": {
"content": "<|fim_middle|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
},
"151661": {
"content": "<|fim_suffix|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
},
"151662": {
"content": "<|fim_pad|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
},
"151663": {
"content": "<|repo_name|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
},
"151664": {
"content": "<|file_sep|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
}
},
"additional_special_tokens": [
"<|im_start|>",
"<|im_end|>",
"<|object_ref_start|>",
"<|object_ref_end|>",
"<|box_start|>",
"<|box_end|>",
"<|quad_start|>",
"<|quad_end|>",
"<|vision_start|>",
"<|vision_end|>",
"<|vision_pad|>",
"<|image_pad|>",
"<|video_pad|>"
],
"bos_token": null,
"chat_template": "{%- if tools %}\n {{- '<|im_start|>system\\n' }}\n {%- if messages[0]['role'] == 'system' %}\n {{- messages[0]['content'] }}\n {%- else %}\n {{- 'You are Qwen, created by Alibaba Cloud. You are a helpful assistant.' }}\n {%- endif %}\n {{- \"\\n\\n# Tools\\n\\nYou may call one or more functions to assist with the user query.\\n\\nYou are provided with function signatures within <tools></tools> XML tags:\\n<tools>\" }}\n {%- for tool in tools %}\n {{- \"\\n\" }}\n {{- tool | tojson }}\n {%- endfor %}\n {{- \"\\n</tools>\\n\\nFor each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:\\n<tool_call>\\n{\\\"name\\\": <function-name>, \\\"arguments\\\": <args-json-object>}\\n</tool_call><|im_end|>\\n\" }}\n{%- else %}\n {%- if messages[0]['role'] == 'system' %}\n {{- '<|im_start|>system\\n' + messages[0]['content'] + '<|im_end|>\\n' }}\n {%- else %}\n {{- '<|im_start|>system\\nYou are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>\\n' }}\n {%- endif %}\n{%- endif %}\n{%- for message in messages %}\n {%- if (message.role == \"user\") or (message.role == \"system\" and not loop.first) or (message.role == \"assistant\" and not message.tool_calls) %}\n {{- '<|im_start|>' + message.role + '\\n' + message.content + '<|im_end|>' + '\\n' }}\n {%- elif message.role == \"assistant\" %}\n {{- '<|im_start|>' + message.role }}\n {%- if message.content %}\n {{- '\\n' + message.content }}\n {%- endif %}\n {%- for tool_call in message.tool_calls %}\n {%- if tool_call.function is defined %}\n {%- set tool_call = tool_call.function %}\n {%- endif %}\n {{- '\\n<tool_call>\\n{\"name\": \"' }}\n {{- tool_call.name }}\n {{- '\", \"arguments\": ' }}\n {{- tool_call.arguments | tojson }}\n {{- '}\\n</tool_call>' }}\n {%- endfor %}\n {{- '<|im_end|>\\n' }}\n {%- elif message.role == \"tool\" %}\n {%- if (loop.index0 == 0) or (messages[loop.index0 - 1].role != \"tool\") %}\n {{- '<|im_start|>user' }}\n {%- endif %}\n {{- '\\n<tool_response>\\n' }}\n {{- message.content }}\n {{- '\\n</tool_response>' }}\n {%- if loop.last or (messages[loop.index0 + 1].role != \"tool\") %}\n {{- '<|im_end|>\\n' }}\n {%- endif %}\n {%- endif %}\n{%- endfor %}\n{%- if add_generation_prompt %}\n {{- '<|im_start|>assistant\\n' }}\n{%- endif %}\n",
"clean_up_tokenization_spaces": false,
"eos_token": "<|endoftext|>",
"errors": "replace",
"model_max_length": 131072,
"pad_token": "<|endoftext|>",
"padding_side": "right",
"split_special_tokens": false,
"tokenizer_class": "Qwen2Tokenizer",
"unk_token": null
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:261cea4c24e8dc936885b356703d1c5fe17a417e1e82b9e59cf2b6b4966e5e42
size 7608

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,604 @@
#!/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 . pytorch_model.bin
import argparse
import torch
import glob
import math
import os
import re
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)
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 files:
state_dict = torch.load(f, map_location=device)
# 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}")
if zero_stage <= 2:
fp32_flat_groups = [state_dicts[i][OPTIMIZER_STATE_DICT][fp32_groups_key] for i in range(len(state_dicts))]
elif zero_stage == 3:
# if there is more than one param group, there will be multiple flattened tensors - one
# flattened tensor per group - for simplicity merge them into a single tensor
#
# XXX: could make the script more memory efficient for when there are multiple groups - it
# will require matching the sub-lists of param_shapes for each param group flattened tensor
fp32_flat_groups = [
torch.cat(state_dicts[i][OPTIMIZER_STATE_DICT][fp32_groups_key], 0) 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")
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 = fp32_flat_groups[0].numel() * 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
for name, shape in param_shapes.items():
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}"
)
# XXX: memory usage doubles here
state_dict[name] = torch.cat(
tuple(fp32_flat_groups[i].narrow(0, offset, partitioned_numel) for i in range(world_size)),
0).narrow(0, 0, unpartitioned_numel).view(shape)
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 get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir, tag=None, exclude_frozen_parameters=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
Returns:
- pytorch ``state_dict``
Note: this approach may not work if your application doesn't have sufficient free CPU memory and
you may need to use the offline approach using the ``zero_to_fp32.py`` script that is saved with
the checkpoint.
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.
"""
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")
return _get_fp32_state_dict_from_zero_checkpoint(ds_checkpoint_dir, exclude_frozen_parameters)
def convert_zero_checkpoint_to_fp32_state_dict(checkpoint_dir, output_file, 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_file``: path to the pytorch fp32 state_dict output file (e.g. path/pytorch_model.bin)
- ``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
"""
state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir, tag, exclude_frozen_parameters)
print(f"Saving fp32 state dict to {output_file}")
torch.save(state_dict, output_file)
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_file",
type=str,
help="path to the pytorch fp32 state_dict output file (e.g. path/checkpoint-12/pytorch_model.bin)")
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_file,
tag=args.tag,
exclude_frozen_parameters=args.exclude_frozen_parameters)

View File

@@ -0,0 +1,24 @@
{
"</tool_call>": 151658,
"<tool_call>": 151657,
"<|box_end|>": 151649,
"<|box_start|>": 151648,
"<|endoftext|>": 151643,
"<|file_sep|>": 151664,
"<|fim_middle|>": 151660,
"<|fim_pad|>": 151662,
"<|fim_prefix|>": 151659,
"<|fim_suffix|>": 151661,
"<|im_end|>": 151645,
"<|im_start|>": 151644,
"<|image_pad|>": 151655,
"<|object_ref_end|>": 151647,
"<|object_ref_start|>": 151646,
"<|quad_end|>": 151651,
"<|quad_start|>": 151650,
"<|repo_name|>": 151663,
"<|video_pad|>": 151656,
"<|vision_end|>": 151653,
"<|vision_pad|>": 151654,
"<|vision_start|>": 151652
}

29
checkpoint-80/config.json Normal file
View File

@@ -0,0 +1,29 @@
{
"_name_or_path": "cjiao/OpenThinker3-1.5B-checkpoint-375",
"architectures": [
"Qwen2ForCausalLM"
],
"attention_dropout": 0.0,
"bos_token_id": 151643,
"eos_token_id": 151645,
"hidden_act": "silu",
"hidden_size": 1536,
"initializer_range": 0.02,
"intermediate_size": 8960,
"max_position_embeddings": 32768,
"max_window_layers": 21,
"model_type": "qwen2",
"num_attention_heads": 12,
"num_hidden_layers": 28,
"num_key_value_heads": 2,
"rms_norm_eps": 1e-06,
"rope_scaling": null,
"rope_theta": 1000000.0,
"sliding_window": null,
"tie_word_embeddings": true,
"torch_dtype": "bfloat16",
"transformers_version": "4.46.1",
"use_cache": false,
"use_sliding_window": false,
"vocab_size": 151936
}

View File

@@ -0,0 +1,14 @@
{
"bos_token_id": 151643,
"do_sample": true,
"eos_token_id": [
151645,
151643
],
"pad_token_id": 151643,
"repetition_penalty": 1.1,
"temperature": 0.7,
"top_k": 20,
"top_p": 0.8,
"transformers_version": "4.46.1"
}

1
checkpoint-80/latest Normal file
View File

@@ -0,0 +1 @@
global_step80

151388
checkpoint-80/merges.txt Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:26103af48b9aa6df37331ec9d7e472d616302444e99b05e0bb1bed5b2676f9de
size 3554214752

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:c8d6a959372d5e0c2ea025dd26c9d0ad2046fce19352056cae8074dcbd0a6fd4
size 14512

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:0f68a37892a1b445d21bb35cc10bf7a058a6f9ec8c363f5ed156ff4f49d90fb6
size 14512

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:0f9f10df8b6d8113344020321994ff3d1b3099ac3f664d30e8fddd4dc54db8ad
size 1064

View File

@@ -0,0 +1,31 @@
{
"additional_special_tokens": [
"<|im_start|>",
"<|im_end|>",
"<|object_ref_start|>",
"<|object_ref_end|>",
"<|box_start|>",
"<|box_end|>",
"<|quad_start|>",
"<|quad_end|>",
"<|vision_start|>",
"<|vision_end|>",
"<|vision_pad|>",
"<|image_pad|>",
"<|video_pad|>"
],
"eos_token": {
"content": "<|endoftext|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false
},
"pad_token": {
"content": "<|endoftext|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false
}
}

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:9c5ae00e602b8860cbd784ba82a8aa14e8feecec692e7076590d014d7b7fdafa
size 11421896

View File

@@ -0,0 +1,208 @@
{
"add_bos_token": false,
"add_prefix_space": false,
"added_tokens_decoder": {
"151643": {
"content": "<|endoftext|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151644": {
"content": "<|im_start|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151645": {
"content": "<|im_end|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151646": {
"content": "<|object_ref_start|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151647": {
"content": "<|object_ref_end|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151648": {
"content": "<|box_start|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151649": {
"content": "<|box_end|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151650": {
"content": "<|quad_start|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151651": {
"content": "<|quad_end|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151652": {
"content": "<|vision_start|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151653": {
"content": "<|vision_end|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151654": {
"content": "<|vision_pad|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151655": {
"content": "<|image_pad|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151656": {
"content": "<|video_pad|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151657": {
"content": "<tool_call>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
},
"151658": {
"content": "</tool_call>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
},
"151659": {
"content": "<|fim_prefix|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
},
"151660": {
"content": "<|fim_middle|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
},
"151661": {
"content": "<|fim_suffix|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
},
"151662": {
"content": "<|fim_pad|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
},
"151663": {
"content": "<|repo_name|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
},
"151664": {
"content": "<|file_sep|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
}
},
"additional_special_tokens": [
"<|im_start|>",
"<|im_end|>",
"<|object_ref_start|>",
"<|object_ref_end|>",
"<|box_start|>",
"<|box_end|>",
"<|quad_start|>",
"<|quad_end|>",
"<|vision_start|>",
"<|vision_end|>",
"<|vision_pad|>",
"<|image_pad|>",
"<|video_pad|>"
],
"bos_token": null,
"chat_template": "{%- if tools %}\n {{- '<|im_start|>system\\n' }}\n {%- if messages[0]['role'] == 'system' %}\n {{- messages[0]['content'] }}\n {%- else %}\n {{- 'You are Qwen, created by Alibaba Cloud. You are a helpful assistant.' }}\n {%- endif %}\n {{- \"\\n\\n# Tools\\n\\nYou may call one or more functions to assist with the user query.\\n\\nYou are provided with function signatures within <tools></tools> XML tags:\\n<tools>\" }}\n {%- for tool in tools %}\n {{- \"\\n\" }}\n {{- tool | tojson }}\n {%- endfor %}\n {{- \"\\n</tools>\\n\\nFor each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:\\n<tool_call>\\n{\\\"name\\\": <function-name>, \\\"arguments\\\": <args-json-object>}\\n</tool_call><|im_end|>\\n\" }}\n{%- else %}\n {%- if messages[0]['role'] == 'system' %}\n {{- '<|im_start|>system\\n' + messages[0]['content'] + '<|im_end|>\\n' }}\n {%- else %}\n {{- '<|im_start|>system\\nYou are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>\\n' }}\n {%- endif %}\n{%- endif %}\n{%- for message in messages %}\n {%- if (message.role == \"user\") or (message.role == \"system\" and not loop.first) or (message.role == \"assistant\" and not message.tool_calls) %}\n {{- '<|im_start|>' + message.role + '\\n' + message.content + '<|im_end|>' + '\\n' }}\n {%- elif message.role == \"assistant\" %}\n {{- '<|im_start|>' + message.role }}\n {%- if message.content %}\n {{- '\\n' + message.content }}\n {%- endif %}\n {%- for tool_call in message.tool_calls %}\n {%- if tool_call.function is defined %}\n {%- set tool_call = tool_call.function %}\n {%- endif %}\n {{- '\\n<tool_call>\\n{\"name\": \"' }}\n {{- tool_call.name }}\n {{- '\", \"arguments\": ' }}\n {{- tool_call.arguments | tojson }}\n {{- '}\\n</tool_call>' }}\n {%- endfor %}\n {{- '<|im_end|>\\n' }}\n {%- elif message.role == \"tool\" %}\n {%- if (loop.index0 == 0) or (messages[loop.index0 - 1].role != \"tool\") %}\n {{- '<|im_start|>user' }}\n {%- endif %}\n {{- '\\n<tool_response>\\n' }}\n {{- message.content }}\n {{- '\\n</tool_response>' }}\n {%- if loop.last or (messages[loop.index0 + 1].role != \"tool\") %}\n {{- '<|im_end|>\\n' }}\n {%- endif %}\n {%- endif %}\n{%- endfor %}\n{%- if add_generation_prompt %}\n {{- '<|im_start|>assistant\\n' }}\n{%- endif %}\n",
"clean_up_tokenization_spaces": false,
"eos_token": "<|endoftext|>",
"errors": "replace",
"model_max_length": 131072,
"pad_token": "<|endoftext|>",
"padding_side": "right",
"split_special_tokens": false,
"tokenizer_class": "Qwen2Tokenizer",
"unk_token": null
}

View File

@@ -0,0 +1,593 @@
{
"best_metric": null,
"best_model_checkpoint": null,
"epoch": 1.0,
"eval_steps": 500,
"global_step": 80,
"is_hyper_param_search": false,
"is_local_process_zero": true,
"is_world_process_zero": true,
"log_history": [
{
"epoch": 0.0125,
"grad_norm": 2.2997210025787354,
"learning_rate": 0.00015998457923856519,
"loss": 1.2401,
"step": 1
},
{
"epoch": 0.025,
"grad_norm": 24.28518295288086,
"learning_rate": 0.00015993832289925785,
"loss": 4.0648,
"step": 2
},
{
"epoch": 0.0375,
"grad_norm": 12.727800369262695,
"learning_rate": 0.0001598612488147773,
"loss": 2.7044,
"step": 3
},
{
"epoch": 0.05,
"grad_norm": 4.934032440185547,
"learning_rate": 0.00015975338669865026,
"loss": 1.994,
"step": 4
},
{
"epoch": 0.0625,
"grad_norm": 8.1886625289917,
"learning_rate": 0.00015961477813377576,
"loss": 2.1426,
"step": 5
},
{
"epoch": 0.075,
"grad_norm": 2.910872220993042,
"learning_rate": 0.00015944547655639412,
"loss": 1.7254,
"step": 6
},
{
"epoch": 0.0875,
"grad_norm": 1.565290093421936,
"learning_rate": 0.00015924554723548617,
"loss": 1.5187,
"step": 7
},
{
"epoch": 0.1,
"grad_norm": 2.9080827236175537,
"learning_rate": 0.00015901506724761103,
"loss": 1.5405,
"step": 8
},
{
"epoch": 0.1125,
"grad_norm": 1.875126838684082,
"learning_rate": 0.00015875412544719134,
"loss": 1.4493,
"step": 9
},
{
"epoch": 0.125,
"grad_norm": 1.2589935064315796,
"learning_rate": 0.00015846282243225845,
"loss": 1.4103,
"step": 10
},
{
"epoch": 0.1375,
"grad_norm": 1.2925529479980469,
"learning_rate": 0.0001581412705056698,
"loss": 1.3507,
"step": 11
},
{
"epoch": 0.15,
"grad_norm": 1.4467802047729492,
"learning_rate": 0.00015778959363181415,
"loss": 1.3,
"step": 12
},
{
"epoch": 0.1625,
"grad_norm": 1.267639398574829,
"learning_rate": 0.0001574079273888208,
"loss": 1.2974,
"step": 13
},
{
"epoch": 0.175,
"grad_norm": 1.0911085605621338,
"learning_rate": 0.00015699641891629178,
"loss": 1.2635,
"step": 14
},
{
"epoch": 0.1875,
"grad_norm": 0.9065354466438293,
"learning_rate": 0.00015655522685857672,
"loss": 1.2119,
"step": 15
},
{
"epoch": 0.2,
"grad_norm": 0.7415559887886047,
"learning_rate": 0.0001560845213036123,
"loss": 1.2337,
"step": 16
},
{
"epoch": 0.2125,
"grad_norm": 0.7553166151046753,
"learning_rate": 0.00015558448371735025,
"loss": 1.1884,
"step": 17
},
{
"epoch": 0.225,
"grad_norm": 0.5407947301864624,
"learning_rate": 0.00015505530687379875,
"loss": 1.17,
"step": 18
},
{
"epoch": 0.2375,
"grad_norm": 0.5162355899810791,
"learning_rate": 0.00015449719478070428,
"loss": 1.1879,
"step": 19
},
{
"epoch": 0.25,
"grad_norm": 0.5688554644584656,
"learning_rate": 0.00015391036260090294,
"loss": 1.1767,
"step": 20
},
{
"epoch": 0.2625,
"grad_norm": 0.48555564880371094,
"learning_rate": 0.0001532950365693709,
"loss": 1.1726,
"step": 21
},
{
"epoch": 0.275,
"grad_norm": 0.4502723515033722,
"learning_rate": 0.00015265145390600652,
"loss": 1.163,
"step": 22
},
{
"epoch": 0.2875,
"grad_norm": 0.3590157926082611,
"learning_rate": 0.00015197986272417774,
"loss": 1.1839,
"step": 23
},
{
"epoch": 0.3,
"grad_norm": 0.38364410400390625,
"learning_rate": 0.00015128052193506944,
"loss": 1.1642,
"step": 24
},
{
"epoch": 0.3125,
"grad_norm": 0.36856546998023987,
"learning_rate": 0.0001505537011478684,
"loss": 1.1495,
"step": 25
},
{
"epoch": 0.325,
"grad_norm": 0.3514528274536133,
"learning_rate": 0.0001497996805658238,
"loss": 1.1257,
"step": 26
},
{
"epoch": 0.3375,
"grad_norm": 0.42414528131484985,
"learning_rate": 0.00014901875087822337,
"loss": 1.1463,
"step": 27
},
{
"epoch": 0.35,
"grad_norm": 0.35511669516563416,
"learning_rate": 0.0001482112131483274,
"loss": 1.141,
"step": 28
},
{
"epoch": 0.3625,
"grad_norm": 0.3799460530281067,
"learning_rate": 0.00014737737869730292,
"loss": 1.1414,
"step": 29
},
{
"epoch": 0.375,
"grad_norm": 0.26333189010620117,
"learning_rate": 0.00014651756898420365,
"loss": 1.1352,
"step": 30
},
{
"epoch": 0.3875,
"grad_norm": 0.37996864318847656,
"learning_rate": 0.0001456321154820411,
"loss": 1.1167,
"step": 31
},
{
"epoch": 0.4,
"grad_norm": 0.3210310637950897,
"learning_rate": 0.00014472135954999581,
"loss": 1.113,
"step": 32
},
{
"epoch": 0.4125,
"grad_norm": 0.342960923910141,
"learning_rate": 0.00014378565230181657,
"loss": 1.1201,
"step": 33
},
{
"epoch": 0.425,
"grad_norm": 0.30171331763267517,
"learning_rate": 0.0001428253544704596,
"loss": 1.1303,
"step": 34
},
{
"epoch": 0.4375,
"grad_norm": 0.3308579623699188,
"learning_rate": 0.00014184083626901897,
"loss": 1.135,
"step": 35
},
{
"epoch": 0.45,
"grad_norm": 0.33749139308929443,
"learning_rate": 0.0001408324772480025,
"loss": 1.1413,
"step": 36
},
{
"epoch": 0.4625,
"grad_norm": 0.29873886704444885,
"learning_rate": 0.00013980066614900776,
"loss": 1.1406,
"step": 37
},
{
"epoch": 0.475,
"grad_norm": 0.25276514887809753,
"learning_rate": 0.00013874580075485485,
"loss": 1.1421,
"step": 38
},
{
"epoch": 0.4875,
"grad_norm": 0.2849913537502289,
"learning_rate": 0.00013766828773623352,
"loss": 1.1298,
"step": 39
},
{
"epoch": 0.5,
"grad_norm": 0.27665936946868896,
"learning_rate": 0.00013656854249492382,
"loss": 1.1052,
"step": 40
},
{
"epoch": 0.5125,
"grad_norm": 0.31618547439575195,
"learning_rate": 0.0001354469890036509,
"loss": 1.1124,
"step": 41
},
{
"epoch": 0.525,
"grad_norm": 0.30855098366737366,
"learning_rate": 0.00013430405964263536,
"loss": 1.1164,
"step": 42
},
{
"epoch": 0.5375,
"grad_norm": 0.24974325299263,
"learning_rate": 0.00013314019503290255,
"loss": 1.1379,
"step": 43
},
{
"epoch": 0.55,
"grad_norm": 0.259245365858078,
"learning_rate": 0.00013195584386641469,
"loss": 1.0963,
"step": 44
},
{
"epoch": 0.5625,
"grad_norm": 0.3342917561531067,
"learning_rate": 0.00013075146273309164,
"loss": 1.1089,
"step": 45
},
{
"epoch": 0.575,
"grad_norm": 0.3317720293998718,
"learning_rate": 0.00012952751594478675,
"loss": 1.1226,
"step": 46
},
{
"epoch": 0.5875,
"grad_norm": 0.2566727101802826,
"learning_rate": 0.0001282844753562857,
"loss": 1.1035,
"step": 47
},
{
"epoch": 0.6,
"grad_norm": 0.25012263655662537,
"learning_rate": 0.00012702282018339786,
"loss": 1.0713,
"step": 48
},
{
"epoch": 0.6125,
"grad_norm": 0.2855740189552307,
"learning_rate": 0.00012574303681820898,
"loss": 1.1232,
"step": 49
},
{
"epoch": 0.625,
"grad_norm": 0.21377117931842804,
"learning_rate": 0.0001244456186415682,
"loss": 1.0726,
"step": 50
},
{
"epoch": 0.6375,
"grad_norm": 0.3012278079986572,
"learning_rate": 0.00012313106583288004,
"loss": 1.0855,
"step": 51
},
{
"epoch": 0.65,
"grad_norm": 0.2754627764225006,
"learning_rate": 0.00012179988517727591,
"loss": 1.113,
"step": 52
},
{
"epoch": 0.6625,
"grad_norm": 0.2773728668689728,
"learning_rate": 0.00012045258987023879,
"loss": 1.0931,
"step": 53
},
{
"epoch": 0.675,
"grad_norm": 0.3616091012954712,
"learning_rate": 0.00011908969931975641,
"loss": 1.1007,
"step": 54
},
{
"epoch": 0.6875,
"grad_norm": 0.28011709451675415,
"learning_rate": 0.00011771173894607985,
"loss": 1.1312,
"step": 55
},
{
"epoch": 0.7,
"grad_norm": 0.19245974719524384,
"learning_rate": 0.00011631923997916375,
"loss": 1.0784,
"step": 56
},
{
"epoch": 0.7125,
"grad_norm": 0.2807864844799042,
"learning_rate": 0.00011491273925386736,
"loss": 1.0766,
"step": 57
},
{
"epoch": 0.725,
"grad_norm": 0.25869062542915344,
"learning_rate": 0.00011349277900299426,
"loss": 1.0929,
"step": 58
},
{
"epoch": 0.7375,
"grad_norm": 0.20374780893325806,
"learning_rate": 0.00011205990664825127,
"loss": 1.0977,
"step": 59
},
{
"epoch": 0.75,
"grad_norm": 0.275302529335022,
"learning_rate": 0.00011061467458920719,
"loss": 1.1218,
"step": 60
},
{
"epoch": 0.7625,
"grad_norm": 0.26479312777519226,
"learning_rate": 0.00010915763999033201,
"loss": 1.0972,
"step": 61
},
{
"epoch": 0.775,
"grad_norm": 0.20327049493789673,
"learning_rate": 0.00010768936456619945,
"loss": 1.0723,
"step": 62
},
{
"epoch": 0.7875,
"grad_norm": 0.18908362090587616,
"learning_rate": 0.0001062104143649355,
"loss": 1.1059,
"step": 63
},
{
"epoch": 0.8,
"grad_norm": 0.2153932750225067,
"learning_rate": 0.0001047213595499958,
"loss": 1.1112,
"step": 64
},
{
"epoch": 0.8125,
"grad_norm": 0.23449215292930603,
"learning_rate": 0.000103222774180357,
"loss": 1.1125,
"step": 65
},
{
"epoch": 0.825,
"grad_norm": 0.19739866256713867,
"learning_rate": 0.00010171523598920594,
"loss": 1.0506,
"step": 66
},
{
"epoch": 0.8375,
"grad_norm": 0.579247236251831,
"learning_rate": 0.00010019932616121264,
"loss": 1.0599,
"step": 67
},
{
"epoch": 0.85,
"grad_norm": 0.2158878892660141,
"learning_rate": 9.867562910847246e-05,
"loss": 1.1116,
"step": 68
},
{
"epoch": 0.8625,
"grad_norm": 0.24534355103969574,
"learning_rate": 9.714473224520406e-05,
"loss": 1.1039,
"step": 69
},
{
"epoch": 0.875,
"grad_norm": 0.1604059487581253,
"learning_rate": 9.560722576129029e-05,
"loss": 1.1007,
"step": 70
},
{
"epoch": 0.8875,
"grad_norm": 0.24135896563529968,
"learning_rate": 9.406370239474839e-05,
"loss": 1.0976,
"step": 71
},
{
"epoch": 0.9,
"grad_norm": 0.2200448215007782,
"learning_rate": 9.251475720321848e-05,
"loss": 1.1001,
"step": 72
},
{
"epoch": 0.9125,
"grad_norm": 0.17517372965812683,
"learning_rate": 9.096098733455746e-05,
"loss": 1.0864,
"step": 73
},
{
"epoch": 0.925,
"grad_norm": 0.23631267249584198,
"learning_rate": 8.940299179662703e-05,
"loss": 1.0976,
"step": 74
},
{
"epoch": 0.9375,
"grad_norm": 0.17627741396427155,
"learning_rate": 8.784137122636488e-05,
"loss": 1.1049,
"step": 75
},
{
"epoch": 0.95,
"grad_norm": 0.1840021312236786,
"learning_rate": 8.627672765822762e-05,
"loss": 1.0504,
"step": 76
},
{
"epoch": 0.9625,
"grad_norm": 0.1925836205482483,
"learning_rate": 8.470966429209512e-05,
"loss": 1.1028,
"step": 77
},
{
"epoch": 0.975,
"grad_norm": 0.18122681975364685,
"learning_rate": 8.31407852607255e-05,
"loss": 1.0605,
"step": 78
},
{
"epoch": 0.9875,
"grad_norm": 0.16970321536064148,
"learning_rate": 8.157069539685026e-05,
"loss": 1.1069,
"step": 79
},
{
"epoch": 1.0,
"grad_norm": 0.2044173628091812,
"learning_rate": 8e-05,
"loss": 1.1173,
"step": 80
}
],
"logging_steps": 1,
"max_steps": 160,
"num_input_tokens_seen": 0,
"num_train_epochs": 2,
"save_steps": 40,
"stateful_callbacks": {
"TrainerControl": {
"args": {
"should_epoch_stop": false,
"should_evaluate": false,
"should_log": false,
"should_save": true,
"should_training_stop": false
},
"attributes": {}
}
},
"total_flos": 2.6380640896784794e+18,
"train_batch_size": 8,
"trial_name": null,
"trial_params": null
}

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:261cea4c24e8dc936885b356703d1c5fe17a417e1e82b9e59cf2b6b4966e5e42
size 7608

1
checkpoint-80/vocab.json Normal file

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,604 @@
#!/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 . pytorch_model.bin
import argparse
import torch
import glob
import math
import os
import re
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)
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 files:
state_dict = torch.load(f, map_location=device)
# 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}")
if zero_stage <= 2:
fp32_flat_groups = [state_dicts[i][OPTIMIZER_STATE_DICT][fp32_groups_key] for i in range(len(state_dicts))]
elif zero_stage == 3:
# if there is more than one param group, there will be multiple flattened tensors - one
# flattened tensor per group - for simplicity merge them into a single tensor
#
# XXX: could make the script more memory efficient for when there are multiple groups - it
# will require matching the sub-lists of param_shapes for each param group flattened tensor
fp32_flat_groups = [
torch.cat(state_dicts[i][OPTIMIZER_STATE_DICT][fp32_groups_key], 0) 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")
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 = fp32_flat_groups[0].numel() * 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
for name, shape in param_shapes.items():
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}"
)
# XXX: memory usage doubles here
state_dict[name] = torch.cat(
tuple(fp32_flat_groups[i].narrow(0, offset, partitioned_numel) for i in range(world_size)),
0).narrow(0, 0, unpartitioned_numel).view(shape)
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 get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir, tag=None, exclude_frozen_parameters=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
Returns:
- pytorch ``state_dict``
Note: this approach may not work if your application doesn't have sufficient free CPU memory and
you may need to use the offline approach using the ``zero_to_fp32.py`` script that is saved with
the checkpoint.
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.
"""
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")
return _get_fp32_state_dict_from_zero_checkpoint(ds_checkpoint_dir, exclude_frozen_parameters)
def convert_zero_checkpoint_to_fp32_state_dict(checkpoint_dir, output_file, 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_file``: path to the pytorch fp32 state_dict output file (e.g. path/pytorch_model.bin)
- ``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
"""
state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir, tag, exclude_frozen_parameters)
print(f"Saving fp32 state dict to {output_file}")
torch.save(state_dict, output_file)
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_file",
type=str,
help="path to the pytorch fp32 state_dict output file (e.g. path/checkpoint-12/pytorch_model.bin)")
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_file,
tag=args.tag,
exclude_frozen_parameters=args.exclude_frozen_parameters)

29
config.json Normal file
View File

@@ -0,0 +1,29 @@
{
"_name_or_path": "cjiao/OpenThinker3-1.5B-checkpoint-375",
"architectures": [
"Qwen2ForCausalLM"
],
"attention_dropout": 0.0,
"bos_token_id": 151643,
"eos_token_id": 151645,
"hidden_act": "silu",
"hidden_size": 1536,
"initializer_range": 0.02,
"intermediate_size": 8960,
"max_position_embeddings": 32768,
"max_window_layers": 21,
"model_type": "qwen2",
"num_attention_heads": 12,
"num_hidden_layers": 28,
"num_key_value_heads": 2,
"rms_norm_eps": 1e-06,
"rope_scaling": null,
"rope_theta": 1000000.0,
"sliding_window": null,
"tie_word_embeddings": true,
"torch_dtype": "bfloat16",
"transformers_version": "4.46.1",
"use_cache": false,
"use_sliding_window": false,
"vocab_size": 151936
}

14
generation_config.json Normal file
View File

@@ -0,0 +1,14 @@
{
"bos_token_id": 151643,
"do_sample": true,
"eos_token_id": [
151645,
151643
],
"pad_token_id": 151643,
"repetition_penalty": 1.1,
"temperature": 0.7,
"top_k": 20,
"top_p": 0.8,
"transformers_version": "4.46.1"
}

151388
merges.txt Normal file

File diff suppressed because it is too large Load Diff

3
model.safetensors Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:5937a541c0f8e227816f6c52870fa6691a0c474738d13d246134687d34cf9a86
size 3554214752

31
special_tokens_map.json Normal file
View File

@@ -0,0 +1,31 @@
{
"additional_special_tokens": [
"<|im_start|>",
"<|im_end|>",
"<|object_ref_start|>",
"<|object_ref_end|>",
"<|box_start|>",
"<|box_end|>",
"<|quad_start|>",
"<|quad_end|>",
"<|vision_start|>",
"<|vision_end|>",
"<|vision_pad|>",
"<|image_pad|>",
"<|video_pad|>"
],
"eos_token": {
"content": "<|endoftext|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false
},
"pad_token": {
"content": "<|endoftext|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false
}
}

3
tokenizer.json Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:9c5ae00e602b8860cbd784ba82a8aa14e8feecec692e7076590d014d7b7fdafa
size 11421896

208
tokenizer_config.json Normal file
View File

@@ -0,0 +1,208 @@
{
"add_bos_token": false,
"add_prefix_space": false,
"added_tokens_decoder": {
"151643": {
"content": "<|endoftext|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151644": {
"content": "<|im_start|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151645": {
"content": "<|im_end|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151646": {
"content": "<|object_ref_start|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151647": {
"content": "<|object_ref_end|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151648": {
"content": "<|box_start|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151649": {
"content": "<|box_end|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151650": {
"content": "<|quad_start|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151651": {
"content": "<|quad_end|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151652": {
"content": "<|vision_start|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151653": {
"content": "<|vision_end|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151654": {
"content": "<|vision_pad|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151655": {
"content": "<|image_pad|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151656": {
"content": "<|video_pad|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151657": {
"content": "<tool_call>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
},
"151658": {
"content": "</tool_call>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
},
"151659": {
"content": "<|fim_prefix|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
},
"151660": {
"content": "<|fim_middle|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
},
"151661": {
"content": "<|fim_suffix|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
},
"151662": {
"content": "<|fim_pad|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
},
"151663": {
"content": "<|repo_name|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
},
"151664": {
"content": "<|file_sep|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
}
},
"additional_special_tokens": [
"<|im_start|>",
"<|im_end|>",
"<|object_ref_start|>",
"<|object_ref_end|>",
"<|box_start|>",
"<|box_end|>",
"<|quad_start|>",
"<|quad_end|>",
"<|vision_start|>",
"<|vision_end|>",
"<|vision_pad|>",
"<|image_pad|>",
"<|video_pad|>"
],
"bos_token": null,
"chat_template": "{%- if tools %}\n {{- '<|im_start|>system\\n' }}\n {%- if messages[0]['role'] == 'system' %}\n {{- messages[0]['content'] }}\n {%- else %}\n {{- 'You are Qwen, created by Alibaba Cloud. You are a helpful assistant.' }}\n {%- endif %}\n {{- \"\\n\\n# Tools\\n\\nYou may call one or more functions to assist with the user query.\\n\\nYou are provided with function signatures within <tools></tools> XML tags:\\n<tools>\" }}\n {%- for tool in tools %}\n {{- \"\\n\" }}\n {{- tool | tojson }}\n {%- endfor %}\n {{- \"\\n</tools>\\n\\nFor each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:\\n<tool_call>\\n{\\\"name\\\": <function-name>, \\\"arguments\\\": <args-json-object>}\\n</tool_call><|im_end|>\\n\" }}\n{%- else %}\n {%- if messages[0]['role'] == 'system' %}\n {{- '<|im_start|>system\\n' + messages[0]['content'] + '<|im_end|>\\n' }}\n {%- else %}\n {{- '<|im_start|>system\\nYou are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>\\n' }}\n {%- endif %}\n{%- endif %}\n{%- for message in messages %}\n {%- if (message.role == \"user\") or (message.role == \"system\" and not loop.first) or (message.role == \"assistant\" and not message.tool_calls) %}\n {{- '<|im_start|>' + message.role + '\\n' + message.content + '<|im_end|>' + '\\n' }}\n {%- elif message.role == \"assistant\" %}\n {{- '<|im_start|>' + message.role }}\n {%- if message.content %}\n {{- '\\n' + message.content }}\n {%- endif %}\n {%- for tool_call in message.tool_calls %}\n {%- if tool_call.function is defined %}\n {%- set tool_call = tool_call.function %}\n {%- endif %}\n {{- '\\n<tool_call>\\n{\"name\": \"' }}\n {{- tool_call.name }}\n {{- '\", \"arguments\": ' }}\n {{- tool_call.arguments | tojson }}\n {{- '}\\n</tool_call>' }}\n {%- endfor %}\n {{- '<|im_end|>\\n' }}\n {%- elif message.role == \"tool\" %}\n {%- if (loop.index0 == 0) or (messages[loop.index0 - 1].role != \"tool\") %}\n {{- '<|im_start|>user' }}\n {%- endif %}\n {{- '\\n<tool_response>\\n' }}\n {{- message.content }}\n {{- '\\n</tool_response>' }}\n {%- if loop.last or (messages[loop.index0 + 1].role != \"tool\") %}\n {{- '<|im_end|>\\n' }}\n {%- endif %}\n {%- endif %}\n{%- endfor %}\n{%- if add_generation_prompt %}\n {{- '<|im_start|>assistant\\n' }}\n{%- endif %}\n",
"clean_up_tokenization_spaces": false,
"eos_token": "<|endoftext|>",
"errors": "replace",
"model_max_length": 131072,
"pad_token": "<|endoftext|>",
"padding_side": "right",
"split_special_tokens": false,
"tokenizer_class": "Qwen2Tokenizer",
"unk_token": null
}

8
train_results.json Normal file
View File

@@ -0,0 +1,8 @@
{
"epoch": 2.0,
"total_flos": 5.276128179356959e+18,
"train_loss": 0.8005891665816307,
"train_runtime": 11560.7477,
"train_samples_per_second": 3.543,
"train_steps_per_second": 0.014
}

182
trainer_log.jsonl Normal file
View File

@@ -0,0 +1,182 @@
{"current_steps": 1, "total_steps": 160, "loss": 1.2401, "lr": 0.00015998457923856519, "epoch": 0.0125, "percentage": 0.62, "elapsed_time": "0:01:36", "remaining_time": "4:16:43"}
{"current_steps": 2, "total_steps": 160, "loss": 4.0648, "lr": 0.00015993832289925785, "epoch": 0.025, "percentage": 1.25, "elapsed_time": "0:03:12", "remaining_time": "4:12:53"}
{"current_steps": 3, "total_steps": 160, "loss": 2.7044, "lr": 0.0001598612488147773, "epoch": 0.0375, "percentage": 1.88, "elapsed_time": "0:04:46", "remaining_time": "4:09:58"}
{"current_steps": 4, "total_steps": 160, "loss": 1.994, "lr": 0.00015975338669865026, "epoch": 0.05, "percentage": 2.5, "elapsed_time": "0:06:22", "remaining_time": "4:08:21"}
{"current_steps": 5, "total_steps": 160, "loss": 2.1426, "lr": 0.00015961477813377576, "epoch": 0.0625, "percentage": 3.12, "elapsed_time": "0:07:56", "remaining_time": "4:06:13"}
{"current_steps": 6, "total_steps": 160, "loss": 1.7254, "lr": 0.00015944547655639412, "epoch": 0.075, "percentage": 3.75, "elapsed_time": "0:09:32", "remaining_time": "4:04:54"}
{"current_steps": 7, "total_steps": 160, "loss": 1.5187, "lr": 0.00015924554723548617, "epoch": 0.0875, "percentage": 4.38, "elapsed_time": "0:11:09", "remaining_time": "4:03:43"}
{"current_steps": 8, "total_steps": 160, "loss": 1.5405, "lr": 0.00015901506724761103, "epoch": 0.1, "percentage": 5.0, "elapsed_time": "0:12:45", "remaining_time": "4:02:18"}
{"current_steps": 9, "total_steps": 160, "loss": 1.4493, "lr": 0.00015875412544719134, "epoch": 0.1125, "percentage": 5.62, "elapsed_time": "0:14:20", "remaining_time": "4:00:40"}
{"current_steps": 10, "total_steps": 160, "loss": 1.4103, "lr": 0.00015846282243225845, "epoch": 0.125, "percentage": 6.25, "elapsed_time": "0:15:56", "remaining_time": "3:59:09"}
{"current_steps": 11, "total_steps": 160, "loss": 1.3507, "lr": 0.0001581412705056698, "epoch": 0.1375, "percentage": 6.88, "elapsed_time": "0:17:30", "remaining_time": "3:57:11"}
{"current_steps": 12, "total_steps": 160, "loss": 1.3, "lr": 0.00015778959363181415, "epoch": 0.15, "percentage": 7.5, "elapsed_time": "0:19:06", "remaining_time": "3:55:37"}
{"current_steps": 13, "total_steps": 160, "loss": 1.2974, "lr": 0.0001574079273888208, "epoch": 0.1625, "percentage": 8.12, "elapsed_time": "0:20:41", "remaining_time": "3:53:59"}
{"current_steps": 14, "total_steps": 160, "loss": 1.2635, "lr": 0.00015699641891629178, "epoch": 0.175, "percentage": 8.75, "elapsed_time": "0:22:16", "remaining_time": "3:52:16"}
{"current_steps": 15, "total_steps": 160, "loss": 1.2119, "lr": 0.00015655522685857672, "epoch": 0.1875, "percentage": 9.38, "elapsed_time": "0:23:52", "remaining_time": "3:50:46"}
{"current_steps": 16, "total_steps": 160, "loss": 1.2337, "lr": 0.0001560845213036123, "epoch": 0.2, "percentage": 10.0, "elapsed_time": "0:25:27", "remaining_time": "3:49:07"}
{"current_steps": 17, "total_steps": 160, "loss": 1.1884, "lr": 0.00015558448371735025, "epoch": 0.2125, "percentage": 10.62, "elapsed_time": "0:27:04", "remaining_time": "3:47:45"}
{"current_steps": 18, "total_steps": 160, "loss": 1.17, "lr": 0.00015505530687379875, "epoch": 0.225, "percentage": 11.25, "elapsed_time": "0:28:40", "remaining_time": "3:46:10"}
{"current_steps": 19, "total_steps": 160, "loss": 1.1879, "lr": 0.00015449719478070428, "epoch": 0.2375, "percentage": 11.88, "elapsed_time": "0:30:15", "remaining_time": "3:44:32"}
{"current_steps": 20, "total_steps": 160, "loss": 1.1767, "lr": 0.00015391036260090294, "epoch": 0.25, "percentage": 12.5, "elapsed_time": "0:31:49", "remaining_time": "3:42:48"}
{"current_steps": 21, "total_steps": 160, "loss": 1.1726, "lr": 0.0001532950365693709, "epoch": 0.2625, "percentage": 13.12, "elapsed_time": "0:33:24", "remaining_time": "3:41:10"}
{"current_steps": 22, "total_steps": 160, "loss": 1.163, "lr": 0.00015265145390600652, "epoch": 0.275, "percentage": 13.75, "elapsed_time": "0:34:59", "remaining_time": "3:39:32"}
{"current_steps": 23, "total_steps": 160, "loss": 1.1839, "lr": 0.00015197986272417774, "epoch": 0.2875, "percentage": 14.37, "elapsed_time": "0:36:36", "remaining_time": "3:38:03"}
{"current_steps": 24, "total_steps": 160, "loss": 1.1642, "lr": 0.00015128052193506944, "epoch": 0.3, "percentage": 15.0, "elapsed_time": "0:38:11", "remaining_time": "3:36:26"}
{"current_steps": 25, "total_steps": 160, "loss": 1.1495, "lr": 0.0001505537011478684, "epoch": 0.3125, "percentage": 15.62, "elapsed_time": "0:39:48", "remaining_time": "3:34:57"}
{"current_steps": 26, "total_steps": 160, "loss": 1.1257, "lr": 0.0001497996805658238, "epoch": 0.325, "percentage": 16.25, "elapsed_time": "0:41:23", "remaining_time": "3:33:18"}
{"current_steps": 27, "total_steps": 160, "loss": 1.1463, "lr": 0.00014901875087822337, "epoch": 0.3375, "percentage": 16.88, "elapsed_time": "0:42:58", "remaining_time": "3:31:43"}
{"current_steps": 28, "total_steps": 160, "loss": 1.141, "lr": 0.0001482112131483274, "epoch": 0.35, "percentage": 17.5, "elapsed_time": "0:44:35", "remaining_time": "3:30:11"}
{"current_steps": 29, "total_steps": 160, "loss": 1.1414, "lr": 0.00014737737869730292, "epoch": 0.3625, "percentage": 18.12, "elapsed_time": "0:46:12", "remaining_time": "3:28:43"}
{"current_steps": 30, "total_steps": 160, "loss": 1.1352, "lr": 0.00014651756898420365, "epoch": 0.375, "percentage": 18.75, "elapsed_time": "0:47:47", "remaining_time": "3:27:07"}
{"current_steps": 31, "total_steps": 160, "loss": 1.1167, "lr": 0.0001456321154820411, "epoch": 0.3875, "percentage": 19.38, "elapsed_time": "0:49:24", "remaining_time": "3:25:34"}
{"current_steps": 32, "total_steps": 160, "loss": 1.113, "lr": 0.00014472135954999581, "epoch": 0.4, "percentage": 20.0, "elapsed_time": "0:50:59", "remaining_time": "3:23:56"}
{"current_steps": 33, "total_steps": 160, "loss": 1.1201, "lr": 0.00014378565230181657, "epoch": 0.4125, "percentage": 20.62, "elapsed_time": "0:52:34", "remaining_time": "3:22:21"}
{"current_steps": 34, "total_steps": 160, "loss": 1.1303, "lr": 0.0001428253544704596, "epoch": 0.425, "percentage": 21.25, "elapsed_time": "0:54:09", "remaining_time": "3:20:41"}
{"current_steps": 35, "total_steps": 160, "loss": 1.135, "lr": 0.00014184083626901897, "epoch": 0.4375, "percentage": 21.88, "elapsed_time": "0:55:44", "remaining_time": "3:19:04"}
{"current_steps": 36, "total_steps": 160, "loss": 1.1413, "lr": 0.0001408324772480025, "epoch": 0.45, "percentage": 22.5, "elapsed_time": "0:57:20", "remaining_time": "3:17:30"}
{"current_steps": 37, "total_steps": 160, "loss": 1.1406, "lr": 0.00013980066614900776, "epoch": 0.4625, "percentage": 23.12, "elapsed_time": "0:58:56", "remaining_time": "3:15:55"}
{"current_steps": 38, "total_steps": 160, "loss": 1.1421, "lr": 0.00013874580075485485, "epoch": 0.475, "percentage": 23.75, "elapsed_time": "1:00:32", "remaining_time": "3:14:21"}
{"current_steps": 39, "total_steps": 160, "loss": 1.1298, "lr": 0.00013766828773623352, "epoch": 0.4875, "percentage": 24.38, "elapsed_time": "1:02:09", "remaining_time": "3:12:51"}
{"current_steps": 40, "total_steps": 160, "loss": 1.1052, "lr": 0.00013656854249492382, "epoch": 0.5, "percentage": 25.0, "elapsed_time": "1:03:45", "remaining_time": "3:11:15"}
{"current_steps": 41, "total_steps": 160, "loss": 1.1124, "lr": 0.0001354469890036509, "epoch": 0.5125, "percentage": 25.62, "elapsed_time": "1:05:49", "remaining_time": "3:11:04"}
{"current_steps": 42, "total_steps": 160, "loss": 1.1164, "lr": 0.00013430405964263536, "epoch": 0.525, "percentage": 26.25, "elapsed_time": "1:07:24", "remaining_time": "3:09:23"}
{"current_steps": 43, "total_steps": 160, "loss": 1.1379, "lr": 0.00013314019503290255, "epoch": 0.5375, "percentage": 26.88, "elapsed_time": "1:08:59", "remaining_time": "3:07:44"}
{"current_steps": 44, "total_steps": 160, "loss": 1.0963, "lr": 0.00013195584386641469, "epoch": 0.55, "percentage": 27.5, "elapsed_time": "1:10:36", "remaining_time": "3:06:09"}
{"current_steps": 45, "total_steps": 160, "loss": 1.1089, "lr": 0.00013075146273309164, "epoch": 0.5625, "percentage": 28.12, "elapsed_time": "1:12:11", "remaining_time": "3:04:29"}
{"current_steps": 46, "total_steps": 160, "loss": 1.1225, "lr": 0.00012952751594478675, "epoch": 0.575, "percentage": 28.75, "elapsed_time": "1:13:48", "remaining_time": "3:02:54"}
{"current_steps": 47, "total_steps": 160, "loss": 1.1035, "lr": 0.0001282844753562857, "epoch": 0.5875, "percentage": 29.38, "elapsed_time": "1:15:22", "remaining_time": "3:01:13"}
{"current_steps": 48, "total_steps": 160, "loss": 1.0713, "lr": 0.00012702282018339786, "epoch": 0.6, "percentage": 30.0, "elapsed_time": "1:16:57", "remaining_time": "2:59:34"}
{"current_steps": 49, "total_steps": 160, "loss": 1.1233, "lr": 0.00012574303681820898, "epoch": 0.6125, "percentage": 30.63, "elapsed_time": "1:18:33", "remaining_time": "2:57:57"}
{"current_steps": 50, "total_steps": 160, "loss": 1.0726, "lr": 0.0001244456186415682, "epoch": 0.625, "percentage": 31.25, "elapsed_time": "1:20:08", "remaining_time": "2:56:19"}
{"current_steps": 51, "total_steps": 160, "loss": 1.0856, "lr": 0.00012313106583288004, "epoch": 0.6375, "percentage": 31.87, "elapsed_time": "1:21:45", "remaining_time": "2:54:43"}
{"current_steps": 52, "total_steps": 160, "loss": 1.113, "lr": 0.00012179988517727591, "epoch": 0.65, "percentage": 32.5, "elapsed_time": "1:23:20", "remaining_time": "2:53:04"}
{"current_steps": 53, "total_steps": 160, "loss": 1.0932, "lr": 0.00012045258987023879, "epoch": 0.6625, "percentage": 33.12, "elapsed_time": "1:24:54", "remaining_time": "2:51:25"}
{"current_steps": 54, "total_steps": 160, "loss": 1.1008, "lr": 0.00011908969931975641, "epoch": 0.675, "percentage": 33.75, "elapsed_time": "1:26:30", "remaining_time": "2:49:49"}
{"current_steps": 55, "total_steps": 160, "loss": 1.1313, "lr": 0.00011771173894607985, "epoch": 0.6875, "percentage": 34.38, "elapsed_time": "1:28:06", "remaining_time": "2:48:12"}
{"current_steps": 56, "total_steps": 160, "loss": 1.0784, "lr": 0.00011631923997916375, "epoch": 0.7, "percentage": 35.0, "elapsed_time": "1:29:42", "remaining_time": "2:46:36"}
{"current_steps": 57, "total_steps": 160, "loss": 1.0767, "lr": 0.00011491273925386736, "epoch": 0.7125, "percentage": 35.62, "elapsed_time": "1:31:18", "remaining_time": "2:45:00"}
{"current_steps": 58, "total_steps": 160, "loss": 1.0929, "lr": 0.00011349277900299426, "epoch": 0.725, "percentage": 36.25, "elapsed_time": "1:32:54", "remaining_time": "2:43:22"}
{"current_steps": 59, "total_steps": 160, "loss": 1.0977, "lr": 0.00011205990664825127, "epoch": 0.7375, "percentage": 36.88, "elapsed_time": "1:34:29", "remaining_time": "2:41:44"}
{"current_steps": 60, "total_steps": 160, "loss": 1.1219, "lr": 0.00011061467458920719, "epoch": 0.75, "percentage": 37.5, "elapsed_time": "1:36:05", "remaining_time": "2:40:08"}
{"current_steps": 61, "total_steps": 160, "loss": 1.0973, "lr": 0.00010915763999033201, "epoch": 0.7625, "percentage": 38.12, "elapsed_time": "1:37:39", "remaining_time": "2:38:30"}
{"current_steps": 41, "total_steps": 160, "loss": 1.1124, "lr": 0.0001354469890036509, "epoch": 0.5125, "percentage": 25.62, "elapsed_time": "0:01:36", "remaining_time": "0:04:40"}
{"current_steps": 42, "total_steps": 160, "loss": 1.1164, "lr": 0.00013430405964263536, "epoch": 0.525, "percentage": 26.25, "elapsed_time": "0:03:10", "remaining_time": "0:08:56"}
{"current_steps": 43, "total_steps": 160, "loss": 1.1379, "lr": 0.00013314019503290255, "epoch": 0.5375, "percentage": 26.88, "elapsed_time": "0:04:45", "remaining_time": "0:12:57"}
{"current_steps": 44, "total_steps": 160, "loss": 1.0963, "lr": 0.00013195584386641469, "epoch": 0.55, "percentage": 27.5, "elapsed_time": "0:06:22", "remaining_time": "0:16:48"}
{"current_steps": 45, "total_steps": 160, "loss": 1.1089, "lr": 0.00013075146273309164, "epoch": 0.5625, "percentage": 28.12, "elapsed_time": "0:07:57", "remaining_time": "0:20:19"}
{"current_steps": 46, "total_steps": 160, "loss": 1.1226, "lr": 0.00012952751594478675, "epoch": 0.575, "percentage": 28.75, "elapsed_time": "0:09:34", "remaining_time": "0:23:43"}
{"current_steps": 47, "total_steps": 160, "loss": 1.1035, "lr": 0.0001282844753562857, "epoch": 0.5875, "percentage": 29.38, "elapsed_time": "0:11:08", "remaining_time": "0:26:47"}
{"current_steps": 48, "total_steps": 160, "loss": 1.0713, "lr": 0.00012702282018339786, "epoch": 0.6, "percentage": 30.0, "elapsed_time": "0:12:43", "remaining_time": "0:29:41"}
{"current_steps": 49, "total_steps": 160, "loss": 1.1232, "lr": 0.00012574303681820898, "epoch": 0.6125, "percentage": 30.63, "elapsed_time": "0:14:19", "remaining_time": "0:32:27"}
{"current_steps": 50, "total_steps": 160, "loss": 1.0726, "lr": 0.0001244456186415682, "epoch": 0.625, "percentage": 31.25, "elapsed_time": "0:15:54", "remaining_time": "0:35:00"}
{"current_steps": 51, "total_steps": 160, "loss": 1.0855, "lr": 0.00012313106583288004, "epoch": 0.6375, "percentage": 31.87, "elapsed_time": "0:17:30", "remaining_time": "0:37:25"}
{"current_steps": 52, "total_steps": 160, "loss": 1.113, "lr": 0.00012179988517727591, "epoch": 0.65, "percentage": 32.5, "elapsed_time": "0:19:05", "remaining_time": "0:39:39"}
{"current_steps": 53, "total_steps": 160, "loss": 1.0931, "lr": 0.00012045258987023879, "epoch": 0.6625, "percentage": 33.12, "elapsed_time": "0:20:39", "remaining_time": "0:41:43"}
{"current_steps": 54, "total_steps": 160, "loss": 1.1007, "lr": 0.00011908969931975641, "epoch": 0.675, "percentage": 33.75, "elapsed_time": "0:22:15", "remaining_time": "0:43:42"}
{"current_steps": 55, "total_steps": 160, "loss": 1.1312, "lr": 0.00011771173894607985, "epoch": 0.6875, "percentage": 34.38, "elapsed_time": "0:23:51", "remaining_time": "0:45:33"}
{"current_steps": 56, "total_steps": 160, "loss": 1.0784, "lr": 0.00011631923997916375, "epoch": 0.7, "percentage": 35.0, "elapsed_time": "0:25:27", "remaining_time": "0:47:17"}
{"current_steps": 57, "total_steps": 160, "loss": 1.0766, "lr": 0.00011491273925386736, "epoch": 0.7125, "percentage": 35.62, "elapsed_time": "0:27:04", "remaining_time": "0:48:55"}
{"current_steps": 58, "total_steps": 160, "loss": 1.0929, "lr": 0.00011349277900299426, "epoch": 0.725, "percentage": 36.25, "elapsed_time": "0:28:39", "remaining_time": "0:50:23"}
{"current_steps": 59, "total_steps": 160, "loss": 1.0977, "lr": 0.00011205990664825127, "epoch": 0.7375, "percentage": 36.88, "elapsed_time": "0:30:14", "remaining_time": "0:51:46"}
{"current_steps": 60, "total_steps": 160, "loss": 1.1218, "lr": 0.00011061467458920719, "epoch": 0.75, "percentage": 37.5, "elapsed_time": "0:31:50", "remaining_time": "0:53:04"}
{"current_steps": 61, "total_steps": 160, "loss": 1.0972, "lr": 0.00010915763999033201, "epoch": 0.7625, "percentage": 38.12, "elapsed_time": "0:33:25", "remaining_time": "0:54:14"}
{"current_steps": 62, "total_steps": 160, "loss": 1.0723, "lr": 0.00010768936456619945, "epoch": 0.775, "percentage": 38.75, "elapsed_time": "0:35:00", "remaining_time": "0:55:20"}
{"current_steps": 63, "total_steps": 160, "loss": 1.1059, "lr": 0.0001062104143649355, "epoch": 0.7875, "percentage": 39.38, "elapsed_time": "0:36:36", "remaining_time": "0:56:21"}
{"current_steps": 64, "total_steps": 160, "loss": 1.1112, "lr": 0.0001047213595499958, "epoch": 0.8, "percentage": 40.0, "elapsed_time": "0:38:12", "remaining_time": "0:57:18"}
{"current_steps": 65, "total_steps": 160, "loss": 1.1125, "lr": 0.000103222774180357, "epoch": 0.8125, "percentage": 40.62, "elapsed_time": "0:39:46", "remaining_time": "0:58:08"}
{"current_steps": 66, "total_steps": 160, "loss": 1.0506, "lr": 0.00010171523598920594, "epoch": 0.825, "percentage": 41.25, "elapsed_time": "0:41:21", "remaining_time": "0:58:53"}
{"current_steps": 67, "total_steps": 160, "loss": 1.0599, "lr": 0.00010019932616121264, "epoch": 0.8375, "percentage": 41.88, "elapsed_time": "0:42:57", "remaining_time": "0:59:38"}
{"current_steps": 68, "total_steps": 160, "loss": 1.1116, "lr": 9.867562910847246e-05, "epoch": 0.85, "percentage": 42.5, "elapsed_time": "0:44:33", "remaining_time": "1:00:17"}
{"current_steps": 69, "total_steps": 160, "loss": 1.1039, "lr": 9.714473224520406e-05, "epoch": 0.8625, "percentage": 43.12, "elapsed_time": "0:46:09", "remaining_time": "1:00:51"}
{"current_steps": 70, "total_steps": 160, "loss": 1.1007, "lr": 9.560722576129029e-05, "epoch": 0.875, "percentage": 43.75, "elapsed_time": "0:47:44", "remaining_time": "1:01:22"}
{"current_steps": 71, "total_steps": 160, "loss": 1.0976, "lr": 9.406370239474839e-05, "epoch": 0.8875, "percentage": 44.38, "elapsed_time": "0:49:19", "remaining_time": "1:01:49"}
{"current_steps": 72, "total_steps": 160, "loss": 1.1001, "lr": 9.251475720321848e-05, "epoch": 0.9, "percentage": 45.0, "elapsed_time": "0:50:54", "remaining_time": "1:02:13"}
{"current_steps": 73, "total_steps": 160, "loss": 1.0864, "lr": 9.096098733455746e-05, "epoch": 0.9125, "percentage": 45.62, "elapsed_time": "0:52:31", "remaining_time": "1:02:35"}
{"current_steps": 74, "total_steps": 160, "loss": 1.0976, "lr": 8.940299179662703e-05, "epoch": 0.925, "percentage": 46.25, "elapsed_time": "0:54:07", "remaining_time": "1:02:54"}
{"current_steps": 75, "total_steps": 160, "loss": 1.1049, "lr": 8.784137122636488e-05, "epoch": 0.9375, "percentage": 46.88, "elapsed_time": "0:55:43", "remaining_time": "1:03:08"}
{"current_steps": 76, "total_steps": 160, "loss": 1.0504, "lr": 8.627672765822762e-05, "epoch": 0.95, "percentage": 47.5, "elapsed_time": "0:57:18", "remaining_time": "1:03:20"}
{"current_steps": 77, "total_steps": 160, "loss": 1.1028, "lr": 8.470966429209512e-05, "epoch": 0.9625, "percentage": 48.12, "elapsed_time": "0:58:54", "remaining_time": "1:03:30"}
{"current_steps": 78, "total_steps": 160, "loss": 1.0605, "lr": 8.31407852607255e-05, "epoch": 0.975, "percentage": 48.75, "elapsed_time": "1:00:30", "remaining_time": "1:03:36"}
{"current_steps": 79, "total_steps": 160, "loss": 1.1069, "lr": 8.157069539685026e-05, "epoch": 0.9875, "percentage": 49.38, "elapsed_time": "1:02:06", "remaining_time": "1:03:40"}
{"current_steps": 80, "total_steps": 160, "loss": 1.1173, "lr": 8e-05, "epoch": 1.0, "percentage": 50.0, "elapsed_time": "1:03:40", "remaining_time": "1:03:40"}
{"current_steps": 81, "total_steps": 160, "loss": 1.0536, "lr": 7.842930460314975e-05, "epoch": 1.0125, "percentage": 50.62, "elapsed_time": "1:05:48", "remaining_time": "1:04:10"}
{"current_steps": 82, "total_steps": 160, "loss": 1.1236, "lr": 7.685921473927454e-05, "epoch": 1.025, "percentage": 51.25, "elapsed_time": "1:07:23", "remaining_time": "1:04:06"}
{"current_steps": 83, "total_steps": 160, "loss": 1.0927, "lr": 7.529033570790488e-05, "epoch": 1.0375, "percentage": 51.88, "elapsed_time": "1:08:58", "remaining_time": "1:03:59"}
{"current_steps": 84, "total_steps": 160, "loss": 1.0861, "lr": 7.372327234177242e-05, "epoch": 1.05, "percentage": 52.5, "elapsed_time": "1:10:33", "remaining_time": "1:03:50"}
{"current_steps": 85, "total_steps": 160, "loss": 1.108, "lr": 7.215862877363515e-05, "epoch": 1.0625, "percentage": 53.12, "elapsed_time": "1:12:08", "remaining_time": "1:03:39"}
{"current_steps": 86, "total_steps": 160, "loss": 1.0958, "lr": 7.0597008203373e-05, "epoch": 1.075, "percentage": 53.75, "elapsed_time": "1:13:44", "remaining_time": "1:03:27"}
{"current_steps": 87, "total_steps": 160, "loss": 1.0456, "lr": 6.903901266544258e-05, "epoch": 1.0875, "percentage": 54.37, "elapsed_time": "1:15:20", "remaining_time": "1:03:13"}
{"current_steps": 88, "total_steps": 160, "loss": 1.1224, "lr": 6.748524279678152e-05, "epoch": 1.1, "percentage": 55.0, "elapsed_time": "1:16:56", "remaining_time": "1:02:57"}
{"current_steps": 89, "total_steps": 160, "loss": 1.0932, "lr": 6.593629760525164e-05, "epoch": 1.1125, "percentage": 55.62, "elapsed_time": "1:18:32", "remaining_time": "1:02:39"}
{"current_steps": 90, "total_steps": 160, "loss": 1.1091, "lr": 6.439277423870975e-05, "epoch": 1.125, "percentage": 56.25, "elapsed_time": "1:20:08", "remaining_time": "1:02:19"}
{"current_steps": 91, "total_steps": 160, "loss": 1.0921, "lr": 6.285526775479596e-05, "epoch": 1.1375, "percentage": 56.88, "elapsed_time": "1:21:41", "remaining_time": "1:01:56"}
{"current_steps": 92, "total_steps": 160, "loss": 1.0642, "lr": 6.13243708915276e-05, "epoch": 1.15, "percentage": 57.5, "elapsed_time": "1:23:17", "remaining_time": "1:01:33"}
{"current_steps": 93, "total_steps": 160, "loss": 1.0832, "lr": 5.9800673838787364e-05, "epoch": 1.1625, "percentage": 58.13, "elapsed_time": "1:24:52", "remaining_time": "1:01:08"}
{"current_steps": 94, "total_steps": 160, "loss": 1.0666, "lr": 5.828476401079407e-05, "epoch": 1.175, "percentage": 58.75, "elapsed_time": "1:26:27", "remaining_time": "1:00:42"}
{"current_steps": 95, "total_steps": 160, "loss": 1.0342, "lr": 5.677722581964303e-05, "epoch": 1.1875, "percentage": 59.38, "elapsed_time": "1:28:03", "remaining_time": "1:00:15"}
{"current_steps": 96, "total_steps": 160, "loss": 1.0668, "lr": 5.5278640450004216e-05, "epoch": 1.2, "percentage": 60.0, "elapsed_time": "1:29:38", "remaining_time": "0:59:45"}
{"current_steps": 97, "total_steps": 160, "loss": 1.0359, "lr": 5.3789585635064534e-05, "epoch": 1.2125, "percentage": 60.62, "elapsed_time": "1:31:15", "remaining_time": "0:59:16"}
{"current_steps": 98, "total_steps": 160, "loss": 1.0305, "lr": 5.231063543380055e-05, "epoch": 1.225, "percentage": 61.25, "elapsed_time": "1:32:51", "remaining_time": "0:58:44"}
{"current_steps": 99, "total_steps": 160, "loss": 1.0516, "lr": 5.084236000966803e-05, "epoch": 1.2375, "percentage": 61.88, "elapsed_time": "1:34:26", "remaining_time": "0:58:11"}
{"current_steps": 100, "total_steps": 160, "loss": 1.0456, "lr": 4.9385325410792824e-05, "epoch": 1.25, "percentage": 62.5, "elapsed_time": "1:36:01", "remaining_time": "0:57:36"}
{"current_steps": 101, "total_steps": 160, "loss": 1.0482, "lr": 4.794009335174874e-05, "epoch": 1.2625, "percentage": 63.12, "elapsed_time": "1:37:36", "remaining_time": "0:57:00"}
{"current_steps": 102, "total_steps": 160, "loss": 1.0442, "lr": 4.650722099700578e-05, "epoch": 1.275, "percentage": 63.75, "elapsed_time": "1:39:11", "remaining_time": "0:56:24"}
{"current_steps": 103, "total_steps": 160, "loss": 1.0694, "lr": 4.508726074613262e-05, "epoch": 1.2875, "percentage": 64.38, "elapsed_time": "1:40:47", "remaining_time": "0:55:46"}
{"current_steps": 104, "total_steps": 160, "loss": 1.0556, "lr": 4.3680760020836266e-05, "epoch": 1.3, "percentage": 65.0, "elapsed_time": "1:42:23", "remaining_time": "0:55:07"}
{"current_steps": 105, "total_steps": 160, "loss": 1.044, "lr": 4.2288261053920186e-05, "epoch": 1.3125, "percentage": 65.62, "elapsed_time": "1:43:59", "remaining_time": "0:54:28"}
{"current_steps": 106, "total_steps": 160, "loss": 1.0231, "lr": 4.0910300680243636e-05, "epoch": 1.325, "percentage": 66.25, "elapsed_time": "1:45:34", "remaining_time": "0:53:47"}
{"current_steps": 107, "total_steps": 160, "loss": 1.0468, "lr": 3.954741012976125e-05, "epoch": 1.3375, "percentage": 66.88, "elapsed_time": "1:47:10", "remaining_time": "0:53:05"}
{"current_steps": 108, "total_steps": 160, "loss": 1.0452, "lr": 3.8200114822724096e-05, "epoch": 1.35, "percentage": 67.5, "elapsed_time": "1:48:46", "remaining_time": "0:52:22"}
{"current_steps": 109, "total_steps": 160, "loss": 1.0487, "lr": 3.686893416711998e-05, "epoch": 1.3625, "percentage": 68.12, "elapsed_time": "1:50:24", "remaining_time": "0:51:39"}
{"current_steps": 110, "total_steps": 160, "loss": 1.0447, "lr": 3.5554381358431845e-05, "epoch": 1.375, "percentage": 68.75, "elapsed_time": "1:51:59", "remaining_time": "0:50:54"}
{"current_steps": 111, "total_steps": 160, "loss": 1.0288, "lr": 3.425696318179103e-05, "epoch": 1.3875, "percentage": 69.38, "elapsed_time": "1:53:35", "remaining_time": "0:50:08"}
{"current_steps": 112, "total_steps": 160, "loss": 1.0269, "lr": 3.297717981660216e-05, "epoch": 1.4, "percentage": 70.0, "elapsed_time": "1:55:11", "remaining_time": "0:49:21"}
{"current_steps": 113, "total_steps": 160, "loss": 1.0361, "lr": 3.1715524643714286e-05, "epoch": 1.4125, "percentage": 70.62, "elapsed_time": "1:56:46", "remaining_time": "0:48:34"}
{"current_steps": 114, "total_steps": 160, "loss": 1.0476, "lr": 3.0472484055213276e-05, "epoch": 1.425, "percentage": 71.25, "elapsed_time": "1:58:21", "remaining_time": "0:47:45"}
{"current_steps": 115, "total_steps": 160, "loss": 1.0531, "lr": 2.9248537266908373e-05, "epoch": 1.4375, "percentage": 71.88, "elapsed_time": "1:59:56", "remaining_time": "0:46:56"}
{"current_steps": 116, "total_steps": 160, "loss": 1.0611, "lr": 2.804415613358532e-05, "epoch": 1.45, "percentage": 72.5, "elapsed_time": "2:01:32", "remaining_time": "0:46:06"}
{"current_steps": 117, "total_steps": 160, "loss": 1.0625, "lr": 2.685980496709749e-05, "epoch": 1.4625, "percentage": 73.12, "elapsed_time": "2:03:08", "remaining_time": "0:45:15"}
{"current_steps": 118, "total_steps": 160, "loss": 1.0647, "lr": 2.569594035736466e-05, "epoch": 1.475, "percentage": 73.75, "elapsed_time": "2:04:44", "remaining_time": "0:44:23"}
{"current_steps": 119, "total_steps": 160, "loss": 1.0543, "lr": 2.4553010996349143e-05, "epoch": 1.4875, "percentage": 74.38, "elapsed_time": "2:06:21", "remaining_time": "0:43:32"}
{"current_steps": 120, "total_steps": 160, "loss": 1.0325, "lr": 2.3431457505076205e-05, "epoch": 1.5, "percentage": 75.0, "elapsed_time": "2:07:57", "remaining_time": "0:42:39"}
{"current_steps": 121, "total_steps": 160, "loss": 1.041, "lr": 2.2331712263766495e-05, "epoch": 1.5125, "percentage": 75.62, "elapsed_time": "2:10:03", "remaining_time": "0:41:55"}
{"current_steps": 122, "total_steps": 160, "loss": 1.0433, "lr": 2.1254199245145177e-05, "epoch": 1.525, "percentage": 76.25, "elapsed_time": "2:11:38", "remaining_time": "0:41:00"}
{"current_steps": 123, "total_steps": 160, "loss": 1.0657, "lr": 2.0199333850992245e-05, "epoch": 1.5375, "percentage": 76.88, "elapsed_time": "2:13:13", "remaining_time": "0:40:04"}
{"current_steps": 124, "total_steps": 160, "loss": 1.0292, "lr": 1.9167522751997527e-05, "epoch": 1.55, "percentage": 77.5, "elapsed_time": "2:14:49", "remaining_time": "0:39:08"}
{"current_steps": 125, "total_steps": 160, "loss": 1.04, "lr": 1.815916373098104e-05, "epoch": 1.5625, "percentage": 78.12, "elapsed_time": "2:16:24", "remaining_time": "0:38:11"}
{"current_steps": 126, "total_steps": 160, "loss": 1.0556, "lr": 1.7174645529540424e-05, "epoch": 1.575, "percentage": 78.75, "elapsed_time": "2:18:01", "remaining_time": "0:37:14"}
{"current_steps": 127, "total_steps": 160, "loss": 1.0365, "lr": 1.621434769818344e-05, "epoch": 1.5875, "percentage": 79.38, "elapsed_time": "2:19:35", "remaining_time": "0:36:16"}
{"current_steps": 128, "total_steps": 160, "loss": 1.0072, "lr": 1.5278640450004213e-05, "epoch": 1.6, "percentage": 80.0, "elapsed_time": "2:21:11", "remaining_time": "0:35:17"}
{"current_steps": 129, "total_steps": 160, "loss": 1.0589, "lr": 1.4367884517958914e-05, "epoch": 1.6125, "percentage": 80.62, "elapsed_time": "2:22:47", "remaining_time": "0:34:18"}
{"current_steps": 130, "total_steps": 160, "loss": 1.0112, "lr": 1.3482431015796373e-05, "epoch": 1.625, "percentage": 81.25, "elapsed_time": "2:24:22", "remaining_time": "0:33:19"}
{"current_steps": 131, "total_steps": 160, "loss": 1.0249, "lr": 1.2622621302697087e-05, "epoch": 1.6375, "percentage": 81.88, "elapsed_time": "2:25:58", "remaining_time": "0:32:18"}
{"current_steps": 132, "total_steps": 160, "loss": 1.0507, "lr": 1.1788786851672628e-05, "epoch": 1.65, "percentage": 82.5, "elapsed_time": "2:27:33", "remaining_time": "0:31:18"}
{"current_steps": 133, "total_steps": 160, "loss": 1.0328, "lr": 1.0981249121776654e-05, "epoch": 1.6625, "percentage": 83.12, "elapsed_time": "2:29:07", "remaining_time": "0:30:16"}
{"current_steps": 134, "total_steps": 160, "loss": 1.0412, "lr": 1.0200319434176227e-05, "epoch": 1.675, "percentage": 83.75, "elapsed_time": "2:30:43", "remaining_time": "0:29:14"}
{"current_steps": 135, "total_steps": 160, "loss": 1.072, "lr": 9.446298852131605e-06, "epoch": 1.6875, "percentage": 84.38, "elapsed_time": "2:32:19", "remaining_time": "0:28:12"}
{"current_steps": 136, "total_steps": 160, "loss": 1.022, "lr": 8.719478064930578e-06, "epoch": 1.7, "percentage": 85.0, "elapsed_time": "2:33:55", "remaining_time": "0:27:09"}
{"current_steps": 137, "total_steps": 160, "loss": 1.021, "lr": 8.020137275822297e-06, "epoch": 1.7125, "percentage": 85.62, "elapsed_time": "2:35:31", "remaining_time": "0:26:06"}
{"current_steps": 138, "total_steps": 160, "loss": 1.0369, "lr": 7.348546093993492e-06, "epoch": 1.725, "percentage": 86.25, "elapsed_time": "2:37:06", "remaining_time": "0:25:02"}
{"current_steps": 139, "total_steps": 160, "loss": 1.0433, "lr": 6.704963430629132e-06, "epoch": 1.7375, "percentage": 86.88, "elapsed_time": "2:38:41", "remaining_time": "0:23:58"}
{"current_steps": 140, "total_steps": 160, "loss": 1.0893, "lr": 6.0896373990970614e-06, "epoch": 1.75, "percentage": 87.5, "elapsed_time": "2:40:17", "remaining_time": "0:22:53"}
{"current_steps": 141, "total_steps": 160, "loss": 1.0433, "lr": 5.502805219295715e-06, "epoch": 1.7625, "percentage": 88.12, "elapsed_time": "2:41:52", "remaining_time": "0:21:48"}
{"current_steps": 142, "total_steps": 160, "loss": 1.0207, "lr": 4.944693126201276e-06, "epoch": 1.775, "percentage": 88.75, "elapsed_time": "2:43:27", "remaining_time": "0:20:43"}
{"current_steps": 143, "total_steps": 160, "loss": 1.0538, "lr": 4.415516282649756e-06, "epoch": 1.7875, "percentage": 89.38, "elapsed_time": "2:45:03", "remaining_time": "0:19:37"}
{"current_steps": 144, "total_steps": 160, "loss": 1.0606, "lr": 3.915478696387718e-06, "epoch": 1.8, "percentage": 90.0, "elapsed_time": "2:46:39", "remaining_time": "0:18:31"}
{"current_steps": 145, "total_steps": 160, "loss": 1.0614, "lr": 3.4447731414232945e-06, "epoch": 1.8125, "percentage": 90.62, "elapsed_time": "2:48:13", "remaining_time": "0:17:24"}
{"current_steps": 146, "total_steps": 160, "loss": 1.0028, "lr": 3.0035810837082267e-06, "epoch": 1.825, "percentage": 91.25, "elapsed_time": "2:49:48", "remaining_time": "0:16:16"}
{"current_steps": 147, "total_steps": 160, "loss": 1.0137, "lr": 2.5920726111792195e-06, "epoch": 1.8375, "percentage": 91.88, "elapsed_time": "2:51:24", "remaining_time": "0:15:09"}
{"current_steps": 148, "total_steps": 160, "loss": 1.0631, "lr": 2.2104063681858757e-06, "epoch": 1.85, "percentage": 92.5, "elapsed_time": "2:53:01", "remaining_time": "0:14:01"}
{"current_steps": 149, "total_steps": 160, "loss": 1.0562, "lr": 1.8587294943302092e-06, "epoch": 1.8625, "percentage": 93.12, "elapsed_time": "2:54:36", "remaining_time": "0:12:53"}
{"current_steps": 150, "total_steps": 160, "loss": 1.0534, "lr": 1.5371775677415656e-06, "epoch": 1.875, "percentage": 93.75, "elapsed_time": "2:56:11", "remaining_time": "0:11:44"}
{"current_steps": 151, "total_steps": 160, "loss": 1.0517, "lr": 1.2458745528086723e-06, "epoch": 1.8875, "percentage": 94.38, "elapsed_time": "2:57:46", "remaining_time": "0:10:35"}
{"current_steps": 152, "total_steps": 160, "loss": 1.0547, "lr": 9.849327523889873e-07, "epoch": 1.9, "percentage": 95.0, "elapsed_time": "2:59:21", "remaining_time": "0:09:26"}
{"current_steps": 153, "total_steps": 160, "loss": 1.0418, "lr": 7.5445276451382e-07, "epoch": 1.9125, "percentage": 95.62, "elapsed_time": "3:00:58", "remaining_time": "0:08:16"}
{"current_steps": 154, "total_steps": 160, "loss": 1.0541, "lr": 5.545234436058966e-07, "epoch": 1.925, "percentage": 96.25, "elapsed_time": "3:02:34", "remaining_time": "0:07:06"}
{"current_steps": 155, "total_steps": 160, "loss": 1.0613, "lr": 3.852218662242546e-07, "epoch": 1.9375, "percentage": 96.88, "elapsed_time": "3:04:10", "remaining_time": "0:05:56"}
{"current_steps": 156, "total_steps": 160, "loss": 1.0097, "lr": 2.466133013497629e-07, "epoch": 1.95, "percentage": 97.5, "elapsed_time": "3:05:46", "remaining_time": "0:04:45"}
{"current_steps": 157, "total_steps": 160, "loss": 1.0606, "lr": 1.3875118522273412e-07, "epoch": 1.9625, "percentage": 98.12, "elapsed_time": "3:07:21", "remaining_time": "0:03:34"}
{"current_steps": 158, "total_steps": 160, "loss": 1.0207, "lr": 6.167710074216792e-08, "epoch": 1.975, "percentage": 98.75, "elapsed_time": "3:08:57", "remaining_time": "0:02:23"}
{"current_steps": 159, "total_steps": 160, "loss": 1.066, "lr": 1.5420761434814523e-08, "epoch": 1.9875, "percentage": 99.38, "elapsed_time": "3:10:33", "remaining_time": "0:01:11"}
{"current_steps": 160, "total_steps": 160, "loss": 1.0772, "lr": 0.0, "epoch": 2.0, "percentage": 100.0, "elapsed_time": "3:12:07", "remaining_time": "0:00:00"}
{"current_steps": 160, "total_steps": 160, "epoch": 2.0, "percentage": 100.0, "elapsed_time": "3:12:39", "remaining_time": "0:00:00"}

1162
trainer_state.json Normal file

File diff suppressed because it is too large Load Diff

3
training_args.bin Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:261cea4c24e8dc936885b356703d1c5fe17a417e1e82b9e59cf2b6b4966e5e42
size 7608

BIN
training_loss.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

1
vocab.json Normal file

File diff suppressed because one or more lines are too long