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

Model: ayh015/myLightningOPD
Source: Original Platform
This commit is contained in:
ModelHub XC
2026-08-27 23:50:14 +08:00
commit d4e0a1af66
368 changed files with 559583 additions and 0 deletions

42
.gitattributes vendored Normal file
View File

@@ -0,0 +1,42 @@
*.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
assets/intuitive.png filter=lfs diff=lfs merge=lfs -text
assets/main-results.png filter=lfs diff=lfs merge=lfs -text
assets/overview.png filter=lfs diff=lfs merge=lfs -text
configs/sft/data/sft_data/openthoughts3_300k_qwen3-8b.jsonl filter=lfs diff=lfs merge=lfs -text
data/prompts/dapo-math-17k/dapo-math-17k.jsonl filter=lfs diff=lfs merge=lfs -text
data/prompts/openthoughts3_300k.jsonl filter=lfs diff=lfs merge=lfs -text
tokenizer.json filter=lfs diff=lfs merge=lfs -text

61
README.md Normal file
View File

@@ -0,0 +1,61 @@
---
library_name: transformers
license: other
base_model: model_weights/qwen3-4b-base
tags:
- llama-factory
- full
- generated_from_trainer
model-index:
- name: qwen3-4b-base-sft-qwen3-8b
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. -->
# qwen3-4b-base-sft-qwen3-8b
This model is a fine-tuned version of [model_weights/qwen3-4b-base](https://huggingface.co/model_weights/qwen3-4b-base) on the openthoughts3_300k_qwen3-8b 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: 8e-05
- train_batch_size: 4
- eval_batch_size: 8
- seed: 42
- distributed_type: multi-GPU
- num_devices: 4
- gradient_accumulation_steps: 2
- total_train_batch_size: 32
- total_eval_batch_size: 32
- 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
- lr_scheduler_warmup_ratio: 0.1
- training_steps: 3000
### Training results
### Framework versions
- Transformers 4.52.4
- Pytorch 2.12.0+cu130
- Datasets 3.6.0
- Tokenizers 0.21.1

64
THIRD_PARTY_NOTICES.md Normal file
View File

@@ -0,0 +1,64 @@
# Third-Party Notices
This project includes or depends on third-party open source software. The following notices are provided in compliance with the respective licenses.
---
## Third-Party Code Included in This Repository
### verl (Bytedance)
- **File**: `slime/utils/seqlen_balancing.py`
- **Source**: https://github.com/volcengine/verl/blob/468adf22c43b744348051fccd7a5d830c6c3c36a/verl/utils/seqlen_balancing.py
- **Copyright**: Copyright 2024 Bytedance Ltd. and/or its affiliates
- **License**: Apache License 2.0
### lm-evaluation-harness (EleutherAI / HuggingFace)
- **File**: `slime/rollout/rm_hub/math_dapo_utils.py`
- **Source**: https://github.com/EleutherAI/lm-evaluation-harness/blob/main/lm_eval/tasks/hendrycks_math/utils.py
- **Copyright**: Copyright 2024 Bytedance Ltd. and/or its affiliates; Copyright 2022 EleutherAI and the HuggingFace Inc. team. All rights reserved.
- **License**: Apache License 2.0
---
## Third-Party Dependencies
This project depends on the following third-party packages, installed via `pip`. These are not distributed with this repository.
| Package | License |
|---------|---------|
| [PyTorch](https://github.com/pytorch/pytorch) | BSD-3-Clause |
| [Megatron-LM](https://github.com/NVIDIA/Megatron-LM) | BSD-3-Clause |
| [Megatron-Bridge](https://github.com/fzyzcjy/Megatron-Bridge) | Apache-2.0 |
| [SGLang](https://github.com/sgl-project/sglang) | Apache-2.0 |
| [sglang-router](https://github.com/sgl-project/sglang) | Apache-2.0 |
| [Ray](https://github.com/ray-project/ray) | Apache-2.0 |
| [Transformers](https://github.com/huggingface/transformers) | Apache-2.0 |
| [vLLM](https://github.com/vllm-project/vllm) | Apache-2.0 |
| [LlamaFactory](https://github.com/hiyouga/LLaMA-Factory) | Apache-2.0 |
| [Datasets](https://github.com/huggingface/datasets) | Apache-2.0 |
| [Accelerate](https://github.com/huggingface/accelerate) | Apache-2.0 |
| [NVIDIA ModelOpt](https://github.com/NVIDIA/TensorRT-Model-Optimizer) | Apache-2.0 |
| [Weights & Biases](https://github.com/wandb/wandb) | MIT |
| [TensorBoard](https://github.com/tensorflow/tensorboard) | Apache-2.0 |
| [Liger Kernel](https://github.com/linkedin/Liger-Kernel) | BSD-2-Clause |
| [ring-flash-attn](https://github.com/zhuzilin/ring-flash-attention) | Apache-2.0 |
| [OmegaConf](https://github.com/omry/omegaconf) | BSD-3-Clause |
| [PyYAML](https://github.com/yaml/pyyaml) | MIT |
| [httpx](https://github.com/encode/httpx) | BSD-3-Clause |
| [Pillow](https://github.com/python-pillow/Pillow) | MIT-CMU |
| [pylatexenc](https://github.com/phfaist/pylatexenc) | MIT |
| [pandas](https://github.com/pandas-dev/pandas) | BSD-3-Clause |
| [PyArrow](https://github.com/apache/arrow) | Apache-2.0 |
| [tqdm](https://github.com/tqdm/tqdm) | MPL-2.0 / MIT |
| [blobfile](https://github.com/christopher-hesse/blobfile) | Unlicense |
| [memray](https://github.com/bloomberg/memray) | Apache-2.0 |
| [MCP](https://github.com/modelcontextprotocol/python-sdk) | MIT |
| [Triton](https://github.com/triton-lang/triton) | MIT |
---
## Apache License 2.0 (Full Text)
The full text of the Apache License 2.0 is available in the [LICENSE](./LICENSE) file included with this repository.

28
added_tokens.json Normal file
View File

@@ -0,0 +1,28 @@
{
"</think>": 151668,
"</tool_call>": 151658,
"</tool_response>": 151666,
"<think>": 151667,
"<tool_call>": 151657,
"<tool_response>": 151665,
"<|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": 0.34443168771526983,
"total_flos": 3.429011909561549e+19,
"train_loss": 0.27564545996983847,
"train_runtime": 45365.0148,
"train_samples_per_second": 2.116,
"train_steps_per_second": 0.066
}

BIN
assets/cost.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

3
assets/intuitive.png Normal file
View File

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

3
assets/main-results.png Normal file
View File

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

BIN
assets/moe-results.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

3
assets/overview.png Normal file
View File

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

BIN
assets/teaser.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

89
chat_template.jinja Normal file
View File

@@ -0,0 +1,89 @@
{%- if tools %}
{{- '<|im_start|>system\n' }}
{%- if messages[0].role == 'system' %}
{{- messages[0].content + '\n\n' }}
{%- endif %}
{{- "# 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>" }}
{%- for tool in tools %}
{{- "\n" }}
{{- tool | tojson }}
{%- endfor %}
{{- "\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" }}
{%- else %}
{%- if messages[0].role == 'system' %}
{{- '<|im_start|>system\n' + messages[0].content + '<|im_end|>\n' }}
{%- endif %}
{%- endif %}
{%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}
{%- for message in messages[::-1] %}
{%- set index = (messages|length - 1) - loop.index0 %}
{%- if ns.multi_step_tool and message.role == "user" and message.content is string and not(message.content.startswith('<tool_response>') and message.content.endswith('</tool_response>')) %}
{%- set ns.multi_step_tool = false %}
{%- set ns.last_query_index = index %}
{%- endif %}
{%- endfor %}
{%- for message in messages %}
{%- if message.content is string %}
{%- set content = message.content %}
{%- else %}
{%- set content = '' %}
{%- endif %}
{%- if (message.role == "user") or (message.role == "system" and not loop.first) %}
{{- '<|im_start|>' + message.role + '\n' + content + '<|im_end|>' + '\n' }}
{%- elif message.role == "assistant" %}
{%- set reasoning_content = '' %}
{%- if message.reasoning_content is string %}
{%- set reasoning_content = message.reasoning_content %}
{%- else %}
{%- if '</think>' in content %}
{%- set reasoning_content = content.split('</think>')[0].rstrip('\n').split('<think>')[-1].lstrip('\n') %}
{%- set content = content.split('</think>')[-1].lstrip('\n') %}
{%- endif %}
{%- endif %}
{%- if loop.index0 > ns.last_query_index %}
{%- if loop.last or (not loop.last and reasoning_content) %}
{{- '<|im_start|>' + message.role + '\n<think>\n' + reasoning_content.strip('\n') + '\n</think>\n\n' + content.lstrip('\n') }}
{%- else %}
{{- '<|im_start|>' + message.role + '\n' + content }}
{%- endif %}
{%- else %}
{{- '<|im_start|>' + message.role + '\n' + content }}
{%- endif %}
{%- if message.tool_calls %}
{%- for tool_call in message.tool_calls %}
{%- if (loop.first and content) or (not loop.first) %}
{{- '\n' }}
{%- endif %}
{%- if tool_call.function %}
{%- set tool_call = tool_call.function %}
{%- endif %}
{{- '<tool_call>\n{"name": "' }}
{{- tool_call.name }}
{{- '", "arguments": ' }}
{%- if tool_call.arguments is string %}
{{- tool_call.arguments }}
{%- else %}
{{- tool_call.arguments | tojson }}
{%- endif %}
{{- '}\n</tool_call>' }}
{%- endfor %}
{%- endif %}
{{- '<|im_end|>\n' }}
{%- elif message.role == "tool" %}
{%- if loop.first or (messages[loop.index0 - 1].role != "tool") %}
{{- '<|im_start|>user' }}
{%- endif %}
{{- '\n<tool_response>\n' }}
{{- content }}
{{- '\n</tool_response>' }}
{%- if loop.last or (messages[loop.index0 + 1].role != "tool") %}
{{- '<|im_end|>\n' }}
{%- endif %}
{%- endif %}
{%- endfor %}
{%- if add_generation_prompt %}
{{- '<|im_start|>assistant\n' }}
{%- if enable_thinking is defined and enable_thinking is false %}
{{- '<think>\n\n</think>\n\n' }}
{%- endif %}
{%- endif %}

View File

@@ -0,0 +1,61 @@
---
library_name: transformers
license: other
base_model: model_weights/qwen3-4b-base
tags:
- llama-factory
- full
- generated_from_trainer
model-index:
- name: qwen3-4b-base-sft-qwen3-8b
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. -->
# qwen3-4b-base-sft-qwen3-8b
This model is a fine-tuned version of [model_weights/qwen3-4b-base](https://huggingface.co/model_weights/qwen3-4b-base) on the openthoughts3_300k_qwen3-8b 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: 8e-05
- train_batch_size: 4
- eval_batch_size: 8
- seed: 42
- distributed_type: multi-GPU
- num_devices: 4
- gradient_accumulation_steps: 2
- total_train_batch_size: 32
- total_eval_batch_size: 32
- 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
- lr_scheduler_warmup_ratio: 0.1
- training_steps: 3000
### Training results
### Framework versions
- Transformers 4.52.4
- Pytorch 2.12.0+cu130
- Datasets 3.6.0
- Tokenizers 0.21.1

View File

@@ -0,0 +1,28 @@
{
"</think>": 151668,
"</tool_call>": 151658,
"</tool_response>": 151666,
"<think>": 151667,
"<tool_call>": 151657,
"<tool_response>": 151665,
"<|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,8 @@
{
"epoch": 0.34443168771526983,
"total_flos": 3.429011909561549e+19,
"train_loss": 0.27564545996983847,
"train_runtime": 45365.0148,
"train_samples_per_second": 2.116,
"train_steps_per_second": 0.066
}

View File

@@ -0,0 +1,89 @@
{%- if tools %}
{{- '<|im_start|>system\n' }}
{%- if messages[0].role == 'system' %}
{{- messages[0].content + '\n\n' }}
{%- endif %}
{{- "# 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>" }}
{%- for tool in tools %}
{{- "\n" }}
{{- tool | tojson }}
{%- endfor %}
{{- "\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" }}
{%- else %}
{%- if messages[0].role == 'system' %}
{{- '<|im_start|>system\n' + messages[0].content + '<|im_end|>\n' }}
{%- endif %}
{%- endif %}
{%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}
{%- for message in messages[::-1] %}
{%- set index = (messages|length - 1) - loop.index0 %}
{%- if ns.multi_step_tool and message.role == "user" and message.content is string and not(message.content.startswith('<tool_response>') and message.content.endswith('</tool_response>')) %}
{%- set ns.multi_step_tool = false %}
{%- set ns.last_query_index = index %}
{%- endif %}
{%- endfor %}
{%- for message in messages %}
{%- if message.content is string %}
{%- set content = message.content %}
{%- else %}
{%- set content = '' %}
{%- endif %}
{%- if (message.role == "user") or (message.role == "system" and not loop.first) %}
{{- '<|im_start|>' + message.role + '\n' + content + '<|im_end|>' + '\n' }}
{%- elif message.role == "assistant" %}
{%- set reasoning_content = '' %}
{%- if message.reasoning_content is string %}
{%- set reasoning_content = message.reasoning_content %}
{%- else %}
{%- if '</think>' in content %}
{%- set reasoning_content = content.split('</think>')[0].rstrip('\n').split('<think>')[-1].lstrip('\n') %}
{%- set content = content.split('</think>')[-1].lstrip('\n') %}
{%- endif %}
{%- endif %}
{%- if loop.index0 > ns.last_query_index %}
{%- if loop.last or (not loop.last and reasoning_content) %}
{{- '<|im_start|>' + message.role + '\n<think>\n' + reasoning_content.strip('\n') + '\n</think>\n\n' + content.lstrip('\n') }}
{%- else %}
{{- '<|im_start|>' + message.role + '\n' + content }}
{%- endif %}
{%- else %}
{{- '<|im_start|>' + message.role + '\n' + content }}
{%- endif %}
{%- if message.tool_calls %}
{%- for tool_call in message.tool_calls %}
{%- if (loop.first and content) or (not loop.first) %}
{{- '\n' }}
{%- endif %}
{%- if tool_call.function %}
{%- set tool_call = tool_call.function %}
{%- endif %}
{{- '<tool_call>\n{"name": "' }}
{{- tool_call.name }}
{{- '", "arguments": ' }}
{%- if tool_call.arguments is string %}
{{- tool_call.arguments }}
{%- else %}
{{- tool_call.arguments | tojson }}
{%- endif %}
{{- '}\n</tool_call>' }}
{%- endfor %}
{%- endif %}
{{- '<|im_end|>\n' }}
{%- elif message.role == "tool" %}
{%- if loop.first or (messages[loop.index0 - 1].role != "tool") %}
{{- '<|im_start|>user' }}
{%- endif %}
{{- '\n<tool_response>\n' }}
{{- content }}
{{- '\n</tool_response>' }}
{%- if loop.last or (messages[loop.index0 + 1].role != "tool") %}
{{- '<|im_end|>\n' }}
{%- endif %}
{%- endif %}
{%- endfor %}
{%- if add_generation_prompt %}
{{- '<|im_start|>assistant\n' }}
{%- if enable_thinking is defined and enable_thinking is false %}
{{- '<think>\n\n</think>\n\n' }}
{%- endif %}
{%- endif %}

View File

@@ -0,0 +1,30 @@
{
"architectures": [
"Qwen3ForCausalLM"
],
"attention_bias": false,
"attention_dropout": 0.0,
"bos_token_id": 151643,
"eos_token_id": 151645,
"head_dim": 128,
"hidden_act": "silu",
"hidden_size": 2560,
"initializer_range": 0.02,
"intermediate_size": 9728,
"max_position_embeddings": 40960,
"max_window_layers": 36,
"model_type": "qwen3",
"num_attention_heads": 32,
"num_hidden_layers": 36,
"num_key_value_heads": 8,
"rms_norm_eps": 1e-06,
"rope_scaling": null,
"rope_theta": 1000000,
"sliding_window": null,
"tie_word_embeddings": true,
"torch_dtype": "bfloat16",
"transformers_version": "4.52.4",
"use_cache": false,
"use_sliding_window": false,
"vocab_size": 151936
}

View File

@@ -0,0 +1,13 @@
{
"bos_token_id": 151643,
"do_sample": true,
"eos_token_id": [
151645,
151643
],
"pad_token_id": 151643,
"temperature": 0.6,
"top_k": 20,
"top_p": 0.95,
"transformers_version": "4.52.4"
}

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:3d57b393ee9734c673d28da679609d593ade800fb4dfc7774a388da2a0be5654
size 4967215360

View File

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

View File

@@ -0,0 +1,406 @@
{
"metadata": {
"total_size": 8822848512
},
"weight_map": {
"lm_head.weight": "model-00002-of-00002.safetensors",
"model.embed_tokens.weight": "model-00001-of-00002.safetensors",
"model.layers.0.input_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.0.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.0.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.0.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.0.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.0.self_attn.k_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.0.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.0.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.0.self_attn.q_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.0.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.0.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.1.input_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.1.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.1.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.1.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.1.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.1.self_attn.k_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.1.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.1.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.1.self_attn.q_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.1.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.1.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.10.input_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.10.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.10.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.10.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.10.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.10.self_attn.k_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.10.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.10.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.10.self_attn.q_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.10.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.10.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.11.input_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.11.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.11.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.11.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.11.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.11.self_attn.k_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.11.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.11.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.11.self_attn.q_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.11.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.11.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.12.input_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.12.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.12.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.12.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.12.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.12.self_attn.k_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.12.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.12.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.12.self_attn.q_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.12.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.12.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.13.input_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.13.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.13.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.13.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.13.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.13.self_attn.k_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.13.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.13.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.13.self_attn.q_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.13.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.13.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.14.input_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.14.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.14.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.14.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.14.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.14.self_attn.k_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.14.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.14.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.14.self_attn.q_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.14.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.14.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.15.input_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.15.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.15.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.15.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.15.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.15.self_attn.k_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.15.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.15.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.15.self_attn.q_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.15.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.15.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.16.input_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.16.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.16.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.16.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.16.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.16.self_attn.k_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.16.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.16.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.16.self_attn.q_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.16.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.16.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.17.input_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.17.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.17.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.17.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.17.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.17.self_attn.k_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.17.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.17.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.17.self_attn.q_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.17.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.17.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.18.input_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.18.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.18.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.18.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.18.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.18.self_attn.k_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.18.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.18.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.18.self_attn.q_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.18.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.18.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.19.input_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.19.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.19.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.19.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.19.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.19.self_attn.k_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.19.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.19.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.19.self_attn.q_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.19.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.19.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.2.input_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.2.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.2.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.2.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.2.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.2.self_attn.k_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.2.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.2.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.2.self_attn.q_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.2.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.2.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.20.input_layernorm.weight": "model-00002-of-00002.safetensors",
"model.layers.20.mlp.down_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.20.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.20.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.20.post_attention_layernorm.weight": "model-00002-of-00002.safetensors",
"model.layers.20.self_attn.k_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.20.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.20.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.20.self_attn.q_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.20.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.20.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.21.input_layernorm.weight": "model-00002-of-00002.safetensors",
"model.layers.21.mlp.down_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.21.mlp.gate_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.21.mlp.up_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.21.post_attention_layernorm.weight": "model-00002-of-00002.safetensors",
"model.layers.21.self_attn.k_norm.weight": "model-00002-of-00002.safetensors",
"model.layers.21.self_attn.k_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.21.self_attn.o_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.21.self_attn.q_norm.weight": "model-00002-of-00002.safetensors",
"model.layers.21.self_attn.q_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.21.self_attn.v_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.22.input_layernorm.weight": "model-00002-of-00002.safetensors",
"model.layers.22.mlp.down_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.22.mlp.gate_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.22.mlp.up_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.22.post_attention_layernorm.weight": "model-00002-of-00002.safetensors",
"model.layers.22.self_attn.k_norm.weight": "model-00002-of-00002.safetensors",
"model.layers.22.self_attn.k_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.22.self_attn.o_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.22.self_attn.q_norm.weight": "model-00002-of-00002.safetensors",
"model.layers.22.self_attn.q_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.22.self_attn.v_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.23.input_layernorm.weight": "model-00002-of-00002.safetensors",
"model.layers.23.mlp.down_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.23.mlp.gate_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.23.mlp.up_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.23.post_attention_layernorm.weight": "model-00002-of-00002.safetensors",
"model.layers.23.self_attn.k_norm.weight": "model-00002-of-00002.safetensors",
"model.layers.23.self_attn.k_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.23.self_attn.o_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.23.self_attn.q_norm.weight": "model-00002-of-00002.safetensors",
"model.layers.23.self_attn.q_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.23.self_attn.v_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.24.input_layernorm.weight": "model-00002-of-00002.safetensors",
"model.layers.24.mlp.down_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.24.mlp.gate_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.24.mlp.up_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.24.post_attention_layernorm.weight": "model-00002-of-00002.safetensors",
"model.layers.24.self_attn.k_norm.weight": "model-00002-of-00002.safetensors",
"model.layers.24.self_attn.k_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.24.self_attn.o_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.24.self_attn.q_norm.weight": "model-00002-of-00002.safetensors",
"model.layers.24.self_attn.q_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.24.self_attn.v_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.25.input_layernorm.weight": "model-00002-of-00002.safetensors",
"model.layers.25.mlp.down_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.25.mlp.gate_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.25.mlp.up_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.25.post_attention_layernorm.weight": "model-00002-of-00002.safetensors",
"model.layers.25.self_attn.k_norm.weight": "model-00002-of-00002.safetensors",
"model.layers.25.self_attn.k_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.25.self_attn.o_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.25.self_attn.q_norm.weight": "model-00002-of-00002.safetensors",
"model.layers.25.self_attn.q_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.25.self_attn.v_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.26.input_layernorm.weight": "model-00002-of-00002.safetensors",
"model.layers.26.mlp.down_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.26.mlp.gate_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.26.mlp.up_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.26.post_attention_layernorm.weight": "model-00002-of-00002.safetensors",
"model.layers.26.self_attn.k_norm.weight": "model-00002-of-00002.safetensors",
"model.layers.26.self_attn.k_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.26.self_attn.o_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.26.self_attn.q_norm.weight": "model-00002-of-00002.safetensors",
"model.layers.26.self_attn.q_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.26.self_attn.v_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.27.input_layernorm.weight": "model-00002-of-00002.safetensors",
"model.layers.27.mlp.down_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.27.mlp.gate_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.27.mlp.up_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.27.post_attention_layernorm.weight": "model-00002-of-00002.safetensors",
"model.layers.27.self_attn.k_norm.weight": "model-00002-of-00002.safetensors",
"model.layers.27.self_attn.k_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.27.self_attn.o_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.27.self_attn.q_norm.weight": "model-00002-of-00002.safetensors",
"model.layers.27.self_attn.q_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.27.self_attn.v_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.28.input_layernorm.weight": "model-00002-of-00002.safetensors",
"model.layers.28.mlp.down_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.28.mlp.gate_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.28.mlp.up_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.28.post_attention_layernorm.weight": "model-00002-of-00002.safetensors",
"model.layers.28.self_attn.k_norm.weight": "model-00002-of-00002.safetensors",
"model.layers.28.self_attn.k_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.28.self_attn.o_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.28.self_attn.q_norm.weight": "model-00002-of-00002.safetensors",
"model.layers.28.self_attn.q_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.28.self_attn.v_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.29.input_layernorm.weight": "model-00002-of-00002.safetensors",
"model.layers.29.mlp.down_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.29.mlp.gate_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.29.mlp.up_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.29.post_attention_layernorm.weight": "model-00002-of-00002.safetensors",
"model.layers.29.self_attn.k_norm.weight": "model-00002-of-00002.safetensors",
"model.layers.29.self_attn.k_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.29.self_attn.o_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.29.self_attn.q_norm.weight": "model-00002-of-00002.safetensors",
"model.layers.29.self_attn.q_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.29.self_attn.v_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.3.input_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.3.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.3.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.3.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.3.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.3.self_attn.k_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.3.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.3.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.3.self_attn.q_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.3.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.3.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.30.input_layernorm.weight": "model-00002-of-00002.safetensors",
"model.layers.30.mlp.down_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.30.mlp.gate_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.30.mlp.up_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.30.post_attention_layernorm.weight": "model-00002-of-00002.safetensors",
"model.layers.30.self_attn.k_norm.weight": "model-00002-of-00002.safetensors",
"model.layers.30.self_attn.k_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.30.self_attn.o_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.30.self_attn.q_norm.weight": "model-00002-of-00002.safetensors",
"model.layers.30.self_attn.q_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.30.self_attn.v_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.31.input_layernorm.weight": "model-00002-of-00002.safetensors",
"model.layers.31.mlp.down_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.31.mlp.gate_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.31.mlp.up_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.31.post_attention_layernorm.weight": "model-00002-of-00002.safetensors",
"model.layers.31.self_attn.k_norm.weight": "model-00002-of-00002.safetensors",
"model.layers.31.self_attn.k_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.31.self_attn.o_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.31.self_attn.q_norm.weight": "model-00002-of-00002.safetensors",
"model.layers.31.self_attn.q_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.31.self_attn.v_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.32.input_layernorm.weight": "model-00002-of-00002.safetensors",
"model.layers.32.mlp.down_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.32.mlp.gate_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.32.mlp.up_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.32.post_attention_layernorm.weight": "model-00002-of-00002.safetensors",
"model.layers.32.self_attn.k_norm.weight": "model-00002-of-00002.safetensors",
"model.layers.32.self_attn.k_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.32.self_attn.o_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.32.self_attn.q_norm.weight": "model-00002-of-00002.safetensors",
"model.layers.32.self_attn.q_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.32.self_attn.v_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.33.input_layernorm.weight": "model-00002-of-00002.safetensors",
"model.layers.33.mlp.down_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.33.mlp.gate_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.33.mlp.up_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.33.post_attention_layernorm.weight": "model-00002-of-00002.safetensors",
"model.layers.33.self_attn.k_norm.weight": "model-00002-of-00002.safetensors",
"model.layers.33.self_attn.k_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.33.self_attn.o_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.33.self_attn.q_norm.weight": "model-00002-of-00002.safetensors",
"model.layers.33.self_attn.q_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.33.self_attn.v_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.34.input_layernorm.weight": "model-00002-of-00002.safetensors",
"model.layers.34.mlp.down_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.34.mlp.gate_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.34.mlp.up_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.34.post_attention_layernorm.weight": "model-00002-of-00002.safetensors",
"model.layers.34.self_attn.k_norm.weight": "model-00002-of-00002.safetensors",
"model.layers.34.self_attn.k_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.34.self_attn.o_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.34.self_attn.q_norm.weight": "model-00002-of-00002.safetensors",
"model.layers.34.self_attn.q_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.34.self_attn.v_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.35.input_layernorm.weight": "model-00002-of-00002.safetensors",
"model.layers.35.mlp.down_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.35.mlp.gate_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.35.mlp.up_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.35.post_attention_layernorm.weight": "model-00002-of-00002.safetensors",
"model.layers.35.self_attn.k_norm.weight": "model-00002-of-00002.safetensors",
"model.layers.35.self_attn.k_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.35.self_attn.o_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.35.self_attn.q_norm.weight": "model-00002-of-00002.safetensors",
"model.layers.35.self_attn.q_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.35.self_attn.v_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.4.input_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.4.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.4.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.4.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.4.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.4.self_attn.k_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.4.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.4.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.4.self_attn.q_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.4.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.4.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.5.input_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.5.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.5.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.5.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.5.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.5.self_attn.k_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.5.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.5.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.5.self_attn.q_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.5.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.5.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.6.input_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.6.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.6.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.6.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.6.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.6.self_attn.k_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.6.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.6.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.6.self_attn.q_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.6.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.6.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.7.input_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.7.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.7.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.7.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.7.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.7.self_attn.k_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.7.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.7.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.7.self_attn.q_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.7.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.7.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.8.input_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.8.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.8.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.8.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.8.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.8.self_attn.k_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.8.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.8.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.8.self_attn.q_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.8.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.8.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.9.input_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.9.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.9.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.9.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.9.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.9.self_attn.k_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.9.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.9.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.9.self_attn.q_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.9.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.9.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
"model.norm.weight": "model-00002-of-00002.safetensors"
}
}

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": "<|im_end|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false
},
"pad_token": {
"content": "<|endoftext|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false
}
}

BIN
checkpoints/qwen3-4b-base-sft-qwen3-8b/tokenizer.json (Stored with Git LFS) Normal file

Binary file not shown.

View File

@@ -0,0 +1,240 @@
{
"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
},
"151665": {
"content": "<tool_response>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
},
"151666": {
"content": "</tool_response>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
},
"151667": {
"content": "<think>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
},
"151668": {
"content": "</think>",
"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,
"clean_up_tokenization_spaces": false,
"eos_token": "<|im_end|>",
"errors": "replace",
"extra_special_tokens": {},
"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,8 @@
{
"epoch": 0.34443168771526983,
"total_flos": 3.429011909561549e+19,
"train_loss": 0.27564545996983847,
"train_runtime": 45365.0148,
"train_samples_per_second": 2.116,
"train_steps_per_second": 0.066
}

File diff suppressed because it is too large Load Diff

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:b28ccff420c215e9d7eaa03851e14301ec0e1720a9cca5e39fab81383ec4e4a7
size 7377

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,61 @@
---
library_name: transformers
license: other
base_model: model_weights/qwen3-4b-base
tags:
- llama-factory
- full
- generated_from_trainer
model-index:
- name: qwen3-4b-base-sft-qwen3-8b
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. -->
# qwen3-4b-base-sft-qwen3-8b
This model is a fine-tuned version of [model_weights/qwen3-4b-base](https://huggingface.co/model_weights/qwen3-4b-base) on the openthoughts3_300k_qwen3-8b 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: 8e-05
- train_batch_size: 4
- eval_batch_size: 8
- seed: 42
- distributed_type: multi-GPU
- num_devices: 4
- gradient_accumulation_steps: 2
- total_train_batch_size: 32
- total_eval_batch_size: 32
- 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
- lr_scheduler_warmup_ratio: 0.1
- training_steps: 3000
### Training results
### Framework versions
- Transformers 4.52.4
- Pytorch 2.12.0+cu130
- Datasets 3.6.0
- Tokenizers 0.21.1

View File

@@ -0,0 +1,28 @@
{
"</think>": 151668,
"</tool_call>": 151658,
"</tool_response>": 151666,
"<think>": 151667,
"<tool_call>": 151657,
"<tool_response>": 151665,
"<|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,8 @@
{
"epoch": 0.34443168771526983,
"total_flos": 3.429011909561549e+19,
"train_loss": 0.27564545996983847,
"train_runtime": 45365.0148,
"train_samples_per_second": 2.116,
"train_steps_per_second": 0.066
}

View File

@@ -0,0 +1,89 @@
{%- if tools %}
{{- '<|im_start|>system\n' }}
{%- if messages[0].role == 'system' %}
{{- messages[0].content + '\n\n' }}
{%- endif %}
{{- "# 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>" }}
{%- for tool in tools %}
{{- "\n" }}
{{- tool | tojson }}
{%- endfor %}
{{- "\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" }}
{%- else %}
{%- if messages[0].role == 'system' %}
{{- '<|im_start|>system\n' + messages[0].content + '<|im_end|>\n' }}
{%- endif %}
{%- endif %}
{%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}
{%- for message in messages[::-1] %}
{%- set index = (messages|length - 1) - loop.index0 %}
{%- if ns.multi_step_tool and message.role == "user" and message.content is string and not(message.content.startswith('<tool_response>') and message.content.endswith('</tool_response>')) %}
{%- set ns.multi_step_tool = false %}
{%- set ns.last_query_index = index %}
{%- endif %}
{%- endfor %}
{%- for message in messages %}
{%- if message.content is string %}
{%- set content = message.content %}
{%- else %}
{%- set content = '' %}
{%- endif %}
{%- if (message.role == "user") or (message.role == "system" and not loop.first) %}
{{- '<|im_start|>' + message.role + '\n' + content + '<|im_end|>' + '\n' }}
{%- elif message.role == "assistant" %}
{%- set reasoning_content = '' %}
{%- if message.reasoning_content is string %}
{%- set reasoning_content = message.reasoning_content %}
{%- else %}
{%- if '</think>' in content %}
{%- set reasoning_content = content.split('</think>')[0].rstrip('\n').split('<think>')[-1].lstrip('\n') %}
{%- set content = content.split('</think>')[-1].lstrip('\n') %}
{%- endif %}
{%- endif %}
{%- if loop.index0 > ns.last_query_index %}
{%- if loop.last or (not loop.last and reasoning_content) %}
{{- '<|im_start|>' + message.role + '\n<think>\n' + reasoning_content.strip('\n') + '\n</think>\n\n' + content.lstrip('\n') }}
{%- else %}
{{- '<|im_start|>' + message.role + '\n' + content }}
{%- endif %}
{%- else %}
{{- '<|im_start|>' + message.role + '\n' + content }}
{%- endif %}
{%- if message.tool_calls %}
{%- for tool_call in message.tool_calls %}
{%- if (loop.first and content) or (not loop.first) %}
{{- '\n' }}
{%- endif %}
{%- if tool_call.function %}
{%- set tool_call = tool_call.function %}
{%- endif %}
{{- '<tool_call>\n{"name": "' }}
{{- tool_call.name }}
{{- '", "arguments": ' }}
{%- if tool_call.arguments is string %}
{{- tool_call.arguments }}
{%- else %}
{{- tool_call.arguments | tojson }}
{%- endif %}
{{- '}\n</tool_call>' }}
{%- endfor %}
{%- endif %}
{{- '<|im_end|>\n' }}
{%- elif message.role == "tool" %}
{%- if loop.first or (messages[loop.index0 - 1].role != "tool") %}
{{- '<|im_start|>user' }}
{%- endif %}
{{- '\n<tool_response>\n' }}
{{- content }}
{{- '\n</tool_response>' }}
{%- if loop.last or (messages[loop.index0 + 1].role != "tool") %}
{{- '<|im_end|>\n' }}
{%- endif %}
{%- endif %}
{%- endfor %}
{%- if add_generation_prompt %}
{{- '<|im_start|>assistant\n' }}
{%- if enable_thinking is defined and enable_thinking is false %}
{{- '<think>\n\n</think>\n\n' }}
{%- endif %}
{%- endif %}

View File

@@ -0,0 +1,30 @@
{
"architectures": [
"Qwen3ForCausalLM"
],
"attention_bias": false,
"attention_dropout": 0.0,
"bos_token_id": 151643,
"eos_token_id": 151645,
"head_dim": 128,
"hidden_act": "silu",
"hidden_size": 2560,
"initializer_range": 0.02,
"intermediate_size": 9728,
"max_position_embeddings": 40960,
"max_window_layers": 36,
"model_type": "qwen3",
"num_attention_heads": 32,
"num_hidden_layers": 36,
"num_key_value_heads": 8,
"rms_norm_eps": 1e-06,
"rope_scaling": null,
"rope_theta": 1000000,
"sliding_window": null,
"tie_word_embeddings": true,
"torch_dtype": "bfloat16",
"transformers_version": "4.52.4",
"use_cache": false,
"use_sliding_window": false,
"vocab_size": 151936
}

View File

@@ -0,0 +1,13 @@
{
"bos_token_id": 151643,
"do_sample": true,
"eos_token_id": [
151645,
151643
],
"pad_token_id": 151643,
"temperature": 0.6,
"top_k": 20,
"top_p": 0.95,
"transformers_version": "4.52.4"
}

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:9347d0d8aeae95b73ee3af7175c658679b6e4544a6f1c65a37c945520ee86a0e
size 5355373240

View File

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

View File

@@ -0,0 +1,405 @@
{
"metadata": {
"total_size": 8044936192
},
"weight_map": {
"model.embed_tokens.weight": "model-00000-of-00002.safetensors",
"model.layers.0.self_attn.o_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.1.self_attn.o_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.2.self_attn.o_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.3.self_attn.o_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.4.self_attn.o_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.5.self_attn.o_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.6.self_attn.o_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.7.self_attn.o_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.8.self_attn.o_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.9.self_attn.o_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.10.self_attn.o_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.11.self_attn.o_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.12.self_attn.o_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.13.self_attn.o_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.14.self_attn.o_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.15.self_attn.o_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.16.self_attn.o_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.17.self_attn.o_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.18.self_attn.o_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.19.self_attn.o_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.20.self_attn.o_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.21.self_attn.o_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.22.self_attn.o_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.23.self_attn.o_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.24.self_attn.o_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.25.self_attn.o_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.26.self_attn.o_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.27.self_attn.o_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.28.self_attn.o_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.29.self_attn.o_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.30.self_attn.o_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.31.self_attn.o_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.32.self_attn.o_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.33.self_attn.o_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.34.self_attn.o_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.35.self_attn.o_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.0.input_layernorm.weight": "model-00000-of-00002.safetensors",
"model.layers.1.input_layernorm.weight": "model-00000-of-00002.safetensors",
"model.layers.2.input_layernorm.weight": "model-00000-of-00002.safetensors",
"model.layers.3.input_layernorm.weight": "model-00000-of-00002.safetensors",
"model.layers.4.input_layernorm.weight": "model-00000-of-00002.safetensors",
"model.layers.5.input_layernorm.weight": "model-00000-of-00002.safetensors",
"model.layers.6.input_layernorm.weight": "model-00000-of-00002.safetensors",
"model.layers.7.input_layernorm.weight": "model-00000-of-00002.safetensors",
"model.layers.8.input_layernorm.weight": "model-00000-of-00002.safetensors",
"model.layers.9.input_layernorm.weight": "model-00000-of-00002.safetensors",
"model.layers.10.input_layernorm.weight": "model-00000-of-00002.safetensors",
"model.layers.11.input_layernorm.weight": "model-00000-of-00002.safetensors",
"model.layers.12.input_layernorm.weight": "model-00000-of-00002.safetensors",
"model.layers.13.input_layernorm.weight": "model-00000-of-00002.safetensors",
"model.layers.14.input_layernorm.weight": "model-00000-of-00002.safetensors",
"model.layers.15.input_layernorm.weight": "model-00000-of-00002.safetensors",
"model.layers.16.input_layernorm.weight": "model-00000-of-00002.safetensors",
"model.layers.17.input_layernorm.weight": "model-00000-of-00002.safetensors",
"model.layers.18.input_layernorm.weight": "model-00000-of-00002.safetensors",
"model.layers.19.input_layernorm.weight": "model-00000-of-00002.safetensors",
"model.layers.20.input_layernorm.weight": "model-00000-of-00002.safetensors",
"model.layers.21.input_layernorm.weight": "model-00000-of-00002.safetensors",
"model.layers.22.input_layernorm.weight": "model-00000-of-00002.safetensors",
"model.layers.23.input_layernorm.weight": "model-00000-of-00002.safetensors",
"model.layers.24.input_layernorm.weight": "model-00000-of-00002.safetensors",
"model.layers.25.input_layernorm.weight": "model-00000-of-00002.safetensors",
"model.layers.26.input_layernorm.weight": "model-00000-of-00002.safetensors",
"model.layers.27.input_layernorm.weight": "model-00000-of-00002.safetensors",
"model.layers.28.input_layernorm.weight": "model-00000-of-00002.safetensors",
"model.layers.29.input_layernorm.weight": "model-00000-of-00002.safetensors",
"model.layers.30.input_layernorm.weight": "model-00000-of-00002.safetensors",
"model.layers.31.input_layernorm.weight": "model-00000-of-00002.safetensors",
"model.layers.32.input_layernorm.weight": "model-00000-of-00002.safetensors",
"model.layers.33.input_layernorm.weight": "model-00000-of-00002.safetensors",
"model.layers.34.input_layernorm.weight": "model-00000-of-00002.safetensors",
"model.layers.35.input_layernorm.weight": "model-00000-of-00002.safetensors",
"model.layers.0.self_attn.q_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.0.self_attn.k_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.0.self_attn.v_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.1.self_attn.q_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.1.self_attn.k_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.1.self_attn.v_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.2.self_attn.q_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.2.self_attn.k_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.2.self_attn.v_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.3.self_attn.q_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.3.self_attn.k_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.3.self_attn.v_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.4.self_attn.q_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.4.self_attn.k_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.4.self_attn.v_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.5.self_attn.q_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.5.self_attn.k_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.5.self_attn.v_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.6.self_attn.q_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.6.self_attn.k_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.6.self_attn.v_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.7.self_attn.q_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.7.self_attn.k_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.7.self_attn.v_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.8.self_attn.q_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.8.self_attn.k_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.8.self_attn.v_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.9.self_attn.q_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.9.self_attn.k_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.9.self_attn.v_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.10.self_attn.q_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.10.self_attn.k_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.10.self_attn.v_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.11.self_attn.q_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.11.self_attn.k_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.11.self_attn.v_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.12.self_attn.q_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.12.self_attn.k_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.12.self_attn.v_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.13.self_attn.q_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.13.self_attn.k_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.13.self_attn.v_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.14.self_attn.q_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.14.self_attn.k_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.14.self_attn.v_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.15.self_attn.q_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.15.self_attn.k_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.15.self_attn.v_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.16.self_attn.q_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.16.self_attn.k_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.16.self_attn.v_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.17.self_attn.q_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.17.self_attn.k_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.17.self_attn.v_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.18.self_attn.q_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.18.self_attn.k_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.18.self_attn.v_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.19.self_attn.q_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.19.self_attn.k_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.19.self_attn.v_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.20.self_attn.q_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.20.self_attn.k_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.20.self_attn.v_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.21.self_attn.q_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.21.self_attn.k_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.21.self_attn.v_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.22.self_attn.q_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.22.self_attn.k_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.22.self_attn.v_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.23.self_attn.q_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.23.self_attn.k_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.23.self_attn.v_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.24.self_attn.q_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.24.self_attn.k_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.24.self_attn.v_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.25.self_attn.q_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.25.self_attn.k_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.25.self_attn.v_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.26.self_attn.q_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.26.self_attn.k_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.26.self_attn.v_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.27.self_attn.q_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.27.self_attn.k_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.27.self_attn.v_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.28.self_attn.q_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.28.self_attn.k_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.28.self_attn.v_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.29.self_attn.q_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.29.self_attn.k_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.29.self_attn.v_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.30.self_attn.q_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.30.self_attn.k_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.30.self_attn.v_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.31.self_attn.q_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.31.self_attn.k_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.31.self_attn.v_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.32.self_attn.q_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.32.self_attn.k_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.32.self_attn.v_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.33.self_attn.q_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.33.self_attn.k_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.33.self_attn.v_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.34.self_attn.q_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.34.self_attn.k_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.34.self_attn.v_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.35.self_attn.q_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.35.self_attn.k_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.35.self_attn.v_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.0.self_attn.q_norm.weight": "model-00000-of-00002.safetensors",
"model.layers.1.self_attn.q_norm.weight": "model-00000-of-00002.safetensors",
"model.layers.2.self_attn.q_norm.weight": "model-00000-of-00002.safetensors",
"model.layers.3.self_attn.q_norm.weight": "model-00000-of-00002.safetensors",
"model.layers.4.self_attn.q_norm.weight": "model-00000-of-00002.safetensors",
"model.layers.5.self_attn.q_norm.weight": "model-00000-of-00002.safetensors",
"model.layers.6.self_attn.q_norm.weight": "model-00000-of-00002.safetensors",
"model.layers.7.self_attn.q_norm.weight": "model-00000-of-00002.safetensors",
"model.layers.8.self_attn.q_norm.weight": "model-00000-of-00002.safetensors",
"model.layers.9.self_attn.q_norm.weight": "model-00000-of-00002.safetensors",
"model.layers.10.self_attn.q_norm.weight": "model-00000-of-00002.safetensors",
"model.layers.11.self_attn.q_norm.weight": "model-00000-of-00002.safetensors",
"model.layers.12.self_attn.q_norm.weight": "model-00000-of-00002.safetensors",
"model.layers.13.self_attn.q_norm.weight": "model-00000-of-00002.safetensors",
"model.layers.14.self_attn.q_norm.weight": "model-00000-of-00002.safetensors",
"model.layers.15.self_attn.q_norm.weight": "model-00000-of-00002.safetensors",
"model.layers.16.self_attn.q_norm.weight": "model-00000-of-00002.safetensors",
"model.layers.17.self_attn.q_norm.weight": "model-00000-of-00002.safetensors",
"model.layers.18.self_attn.q_norm.weight": "model-00000-of-00002.safetensors",
"model.layers.19.self_attn.q_norm.weight": "model-00000-of-00002.safetensors",
"model.layers.20.self_attn.q_norm.weight": "model-00000-of-00002.safetensors",
"model.layers.21.self_attn.q_norm.weight": "model-00000-of-00002.safetensors",
"model.layers.22.self_attn.q_norm.weight": "model-00000-of-00002.safetensors",
"model.layers.23.self_attn.q_norm.weight": "model-00000-of-00002.safetensors",
"model.layers.24.self_attn.q_norm.weight": "model-00000-of-00002.safetensors",
"model.layers.25.self_attn.q_norm.weight": "model-00000-of-00002.safetensors",
"model.layers.26.self_attn.q_norm.weight": "model-00000-of-00002.safetensors",
"model.layers.27.self_attn.q_norm.weight": "model-00000-of-00002.safetensors",
"model.layers.28.self_attn.q_norm.weight": "model-00000-of-00002.safetensors",
"model.layers.29.self_attn.q_norm.weight": "model-00000-of-00002.safetensors",
"model.layers.30.self_attn.q_norm.weight": "model-00000-of-00002.safetensors",
"model.layers.31.self_attn.q_norm.weight": "model-00000-of-00002.safetensors",
"model.layers.32.self_attn.q_norm.weight": "model-00000-of-00002.safetensors",
"model.layers.33.self_attn.q_norm.weight": "model-00000-of-00002.safetensors",
"model.layers.34.self_attn.q_norm.weight": "model-00000-of-00002.safetensors",
"model.layers.35.self_attn.q_norm.weight": "model-00000-of-00002.safetensors",
"model.layers.0.self_attn.k_norm.weight": "model-00000-of-00002.safetensors",
"model.layers.1.self_attn.k_norm.weight": "model-00000-of-00002.safetensors",
"model.layers.2.self_attn.k_norm.weight": "model-00000-of-00002.safetensors",
"model.layers.3.self_attn.k_norm.weight": "model-00000-of-00002.safetensors",
"model.layers.4.self_attn.k_norm.weight": "model-00000-of-00002.safetensors",
"model.layers.5.self_attn.k_norm.weight": "model-00000-of-00002.safetensors",
"model.layers.6.self_attn.k_norm.weight": "model-00000-of-00002.safetensors",
"model.layers.7.self_attn.k_norm.weight": "model-00000-of-00002.safetensors",
"model.layers.8.self_attn.k_norm.weight": "model-00000-of-00002.safetensors",
"model.layers.9.self_attn.k_norm.weight": "model-00000-of-00002.safetensors",
"model.layers.10.self_attn.k_norm.weight": "model-00000-of-00002.safetensors",
"model.layers.11.self_attn.k_norm.weight": "model-00000-of-00002.safetensors",
"model.layers.12.self_attn.k_norm.weight": "model-00000-of-00002.safetensors",
"model.layers.13.self_attn.k_norm.weight": "model-00000-of-00002.safetensors",
"model.layers.14.self_attn.k_norm.weight": "model-00000-of-00002.safetensors",
"model.layers.15.self_attn.k_norm.weight": "model-00000-of-00002.safetensors",
"model.layers.16.self_attn.k_norm.weight": "model-00000-of-00002.safetensors",
"model.layers.17.self_attn.k_norm.weight": "model-00000-of-00002.safetensors",
"model.layers.18.self_attn.k_norm.weight": "model-00000-of-00002.safetensors",
"model.layers.19.self_attn.k_norm.weight": "model-00000-of-00002.safetensors",
"model.layers.20.self_attn.k_norm.weight": "model-00000-of-00002.safetensors",
"model.layers.21.self_attn.k_norm.weight": "model-00000-of-00002.safetensors",
"model.layers.22.self_attn.k_norm.weight": "model-00000-of-00002.safetensors",
"model.layers.23.self_attn.k_norm.weight": "model-00000-of-00002.safetensors",
"model.layers.24.self_attn.k_norm.weight": "model-00000-of-00002.safetensors",
"model.layers.25.self_attn.k_norm.weight": "model-00000-of-00002.safetensors",
"model.layers.26.self_attn.k_norm.weight": "model-00000-of-00002.safetensors",
"model.layers.27.self_attn.k_norm.weight": "model-00000-of-00002.safetensors",
"model.layers.28.self_attn.k_norm.weight": "model-00000-of-00002.safetensors",
"model.layers.29.self_attn.k_norm.weight": "model-00000-of-00002.safetensors",
"model.layers.30.self_attn.k_norm.weight": "model-00000-of-00002.safetensors",
"model.layers.31.self_attn.k_norm.weight": "model-00000-of-00002.safetensors",
"model.layers.32.self_attn.k_norm.weight": "model-00000-of-00002.safetensors",
"model.layers.33.self_attn.k_norm.weight": "model-00000-of-00002.safetensors",
"model.layers.34.self_attn.k_norm.weight": "model-00000-of-00002.safetensors",
"model.layers.35.self_attn.k_norm.weight": "model-00000-of-00002.safetensors",
"model.layers.0.post_attention_layernorm.weight": "model-00000-of-00002.safetensors",
"model.layers.1.post_attention_layernorm.weight": "model-00000-of-00002.safetensors",
"model.layers.2.post_attention_layernorm.weight": "model-00000-of-00002.safetensors",
"model.layers.3.post_attention_layernorm.weight": "model-00000-of-00002.safetensors",
"model.layers.4.post_attention_layernorm.weight": "model-00000-of-00002.safetensors",
"model.layers.5.post_attention_layernorm.weight": "model-00000-of-00002.safetensors",
"model.layers.6.post_attention_layernorm.weight": "model-00000-of-00002.safetensors",
"model.layers.7.post_attention_layernorm.weight": "model-00000-of-00002.safetensors",
"model.layers.8.post_attention_layernorm.weight": "model-00000-of-00002.safetensors",
"model.layers.9.post_attention_layernorm.weight": "model-00000-of-00002.safetensors",
"model.layers.10.post_attention_layernorm.weight": "model-00000-of-00002.safetensors",
"model.layers.11.post_attention_layernorm.weight": "model-00000-of-00002.safetensors",
"model.layers.12.post_attention_layernorm.weight": "model-00000-of-00002.safetensors",
"model.layers.13.post_attention_layernorm.weight": "model-00000-of-00002.safetensors",
"model.layers.14.post_attention_layernorm.weight": "model-00000-of-00002.safetensors",
"model.layers.15.post_attention_layernorm.weight": "model-00000-of-00002.safetensors",
"model.layers.16.post_attention_layernorm.weight": "model-00000-of-00002.safetensors",
"model.layers.17.post_attention_layernorm.weight": "model-00000-of-00002.safetensors",
"model.layers.18.post_attention_layernorm.weight": "model-00000-of-00002.safetensors",
"model.layers.19.post_attention_layernorm.weight": "model-00000-of-00002.safetensors",
"model.layers.20.post_attention_layernorm.weight": "model-00000-of-00002.safetensors",
"model.layers.21.post_attention_layernorm.weight": "model-00000-of-00002.safetensors",
"model.layers.22.post_attention_layernorm.weight": "model-00000-of-00002.safetensors",
"model.layers.23.post_attention_layernorm.weight": "model-00000-of-00002.safetensors",
"model.layers.24.post_attention_layernorm.weight": "model-00000-of-00002.safetensors",
"model.layers.25.post_attention_layernorm.weight": "model-00000-of-00002.safetensors",
"model.layers.26.post_attention_layernorm.weight": "model-00000-of-00002.safetensors",
"model.layers.27.post_attention_layernorm.weight": "model-00000-of-00002.safetensors",
"model.layers.28.post_attention_layernorm.weight": "model-00000-of-00002.safetensors",
"model.layers.29.post_attention_layernorm.weight": "model-00000-of-00002.safetensors",
"model.layers.30.post_attention_layernorm.weight": "model-00000-of-00002.safetensors",
"model.layers.31.post_attention_layernorm.weight": "model-00000-of-00002.safetensors",
"model.layers.32.post_attention_layernorm.weight": "model-00000-of-00002.safetensors",
"model.layers.33.post_attention_layernorm.weight": "model-00000-of-00002.safetensors",
"model.layers.34.post_attention_layernorm.weight": "model-00000-of-00002.safetensors",
"model.layers.35.post_attention_layernorm.weight": "model-00000-of-00002.safetensors",
"model.layers.0.mlp.down_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.1.mlp.down_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.2.mlp.down_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.3.mlp.down_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.4.mlp.down_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.5.mlp.down_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.6.mlp.down_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.7.mlp.down_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.8.mlp.down_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.9.mlp.down_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.10.mlp.down_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.11.mlp.down_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.12.mlp.down_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.13.mlp.down_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.14.mlp.down_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.15.mlp.down_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.16.mlp.down_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.17.mlp.down_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.18.mlp.down_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.19.mlp.down_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.20.mlp.down_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.21.mlp.down_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.22.mlp.down_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.23.mlp.down_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.24.mlp.down_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.25.mlp.down_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.26.mlp.down_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.27.mlp.down_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.28.mlp.down_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.29.mlp.down_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.30.mlp.down_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.31.mlp.down_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.32.mlp.down_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.33.mlp.down_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.34.mlp.down_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.35.mlp.down_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.0.mlp.gate_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.0.mlp.up_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.1.mlp.gate_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.1.mlp.up_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.2.mlp.gate_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.2.mlp.up_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.3.mlp.gate_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.3.mlp.up_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.4.mlp.gate_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.4.mlp.up_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.5.mlp.gate_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.5.mlp.up_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.6.mlp.gate_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.6.mlp.up_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.7.mlp.gate_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.7.mlp.up_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.8.mlp.gate_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.8.mlp.up_proj.weight": "model-00000-of-00002.safetensors",
"model.layers.9.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.9.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.10.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.10.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.11.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.11.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.12.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.12.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.13.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.13.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.14.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.14.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.15.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.15.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.16.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.16.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.17.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.17.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.18.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.18.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.19.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.19.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.20.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.20.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.21.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.21.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.22.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.22.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.23.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.23.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.24.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.24.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.25.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.25.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.26.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.26.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.27.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.27.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.28.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.28.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.29.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.29.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.30.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.30.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.31.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.31.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.32.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.32.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.33.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.33.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.34.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.34.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.35.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.35.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
"model.norm.weight": "model-00001-of-00002.safetensors"
}
}

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": "<|im_end|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false
},
"pad_token": {
"content": "<|endoftext|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false
}
}

BIN
checkpoints/qwen3-4b-lightning-opd-hf/tokenizer.json (Stored with Git LFS) Normal file

Binary file not shown.

View File

@@ -0,0 +1,240 @@
{
"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
},
"151665": {
"content": "<tool_response>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
},
"151666": {
"content": "</tool_response>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
},
"151667": {
"content": "<think>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
},
"151668": {
"content": "</think>",
"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,
"clean_up_tokenization_spaces": false,
"eos_token": "<|im_end|>",
"errors": "replace",
"extra_special_tokens": {},
"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,8 @@
{
"epoch": 0.34443168771526983,
"total_flos": 3.429011909561549e+19,
"train_loss": 0.27564545996983847,
"train_runtime": 45365.0148,
"train_samples_per_second": 2.116,
"train_steps_per_second": 0.066
}

File diff suppressed because it is too large Load Diff

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:b28ccff420c215e9d7eaa03851e14301ec0e1720a9cca5e39fab81383ec4e4a7
size 7377

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

File diff suppressed because one or more lines are too long

30
config.json Normal file
View File

@@ -0,0 +1,30 @@
{
"architectures": [
"Qwen3ForCausalLM"
],
"attention_bias": false,
"attention_dropout": 0.0,
"bos_token_id": 151643,
"eos_token_id": 151645,
"head_dim": 128,
"hidden_act": "silu",
"hidden_size": 2560,
"initializer_range": 0.02,
"intermediate_size": 9728,
"max_position_embeddings": 40960,
"max_window_layers": 36,
"model_type": "qwen3",
"num_attention_heads": 32,
"num_hidden_layers": 36,
"num_key_value_heads": 8,
"rms_norm_eps": 1e-06,
"rope_scaling": null,
"rope_theta": 1000000,
"sliding_window": null,
"tie_word_embeddings": true,
"torch_dtype": "bfloat16",
"transformers_version": "4.52.4",
"use_cache": false,
"use_sliding_window": false,
"vocab_size": 151936
}

View File

@@ -0,0 +1,145 @@
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
import os
from pathlib import Path
import slime.utils.external_utils.command_utils as U
# Lightning OPD: response tokens + teacher logprobs are pre-computed in parquet.
# No teacher server needed at training time -> all 8 GPUs go to the actor.
#
# Required env vars:
# SFT_CHECKPOINT - path to the SFT checkpoint (HF format)
# LIGHTNING_OPD_DATA - path to the precomputed parquet
MODEL_NAME = "Qwen3-30B-A3B-Base-Open-Thoughts-Qwen3-30B-A3B-Thinking-2507-sft"
MODEL_TYPE = "qwen3-30B-A3B"
NUM_GPUS = 8
SFT_CHECKPOINT = os.environ["SFT_CHECKPOINT"]
def prepare():
U.convert_checkpoint(
model_name=MODEL_NAME,
megatron_model_type=MODEL_TYPE,
num_gpus_per_node=NUM_GPUS,
hf_checkpoint=SFT_CHECKPOINT,
)
def execute(rerun=True):
load_save_path = f"/root/models/{MODEL_NAME}_ckpt__{Path(__file__).stem}/"
ckpt_args = (
f"--hf-checkpoint {SFT_CHECKPOINT} "
f"--ref-load /root/models/{MODEL_NAME}_torch_dist "
f"--load {load_save_path} "
f"--save {load_save_path} "
"--save-interval 10 "
"--save-retain-interval 100 "
)
rollout_args = (
f"--prompt-data {os.environ['LIGHTNING_OPD_DATA']} "
"--input-key prompt "
"--label-key label "
"--rollout-shuffle "
"--num-rollout 3000 "
"--rollout-batch-size 256 "
"--n-samples-per-prompt 1 "
"--rollout-max-response-len 4096 "
"--global-batch-size 256 "
)
rm_args = (
"--custom-rm-path slime.rollout.on_policy_distillation.reward_func "
"--custom-reward-post-process-path slime.rollout.on_policy_distillation.post_process_rewards "
"--include-verifiable-reward "
)
perf_args = (
"--tensor-model-parallel-size 4 "
"--sequence-parallel "
"--pipeline-model-parallel-size 1 "
"--context-parallel-size 1 "
"--expert-model-parallel-size 8 "
"--expert-tensor-parallel-size 1 "
"--recompute-granularity full "
"--recompute-method uniform "
"--recompute-num-layers 1 "
"--use-dynamic-batch-size "
"--max-tokens-per-gpu 12288 "
)
grpo_args = (
"--advantage-estimator on_policy_distillation "
"--use-kl-loss "
"--kl-loss-coef 0.00 "
"--kl-loss-type low_var_kl "
"--entropy-coef 0.00 "
)
optimizer_args = (
"--optimizer adam "
"--lr 2e-6 "
"--lr-decay-style constant "
"--weight-decay 0.1 "
"--adam-beta1 0.9 "
"--adam-beta2 0.98 "
"--optimizer-cpu-offload "
"--overlap-cpu-optimizer-d2h-h2d "
"--use-precision-aware-optimizer "
)
wandb_args = ""
if os.environ.get("WANDB_KEY"):
wandb_args = (
"--use-wandb "
"--wandb-project lightning-opd "
f"--wandb-group {Path(__file__).stem} "
f"--wandb-key {os.environ['WANDB_KEY']} "
)
sglang_args = (
"--rollout-num-gpus-per-engine 8 "
"--sglang-mem-fraction-static 0.8 "
"--sglang-cuda-graph-max-bs 32 "
"--sglang-max-running-requests 512 "
"--sglang-enable-metrics "
)
misc_args = (
"--attention-dropout 0.0 "
"--hidden-dropout 0.0 "
"--accumulate-allreduce-grads-in-fp32 "
"--attention-softmax-in-fp32 "
"--attention-backend flash "
"--actor-num-nodes 1 "
"--actor-num-gpus-per-node 8 "
"--rollout-num-gpus 0 "
)
train_args = (
f"{ckpt_args} "
f"{rollout_args} "
f"{rm_args} "
f"{grpo_args} "
f"{optimizer_args} "
f"{wandb_args} "
f"{perf_args} "
f"{sglang_args} "
f"{misc_args} "
)
U.execute_train(
rerun=rerun,
train_args=train_args,
num_gpus_per_node=NUM_GPUS,
megatron_model_type=MODEL_TYPE,
)
if __name__ == "__main__":
prepare()
execute(rerun=False)

View File

@@ -0,0 +1,140 @@
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
import os
from pathlib import Path
import slime.utils.external_utils.command_utils as U
# Lightning OPD: response tokens + teacher logprobs are pre-computed in parquet.
# No teacher server needed at training time -> all 8 GPUs go to the actor.
#
# Required env vars:
# SFT_CHECKPOINT - path to the SFT checkpoint (HF format)
# LIGHTNING_OPD_DATA - path to the precomputed parquet
MODEL_NAME = "Qwen3-4B-Base-Open-Thoughts-Qwen3-8B-sft-3k"
MODEL_TYPE = "qwen3-4B"
NUM_GPUS = 4
SFT_CHECKPOINT = os.environ["SFT_CHECKPOINT"]
def prepare():
U.convert_checkpoint(
model_name=MODEL_NAME,
megatron_model_type=MODEL_TYPE,
num_gpus_per_node=NUM_GPUS,
hf_checkpoint=SFT_CHECKPOINT,
)
def execute(rerun=True):
load_save_path = f"/root/models/{MODEL_NAME}_ckpt__{Path(__file__).stem}/"
ckpt_args = (
f"--hf-checkpoint {SFT_CHECKPOINT} "
f"--ref-load /root/models/{MODEL_NAME}_torch_dist "
f"--load {load_save_path} "
f"--save {load_save_path} "
"--save-interval 10 "
"--save-retain-interval 100 "
)
rollout_args = (
f"--prompt-data {os.environ['LIGHTNING_OPD_DATA']} "
"--input-key prompt "
"--label-key label "
"--rollout-shuffle "
"--num-rollout 150 "
"--rollout-batch-size 256 "
"--n-samples-per-prompt 1 "
"--rollout-max-response-len 4096 "
"--global-batch-size 256 "
"--rollout-temperature 0.8"
)
rm_args = (
"--custom-rm-path slime.rollout.on_policy_distillation.reward_func "
"--custom-reward-post-process-path slime.rollout.on_policy_distillation.post_process_rewards "
"--include-verifiable-reward "
)
perf_args = (
"--tensor-model-parallel-size 2 "
"--sequence-parallel "
"--pipeline-model-parallel-size 1 "
"--context-parallel-size 1 "
"--expert-model-parallel-size 1 "
"--expert-tensor-parallel-size 1 "
"--recompute-granularity full "
"--recompute-method uniform "
"--recompute-num-layers 1 "
"--use-dynamic-batch-size "
"--max-tokens-per-gpu 16384 "
)
grpo_args = (
"--advantage-estimator on_policy_distillation "
"--use-kl-loss "
"--kl-loss-coef 0.00 "
"--kl-loss-type low_var_kl "
"--entropy-coef 0.00 "
)
optimizer_args = (
"--optimizer adam "
"--lr 2e-6 "
"--lr-decay-style constant "
"--weight-decay 0.1 "
"--adam-beta1 0.9 "
"--adam-beta2 0.98 "
)
wandb_args = ""
if os.environ.get("WANDB_KEY"):
wandb_args = (
"--use-wandb "
"--wandb-project lightning-opd "
f"--wandb-group {Path(__file__).stem} "
f"--wandb-key {os.environ['WANDB_KEY']} "
)
sglang_args = (
"--rollout-num-gpus-per-engine 1 "
"--sglang-mem-fraction-static 0.4 "
)
misc_args = (
"--attention-dropout 0.0 "
"--hidden-dropout 0.0 "
"--accumulate-allreduce-grads-in-fp32 "
"--attention-softmax-in-fp32 "
"--attention-backend flash "
"--actor-num-nodes 1 "
"--actor-num-gpus-per-node 4 "
"--rollout-num-gpus 0 "
)
train_args = (
f"{ckpt_args} "
f"{rollout_args} "
f"{rm_args} "
f"{grpo_args} "
f"{optimizer_args} "
f"{wandb_args} "
f"{perf_args} "
f"{sglang_args} "
f"{misc_args} "
)
U.execute_train(
rerun=rerun,
train_args=train_args,
num_gpus_per_node=NUM_GPUS,
megatron_model_type=MODEL_TYPE,
)
if __name__ == "__main__":
prepare()
execute(rerun=False)

View File

@@ -0,0 +1,139 @@
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
import os
from pathlib import Path
import slime.utils.external_utils.command_utils as U
# Lightning OPD: response tokens + teacher logprobs are pre-computed in parquet.
# No teacher server needed at training time -> all 8 GPUs go to the actor.
#
# Required env vars:
# SFT_CHECKPOINT - path to the SFT checkpoint (HF format)
# LIGHTNING_OPD_DATA - path to the precomputed parquet
MODEL_NAME = "Qwen3-8B-Base-Open-Thoughts-Qwen3-32B-sft-3k"
MODEL_TYPE = "qwen3-8B"
NUM_GPUS = 8
SFT_CHECKPOINT = os.environ["SFT_CHECKPOINT"]
def prepare():
U.convert_checkpoint(
model_name=MODEL_NAME,
megatron_model_type=MODEL_TYPE,
num_gpus_per_node=NUM_GPUS,
hf_checkpoint=SFT_CHECKPOINT,
)
def execute(rerun=True):
load_save_path = f"/root/models/{MODEL_NAME}_ckpt__{Path(__file__).stem}/"
ckpt_args = (
f"--hf-checkpoint {SFT_CHECKPOINT} "
f"--ref-load /root/models/{MODEL_NAME}_torch_dist "
f"--load {load_save_path} "
f"--save {load_save_path} "
"--save-interval 10 "
"--save-retain-interval 100 "
)
rollout_args = (
f"--prompt-data {os.environ['LIGHTNING_OPD_DATA']} "
"--input-key prompt "
"--label-key label "
"--rollout-shuffle "
"--num-rollout 3000 "
"--rollout-batch-size 256 "
"--n-samples-per-prompt 1 "
"--rollout-max-response-len 4096 "
"--global-batch-size 256 "
)
rm_args = (
"--custom-rm-path slime.rollout.on_policy_distillation.reward_func "
"--custom-reward-post-process-path slime.rollout.on_policy_distillation.post_process_rewards "
"--include-verifiable-reward "
)
perf_args = (
"--tensor-model-parallel-size 4 "
"--sequence-parallel "
"--pipeline-model-parallel-size 1 "
"--context-parallel-size 1 "
"--expert-model-parallel-size 1 "
"--expert-tensor-parallel-size 1 "
"--recompute-granularity full "
"--recompute-method uniform "
"--recompute-num-layers 1 "
"--use-dynamic-batch-size "
"--max-tokens-per-gpu 16384 "
)
grpo_args = (
"--advantage-estimator on_policy_distillation "
"--use-kl-loss "
"--kl-loss-coef 0.00 "
"--kl-loss-type low_var_kl "
"--entropy-coef 0.00 "
)
optimizer_args = (
"--optimizer adam "
"--lr 2e-6 "
"--lr-decay-style constant "
"--weight-decay 0.1 "
"--adam-beta1 0.9 "
"--adam-beta2 0.98 "
)
wandb_args = ""
if os.environ.get("WANDB_KEY"):
wandb_args = (
"--use-wandb "
"--wandb-project lightning-opd "
f"--wandb-group {Path(__file__).stem} "
f"--wandb-key {os.environ['WANDB_KEY']} "
)
sglang_args = (
"--rollout-num-gpus-per-engine 1 "
"--sglang-mem-fraction-static 0.4 "
)
misc_args = (
"--attention-dropout 0.0 "
"--hidden-dropout 0.0 "
"--accumulate-allreduce-grads-in-fp32 "
"--attention-softmax-in-fp32 "
"--attention-backend flash "
"--actor-num-nodes 1 "
"--actor-num-gpus-per-node 8 "
"--rollout-num-gpus 0 "
)
train_args = (
f"{ckpt_args} "
f"{rollout_args} "
f"{rm_args} "
f"{grpo_args} "
f"{optimizer_args} "
f"{wandb_args} "
f"{perf_args} "
f"{sglang_args} "
f"{misc_args} "
)
U.execute_train(
rerun=rerun,
train_args=train_args,
num_gpus_per_node=NUM_GPUS,
megatron_model_type=MODEL_TYPE,
)
if __name__ == "__main__":
prepare()
execute(rerun=False)

View File

@@ -0,0 +1,49 @@
NLAYERS=48
FIRST_K_DENSE_REPLACE=0
arr=()
for ((i=0; i<NLAYERS; i++)); do
if (( i < FIRST_K_DENSE_REPLACE )); then
arr+=(0)
else
arr+=(1)
fi
done
printf -v MOE_LAYER_FREQ "[%s]" "$(IFS=', '; echo "${arr[*]}")"
MODEL_ARGS=(
--disable-bias-linear
--qk-layernorm
--group-query-attention
--num-attention-heads 32
--num-query-groups 4
--kv-channels 128
--num-layers 48
--hidden-size 2048
--ffn-hidden-size 6144
--normalization RMSNorm
--position-embedding-type rope
--norm-epsilon 1e-6
--rotary-percent 1.0
--swiglu
--untie-embeddings-and-output-weights
--vocab-size 151936
--rotary-base 1000000
# moe
--moe-ffn-hidden-size 768
--moe-router-score-function softmax
--moe-token-dispatcher-type alltoall
--moe-router-topk 8
--moe-layer-freq $MOE_LAYER_FREQ
--num-experts 128
--moe-grouped-gemm
--moe-token-drop-policy probs
--moe-router-dtype fp32
--moe-permute-fusion
--moe-aux-loss-coeff 0
)

View File

@@ -0,0 +1,20 @@
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
MODEL_ARGS=(
--swiglu
--num-layers 36
--hidden-size 2560
--ffn-hidden-size 9728
--num-attention-heads 32
--group-query-attention
--num-query-groups 8
--use-rotary-position-embeddings
--disable-bias-linear
--normalization "RMSNorm"
--norm-epsilon 1e-6
--rotary-base "${MODEL_ARGS_ROTARY_BASE:-1000000}"
--vocab-size 151936
--kv-channels 128
--qk-layernorm
)

View File

@@ -0,0 +1,21 @@
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
MODEL_ARGS=(
--swiglu
--num-layers 36
--hidden-size 4096
--ffn-hidden-size 12288
--num-attention-heads 32
--group-query-attention
--num-query-groups 8
--use-rotary-position-embeddings
--disable-bias-linear
--normalization "RMSNorm"
--norm-epsilon 1e-6
--rotary-base 1000000
--vocab-size 151936
--kv-channels 128
--qk-layernorm
--untie-embeddings-and-output-weights
)

190
configs/opd/qwen3-4b-opd.py Normal file
View File

@@ -0,0 +1,190 @@
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
import os
from pathlib import Path
import slime.utils.external_utils.command_utils as U
from slime.utils.external_utils.command_utils import get_bool_env_var
# Standard OPD: requires a live teacher server during training.
# 2 GPUs for actor (TP=2), 4 GPUs for rollout, 2 GPUs for teacher server.
#
# Required env vars:
# SFT_CHECKPOINT - path to the SFT checkpoint (HF format)
MODEL_NAME = "Qwen3-4B-Base-Open-Thoughts-Qwen3-8B-sft-3k"
TEACHER_MODEL_NAME = "Qwen3-8B"
TEACHER_IP = os.environ.get("MASTER_ADDR", "127.0.0.1")
TEACHER_PORT = 13141
MODEL_TYPE = "qwen3-4B"
NUM_GPUS = 8
SFT_CHECKPOINT = os.environ["SFT_CHECKPOINT"]
def deploy_teacher_model():
import random, string
random_suffix = ''.join(random.choices(string.ascii_letters + string.digits, k=6))
LOG_FILE = f"/tmp/sglang_{random_suffix}.log"
external_ray = get_bool_env_var("SLIME_SCRIPT_EXTERNAL_RAY")
U.exec_command(
"pkill -9 sglang; "
"sleep 3; "
f"{'' if external_ray else 'ray stop --force; '}"
f"{'' if external_ray else 'pkill -9 ray; '}"
"pkill -9 slime; "
"sleep 3; "
f"{'' if external_ray else 'pkill -9 ray; '}"
"pkill -9 slime; "
"pkill -9 redis; "
"true;"
)
U.exec_command(
f"CUDA_VISIBLE_DEVICES=6,7 python3 -m sglang.launch_server "
f"--model-path /root/models/{TEACHER_MODEL_NAME} "
f"--host 0.0.0.0 "
f"--port {TEACHER_PORT} "
f"--tp 2 "
f"--chunked-prefill-size 4096 "
f"--mem-fraction-static 0.6 "
f"--context-length 32768 "
f"> {LOG_FILE} 2>&1 & "
)
U.exec_command(
f"until curl -sf http://{TEACHER_IP}:{TEACHER_PORT}/health_generate > /dev/null; do "
f" echo 'Waiting for teacher model...'; "
f" tail -n 10 {LOG_FILE}; sleep 5; done; "
f"echo 'Teacher model ready at {TEACHER_IP}:{TEACHER_PORT}.'; sleep 10;"
)
def prepare():
U.exec_command("mkdir -p /root/models /root/datasets")
U.exec_command(f"huggingface-cli download Qwen/{TEACHER_MODEL_NAME} --local-dir /root/models/{TEACHER_MODEL_NAME}")
U.convert_checkpoint(
model_name=MODEL_NAME,
megatron_model_type=MODEL_TYPE,
num_gpus_per_node=NUM_GPUS,
hf_checkpoint=SFT_CHECKPOINT,
)
deploy_teacher_model()
def execute(rerun=True):
load_save_path = f"/root/models/{MODEL_NAME}_ckpt__{Path(__file__).stem}/"
ckpt_args = (
f"--hf-checkpoint {SFT_CHECKPOINT} "
f"--ref-load /root/models/{MODEL_NAME}_torch_dist "
f"--load {load_save_path} "
f"--save {load_save_path} "
"--save-interval 10 "
"--save-retain-interval 10 "
)
rollout_args = (
"--prompt-data /root/datasets/dapo-math-17k/dapo-math-17k.jsonl "
"--input-key prompt "
"--label-key label "
"--apply-chat-template "
"--rollout-shuffle "
"--num-rollout 3000 "
"--rollout-batch-size 64 "
"--n-samples-per-prompt 4 "
"--rollout-max-response-len 4096 "
"--rollout-temperature 0.8 "
"--global-batch-size 256 "
"--balance-data "
)
rm_args = (
"--custom-rm-path slime.rollout.on_policy_distillation.reward_func "
"--custom-reward-post-process-path slime.rollout.on_policy_distillation.post_process_rewards "
f"--rm-url http://{TEACHER_IP}:{TEACHER_PORT}/generate "
"--include-verifiable-reward "
)
perf_args = (
"--tensor-model-parallel-size 2 "
"--sequence-parallel "
"--pipeline-model-parallel-size 1 "
"--context-parallel-size 1 "
"--expert-model-parallel-size 1 "
"--expert-tensor-parallel-size 1 "
"--recompute-granularity full "
"--recompute-method uniform "
"--recompute-num-layers 1 "
"--use-dynamic-batch-size "
"--max-tokens-per-gpu 16384 "
)
grpo_args = (
"--advantage-estimator on_policy_distillation "
"--use-kl-loss "
"--kl-loss-coef 0.00 "
"--kl-loss-type low_var_kl "
"--entropy-coef 0.00 "
)
optimizer_args = (
"--optimizer adam "
"--lr 2e-6 "
"--lr-decay-style constant "
"--weight-decay 0.1 "
"--adam-beta1 0.9 "
"--adam-beta2 0.98 "
)
wandb_args = ""
if os.environ.get("WANDB_KEY"):
wandb_args = (
"--use-wandb "
"--wandb-project lightning-opd "
f"--wandb-group {Path(__file__).stem} "
f"--wandb-key {os.environ['WANDB_KEY']} "
)
sglang_args = (
"--rollout-num-gpus-per-engine 1 "
"--sglang-mem-fraction-static 0.4 "
)
misc_args = (
"--attention-dropout 0.0 "
"--hidden-dropout 0.0 "
"--accumulate-allreduce-grads-in-fp32 "
"--attention-softmax-in-fp32 "
"--attention-backend flash "
"--actor-num-nodes 1 "
"--actor-num-gpus-per-node 2 "
"--rollout-num-gpus 4 "
)
train_args = (
f"{ckpt_args} "
f"{rollout_args} "
f"{rm_args} "
f"{grpo_args} "
f"{optimizer_args} "
f"{wandb_args} "
f"{perf_args} "
f"{sglang_args} "
f"{misc_args} "
)
U.execute_train(
rerun=rerun,
train_args=train_args,
num_gpus_per_node=NUM_GPUS,
megatron_model_type=MODEL_TYPE,
)
if __name__ == "__main__":
prepare()
execute(rerun=False)

190
configs/opd/qwen3-8b-opd.py Normal file
View File

@@ -0,0 +1,190 @@
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
import os
from pathlib import Path
import slime.utils.external_utils.command_utils as U
from slime.utils.external_utils.command_utils import get_bool_env_var
# Standard OPD: requires a live teacher server during training.
# 4 GPUs for actor (TP=4), 2 GPUs for rollout, 2 GPUs for teacher server.
#
# Required env vars:
# SFT_CHECKPOINT - path to the SFT checkpoint (HF format)
MODEL_NAME = "Qwen3-8B-Base-Open-Thoughts-Qwen3-32B-sft-3.5k"
TEACHER_MODEL_NAME = "Qwen3-32B"
TEACHER_IP = os.environ.get("MASTER_ADDR", "127.0.0.1")
TEACHER_PORT = 13141
MODEL_TYPE = "qwen3-8B"
NUM_GPUS = 8
SFT_CHECKPOINT = os.environ["SFT_CHECKPOINT"]
def deploy_teacher_model():
import random, string
random_suffix = ''.join(random.choices(string.ascii_letters + string.digits, k=6))
LOG_FILE = f"/tmp/sglang_{random_suffix}.log"
external_ray = get_bool_env_var("SLIME_SCRIPT_EXTERNAL_RAY")
U.exec_command(
"pkill -9 sglang; "
"sleep 3; "
f"{'' if external_ray else 'ray stop --force; '}"
f"{'' if external_ray else 'pkill -9 ray; '}"
"pkill -9 slime; "
"sleep 3; "
f"{'' if external_ray else 'pkill -9 ray; '}"
"pkill -9 slime; "
"pkill -9 redis; "
"true;"
)
U.exec_command(
f"CUDA_VISIBLE_DEVICES=6,7 python3 -m sglang.launch_server "
f"--model-path /root/models/{TEACHER_MODEL_NAME} "
f"--host 0.0.0.0 "
f"--port {TEACHER_PORT} "
f"--tp 2 "
f"--chunked-prefill-size 4096 "
f"--mem-fraction-static 0.6 "
f"--context-length 32768 "
f"> {LOG_FILE} 2>&1 & "
)
U.exec_command(
f"until curl -sf http://{TEACHER_IP}:{TEACHER_PORT}/health_generate > /dev/null; do "
f" echo 'Waiting for teacher model...'; "
f" tail -n 10 {LOG_FILE}; sleep 5; done; "
f"echo 'Teacher model ready at {TEACHER_IP}:{TEACHER_PORT}.'; sleep 10;"
)
def prepare():
U.exec_command("mkdir -p /root/models /root/datasets/dapo-math-17k")
U.exec_command(f"huggingface-cli download Qwen/{TEACHER_MODEL_NAME} --local-dir /root/models/{TEACHER_MODEL_NAME}")
U.convert_checkpoint(
model_name=MODEL_NAME,
megatron_model_type=MODEL_TYPE,
num_gpus_per_node=NUM_GPUS,
hf_checkpoint=SFT_CHECKPOINT,
)
deploy_teacher_model()
def execute(rerun=True):
load_save_path = f"/root/models/{MODEL_NAME}_ckpt__{Path(__file__).stem}/"
ckpt_args = (
f"--hf-checkpoint {SFT_CHECKPOINT} "
f"--ref-load /root/models/{MODEL_NAME}_torch_dist "
f"--load {load_save_path} "
f"--save {load_save_path} "
"--save-interval 5 "
"--save-retain-interval 5 "
)
rollout_args = (
"--prompt-data /root/datasets/dapo-math-17k/dapo-math-17k.jsonl "
"--input-key prompt "
"--label-key label "
"--apply-chat-template "
"--rollout-shuffle "
"--num-rollout 3000 "
"--rollout-batch-size 64 "
"--n-samples-per-prompt 4 "
"--rollout-max-response-len 4096 "
"--rollout-temperature 0.8 "
"--global-batch-size 256 "
"--balance-data "
)
rm_args = (
"--custom-rm-path slime.rollout.on_policy_distillation.reward_func "
"--custom-reward-post-process-path slime.rollout.on_policy_distillation.post_process_rewards "
f"--rm-url http://{TEACHER_IP}:{TEACHER_PORT}/generate "
"--include-verifiable-reward "
)
perf_args = (
"--tensor-model-parallel-size 4 "
"--sequence-parallel "
"--pipeline-model-parallel-size 1 "
"--context-parallel-size 1 "
"--expert-model-parallel-size 1 "
"--expert-tensor-parallel-size 1 "
"--recompute-granularity full "
"--recompute-method uniform "
"--recompute-num-layers 1 "
"--use-dynamic-batch-size "
"--max-tokens-per-gpu 8192 "
)
grpo_args = (
"--advantage-estimator on_policy_distillation "
"--use-kl-loss "
"--kl-loss-coef 0.00 "
"--kl-loss-type low_var_kl "
"--entropy-coef 0.00 "
)
optimizer_args = (
"--optimizer adam "
"--lr 2e-6 "
"--lr-decay-style constant "
"--weight-decay 0.1 "
"--adam-beta1 0.9 "
"--adam-beta2 0.98 "
)
wandb_args = ""
if os.environ.get("WANDB_KEY"):
wandb_args = (
"--use-wandb "
"--wandb-project lightning-opd "
f"--wandb-group {Path(__file__).stem} "
f"--wandb-key {os.environ['WANDB_KEY']} "
)
sglang_args = (
"--rollout-num-gpus-per-engine 1 "
"--sglang-mem-fraction-static 0.4 "
)
misc_args = (
"--attention-dropout 0.0 "
"--hidden-dropout 0.0 "
"--accumulate-allreduce-grads-in-fp32 "
"--attention-softmax-in-fp32 "
"--attention-backend flash "
"--actor-num-nodes 1 "
"--actor-num-gpus-per-node 4 "
"--rollout-num-gpus 2 "
)
train_args = (
f"{ckpt_args} "
f"{rollout_args} "
f"{rm_args} "
f"{grpo_args} "
f"{optimizer_args} "
f"{wandb_args} "
f"{perf_args} "
f"{sglang_args} "
f"{misc_args} "
)
U.execute_train(
rerun=rerun,
train_args=train_args,
num_gpus_per_node=NUM_GPUS,
megatron_model_type=MODEL_TYPE,
)
if __name__ == "__main__":
prepare()
execute(rerun=False)

View File

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

View File

@@ -0,0 +1,23 @@
{
"openthoughts3_300k_qwen3-8b": {
"file_name": "data/sft_data/openthoughts3_300k_qwen3-8b.jsonl",
"formatting": "sharegpt",
"columns": {
"messages": "messages"
},
"tags": {
"role_tag": "role",
"content_tag": "content",
"user_tag": "user",
"assistant_tag": "assistant",
"system_tag": "system"
}
},
"openthoughts3_300k_qwen3-32b": {
"file_name": "data/sft_data/openthoughts3_300k_qwen3-32b.parquet",
"formatting": "sharegpt",
"columns": {
"messages": "messages"
}
}
}

View File

@@ -0,0 +1,16 @@
{
"openthoughts3_300k_qwen3-8b": {
"file_name": "data/sft_data/openthoughts3_300k_qwen3-8b.jsonl",
"formatting": "sharegpt",
"columns": {
"messages": "messages"
}
},
"openthoughts3_300k_qwen3-32b": {
"file_name": "data/sft_data/openthoughts3_300k_qwen3-32b.parquet",
"formatting": "sharegpt",
"columns": {
"messages": "messages"
}
}
}

View File

@@ -0,0 +1,42 @@
### model
model_name_or_path: model_weights/qwen3-4b-base
### method
stage: sft
do_train: true
finetuning_type: full
deepspeed: examples/deepspeed/ds_z0_config.json
enable_liger_kernel: true
packing: true
### dataset
dataset: openthoughts3_300k_qwen3-8b
template: qwen3
cutoff_len: 16384
overwrite_cache: true
preprocessing_num_workers: 16
dataloader_persistent_workers: true
dataloader_pin_memory: true
dataloader_num_workers: 4
### output
logging_steps: 1
save_steps: 100
save_total_limit: 10
plot_loss: true
overwrite_output_dir: false
save_only_model: false
#report_to: wandb
report_to: none
run_name: qwen3-4b-base-open-thoughts3-qwen3-8b
### train
per_device_train_batch_size: 4
gradient_accumulation_steps: 2
learning_rate: 0.00008
max_steps: 3000
lr_scheduler_type: cosine
warmup_ratio: 0.1
bf16: true
ddp_timeout: 180000000

View File

@@ -0,0 +1,41 @@
### model
model_name_or_path: Qwen/Qwen3-8B-Base
### method
stage: sft
do_train: true
finetuning_type: full
deepspeed: examples/deepspeed/ds_z1_config.json
enable_liger_kernel: true
packing: true
### dataset
dataset: openthoughts3_300k_qwen3-32b
template: qwen3
cutoff_len: 16384
overwrite_cache: true
preprocessing_num_workers: 16
dataloader_persistent_workers: true
dataloader_pin_memory: true
dataloader_num_workers: 4
### output
logging_steps: 1
save_steps: 100
save_total_limit: 10
plot_loss: true
overwrite_output_dir: false
save_only_model: false
report_to: wandb
run_name: qwen3-8b-base-open-thoughts3-qwen3-32b
### train
per_device_train_batch_size: 2
gradient_accumulation_steps: 2
learning_rate: 8e-5
max_steps: 3000
lr_scheduler_type: cosine
warmup_ratio: 0.1
bf16: true
ddp_timeout: 180000000

49
configs/sft/run_sft.sh Normal file
View File

@@ -0,0 +1,49 @@
#!/usr/bin/env bash
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
# Step 2: Run SFT training with LlamaFactory.
#
# Required environment variables:
# CONFIG_YAML - Name of the SFT config file in configs/sft/ (e.g. qwen3-4b-base-sft-qwen3-8b.yaml)
# OUTPUT_DIR - Directory for the SFT checkpoint output
#
# Optional:
# NUM_NODES - Number of nodes (default: 4)
# NUM_GPUS - GPUs per node (default: 8)
# MASTER_ADDR - Master node address (default: localhost)
#
# Prerequisites:
# - LlamaFactory installed (pip install llamafactory)
# - SFT data generated by Step 1 and registered in LlamaFactory's dataset_info.json
set -euo pipefail
: "${CONFIG_YAML:?Set CONFIG_YAML (e.g. qwen3-4b-base-sft-qwen3-8b.yaml)}"
: "${OUTPUT_DIR:?Set OUTPUT_DIR for SFT checkpoint output}"
NUM_NODES="${NUM_NODES:-4}"
NUM_GPUS="${NUM_GPUS:-8}"
MASTER_ADDR="${MASTER_ADDR:-localhost}"
MASTER_PORT="${MASTER_PORT:-29500}"
# torchrun \
# --nnodes "${NUM_NODES}" \
# --nproc_per_node="${NUM_GPUS}" \
# --rdzv_id $RANDOM \
# --rdzv_backend c10d \
# --rdzv_endpoint "${MASTER_ADDR}:29500" \
# -m llamafactory.cli.train \
# "configs/sft/${CONFIG_YAML}" \
# "dataset_dir=configs/sft" \
# "output_dir=${OUTPUT_DIR}"
FORCE_TORCHRUN=1 \
NNODES="${NUM_NODES}" \
NPROC_PER_NODE="${NUM_GPUS}" \
MASTER_ADDR="${MASTER_ADDR}" \
MASTER_PORT="${MASTER_PORT}" \
llamafactory-cli train \
"configs/sft/${CONFIG_YAML}" \
"dataset_dir=configs/sft" \
"output_dir=${OUTPUT_DIR}"

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

160
data_curation/merge.py Normal file
View File

@@ -0,0 +1,160 @@
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
"""
Merge Arrow IPC files produced by data_curation/pipeline.py into a single parquet.
After multi-GPU data generation, each worker writes Arrow files into
rank-specific subdirectories. This script merges them into one parquet
file for downstream consumption (SFT training or Lightning OPD preparation).
Usage:
python data_curation/merge.py \
--input-dir data/sft_data \
--output data/sft_data/merged.parquet
# With filtering: only keep samples with token count <= 16384
python data_curation/merge.py \
--input-dir data/sft_data \
--output data/sft_data/merged.parquet \
--max-tokens 16384
"""
import argparse
from pathlib import Path
import json
import pyarrow as pa
import pyarrow.ipc as ipc
from tqdm import tqdm
def parse_args():
parser = argparse.ArgumentParser(
description="Merge Arrow IPC files into a single parquet file."
)
parser.add_argument(
"--input-dir", type=str, required=True,
help="Directory containing Arrow files (searched recursively).",
)
parser.add_argument(
"--output", type=str, required=True,
help="Output parquet file path.",
)
parser.add_argument(
"--max-tokens", type=int, default=None,
help="If set, discard rows with tokens > this value.",
)
return parser.parse_args()
# def merge_arrow_files(input_dir: str, output: str, max_tokens: int | None = None):
# input_path = Path(input_dir)
# arrow_files = sorted(input_path.rglob("*.arrow"))
# if not arrow_files:
# print(f"No Arrow files found in {input_dir}")
# return
# print(f"Found {len(arrow_files)} Arrow files in {input_dir}")
# tables = []
# total_rows = 0
# for f in tqdm(arrow_files, desc="Reading Arrow files"):
# with pa.OSFile(str(f), "rb") as source:
# table = ipc.open_file(source).read_all()
# tables.append(table)
# total_rows += len(table)
# merged = pa.concat_tables(tables)
# print(f"Total rows before filtering: {total_rows}")
# if max_tokens is not None and "tokens" in merged.column_names:
# tokens = merged.column("tokens").to_pylist()
# mask = [t <= max_tokens for t in tokens]
# merged = merged.filter(mask)
# filtered = total_rows - len(merged)
# print(f"Filtered {filtered} rows with tokens > {max_tokens}")
# output_path = Path(output)
# output_path.parent.mkdir(parents=True, exist_ok=True)
# df = merged.to_pandas()
# df.to_parquet(output, index=False)
# print(f"Merged {len(df)} rows -> {output}")
def merge_arrow_files(input_dir: str, output: str, max_tokens: int | None = None):
input_path = Path(input_dir)
arrow_files = sorted(input_path.rglob("*.arrow"))
if not arrow_files:
print(f"No Arrow files found in {input_dir}")
return
print(f"Found {len(arrow_files)} Arrow files in {input_dir}")
output_path = Path(output)
output_path.parent.mkdir(parents=True, exist_ok=True)
# Recommended path for nested conversation data
if output_path.suffix == ".jsonl":
total_rows = 0
kept_rows = 0
filtered_rows = 0
with open(output_path, "w", encoding="utf-8") as out_f:
for f in tqdm(arrow_files, desc="Reading Arrow files"):
with pa.OSFile(str(f), "rb") as source:
table = ipc.open_file(source).read_all()
rows = table.to_pylist()
total_rows += len(rows)
for row in rows:
if max_tokens is not None and "tokens" in row:
if row["tokens"] > max_tokens:
filtered_rows += 1
continue
out_f.write(json.dumps(row, ensure_ascii=False) + "\n")
kept_rows += 1
print(f"Total rows before filtering: {total_rows}")
if max_tokens is not None:
print(f"Filtered {filtered_rows} rows with tokens > {max_tokens}")
print(f"Merged {kept_rows} rows -> {output}")
return
# Optional parquet path, not recommended for nested messages
elif output_path.suffix == ".parquet":
import pyarrow.parquet as pq
tables = []
total_rows = 0
for f in tqdm(arrow_files, desc="Reading Arrow files"):
with pa.OSFile(str(f), "rb") as source:
table = ipc.open_file(source).read_all()
tables.append(table)
total_rows += len(table)
merged = pa.concat_tables(tables)
print(f"Total rows before filtering: {total_rows}")
if max_tokens is not None and "tokens" in merged.column_names:
tokens = merged.column("tokens").to_pylist()
mask = [t <= max_tokens for t in tokens]
merged = merged.filter(mask)
filtered = total_rows - len(merged)
print(f"Filtered {filtered} rows with tokens > {max_tokens}")
pq.write_table(merged, output)
print(f"Merged {len(merged)} rows -> {output}")
return
else:
raise ValueError(f"Unsupported output format: {output_path.suffix}")
if __name__ == "__main__":
args = parse_args()
merge_arrow_files(args.input_dir, args.output, args.max_tokens)

218
data_curation/pipeline.py Normal file
View File

@@ -0,0 +1,218 @@
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
"""
Data curation pipeline: generate responses from a dataset using vLLM.
Each worker (identified by --rank) processes a disjoint shard of the input
dataset, generates responses via vLLM offline inference, and writes results
as Arrow IPC files (one per batch) into a rank-specific output directory.
Checkpointing allows resuming from the last completed batch.
Standalone:
python data_curation/pipeline.py \
--model Qwen/Qwen3-4B \
--input data.jsonl \
--output-dir output/
Multi-GPU (one model per GPU):
See run_curation.sh for the recommended launch pattern.
"""
import argparse
import json
import os
import pickle
from pathlib import Path
import pandas as pd
import pyarrow as pa
import pyarrow.ipc as ipc
from tqdm import tqdm
from vllm import LLM, SamplingParams
# ---------------------------------------------------------------------------
# Data I/O
# ---------------------------------------------------------------------------
def load_dataset(path: str) -> list[dict]:
"""Load a .jsonl or .parquet dataset into a list of dicts."""
if path.endswith(".parquet"):
df = pd.read_parquet(path)
records = df.to_dict("records")
for record in records:
if "prompt" in record and hasattr(record["prompt"], "tolist"):
record["prompt"] = record["prompt"].tolist()
return records
elif path.endswith(".jsonl"):
with open(path) as f:
return [json.loads(line) for line in f]
else:
raise ValueError(f"Unsupported format: {path}. Use .jsonl or .parquet.")
def save_batch_arrow(rows: list[dict], path: str) -> None:
"""Write a list of dicts as an Arrow IPC file."""
table = pa.Table.from_pandas(pd.DataFrame(rows))
with pa.OSFile(path, "wb") as sink:
with ipc.new_file(sink, table.schema) as writer:
writer.write_table(table)
# ---------------------------------------------------------------------------
# Core pipeline
# ---------------------------------------------------------------------------
def run_curation(args: argparse.Namespace) -> None:
tag = f"[Rank {args.rank}/{args.world_size}]"
# ── Load & shard dataset ──────────────────────────────────────────────
print(f"{tag} Loading dataset: {args.input}")
dataset = load_dataset(args.input)
if args.num_samples is not None:
dataset = dataset[: args.num_samples]
print(f"{tag} Debug mode: limiting to {args.num_samples} samples")
if args.world_size > 1:
dataset = dataset[args.rank :: args.world_size]
print(f"{tag} Assigned {len(dataset)} samples")
# ── Output directory ──────────────────────────────────────────────────
if args.world_size > 1:
output_dir = Path(args.output_dir) / f"rank{args.rank:05d}"
else:
output_dir = Path(args.output_dir)
output_dir.mkdir(parents=True, exist_ok=True)
# ── Checkpoint ────────────────────────────────────────────────────────
ckpt_dir = Path(args.checkpoint_dir)
ckpt_dir.mkdir(parents=True, exist_ok=True)
ckpt_file = ckpt_dir / f"rank{args.rank:05d}.pkl"
start_idx = 0
if ckpt_file.exists():
with open(ckpt_file, "rb") as f:
start_idx = pickle.load(f)["next_idx"]
print(f"{tag} Resuming from index {start_idx}")
# ── Model ─────────────────────────────────────────────────────────────
print(f"{tag} Loading model: {args.model} (tp={args.tensor_parallel_size})")
llm = LLM(
model=args.model,
tensor_parallel_size=args.tensor_parallel_size,
trust_remote_code=True,
)
sampling_params = SamplingParams(
temperature=args.temperature,
top_p=args.top_p,
max_tokens=args.max_tokens,
n=args.num_responses,
)
# ── Batch loop ────────────────────────────────────────────────────────
total_batches = (len(dataset) + args.batch_size - 1) // args.batch_size
total_saved = 0
print(f"{tag} Processing {len(dataset)} prompts, batch_size={args.batch_size}, "
f"total_batches={total_batches}")
for batch_start in range(start_idx, len(dataset), args.batch_size):
batch_end = min(batch_start + args.batch_size, len(dataset))
batch = dataset[batch_start:batch_end]
batch_idx = batch_start // args.batch_size
prompts = [item["prompt"] for item in batch]
print(f"{tag} Batch {batch_idx + 1}/{total_batches} "
f"({batch_end - batch_start} samples) ...")
outputs = llm.chat(prompts, sampling_params)
# Build results
rows = []
for item, output in zip(batch, outputs):
for completion in output.outputs:
text = completion.text
# Ensure <think> tag is present
if "</think>" in text and not text.strip().startswith("<think>"):
text = "<think>\n" + text
messages = item["prompt"] + [{"role": "assistant", "content": text}]
rows.append({
"messages": messages,
"tokens": len(completion.token_ids),
})
# Save Arrow file
arrow_path = output_dir / f"data-{batch_idx:05d}-of-{total_batches:05d}.arrow"
save_batch_arrow(rows, str(arrow_path))
total_saved += len(rows)
# Save checkpoint
with open(ckpt_file, "wb") as f:
pickle.dump({"next_idx": batch_end}, f)
print(f"{tag} Saved {arrow_path.name} (total: {total_saved})")
# ── Cleanup ───────────────────────────────────────────────────────────
if ckpt_file.exists():
ckpt_file.unlink()
print(f"{tag} Done! {total_saved} samples → {output_dir}/")
# ---------------------------------------------------------------------------
# CLI
# ---------------------------------------------------------------------------
def parse_args() -> argparse.Namespace:
p = argparse.ArgumentParser(
description="Generate responses from a dataset using vLLM offline inference.",
)
# Required
p.add_argument("--model", type=str, required=True,
help="HuggingFace model name or path.")
p.add_argument("--input", type=str, required=True,
help="Input dataset (.jsonl or .parquet).")
p.add_argument("--output-dir", type=str, required=True,
help="Root output directory. Each rank writes to a subdirectory.")
# Generation
p.add_argument("--max-tokens", type=int, default=16384,
help="Max new tokens per response (default: 16384).")
p.add_argument("--temperature", type=float, default=0.7,
help="Sampling temperature (default: 0.7).")
p.add_argument("--top-p", type=float, default=0.9,
help="Nucleus sampling top-p (default: 0.9).")
p.add_argument("--num-responses", type=int, default=1,
help="Number of responses per prompt (default: 1).")
p.add_argument("--batch-size", type=int, default=32,
help="Prompts per vLLM batch call (default: 32).")
# Parallelism
p.add_argument("--tensor-parallel-size", type=int, default=1,
help="vLLM tensor-parallel size (default: 1).")
p.add_argument("--rank", type=int, default=None,
help="Worker rank (auto-detected from env if omitted).")
p.add_argument("--world-size", type=int, default=None,
help="Total workers (auto-detected from env if omitted).")
# Misc
p.add_argument("--num-samples", type=int, default=None,
help="Limit total samples before sharding (for debugging).")
p.add_argument("--checkpoint-dir", type=str, default="checkpoints",
help="Directory for per-rank checkpoint files (default: checkpoints).")
args = p.parse_args()
# Auto-detect rank / world_size from environment (torchrun, etc.)
if args.rank is None:
args.rank = int(os.environ.get("RANK", os.environ.get("LOCAL_RANK", 0)))
if args.world_size is None:
args.world_size = int(os.environ.get("WORLD_SIZE", 1))
return args
if __name__ == "__main__":
run_curation(parse_args())

View File

@@ -0,0 +1,247 @@
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
"""
Prepare Lightning OPD parquet from student rollout data.
Phase 1 tokenize (CPU-friendly):
Reads student rollout parquet, builds prompt via chat template,
tokenizes responses, truncates to --max-response-len, writes intermediate
parquet WITHOUT teacher logprobs.
Phase 2 precompute teacher logprobs (requires GPU / teacher sglang server):
Reads the intermediate parquet produced in Phase 1, sends each
(prompt + response) sequence to the teacher sglang server, stores
per-token response logprobs back into the metadata, writes the final
parquet.
Usage (Phase 1, CPU node):
python3 data_curation/prepare_lightning_opd.py \\
--tokenizer-path checkpoints/sft \\
--input-parquet data/rollouts/rollouts.parquet \\
--output-dir data/lightning_opd
Usage (Phase 2, GPU node with teacher sglang running):
python3 data_curation/prepare_lightning_opd.py \\
--tokenizer-path checkpoints/sft \\
--input-parquet data/rollouts/rollouts.parquet \\
--output-dir data/lightning_opd \\
--compute-teacher-logprobs \\
--teacher-url http://127.0.0.1:13141/generate
"""
import argparse
import asyncio
from pathlib import Path
import aiohttp
import pandas as pd
from transformers import AutoTokenizer
from tqdm import tqdm
def parse_args():
parser = argparse.ArgumentParser(
description="Prepare Lightning OPD parquet data (tokenize + optional teacher logprobs)."
)
parser.add_argument(
"--tokenizer-path", type=str, required=True,
help="Path to HuggingFace tokenizer (e.g. the student SFT checkpoint).",
)
parser.add_argument(
"--input-parquet", type=str, required=True,
help="Path to student rollout parquet. Expected columns: messages (list[dict]), tokens (int).",
)
parser.add_argument(
"--output-dir", type=str, required=True,
help="Directory where intermediate and final parquet files are written.",
)
parser.add_argument(
"--max-response-len", type=int, default=4096,
help="Maximum response token length; longer responses are truncated (default: 4096).",
)
parser.add_argument(
"--compute-teacher-logprobs", action="store_true",
help="Run Phase 2: compute teacher logprobs via a running sglang server.",
)
parser.add_argument(
"--teacher-url", type=str, default="http://127.0.0.1:13141/generate",
help="Teacher sglang server URL (default: http://127.0.0.1:13141/generate).",
)
parser.add_argument(
"--concurrency", type=int, default=64,
help="Number of concurrent requests to teacher sglang server (default: 64).",
)
return parser.parse_args()
# ── Phase 1: tokenize ────────────────────────────────────────────────────────
def phase1_tokenize(args, intermediate_path: Path):
print(f"[Phase 1] Loading tokenizer from {args.tokenizer_path}")
tokenizer = AutoTokenizer.from_pretrained(args.tokenizer_path, trust_remote_code=True)
print(f"[Phase 1] Loading input parquet: {args.input_parquet}")
df = pd.read_parquet(args.input_parquet)
print(f"[Phase 1] Total rows: {len(df)}")
rows_out = []
truncated = 0
skipped = 0
for row in tqdm(df.itertuples(), total=len(df), desc="Tokenizing"):
messages = row.messages
user_messages = [m for m in messages if m["role"] != "assistant"]
prompt_str = tokenizer.apply_chat_template(
user_messages, tokenize=False, add_generation_prompt=True, enable_thinking=True
)
assistant_msg = None
for msg in messages:
if msg["role"] == "assistant":
assistant_msg = msg["content"]
break
if assistant_msg is None:
skipped += 1
continue
response_ids = tokenizer.encode(assistant_msg, add_special_tokens=False)
if len(response_ids) > args.max_response_len:
truncated += 1
response_ids = response_ids[:args.max_response_len]
assistant_msg = tokenizer.decode(response_ids, skip_special_tokens=False)
rows_out.append({
"prompt": prompt_str,
"label": "0",
"metadata": {
"is_lightning_opd": True,
"response_tokens": response_ids,
"loss_mask": [1] * len(response_ids),
"response": assistant_msg,
},
})
print(f"[Phase 1] Rows written: {len(rows_out)}, "
f"truncated to {args.max_response_len}: {truncated}, skipped: {skipped}")
df_out = pd.DataFrame(rows_out)
intermediate_path.parent.mkdir(parents=True, exist_ok=True)
df_out.to_parquet(intermediate_path, index=False)
print(f"[Phase 1] Saved to {intermediate_path}")
# ── Phase 2: precompute teacher logprobs ─────────────────────────────────────
async def _fetch_logprobs(
session: aiohttp.ClientSession,
teacher_url: str,
full_ids: list[int],
response_len: int,
) -> list[float]:
"""Call teacher sglang server and return per-token logprobs for the response portion."""
payload = {
"input_ids": full_ids,
"sampling_params": {
"temperature": 0,
"max_new_tokens": 0,
"skip_special_tokens": False,
},
"return_logprob": True,
"logprob_start_len": 0,
}
async with session.post(teacher_url, json=payload) as resp:
resp.raise_for_status()
ret = await resp.json()
all_lps = ret["meta_info"]["input_token_logprobs"]
response_lps = [float(item[0]) for item in all_lps[1:]][-response_len:]
assert len(response_lps) == response_len, (
f"Expected {response_len} logprobs, got {len(response_lps)}"
)
return response_lps
async def _process_all(args, tokenizer, rows: list[dict]) -> list[list[float]]:
"""Process all rows concurrently with a live progress bar, preserving order."""
semaphore = asyncio.Semaphore(args.concurrency)
connector = aiohttp.TCPConnector(limit=args.concurrency)
results = [None] * len(rows)
async def bounded_fetch(idx: int, full_ids: list[int], response_len: int):
async with semaphore:
result = await _fetch_logprobs(session, args.teacher_url, full_ids, response_len)
results[idx] = result
pbar.update(1)
async with aiohttp.ClientSession(connector=connector) as session:
with tqdm(total=len(rows), desc="[Phase 2] Teacher logprobs") as pbar:
tasks = []
for idx, row in enumerate(rows):
meta = row["metadata"]
prompt_ids = tokenizer.encode(row["prompt"], add_special_tokens=False)
response_ids = [int(x) for x in meta["response_tokens"]]
full_ids = prompt_ids + response_ids
tasks.append(bounded_fetch(idx, full_ids, len(response_ids)))
await asyncio.gather(*tasks)
return results
def phase2_logprobs(args, intermediate_path: Path, output_path: Path):
print(f"[Phase 2] Loading intermediate parquet: {intermediate_path}")
df = pd.read_parquet(intermediate_path)
rows = df.to_dict(orient="records")
print(f"[Phase 2] Total rows: {len(rows)}")
print(f"[Phase 2] Loading tokenizer from {args.tokenizer_path}")
tokenizer = AutoTokenizer.from_pretrained(args.tokenizer_path, trust_remote_code=True)
print(f"[Phase 2] Computing teacher logprobs via {args.teacher_url} "
f"(concurrency={args.concurrency})")
all_logprobs = asyncio.run(_process_all(args, tokenizer, rows))
for row, lps in zip(rows, all_logprobs):
row["metadata"]["teacher_log_probs"] = lps
df_out = pd.DataFrame(rows)
output_path.parent.mkdir(parents=True, exist_ok=True)
df_out.to_parquet(output_path, index=False)
print(f"[Phase 2] Saved to {output_path}")
# Sanity check
df_check = pd.read_parquet(output_path)
row0 = df_check.iloc[0]
meta = row0["metadata"]
print("\n[Phase 2] Sanity check row 0:")
print(f" prompt[:80]: {row0['prompt'][:80]}")
print(f" label: {row0['label']}")
print(f" len(response_tokens): {len(meta['response_tokens'])}")
print(f" len(teacher_log_probs): {len(meta['teacher_log_probs'])}")
print(f" teacher_log_probs[:5]: {meta['teacher_log_probs'][:5]}")
# ── Entry point ───────────────────────────────────────────────────────────────
def main():
args = parse_args()
output_dir = Path(args.output_dir)
input_stem = Path(args.input_parquet).stem
intermediate_path = output_dir / f"{input_stem}-lightning-opd.parquet"
output_path = output_dir / f"{input_stem}-lightning-opd-precomputed.parquet"
if args.compute_teacher_logprobs:
if not intermediate_path.exists():
print("[INFO] Intermediate parquet not found, running Phase 1 first.")
phase1_tokenize(args, intermediate_path)
phase2_logprobs(args, intermediate_path, output_path)
else:
phase1_tokenize(args, intermediate_path)
print(f"\n[INFO] To add teacher logprobs, re-run with --compute-teacher-logprobs "
f"after starting the teacher sglang server.")
if __name__ == "__main__":
main()

View File

@@ -0,0 +1,126 @@
#!/usr/bin/env bash
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Launch data curation across multiple GPUs / nodes.
#
# Each GPU runs one independent vLLM worker that processes a disjoint shard
# of the dataset. No torch.distributed communication is needed — each worker
# is a standalone process with its own rank derived from environment variables.
#
# ── Single node, 8 GPUs (tp=1, 8 workers) ────────────────────────────────
# bash data_curation/run_curation.sh \
# --model Qwen/Qwen3-4B \
# --input data.jsonl \
# --output-dir output/ \
# --num-gpus 8
#
# ── Single node, 2 GPUs (tp=2, 1 worker) ─────────────────────────────────
# bash data_curation/run_curation.sh \
# --model Qwen/Qwen3-8B \
# --input data.jsonl \
# --output-dir output/ \
# --num-gpus 2 \
# --tensor-parallel-size 2
#
# ── Multi-node (2 nodes × 8 GPUs, tp=1, 16 workers) ─────────────────────
# # On node 0:
# NODE_RANK=0 NUM_NODES=2 bash data_curation/run_curation.sh \
# --model Qwen/Qwen3-4B \
# --input data.jsonl \
# --output-dir output/ \
# --num-gpus 8
#
# # On node 1:
# NODE_RANK=1 NUM_NODES=2 bash data_curation/run_curation.sh \
# --model Qwen/Qwen3-4B \
# --input data.jsonl \
# --output-dir output/ \
# --num-gpus 8
#
# Environment variables (optional):
# NUM_NODES total number of nodes (default: 1)
# NODE_RANK rank of this node (default: 0)
# ──────────────────────────────────────────────────────────────────────────
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# ── Parse --num-gpus and --tensor-parallel-size from args ─────────────────
NUM_GPUS=1
TP=1
PIPELINE_ARGS=()
while [[ $# -gt 0 ]]; do
case "$1" in
--num-gpus)
NUM_GPUS="$2"; shift 2 ;;
--tensor-parallel-size)
TP="$2"; PIPELINE_ARGS+=("--tensor-parallel-size" "$2"); shift 2 ;;
*)
PIPELINE_ARGS+=("$1"); shift ;;
esac
done
# ── Compute worker layout ────────────────────────────────────────────────
NUM_NODES="${NUM_NODES:-1}"
NODE_RANK="${NODE_RANK:-0}"
WORKERS_PER_NODE=$(( NUM_GPUS / TP ))
WORLD_SIZE=$(( WORKERS_PER_NODE * NUM_NODES ))
echo "=== Data Curation Launch ==="
echo " Nodes: ${NUM_NODES} (this node: ${NODE_RANK})"
echo " GPUs per node: ${NUM_GPUS}"
echo " TP size: ${TP}"
echo " Workers per node: ${WORKERS_PER_NODE}"
echo " World size: ${WORLD_SIZE}"
echo " Pipeline args: ${PIPELINE_ARGS[*]}"
echo "============================"
# ── Launch workers ───────────────────────────────────────────────────────
PIDS=()
for (( LOCAL=0; LOCAL<WORKERS_PER_NODE; LOCAL++ )); do
GLOBAL_RANK=$(( NODE_RANK * WORKERS_PER_NODE + LOCAL ))
GPU_START=$(( LOCAL * TP ))
GPU_END=$(( GPU_START + TP - 1 ))
# Build CUDA_VISIBLE_DEVICES string, e.g. "0" or "2,3"
GPUS=""
for (( g=GPU_START; g<=GPU_END; g++ )); do
[[ -n "$GPUS" ]] && GPUS="${GPUS},"
GPUS="${GPUS}${g}"
done
echo "[Node ${NODE_RANK}] Launching worker rank=${GLOBAL_RANK} on GPU(s) ${GPUS}"
CUDA_VISIBLE_DEVICES="${GPUS}" \
RANK="${GLOBAL_RANK}" \
WORLD_SIZE="${WORLD_SIZE}" \
python "${SCRIPT_DIR}/pipeline.py" \
--rank "${GLOBAL_RANK}" \
--world-size "${WORLD_SIZE}" \
"${PIPELINE_ARGS[@]}" \
> >(sed "s/^/[rank${GLOBAL_RANK}] /") \
2>&1 &
PIDS+=($!)
done
# ── Wait for all workers ─────────────────────────────────────────────────
echo "Waiting for ${#PIDS[@]} workers to finish..."
FAILED=0
for PID in "${PIDS[@]}"; do
if ! wait "$PID"; then
echo "Worker PID ${PID} failed!"
FAILED=1
fi
done
if [[ $FAILED -eq 1 ]]; then
echo "Some workers failed. Check logs above."
exit 1
fi
echo "All workers finished successfully."

13
generation_config.json Normal file
View File

@@ -0,0 +1,13 @@
{
"bos_token_id": 151643,
"do_sample": true,
"eos_token_id": [
151645,
151643
],
"pad_token_id": 151643,
"temperature": 0.6,
"top_k": 20,
"top_p": 0.95,
"transformers_version": "4.52.4"
}

151388
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:3d57b393ee9734c673d28da679609d593ade800fb4dfc7774a388da2a0be5654
size 4967215360

View File

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

View File

@@ -0,0 +1,406 @@
{
"metadata": {
"total_size": 8822848512
},
"weight_map": {
"lm_head.weight": "model-00002-of-00002.safetensors",
"model.embed_tokens.weight": "model-00001-of-00002.safetensors",
"model.layers.0.input_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.0.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.0.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.0.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.0.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.0.self_attn.k_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.0.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.0.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.0.self_attn.q_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.0.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.0.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.1.input_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.1.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.1.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.1.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.1.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.1.self_attn.k_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.1.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.1.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.1.self_attn.q_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.1.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.1.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.10.input_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.10.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.10.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.10.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.10.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.10.self_attn.k_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.10.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.10.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.10.self_attn.q_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.10.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.10.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.11.input_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.11.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.11.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.11.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.11.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.11.self_attn.k_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.11.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.11.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.11.self_attn.q_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.11.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.11.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.12.input_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.12.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.12.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.12.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.12.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.12.self_attn.k_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.12.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.12.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.12.self_attn.q_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.12.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.12.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.13.input_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.13.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.13.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.13.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.13.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.13.self_attn.k_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.13.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.13.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.13.self_attn.q_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.13.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.13.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.14.input_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.14.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.14.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.14.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.14.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.14.self_attn.k_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.14.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.14.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.14.self_attn.q_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.14.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.14.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.15.input_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.15.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.15.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.15.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.15.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.15.self_attn.k_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.15.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.15.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.15.self_attn.q_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.15.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.15.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.16.input_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.16.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.16.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.16.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.16.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.16.self_attn.k_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.16.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.16.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.16.self_attn.q_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.16.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.16.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.17.input_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.17.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.17.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.17.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.17.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.17.self_attn.k_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.17.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.17.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.17.self_attn.q_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.17.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.17.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.18.input_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.18.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.18.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.18.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.18.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.18.self_attn.k_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.18.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.18.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.18.self_attn.q_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.18.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.18.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.19.input_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.19.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.19.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.19.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.19.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.19.self_attn.k_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.19.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.19.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.19.self_attn.q_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.19.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.19.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.2.input_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.2.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.2.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.2.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.2.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.2.self_attn.k_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.2.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.2.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.2.self_attn.q_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.2.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.2.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.20.input_layernorm.weight": "model-00002-of-00002.safetensors",
"model.layers.20.mlp.down_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.20.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.20.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.20.post_attention_layernorm.weight": "model-00002-of-00002.safetensors",
"model.layers.20.self_attn.k_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.20.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.20.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.20.self_attn.q_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.20.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.20.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.21.input_layernorm.weight": "model-00002-of-00002.safetensors",
"model.layers.21.mlp.down_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.21.mlp.gate_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.21.mlp.up_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.21.post_attention_layernorm.weight": "model-00002-of-00002.safetensors",
"model.layers.21.self_attn.k_norm.weight": "model-00002-of-00002.safetensors",
"model.layers.21.self_attn.k_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.21.self_attn.o_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.21.self_attn.q_norm.weight": "model-00002-of-00002.safetensors",
"model.layers.21.self_attn.q_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.21.self_attn.v_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.22.input_layernorm.weight": "model-00002-of-00002.safetensors",
"model.layers.22.mlp.down_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.22.mlp.gate_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.22.mlp.up_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.22.post_attention_layernorm.weight": "model-00002-of-00002.safetensors",
"model.layers.22.self_attn.k_norm.weight": "model-00002-of-00002.safetensors",
"model.layers.22.self_attn.k_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.22.self_attn.o_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.22.self_attn.q_norm.weight": "model-00002-of-00002.safetensors",
"model.layers.22.self_attn.q_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.22.self_attn.v_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.23.input_layernorm.weight": "model-00002-of-00002.safetensors",
"model.layers.23.mlp.down_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.23.mlp.gate_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.23.mlp.up_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.23.post_attention_layernorm.weight": "model-00002-of-00002.safetensors",
"model.layers.23.self_attn.k_norm.weight": "model-00002-of-00002.safetensors",
"model.layers.23.self_attn.k_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.23.self_attn.o_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.23.self_attn.q_norm.weight": "model-00002-of-00002.safetensors",
"model.layers.23.self_attn.q_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.23.self_attn.v_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.24.input_layernorm.weight": "model-00002-of-00002.safetensors",
"model.layers.24.mlp.down_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.24.mlp.gate_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.24.mlp.up_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.24.post_attention_layernorm.weight": "model-00002-of-00002.safetensors",
"model.layers.24.self_attn.k_norm.weight": "model-00002-of-00002.safetensors",
"model.layers.24.self_attn.k_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.24.self_attn.o_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.24.self_attn.q_norm.weight": "model-00002-of-00002.safetensors",
"model.layers.24.self_attn.q_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.24.self_attn.v_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.25.input_layernorm.weight": "model-00002-of-00002.safetensors",
"model.layers.25.mlp.down_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.25.mlp.gate_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.25.mlp.up_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.25.post_attention_layernorm.weight": "model-00002-of-00002.safetensors",
"model.layers.25.self_attn.k_norm.weight": "model-00002-of-00002.safetensors",
"model.layers.25.self_attn.k_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.25.self_attn.o_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.25.self_attn.q_norm.weight": "model-00002-of-00002.safetensors",
"model.layers.25.self_attn.q_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.25.self_attn.v_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.26.input_layernorm.weight": "model-00002-of-00002.safetensors",
"model.layers.26.mlp.down_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.26.mlp.gate_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.26.mlp.up_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.26.post_attention_layernorm.weight": "model-00002-of-00002.safetensors",
"model.layers.26.self_attn.k_norm.weight": "model-00002-of-00002.safetensors",
"model.layers.26.self_attn.k_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.26.self_attn.o_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.26.self_attn.q_norm.weight": "model-00002-of-00002.safetensors",
"model.layers.26.self_attn.q_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.26.self_attn.v_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.27.input_layernorm.weight": "model-00002-of-00002.safetensors",
"model.layers.27.mlp.down_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.27.mlp.gate_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.27.mlp.up_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.27.post_attention_layernorm.weight": "model-00002-of-00002.safetensors",
"model.layers.27.self_attn.k_norm.weight": "model-00002-of-00002.safetensors",
"model.layers.27.self_attn.k_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.27.self_attn.o_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.27.self_attn.q_norm.weight": "model-00002-of-00002.safetensors",
"model.layers.27.self_attn.q_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.27.self_attn.v_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.28.input_layernorm.weight": "model-00002-of-00002.safetensors",
"model.layers.28.mlp.down_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.28.mlp.gate_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.28.mlp.up_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.28.post_attention_layernorm.weight": "model-00002-of-00002.safetensors",
"model.layers.28.self_attn.k_norm.weight": "model-00002-of-00002.safetensors",
"model.layers.28.self_attn.k_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.28.self_attn.o_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.28.self_attn.q_norm.weight": "model-00002-of-00002.safetensors",
"model.layers.28.self_attn.q_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.28.self_attn.v_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.29.input_layernorm.weight": "model-00002-of-00002.safetensors",
"model.layers.29.mlp.down_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.29.mlp.gate_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.29.mlp.up_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.29.post_attention_layernorm.weight": "model-00002-of-00002.safetensors",
"model.layers.29.self_attn.k_norm.weight": "model-00002-of-00002.safetensors",
"model.layers.29.self_attn.k_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.29.self_attn.o_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.29.self_attn.q_norm.weight": "model-00002-of-00002.safetensors",
"model.layers.29.self_attn.q_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.29.self_attn.v_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.3.input_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.3.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.3.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.3.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.3.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.3.self_attn.k_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.3.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.3.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.3.self_attn.q_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.3.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.3.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.30.input_layernorm.weight": "model-00002-of-00002.safetensors",
"model.layers.30.mlp.down_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.30.mlp.gate_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.30.mlp.up_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.30.post_attention_layernorm.weight": "model-00002-of-00002.safetensors",
"model.layers.30.self_attn.k_norm.weight": "model-00002-of-00002.safetensors",
"model.layers.30.self_attn.k_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.30.self_attn.o_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.30.self_attn.q_norm.weight": "model-00002-of-00002.safetensors",
"model.layers.30.self_attn.q_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.30.self_attn.v_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.31.input_layernorm.weight": "model-00002-of-00002.safetensors",
"model.layers.31.mlp.down_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.31.mlp.gate_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.31.mlp.up_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.31.post_attention_layernorm.weight": "model-00002-of-00002.safetensors",
"model.layers.31.self_attn.k_norm.weight": "model-00002-of-00002.safetensors",
"model.layers.31.self_attn.k_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.31.self_attn.o_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.31.self_attn.q_norm.weight": "model-00002-of-00002.safetensors",
"model.layers.31.self_attn.q_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.31.self_attn.v_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.32.input_layernorm.weight": "model-00002-of-00002.safetensors",
"model.layers.32.mlp.down_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.32.mlp.gate_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.32.mlp.up_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.32.post_attention_layernorm.weight": "model-00002-of-00002.safetensors",
"model.layers.32.self_attn.k_norm.weight": "model-00002-of-00002.safetensors",
"model.layers.32.self_attn.k_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.32.self_attn.o_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.32.self_attn.q_norm.weight": "model-00002-of-00002.safetensors",
"model.layers.32.self_attn.q_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.32.self_attn.v_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.33.input_layernorm.weight": "model-00002-of-00002.safetensors",
"model.layers.33.mlp.down_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.33.mlp.gate_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.33.mlp.up_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.33.post_attention_layernorm.weight": "model-00002-of-00002.safetensors",
"model.layers.33.self_attn.k_norm.weight": "model-00002-of-00002.safetensors",
"model.layers.33.self_attn.k_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.33.self_attn.o_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.33.self_attn.q_norm.weight": "model-00002-of-00002.safetensors",
"model.layers.33.self_attn.q_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.33.self_attn.v_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.34.input_layernorm.weight": "model-00002-of-00002.safetensors",
"model.layers.34.mlp.down_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.34.mlp.gate_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.34.mlp.up_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.34.post_attention_layernorm.weight": "model-00002-of-00002.safetensors",
"model.layers.34.self_attn.k_norm.weight": "model-00002-of-00002.safetensors",
"model.layers.34.self_attn.k_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.34.self_attn.o_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.34.self_attn.q_norm.weight": "model-00002-of-00002.safetensors",
"model.layers.34.self_attn.q_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.34.self_attn.v_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.35.input_layernorm.weight": "model-00002-of-00002.safetensors",
"model.layers.35.mlp.down_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.35.mlp.gate_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.35.mlp.up_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.35.post_attention_layernorm.weight": "model-00002-of-00002.safetensors",
"model.layers.35.self_attn.k_norm.weight": "model-00002-of-00002.safetensors",
"model.layers.35.self_attn.k_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.35.self_attn.o_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.35.self_attn.q_norm.weight": "model-00002-of-00002.safetensors",
"model.layers.35.self_attn.q_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.35.self_attn.v_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.4.input_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.4.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.4.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.4.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.4.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.4.self_attn.k_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.4.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.4.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.4.self_attn.q_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.4.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.4.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.5.input_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.5.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.5.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.5.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.5.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.5.self_attn.k_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.5.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.5.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.5.self_attn.q_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.5.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.5.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.6.input_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.6.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.6.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.6.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.6.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.6.self_attn.k_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.6.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.6.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.6.self_attn.q_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.6.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.6.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.7.input_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.7.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.7.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.7.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.7.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.7.self_attn.k_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.7.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.7.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.7.self_attn.q_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.7.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.7.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.8.input_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.8.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.8.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.8.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.8.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.8.self_attn.k_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.8.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.8.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.8.self_attn.q_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.8.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.8.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.9.input_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.9.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.9.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.9.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.9.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.9.self_attn.k_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.9.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.9.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.9.self_attn.q_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.9.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.9.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
"model.norm.weight": "model-00002-of-00002.safetensors"
}
}

59
pyproject.toml Normal file
View File

@@ -0,0 +1,59 @@
[build-system]
requires = [
"packaging",
"setuptools >= 49.4.0",
"wheel",
]
build-backend = "setuptools.build_meta"
[tool.isort]
profile = "black" # black-compatible
line_length = 119 # should match black parameters
ignore_whitespace = true # ignore whitespace for compatibility with the initial style
py_version = 310 # python 3.10 as a target version
sections = ["FUTURE", "STDLIB", "THIRDPARTY", "FIRSTPARTY", "LOCALFOLDER"]
default_section = "THIRDPARTY"
extend_skip = ["setup.py", "docs/source/conf.py"]
known_first_party = ["slime", "slime_plugins"]
known_third_party = ["megatron", "wandb", "ray", "transformers"]
src_paths = ["slime", "slime_plugins"]
[tool.black]
line_length = 119
[tool.ruff]
line-length = 119
[tool.pytest.ini_options]
# durations=0 will display all tests execution time, sorted in ascending order starting from from the slowest one.
# -vv will also display tests with duration = 0.00s
addopts = "--verbose --pyargs --durations=0 --strict-markers" # always add these arguments to pytest
testpaths = ["./tests"] # must be an explicit path to avoid importing another "tests" module
# directories to ignore when discovering tests
norecursedirs = [
"external",
"examples",
"docs",
"scripts",
"tools",
"tutorials",
"*.egg",
".*",
"_darcs",
"build",
"CVS",
"dist",
"venv",
"{arch}",
]
# markers to select tests, use `pytest --markers` to see all available markers, `pytest -m "<marker>"` to select tests
markers = [
"unit: marks unit test, i.e. testing a single, well isolated functionality (deselect with '-m \"not unit\"')",
"integration: marks test checking the elements when integrated into subsystems (deselect with '-m \"not integration\"')",
"system: marks test working at the highest integration level (deselect with '-m \"not system\"')",
"acceptance: marks test checking whether the developed product/model passes the user defined acceptance criteria (deselect with '-m \"not acceptance\"')",
"docs: mark tests related to documentation (deselect with '-m \"not docs\"')",
"skipduringci: marks tests that are skipped ci as they are addressed by Jenkins jobs but should be run to test user setups",
"pleasefixme: marks tests that are broken and need fixing",
]

19
requirements.txt Normal file
View File

@@ -0,0 +1,19 @@
accelerate
blobfile
datasets
httpx[http2]
mcp[cli]
megatron-bridge @ git+https://github.com/fzyzcjy/Megatron-Bridge.git@dev_rl
memray # needed for debugging (but is lightweight), we can put it to dev mode when using pyproject.toml
nvidia-modelopt[torch]>=0.37.0 # needed by megatron-bridge
omegaconf
pillow
pylatexenc
pyyaml
ray[default]
ring_flash_attn
sglang-router>=0.2.3
tensorboard
transformers
wandb
liger_kernel

10
run_docker.sh Normal file
View File

@@ -0,0 +1,10 @@
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
docker run -it --gpus all \
--shm-size=64g \
-v $(pwd):/workspace/Lightning-OPD \
-v $HOME/.cache:$HOME/.cache \
-w /workspace/Lightning-OPD \
tonyhao96/jetmoe:v0.2 \
bash

View File

@@ -0,0 +1,42 @@
#!/usr/bin/env bash
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
# Step 3: Collect student rollouts on OPD prompts.
#
# Uses data_curation/ to run the SFT model on OPD prompts (e.g. DAPO-Math-17k)
# and collect response rollouts for Lightning OPD data preparation.
#
# Required environment variables:
# SFT_CHECKPOINT - Path to the SFT model checkpoint
# OPD_PROMPTS - Path to the OPD prompt dataset (.jsonl or .parquet)
# OUTPUT_DIR - Directory for collected rollout data
#
# Optional:
# NUM_GPUS - Number of GPUs to use (default: 8)
# TP_SIZE - Tensor parallel size per worker (default: 1)
#
# Extra args are passed through to data_curation/pipeline.py, e.g.:
# bash scripts/collect_rollouts.sh --num-samples 10
set -euo pipefail
: "${SFT_CHECKPOINT:?Set SFT_CHECKPOINT to the SFT model path}"
: "${OPD_PROMPTS:?Set OPD_PROMPTS to the OPD prompt dataset path}"
: "${OUTPUT_DIR:?Set OUTPUT_DIR for collected rollout data}"
# Resolve to absolute paths (workers may run from different cwd)
SFT_CHECKPOINT="$(cd "$(dirname "${SFT_CHECKPOINT}")" && pwd)/$(basename "${SFT_CHECKPOINT}")"
OPD_PROMPTS="$(cd "$(dirname "${OPD_PROMPTS}")" && pwd)/$(basename "${OPD_PROMPTS}")"
OUTPUT_DIR="$(mkdir -p "${OUTPUT_DIR}" && cd "${OUTPUT_DIR}" && pwd)"
NUM_GPUS="${NUM_GPUS:-8}"
TP_SIZE="${TP_SIZE:-1}"
bash data_curation/run_curation.sh \
--model "${SFT_CHECKPOINT}" \
--input "${OPD_PROMPTS}" \
--output-dir "${OUTPUT_DIR}" \
--num-gpus "${NUM_GPUS}" \
--tensor-parallel-size "${TP_SIZE}" \
"$@"

View File

@@ -0,0 +1,27 @@
#!/bin/bash
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Convert a Megatron torch_dist checkpoint to HuggingFace format.
#
# Required env vars:
# MEGATRON_CKPT_DIR - path to the Megatron checkpoint directory (e.g., /root/models/<name>_ckpt__<config>/iter_0000150)
# HF_OUTPUT_DIR - path to save the converted HuggingFace model
# ORIGIN_HF_DIR - path to the original HuggingFace model (for config.json, tokenizer, etc.)
#
# Example:
# MEGATRON_CKPT_DIR=/root/models/Qwen3-4B-Base-sft_ckpt__qwen3-4b-lightning-opd/iter_0000150 \
# HF_OUTPUT_DIR=checkpoints/qwen3-4b-lightning-opd-hf \
# ORIGIN_HF_DIR=checkpoints/qwen3-4b-base-sft-qwen3-8b/<your-sft-checkpoint> \
# bash scripts/convert_megatron_to_hf.sh
set -euo pipefail
: "${MEGATRON_CKPT_DIR:?Please set MEGATRON_CKPT_DIR}"
: "${HF_OUTPUT_DIR:?Please set HF_OUTPUT_DIR}"
: "${ORIGIN_HF_DIR:?Please set ORIGIN_HF_DIR}"
python tools/convert_torch_dist_to_hf.py \
--input-dir "${MEGATRON_CKPT_DIR}" \
--output-dir "${HF_OUTPUT_DIR}" \
--origin-hf-dir "${ORIGIN_HF_DIR}"

53
scripts/eval_aime2024.sh Normal file
View File

@@ -0,0 +1,53 @@
export MKL_THREADING_LAYER=GNU
export MKL_SERVICE_FORCE_INTEL=0
export OMP_NUM_THREADS=1
# CUDA_VISIBLE_DEVICES=0 python tools/eval_aime2024_vllm.py \
# --model /mnt/disk1/yihao/Lightning-OPD/model_weights/qwen3-8b \
# --num-gpus 1 \
# --n-samples 1 \
# --temperature 0.0 \
# --top-p 1.0 \
# --max-tokens 32768 \
# --prompt-template paper \
# --hf-cache /mnt/disk1/yihao/hf_cache \
# --output outputs/aime2024_qwen3_8b_paper_n1_32k.jsonl
# CUDA_VISIBLE_DEVICES=0 python tools/eval_aime2024_vllm.py \
# --model /mnt/disk1/yihao/Lightning-OPD/checkpoints/qwen3-4b-poe-distill-lora-opd-ppo-clip-locking-b-5-self-distill-100 \
# --num-gpus 1 \
# --n-samples 1 \
# --temperature 0.0 \
# --top-p 1.0 \
# --max-tokens 32768 \
# --prompt-template paper \
# --hf-cache /mnt/disk1/yihao/hf_cache \
# --output outputs/aime2024_qwen3_8b_paper_n1_32k.jsonl
CUDA_VISIBLE_DEVICES=4,5,6,7 python tools/eval_aime2024_vllm.py \
--model /mnt/disk1/yihao/Lightning-OPD/checkpoints/qwen3-4b-poe-distill-lora-opd-ppo-clip-locking-b-5-self-distill-100 \
--num-gpus 4 \
--n-samples 32 \
--temperature 0.6 \
--top-p 0.95 \
--max-tokens 32768 \
--prompt-template paper \
--hf-cache /mnt/disk1/yihao/hf_cache \
--output outputs/aime2024_qwen3_4b_poe_distill_lora_paper_n1_32k.jsonl \
--enable-thinking
# CUDA_VISIBLE_DEVICES=4,5,6,7 python tools/eval_aime2024_vllm.py \
# --model /mnt/disk1/yihao/Lightning-OPD/checkpoints/qwen3-4b-poe-distill-lora-opd-ppo-clip-60 \
# --num-gpus 4 \
# --n-samples 32 \
# --temperature 0.6 \
# --top-p 0.95 \
# --max-tokens 32768 \
# --enable-thinking \
# --prompt-template paper \
# --hf-cache /mnt/disk1/yihao/hf_cache \
# --output outputs/aime2024_qwen3_4b_lightning_opd_paper_n32_32k.jsonl \

23
scripts/eval_aime2025.sh Normal file
View File

@@ -0,0 +1,23 @@
CUDA_VISIBLE_DEVICES=4,5,6,7 python tools/eval_aime2025_vllm.py \
--model /mnt/disk1/yihao/Lightning-OPD/checkpoints/qwen3-4b-lightning-opd-hf \
--num-gpus 4 \
--prompt-template paper \
--n-samples 32 \
--temperature 0.6 \
--top-p 0.95 \
--max-tokens 32768 \
--enable-thinking \
--output outputs/aime2025_qwen3_4b_lightning_opd.jsonl
# CUDA_VISIBLE_DEVICES=0,2 python tools/eval_aime2025_vllm.py \
# --model /mnt/disk1/yihao/Lightning-OPD/checkpoints/qwen3-4b-lightning-opd-hf \
# --num-gpus 2 \
# --n-samples 1 \
# --temperature 0.0 \
# --top-p 1.0 \
# --max-tokens 32768 \
# --prompt-template paper \
# --hf-cache /mnt/disk1/yihao/hf_cache \
# --output outputs/aime2024_qwen3_4b_poe_distill_lora_paper_n1_32k.jsonl \
# --enable-thinking

10
scripts/eval_hmmt25.sh Normal file
View File

@@ -0,0 +1,10 @@
CUDA_VISIBLE_DEVICES=4,5,6,7 python tools/eval_hmmt2025_vllm.py \
--model /mnt/disk1/yihao/Lightning-OPD/checkpoints/qwen3-4b-lightning-opd-hf \
--num-gpus 4 \
--prompt-template paper \
--n-samples 32 \
--temperature 0.6 \
--top-p 0.95 \
--max-tokens 32768 \
--enable-thinking \
--output outputs/hmmt_feb_2025_qwen3_4b_lightning_opd.jsonl

View File

@@ -0,0 +1,59 @@
#!/usr/bin/env bash
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
# Step 1: Generate SFT data using the teacher model.
#
# Uses data_curation/ to run the teacher model on OpenThoughts-3 prompts
# and generate response trajectories for SFT training.
#
# Required environment variables:
# TEACHER_MODEL - HuggingFace model name or path (e.g. Qwen/Qwen3-8B)
# SFT_PROMPTS - Path to the prompt dataset (.jsonl or .parquet)
# OUTPUT_DIR - Directory for generated SFT data
#
# Optional:
# NUM_GPUS - Number of GPUs to use (default: 8)
# TP_SIZE - Tensor parallel size per worker (default: 1)
#
# Extra args are passed through to data_curation/pipeline.py, e.g.:
# bash scripts/generate_sft_data.sh --num-samples 10
set -euo pipefail
# ---- CUDA / FlashInfer build environment ----
if [ -n "${CONDA_PREFIX:-}" ]; then
export CUDA_HOME="${CUDA_HOME:-$CONDA_PREFIX}"
export CUDA_PATH="${CUDA_PATH:-$CONDA_PREFIX}"
export CUDACXX="${CUDACXX:-$CONDA_PREFIX/bin/nvcc}"
export PATH="$CONDA_PREFIX/bin:$PATH"
export LD_LIBRARY_PATH="$CONDA_PREFIX/lib:$CONDA_PREFIX/lib64:/usr/lib/x86_64-linux-gnu:${LD_LIBRARY_PATH:-}"
export LIBRARY_PATH="/usr/lib/x86_64-linux-gnu:${LIBRARY_PATH:-}"
fi
echo "Using nvcc: $(which nvcc)"
nvcc --version || true
echo "CUDA_HOME=${CUDA_HOME:-}"
echo "CUDACXX=${CUDACXX:-}"
echo "LIBRARY_PATH=${LIBRARY_PATH:-}"
# ---------------------------------------------
: "${TEACHER_MODEL:?Set TEACHER_MODEL (e.g. Qwen/Qwen3-8B)}"
: "${SFT_PROMPTS:?Set SFT_PROMPTS to the prompt dataset path}"
: "${OUTPUT_DIR:?Set OUTPUT_DIR for generated SFT data}"
# Resolve to absolute paths (workers may run from different cwd)
SFT_PROMPTS="$(cd "$(dirname "${SFT_PROMPTS}")" && pwd)/$(basename "${SFT_PROMPTS}")"
OUTPUT_DIR="$(mkdir -p "${OUTPUT_DIR}" && cd "${OUTPUT_DIR}" && pwd)"
NUM_GPUS="${NUM_GPUS:-8}"
TP_SIZE="${TP_SIZE:-1}"
bash data_curation/run_curation.sh \
--model "${TEACHER_MODEL}" \
--input "${SFT_PROMPTS}" \
--output-dir "${OUTPUT_DIR}" \
--num-gpus "${NUM_GPUS}" \
--tensor-parallel-size "${TP_SIZE}" \
"$@"

View File

@@ -0,0 +1,5 @@
python tools/merge_poe_lora.py \
--base-model checkpoints/qwen3-4b-base-sft-qwen3-8b \
--adapter checkpoints/qwen3-4b-poe-distill-lora-opd-ppo-clip-locking-b-5-self-distill/checkpoint-100 \
--output-dir checkpoints/qwen3-4b-poe-distill-lora-opd-ppo-clip-locking-b-5-self-distill-100 \
--dtype bfloat16

View File

@@ -0,0 +1,29 @@
#!/usr/bin/env bash
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
# Precompute teacher logprobs for Lightning OPD (4B scale, teacher=Qwen3-8B).
#
# Required environment variables:
# SFT_CHECKPOINT - Path to the SFT checkpoint (used as tokenizer)
# ROLLOUT_PARQUET - Path to the student rollout parquet file
# OUTPUT_DIR - Directory for the output parquet with teacher logprobs
#
# This script starts a Qwen3-8B teacher server, then runs Phase 1+2 of
# prepare_lightning_opd.py to tokenize and precompute teacher logprobs.
set -euo pipefail
: "${SFT_CHECKPOINT:?Set SFT_CHECKPOINT to the SFT model path}"
: "${ROLLOUT_PARQUET:?Set ROLLOUT_PARQUET to the student rollout parquet}"
: "${OUTPUT_DIR:?Set OUTPUT_DIR for the output parquet}"
# Start teacher server
bash scripts/serve_teacher_8b.sh
python3 data_curation/prepare_lightning_opd.py \
--tokenizer-path "${SFT_CHECKPOINT}" \
--input-parquet "${ROLLOUT_PARQUET}" \
--output-dir "${OUTPUT_DIR}" \
--compute-teacher-logprobs \
--teacher-url http://127.0.0.1:13141/generate

View File

@@ -0,0 +1,29 @@
#!/usr/bin/env bash
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
# Precompute teacher logprobs for Lightning OPD (8B scale, teacher=Qwen3-32B).
#
# Required environment variables:
# SFT_CHECKPOINT - Path to the SFT checkpoint (used as tokenizer)
# ROLLOUT_PARQUET - Path to the student rollout parquet file
# OUTPUT_DIR - Directory for the output parquet with teacher logprobs
#
# This script starts a Qwen3-32B teacher server, then runs Phase 1+2 of
# prepare_lightning_opd.py to tokenize and precompute teacher logprobs.
set -euo pipefail
: "${SFT_CHECKPOINT:?Set SFT_CHECKPOINT to the SFT model path}"
: "${ROLLOUT_PARQUET:?Set ROLLOUT_PARQUET to the student rollout parquet}"
: "${OUTPUT_DIR:?Set OUTPUT_DIR for the output parquet}"
# Start teacher server
bash scripts/serve_teacher_32b.sh
python3 data_curation/prepare_lightning_opd.py \
--tokenizer-path "${SFT_CHECKPOINT}" \
--input-parquet "${ROLLOUT_PARQUET}" \
--output-dir "${OUTPUT_DIR}" \
--compute-teacher-logprobs \
--teacher-url http://127.0.0.1:13141/generate

View File

@@ -0,0 +1,150 @@
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
"""
Convert HuggingFace OpenThoughts3-1.2M dataset to a prompt-only JSONL file
for SFT data generation (Step 1).
Extracts the prompt (user messages) from each sample and writes to JSONL.
Optionally samples a subset (default 300K) to reduce compute cost.
Usage:
python scripts/prepare_sft_prompts.py \
--output data/prompts/openthoughts3_300k.jsonl \
--num-samples 300000
# Use a local parquet file instead of downloading from HF
python scripts/prepare_sft_prompts.py \
--input data/prompts/local.parquet \
--output data/prompts/openthoughts3_300k.jsonl
"""
import argparse
import json
import random
def parse_args():
parser = argparse.ArgumentParser(
description="Extract prompts from OpenThoughts3-1.2M for SFT data generation."
)
parser.add_argument(
"--input", type=str, default=None,
help="Path to a local parquet/jsonl file. If not set, downloads from HuggingFace.",
)
parser.add_argument(
"--hf-dataset", type=str, default="open-thoughts/OpenThoughts3-1.2M",
help="HuggingFace dataset name (default: open-thoughts/OpenThoughts3-1.2M).",
)
parser.add_argument(
"--output", type=str, required=True,
help="Output JSONL file path.",
)
parser.add_argument(
"--num-samples", type=int, default=300000,
help="Number of samples to keep (default: 300000). Set to 0 for all.",
)
parser.add_argument(
"--seed", type=int, default=42,
help="Random seed for sampling (default: 42).",
)
return parser.parse_args()
def extract_prompt(sample):
"""Extract the prompt (non-assistant messages) from a sample.
Supports two common formats:
1. {"conversations": [{"from": "human", "value": ...}, ...]} (sharegpt)
2. {"prompt": [{"role": "user", "content": ...}, ...]} (chat messages)
"""
if "conversations" in sample:
messages = []
for turn in sample["conversations"]:
role = turn.get("from", turn.get("role", ""))
content = turn.get("value", turn.get("content", ""))
if role in ("human", "user"):
messages.append({"role": "user", "content": content})
elif role == "system":
messages.append({"role": "system", "content": content})
if messages:
return {"prompt": messages}
if "prompt" in sample:
if isinstance(sample["prompt"], list):
return {"prompt": sample["prompt"]}
elif isinstance(sample["prompt"], str):
return {"prompt": [{"role": "user", "content": sample["prompt"]}]}
if "messages" in sample:
messages = [
{"role": m["role"], "content": m["content"]}
for m in sample["messages"]
if m["role"] != "assistant"
]
if messages:
return {"prompt": messages}
return None
def load_dataset_from_hf(dataset_name):
"""Load dataset from HuggingFace."""
from datasets import load_dataset
print(f"Loading dataset from HuggingFace: {dataset_name}")
ds = load_dataset(dataset_name, split="train")
return ds
def load_dataset_from_file(path):
"""Load dataset from local file (parquet or jsonl)."""
import pandas as pd
print(f"Loading dataset from local file: {path}")
if path.endswith(".parquet"):
df = pd.read_parquet(path)
return df.to_dict("records")
elif path.endswith(".jsonl"):
with open(path) as f:
return [json.loads(line) for line in f]
else:
raise ValueError(f"Unsupported format: {path}")
def main():
args = parse_args()
random.seed(args.seed)
# Load dataset
if args.input:
samples = load_dataset_from_file(args.input)
else:
samples = load_dataset_from_hf(args.hf_dataset)
print(f"Total samples: {len(samples)}")
# Sample subset
if args.num_samples > 0 and args.num_samples < len(samples):
indices = random.sample(range(len(samples)), args.num_samples)
indices.sort()
samples = [samples[i] for i in indices]
print(f"Sampled {args.num_samples} samples")
# Extract prompts
from tqdm import tqdm
written = 0
skipped = 0
with open(args.output, "w") as f:
for sample in tqdm(samples, desc="Extracting prompts"):
prompt_item = extract_prompt(sample)
if prompt_item and len(prompt_item["prompt"]) > 0:
f.write(json.dumps(prompt_item) + "\n")
written += 1
else:
skipped += 1
print(f"Written: {written}, Skipped: {skipped}")
print(f"Output: {args.output}")
if __name__ == "__main__":
main()

View File

@@ -0,0 +1,126 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: Apache-2.0
# Starter launcher for PoE / sampled-token OPD LoRA training with:
# 1) hold-then-transition beta schedule
# 2) optional hold-then-transition learning-rate schedule
#
# Default schedule below:
# steps 0-99: beta = 1.0, lr = 2e-6
# steps 100-110: beta 1.0 -> 0.5, lr 2e-6 -> 1e-7
# steps 111+: beta = 0.5, lr = 1e-7
#
# Note: these are optimizer global steps, not micro-batch steps.
set -euo pipefail
: "${SFT_CHECKPOINT:?Set SFT_CHECKPOINT to the Qwen3-4B SFT checkpoint}"
# Path to the patched Python trainer. If you copy the Python file into tools/,
# leave this default; otherwise pass SCRIPT_PATH=/path/to/file.py.
SCRIPT_PATH="${SCRIPT_PATH:-tools/train_poe_distill_lora.py}"
TEACHER_MODEL="${TEACHER_MODEL:-model_weights/qwen3-8b}"
TRAIN_DATA="${TRAIN_DATA:-data/rollouts/dapo-math-17k-qwen3-4b-sft-rollouts.parquet}"
OUTPUT_DIR="${OUTPUT_DIR:-checkpoints/qwen3-4b-poe-distill-lora-opd-hold-beta-lr}"
CUDA_VISIBLE_DEVICES="${CUDA_VISIBLE_DEVICES:-0}"
NPROC_PER_NODE="${NPROC_PER_NODE:-1}"
# Training length.
MAX_STEPS="${MAX_STEPS:-120}"
SAVE_STEPS="${SAVE_STEPS:-10}"
LOGGING_STEPS="${LOGGING_STEPS:-1}"
# Beta schedule: hold beta_start, transition to beta_end.
BETA_START="${BETA_START:-1.0}"
BETA_END="${BETA_END:-0.5}"
BETA_HOLD_STEPS="${BETA_HOLD_STEPS:-100}"
BETA_TRANSITION_STEPS="${BETA_TRANSITION_STEPS:-10}"
HOLD_TRANSITION_SCHEDULE="${HOLD_TRANSITION_SCHEDULE:-linear}" # linear or cosine
# LR schedule: hold lr_start, transition to lr_end.
# When LR_END is non-empty, use constant HF scheduler and let the callback set LR.
LEARNING_RATE="${LEARNING_RATE:-2e-6}"
LR_START="${LR_START:-${LEARNING_RATE}}"
LR_END="${LR_END:-1e-7}"
LR_HOLD_STEPS="${LR_HOLD_STEPS:-${BETA_HOLD_STEPS}}"
LR_TRANSITION_STEPS="${LR_TRANSITION_STEPS:-${BETA_TRANSITION_STEPS}}"
# Loss / OPD behavior.
LOSS_TYPE="${LOSS_TYPE:-sampled_token}"
ADVANTAGE_NORMALIZATION="${ADVANTAGE_NORMALIZATION:-none}"
ADVANTAGE_CLIP="${ADVANTAGE_CLIP:-10.0}"
USE_PPO_CLIP="${USE_PPO_CLIP:-1}"
PPO_CLIP_LOW="${PPO_CLIP_LOW:-0.2}"
PPO_CLIP_HIGH="${PPO_CLIP_HIGH:-0.2}"
SAMPLED_LOSS_REDUCTION="${SAMPLED_LOSS_REDUCTION:-per_sample}"
POSITIVE_ADVANTAGES_ONLY="${POSITIVE_ADVANTAGES_ONLY:-0}"
# Model / optimizer defaults.
MAX_LENGTH="${MAX_LENGTH:-4096}"
DISTILL_CHUNK_SIZE="${DISTILL_CHUNK_SIZE:-128}"
PER_DEVICE_TRAIN_BATCH_SIZE="${PER_DEVICE_TRAIN_BATCH_SIZE:-2}"
GRADIENT_ACCUMULATION_STEPS="${GRADIENT_ACCUMULATION_STEPS:-8}"
WEIGHT_DECAY="${WEIGHT_DECAY:-0.1}"
ADAM_BETA1="${ADAM_BETA1:-0.9}"
ADAM_BETA2="${ADAM_BETA2:-0.98}"
WARMUP_RATIO="${WARMUP_RATIO:-0.0}"
LR_SCHEDULER_TYPE="${LR_SCHEDULER_TYPE:-constant}"
FREEZE_LORA_B_AFTER_STEP="${FREEZE_LORA_B_AFTER_STEP:-99999}"
PPO_CLIP_ARGS=()
if [[ "${USE_PPO_CLIP}" == "1" || "${USE_PPO_CLIP}" == "true" || "${USE_PPO_CLIP}" == "True" ]]; then
PPO_CLIP_ARGS+=(--use-ppo-clip)
fi
POS_ADV_ARGS=()
if [[ "${POSITIVE_ADVANTAGES_ONLY}" == "1" || "${POSITIVE_ADVANTAGES_ONLY}" == "true" || "${POSITIVE_ADVANTAGES_ONLY}" == "True" ]]; then
POS_ADV_ARGS+=(--positive-advantages-only)
fi
LR_ARGS=(--lr-start "${LR_START}")
if [[ -n "${LR_END}" ]]; then
LR_ARGS+=(
--lr-end "${LR_END}"
--lr-hold-steps "${LR_HOLD_STEPS}"
--lr-transition-steps "${LR_TRANSITION_STEPS}"
)
fi
CUDA_VISIBLE_DEVICES="${CUDA_VISIBLE_DEVICES}" torchrun --standalone --nproc_per_node="${NPROC_PER_NODE}" "${SCRIPT_PATH}" \
--student-model "${SFT_CHECKPOINT}" \
--teacher-model "${TEACHER_MODEL}" \
--train-data "${TRAIN_DATA}" \
--output-dir "${OUTPUT_DIR}" \
--alpha "${ALPHA:-1.0}" \
--beta-start "${BETA_START}" \
--beta-end "${BETA_END}" \
--beta-hold-steps "${BETA_HOLD_STEPS}" \
--beta-transition-steps "${BETA_TRANSITION_STEPS}" \
--hold-transition-schedule "${HOLD_TRANSITION_SCHEDULE}" \
"${LR_ARGS[@]}" \
--loss-type "${LOSS_TYPE}" \
--advantage-normalization "${ADVANTAGE_NORMALIZATION}" \
--advantage-clip "${ADVANTAGE_CLIP}" \
"${PPO_CLIP_ARGS[@]}" \
--ppo-clip-low "${PPO_CLIP_LOW}" \
--ppo-clip-high "${PPO_CLIP_HIGH}" \
--sampled-loss-reduction "${SAMPLED_LOSS_REDUCTION}" \
"${POS_ADV_ARGS[@]}" \
--max-length "${MAX_LENGTH}" \
--distill-chunk-size "${DISTILL_CHUNK_SIZE}" \
--per-device-train-batch-size "${PER_DEVICE_TRAIN_BATCH_SIZE}" \
--gradient-accumulation-steps "${GRADIENT_ACCUMULATION_STEPS}" \
--learning-rate "${LEARNING_RATE}" \
--weight-decay "${WEIGHT_DECAY}" \
--adam-beta1 "${ADAM_BETA1}" \
--adam-beta2 "${ADAM_BETA2}" \
--warmup-ratio "${WARMUP_RATIO}" \
--lr-scheduler-type "${LR_SCHEDULER_TYPE}" \
--max-steps "${MAX_STEPS}" \
--save-steps "${SAVE_STEPS}" \
--logging-steps "${LOGGING_STEPS}" \
--freeze-lora-b-after-step "${FREEZE_LORA_B_AFTER_STEP}" \
--no-gradient-checkpointing \
"$@"

View File

@@ -0,0 +1,19 @@
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
LOG_FILE="/tmp/sglang_$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 6).log"
python3 -m sglang.launch_server \
--model-path Qwen/Qwen3-32B \
--host 127.0.0.1 \
--port 13141 \
--tp 8 \
--chunked-prefill-size 4096 \
--mem-fraction-static 0.6 \
--context-length 8192 \
> "$LOG_FILE" 2>&1 &
until curl -sf http://127.0.0.1:13141/health_generate > /dev/null; do
echo "Waiting for the teacher model server to start..."
tail -n 10 "$LOG_FILE"
sleep 5
done

View File

@@ -0,0 +1,19 @@
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
LOG_FILE="/tmp/sglang_$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 6).log"
python3 -m sglang.launch_server \
--model-path model_weights/qwen3-8b \
--host 127.0.0.1 \
--port 13141 \
--tp 4 \
--chunked-prefill-size 4096 \
--mem-fraction-static 0.6 \
--context-length 8192 \
> "$LOG_FILE" 2>&1 &
until curl -sf http://127.0.0.1:13141/health_generate > /dev/null; do
echo "Waiting for the teacher model server to start..."
tail -n 10 "$LOG_FILE"
sleep 5
done

57
setup.py Normal file
View File

@@ -0,0 +1,57 @@
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
import sys
import platform
from setuptools import find_packages, setup
from wheel.bdist_wheel import bdist_wheel as _bdist_wheel
def _fetch_requirements(path):
with open(path, "r") as fd:
return [r.strip() for r in fd.readlines() if r.strip() and not r.startswith("#")]
# Custom wheel class to modify the wheel name
class bdist_wheel(_bdist_wheel):
def finalize_options(self):
_bdist_wheel.finalize_options(self)
self.root_is_pure = False
def get_tag(self):
python_version = f"cp{sys.version_info.major}{sys.version_info.minor}"
abi_tag = f"{python_version}"
if platform.system() == "Linux":
platform_tag = "manylinux1_x86_64"
else:
platform_tag = platform.system().lower()
return python_version, abi_tag, platform_tag
# Setup configuration
setup(
author="slime Team",
name="slime",
version="0.1.0",
packages=find_packages(include=["slime*", "slime_plugins*"]),
include_package_data=True,
install_requires=_fetch_requirements("requirements.txt"),
extras_require={
"fsdp": [
"torch>=2.0",
]
},
python_requires=">=3.10",
classifiers=[
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Environment :: GPU :: NVIDIA CUDA",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Topic :: System :: Distributed Computing",
],
cmdclass={"bdist_wheel": bdist_wheel},
)

39
slime.egg-info/PKG-INFO Normal file
View File

@@ -0,0 +1,39 @@
Metadata-Version: 2.4
Name: slime
Version: 0.1.0
Author: slime Team
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Environment :: GPU :: NVIDIA CUDA
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: System :: Distributed Computing
Requires-Python: >=3.10
License-File: LICENSE
Requires-Dist: accelerate
Requires-Dist: blobfile
Requires-Dist: datasets
Requires-Dist: httpx[http2]
Requires-Dist: mcp[cli]
Requires-Dist: megatron-bridge @ git+https://github.com/fzyzcjy/Megatron-Bridge.git@dev_rl
Requires-Dist: memray
Requires-Dist: nvidia-modelopt[torch]>=0.37.0
Requires-Dist: omegaconf
Requires-Dist: pillow
Requires-Dist: pylatexenc
Requires-Dist: pyyaml
Requires-Dist: ray[default]
Requires-Dist: ring_flash_attn
Requires-Dist: sglang-router>=0.2.3
Requires-Dist: tensorboard
Requires-Dist: transformers
Requires-Dist: wandb
Requires-Dist: liger_kernel
Provides-Extra: fsdp
Requires-Dist: torch>=2.0; extra == "fsdp"
Dynamic: author
Dynamic: classifier
Dynamic: license-file
Dynamic: provides-extra
Dynamic: requires-dist
Dynamic: requires-python

140
slime.egg-info/SOURCES.txt Normal file
View File

@@ -0,0 +1,140 @@
LICENSE
README.md
pyproject.toml
setup.py
slime/__init__.py
slime.egg-info/PKG-INFO
slime.egg-info/SOURCES.txt
slime.egg-info/dependency_links.txt
slime.egg-info/requires.txt
slime.egg-info/top_level.txt
slime/backends/__init__.py
slime/backends/fsdp_utils/__init__.py
slime/backends/fsdp_utils/actor.py
slime/backends/fsdp_utils/arguments.py
slime/backends/fsdp_utils/checkpoint.py
slime/backends/fsdp_utils/data_packing.py
slime/backends/fsdp_utils/lr_scheduler.py
slime/backends/fsdp_utils/update_weight_utils.py
slime/backends/fsdp_utils/kernels/__init__.py
slime/backends/fsdp_utils/kernels/fused_experts.py
slime/backends/fsdp_utils/kernels/fused_moe_triton_backward_kernels.py
slime/backends/fsdp_utils/models/__init__.py
slime/backends/fsdp_utils/models/qwen3_moe.py
slime/backends/fsdp_utils/models/qwen3_moe_hf.py
slime/backends/megatron_utils/__init__.py
slime/backends/megatron_utils/actor.py
slime/backends/megatron_utils/arguments.py
slime/backends/megatron_utils/checkpoint.py
slime/backends/megatron_utils/ci_utils.py
slime/backends/megatron_utils/cp_utils.py
slime/backends/megatron_utils/data.py
slime/backends/megatron_utils/initialize.py
slime/backends/megatron_utils/loss.py
slime/backends/megatron_utils/misc_utils.py
slime/backends/megatron_utils/model.py
slime/backends/megatron_utils/model_provider.py
slime/backends/megatron_utils/sglang.py
slime/backends/megatron_utils/megatron_to_hf/__init__.py
slime/backends/megatron_utils/megatron_to_hf/deepseekv3.py
slime/backends/megatron_utils/megatron_to_hf/glm4.py
slime/backends/megatron_utils/megatron_to_hf/glm4moe.py
slime/backends/megatron_utils/megatron_to_hf/llama.py
slime/backends/megatron_utils/megatron_to_hf/mimo.py
slime/backends/megatron_utils/megatron_to_hf/qwen2.py
slime/backends/megatron_utils/megatron_to_hf/qwen3_next.py
slime/backends/megatron_utils/megatron_to_hf/qwen3moe.py
slime/backends/megatron_utils/megatron_to_hf/processors/__init__.py
slime/backends/megatron_utils/megatron_to_hf/processors/padding_remover.py
slime/backends/megatron_utils/megatron_to_hf/processors/quantizer.py
slime/backends/megatron_utils/update_weight/__init__.py
slime/backends/megatron_utils/update_weight/common.py
slime/backends/megatron_utils/update_weight/hf_weight_iterator_base.py
slime/backends/megatron_utils/update_weight/hf_weight_iterator_bridge.py
slime/backends/megatron_utils/update_weight/hf_weight_iterator_direct.py
slime/backends/megatron_utils/update_weight/update_weight_from_distributed.py
slime/backends/megatron_utils/update_weight/update_weight_from_tensor.py
slime/backends/sglang_utils/__init__.py
slime/backends/sglang_utils/arguments.py
slime/backends/sglang_utils/sglang_engine.py
slime/ray/__init__.py
slime/ray/actor_group.py
slime/ray/placement_group.py
slime/ray/ray_actor.py
slime/ray/rollout.py
slime/ray/train_actor.py
slime/ray/utils.py
slime/rollout/__init__.py
slime/rollout/base_types.py
slime/rollout/data_source.py
slime/rollout/on_policy_distillation.py
slime/rollout/sglang_rollout.py
slime/rollout/sleep_rollout.py
slime/rollout/filter_hub/__init__.py
slime/rollout/filter_hub/base_types.py
slime/rollout/filter_hub/dynamic_sampling_filters.py
slime/rollout/rm_hub/__init__.py
slime/rollout/rm_hub/deepscaler.py
slime/rollout/rm_hub/f1.py
slime/rollout/rm_hub/gpqa.py
slime/rollout/rm_hub/ifbench.py
slime/rollout/rm_hub/math_dapo_utils.py
slime/rollout/rm_hub/math_utils.py
slime/router/__init__.py
slime/router/router.py
slime/router/middleware_hub/__init__.py
slime/router/middleware_hub/radix_tree.py
slime/router/middleware_hub/radix_tree_middleware.py
slime/utils/__init__.py
slime/utils/arguments.py
slime/utils/async_utils.py
slime/utils/context_utils.py
slime/utils/data.py
slime/utils/distributed_utils.py
slime/utils/eval_config.py
slime/utils/flops_utils.py
slime/utils/fp8_kernel.py
slime/utils/health_monitor.py
slime/utils/http_utils.py
slime/utils/iter_utils.py
slime/utils/logging_utils.py
slime/utils/mask_utils.py
slime/utils/megatron_bridge_utils.py
slime/utils/memory_utils.py
slime/utils/metric_checker.py
slime/utils/metric_utils.py
slime/utils/misc.py
slime/utils/ppo_utils.py
slime/utils/processing_utils.py
slime/utils/profile_utils.py
slime/utils/ray_utils.py
slime/utils/reloadable_process_group.py
slime/utils/rocm_checkpoint_writer.py
slime/utils/routing_replay.py
slime/utils/seqlen_balancing.py
slime/utils/tensor_backper.py
slime/utils/tensorboard_utils.py
slime/utils/timer.py
slime/utils/tracking_utils.py
slime/utils/train_dump_utils.py
slime/utils/train_metric_utils.py
slime/utils/typer_utils.py
slime/utils/types.py
slime/utils/wandb_utils.py
slime/utils/debug_utils/__init__.py
slime/utils/debug_utils/display_debug_rollout_data.py
slime/utils/debug_utils/replay_reward_fn.py
slime/utils/debug_utils/send_to_sglang.py
slime/utils/external_utils/__init__.py
slime/utils/external_utils/command_utils.py
slime_plugins/__init__.py
slime_plugins/mbridge/__init__.py
slime_plugins/mbridge/glm4.py
slime_plugins/mbridge/glm4moe.py
slime_plugins/mbridge/mimo.py
slime_plugins/mbridge/qwen3_next.py
slime_plugins/megatron_bridge/__init__.py
slime_plugins/models/__init__.py
slime_plugins/models/glm4.py
slime_plugins/models/hf_attention.py
slime_plugins/models/qwen3_next.py

Some files were not shown because too many files have changed in this diff Show More