lazarevich commited on
Commit
a60b8c1
·
0 Parent(s):

upload checkpoint

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. README.md +158 -0
  2. chat_template.jinja +80 -0
  3. config.json +312 -0
  4. configuration_step3p5.py +59 -0
  5. model-00001-of-00064.safetensors +3 -0
  6. model-00002-of-00064.safetensors +3 -0
  7. model-00003-of-00064.safetensors +3 -0
  8. model-00004-of-00064.safetensors +3 -0
  9. model-00005-of-00064.safetensors +3 -0
  10. model-00006-of-00064.safetensors +3 -0
  11. model-00007-of-00064.safetensors +3 -0
  12. model-00008-of-00064.safetensors +3 -0
  13. model-00009-of-00064.safetensors +3 -0
  14. model-00010-of-00064.safetensors +3 -0
  15. model-00011-of-00064.safetensors +3 -0
  16. model-00012-of-00064.safetensors +3 -0
  17. model-00013-of-00064.safetensors +3 -0
  18. model-00014-of-00064.safetensors +3 -0
  19. model-00015-of-00064.safetensors +3 -0
  20. model-00016-of-00064.safetensors +3 -0
  21. model-00017-of-00064.safetensors +3 -0
  22. model-00018-of-00064.safetensors +3 -0
  23. model-00019-of-00064.safetensors +3 -0
  24. model-00020-of-00064.safetensors +3 -0
  25. model-00021-of-00064.safetensors +3 -0
  26. model-00022-of-00064.safetensors +3 -0
  27. model-00023-of-00064.safetensors +3 -0
  28. model-00024-of-00064.safetensors +3 -0
  29. model-00025-of-00064.safetensors +3 -0
  30. model-00026-of-00064.safetensors +3 -0
  31. model-00027-of-00064.safetensors +3 -0
  32. model-00028-of-00064.safetensors +3 -0
  33. model-00029-of-00064.safetensors +3 -0
  34. model-00030-of-00064.safetensors +3 -0
  35. model-00031-of-00064.safetensors +3 -0
  36. model-00032-of-00064.safetensors +3 -0
  37. model-00033-of-00064.safetensors +3 -0
  38. model-00034-of-00064.safetensors +3 -0
  39. model-00035-of-00064.safetensors +3 -0
  40. model-00036-of-00064.safetensors +3 -0
  41. model-00037-of-00064.safetensors +3 -0
  42. model-00038-of-00064.safetensors +3 -0
  43. model-00039-of-00064.safetensors +3 -0
  44. model-00040-of-00064.safetensors +3 -0
  45. model-00041-of-00064.safetensors +3 -0
  46. model-00042-of-00064.safetensors +3 -0
  47. model-00043-of-00064.safetensors +3 -0
  48. model-00044-of-00064.safetensors +3 -0
  49. model-00045-of-00064.safetensors +3 -0
  50. model-00046-of-00064.safetensors +3 -0
README.md ADDED
@@ -0,0 +1,158 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - en
4
+ library_name: transformers
5
+ tags:
6
+ - stepfun
7
+ - MOE
8
+ - pruning
9
+ - compression
10
+ license: other
11
+ name: cerebras/Step-3.5-Flash-REAP-121B-A11B
12
+ description: >
13
+ This model was obtained by uniformly pruning 40% of experts in Step-3.5-Flash using the REAP method.
14
+ readme: >
15
+ https://huggingface.co/cerebras/Step-3.5-Flash-REAP-121B-A11B/main/README.md
16
+ pipeline_tag: text-generation
17
+ base_model:
18
+ - stepfun-ai/Step-3.5-Flash
19
+ ---
20
+
21
+ <p align="center">
22
+ <em>𓌳 <strong>REAP</strong>𓌳 the Experts: Why Pruning Prevails for One-Shot MoE Compression</em><br>
23
+ <img src="https://i.imgur.com/rmzG3gg.png" alt="REAP" width="75%">
24
+ </p>
25
+
26
+ # Step-3.5-Flash-REAP-121B-A11B
27
+
28
+ ## ✨ Highlights
29
+
30
+ Introducing **Step-3.5-Flash-REAP-121B-A11B**, a **memory-efficient compressed variant** of Step-3.5-Flash that maintains near-identical performance while being **40% lighter**.
31
+
32
+ This model was created using **REAP (Router-weighted Expert Activation Pruning)**, a novel expert pruning method that selectively removes redundant experts while preserving the router's independent control over remaining experts. Key features include:
33
+
34
+ - **Near-Lossless Performance**: Maintains almost identical accuracy on code generation, agentic coding, and function calling tasks compared to the full 196B model
35
+ - **40% Memory Reduction**: Compressed from 196B to 121B parameters, significantly lowering deployment costs and memory requirements
36
+ - **Preserved Capabilities**: Retains all core functionalities including code generation, math & reasoning and tool calling.
37
+ - **Drop-in Compatibility**: Works with vanilla vLLM - no source modifications or custom patches required
38
+ - **Optimized for Real-World Use**: Particularly effective for resource-constrained environments, local deployments, and academic research
39
+ ---
40
+ ## 📋 Model Overview
41
+
42
+ **Step-3.5-Flash-REAP-121B-A11B** has the following specifications:
43
+
44
+ - **Base Model**: Step-3.5-Flash
45
+ - **Compression Method**: REAP (Router-weighted Expert Activation Pruning)
46
+ - **Compression Ratio**: 40% expert pruning
47
+ - **Type**: Sparse Mixture-of-Experts (SMoE) Causal Language Model
48
+ - **Number of Parameters**: 121B total, 11B activated per token
49
+ - **Number of Layers**: 45
50
+ - **Number of Attention Heads**: 64
51
+ - **Number of Experts**: 173 (uniformly pruned from 288)
52
+ - **Number of Activated Experts**: 8 per token
53
+ - **Context Length**: 262,144 tokens
54
+ - **License**: Apache 2.0
55
+
56
+ ---
57
+
58
+ ## 📊 Evaluations
59
+
60
+ <table>
61
+ <thead>
62
+ <tr>
63
+ <th align="left">Benchmark</th>
64
+ <th align="center">Step-3.5-Flash</th>
65
+ <th align="center"><a href="https://huggingface.co/cerebras/Step-3.5-Flash-REAP-149B-A11B">Step-3.5-Flash-REAP-149B-A11B</a></th>
66
+ <th align="center"><a href="https://huggingface.co/cerebras/Step-3.5-Flash-REAP-121B-A11B">Step-3.5-Flash-REAP-121B-A11B</a></th>
67
+ </tr>
68
+ </thead>
69
+ <tbody>
70
+ <tr>
71
+ <td><strong>Compression</strong></td>
72
+ <td align="center">—</td>
73
+ <td align="center">25%</td>
74
+ <td align="center">40%</td>
75
+ </tr>
76
+ <tr>
77
+ <td colspan="5" align="center"><strong>Coding</strong></td>
78
+ </tr>
79
+ <tr>
80
+ <td><strong>HumanEval</strong></td>
81
+ <td align="center">98.2</td>
82
+ <td align="center">97.0</td>
83
+ <td align="center">95.7</td>
84
+ </tr>
85
+ <tr>
86
+ <td><strong>HumanEval+</strong></td>
87
+ <td align="center">93.9</td>
88
+ <td align="center">90.9</td>
89
+ <td align="center">91.5</td>
90
+ </tr>
91
+ </tbody>
92
+ </table>
93
+
94
+ ---
95
+
96
+ ## 🚀 Deployment
97
+
98
+ You can deploy the model directly using the **latest vLLM** (that supports Step-3.5-Flash), no source modifications or custom patches required.
99
+
100
+ ```bash
101
+ vllm serve cerebras/Step-3.5-Flash-REAP-121B-A11B \
102
+ --tensor-parallel-size 8 \
103
+ --tool-call-parser step3p5 \
104
+ --reasoning-parser step3p5 \
105
+ --trust-remote-code \
106
+ --enable_expert_parallel \
107
+ --disable-cascade-attn \
108
+ --enable-auto-tool-choice
109
+ ```
110
+
111
+ If you encounter insufficient memory when running this model, you might need to set a lower value for `--max-num-seqs` flag (e.g. set to 64). For more information, refer to the [official vLLM deployment guide](https://huggingface.co/stepfun-ai/Step-3.5-Flash#61-vllm).
112
+
113
+ ## 🧩 Model Creation
114
+
115
+ This checkpoint was created by applying the **REAP (Router-weighted Expert Activation Pruning)** method uniformly across all Mixture-of-Experts (MoE) blocks of **Step-3.5-Flash**, with a **40% pruning rate**.
116
+
117
+ ### How REAP Works
118
+
119
+ REAP selects experts to prune based on a novel **saliency criterion** that considers both:
120
+ - **Router gate values**: How frequently and strongly the router activates each expert
121
+ - **Expert activation norms**: The magnitude of each expert's output contributions
122
+
123
+ This dual consideration ensures that experts contributing minimally to the layer's output are pruned, while preserving those that play critical roles in the model's computations.
124
+
125
+ ### Key Advantages
126
+
127
+ - **One-Shot Compression**: No fine-tuning required after pruning - the model is immediately ready for deployment
128
+ - **Preserved Router Control**: Unlike expert merging methods, REAP maintains the router's independent, input-dependent control over remaining experts, avoiding "functional subspace collapse"
129
+ - **Generative Task Superiority**: REAP significantly outperforms expert merging approaches on generative benchmarks (code generation, creative writing, mathematical reasoning) while maintaining competitive performance on discriminative tasks
130
+
131
+ 📚 For more details, refer to the following resources:
132
+
133
+ - [🧾 arXiv Preprint](https://arxiv.org/abs/2510.13999)
134
+ - [🧾 REAP Blog](https://www.cerebras.ai/blog/reap)
135
+ - [💻 REAP Codebase (GitHub)](https://github.com/CerebrasResearch/reap)
136
+
137
+ ---
138
+
139
+ ## ⚖️ License
140
+
141
+ This model is derived from
142
+ **[`stepfun-ai/Step-3.5-Flash`](https://huggingface.co/stepfun-ai/Step-3.5-Flash)**
143
+ and distributed under the **Apache 2.0 license**.
144
+
145
+ ---
146
+
147
+ ## 🧾 Citation
148
+
149
+ If you use this checkpoint, please cite the REAP paper:
150
+
151
+ ```bibtex
152
+ @article{lasby-reap,
153
+ title={REAP the Experts: Why Pruning Prevails for One-Shot MoE compression},
154
+ author={Lasby, Mike and Lazarevich, Ivan and Sinnadurai, Nish and Lie, Sean and Ioannou, Yani and Thangarasa, Vithursan},
155
+ journal={arXiv preprint arXiv:2510.13999},
156
+ year={2025}
157
+ }
158
+ ```
chat_template.jinja ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {% macro render_content(content) %}{% if content is none %}{{- '' }}{% elif content is string %}{{- content }}{% elif content is mapping %}{{- content['value'] if 'value' in content else content['text'] }}{% elif content is iterable %}{% for item in content %}{% if item.type == 'text' %}{{- item['value'] if 'value' in item else item['text'] }}{% elif item.type == 'image' %}<im_patch>{% endif %}{% endfor %}{% endif %}{% endmacro %}
2
+ {{bos_token}}{%- if tools %}
3
+ {{- '<|im_start|>system\n' }}
4
+ {%- if messages[0].role == 'system' %}
5
+ {{- render_content(messages[0].content) + '\n\n' }}
6
+ {%- endif %}
7
+ {{- "# Tools\n\nYou have access to the following functions in JSONSchema format:\n\n<tools>" }}
8
+ {%- for tool in tools %}
9
+ {{- "\n" }}
10
+ {{- tool | tojson(ensure_ascii=False) }}
11
+ {%- endfor %}
12
+ {{- "\n</tools>\n\nIf you choose to call a function ONLY reply in the following format with NO suffix:\n\n<tool_call>\n<function=example_function_name>\n<parameter=example_parameter_1>\nvalue_1\n</parameter>\n<parameter=example_parameter_2>\nThis is the value for the second parameter\nthat can span\nmultiple lines\n</parameter>\n</function>\n</tool_call>\n\n<IMPORTANT>\nReminder:\n- Function calls MUST follow the specified format: an inner <function=...>\n...\n</function> block must be nested within <tool_call>\n...\n</tool_call> XML tags\n- Required parameters MUST be specified\n</IMPORTANT><|im_end|>\n" }}
13
+ {%- else %}
14
+ {%- if messages[0].role == 'system' %}
15
+ {{- '<|im_start|>system\n' + render_content(messages[0].content) + '<|im_end|>\n' }}
16
+ {%- endif %}
17
+ {%- endif %}
18
+ {%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}
19
+ {%- for message in messages[::-1] %}
20
+ {%- set index = (messages|length - 1) - loop.index0 %}
21
+ {%- if ns.multi_step_tool and message.role == "user" and render_content(message.content) is string and not(render_content(message.content).startswith('<tool_response>') and render_content(message.content).endswith('</tool_response>')) %}
22
+ {%- set ns.multi_step_tool = false %}
23
+ {%- set ns.last_query_index = index %}
24
+ {%- endif %}
25
+ {%- endfor %}
26
+ {%- for message in messages %}
27
+ {%- set content = render_content(message.content) %}
28
+ {%- if (message.role == "user") or (message.role == "system" and not loop.first) %}
29
+ {%- set role_name = 'observation' if (message.role == "system" and not loop.first and message.name == 'observation') else message.role %}
30
+ {{- '<|im_start|>' + role_name + '\n' + content + '<|im_end|>' + '\n' }}
31
+ {%- elif message.role == "assistant" %}
32
+ {%- if message.reasoning_content is string %}
33
+ {%- set reasoning_content = render_content(message.reasoning_content) %}
34
+ {%- else %}
35
+ {%- if '</think>' in content %}
36
+ {%- set reasoning_content = content.split('</think>')[0].rstrip('\n').split('<think>')[-1].lstrip('\n') %}
37
+ {%- set content = content.split('</think>')[-1].lstrip('\n') %}
38
+ {%- else %}
39
+ {%- set reasoning_content = '' %}
40
+ {%- endif %}
41
+ {%- endif %}
42
+ {%- if loop.index0 > ns.last_query_index %}
43
+ {{- '<|im_start|>' + message.role + '\n<think>\n' + reasoning_content + '\n</think>\n' + content }}
44
+ {%- else %}
45
+ {{- '<|im_start|>' + message.role + '\n' + content }}
46
+ {%- endif %}
47
+ {%- if message.tool_calls %}
48
+ {%- for tool_call in message.tool_calls %}
49
+ {%- if tool_call.function is defined %}
50
+ {%- set tool_call = tool_call.function %}
51
+ {%- endif %}
52
+ {{- '<tool_call>\n<function=' + tool_call.name + '>\n' }}
53
+ {%- if tool_call.arguments is defined %}
54
+ {%- set arguments = tool_call.arguments %}
55
+ {%- for args_name, args_value in arguments|items %}
56
+ {{- '<parameter=' + args_name + '>\n' }}
57
+ {%- set args_value = args_value | tojson(ensure_ascii=False) | safe if args_value is mapping or (args_value is sequence and args_value is not string) else args_value | string %}
58
+ {{- args_value }}
59
+ {{- '\n</parameter>\n' }}
60
+ {%- endfor %}
61
+ {%- endif %}
62
+ {{- '</function>\n</tool_call>' }}
63
+ {%- endfor %}
64
+ {%- endif %}
65
+ {{- '<|im_end|>\n' }}
66
+ {%- elif message.role == "tool" %}
67
+ {%- if loop.first or (messages[loop.index0 - 1].role != "tool") %}
68
+ {{- '<|im_start|>tool_response\n' }}
69
+ {%- endif %}
70
+ {{- '<tool_response>' }}
71
+ {{- content }}
72
+ {{- '</tool_response>' }}
73
+ {%- if loop.last or (messages[loop.index0 + 1].role != "tool") %}
74
+ {{- '<|im_end|>\n' }}
75
+ {%- endif %}
76
+ {%- endif %}
77
+ {%- endfor %}
78
+ {%- if add_generation_prompt %}
79
+ {{- '<|im_start|>assistant\n<think>\n' }}
80
+ {%- endif %}
config.json ADDED
@@ -0,0 +1,312 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "Step3p5ForCausalLM"
4
+ ],
5
+ "model_type": "step3p5",
6
+ "auto_map": {
7
+ "AutoConfig": "configuration_step3p5.Step3p5Config",
8
+ "AutoModelForCausalLM": "modeling_step3p5.Step3p5ForCausalLM"
9
+ },
10
+ "rope_scaling": {
11
+ "rope_type": "llama3",
12
+ "factor": 2.0,
13
+ "original_max_position_embeddings": 131072,
14
+ "low_freq_factor": 1.0,
15
+ "high_freq_factor": 32.0
16
+ },
17
+ "yarn_only_types": ["full_attention"],
18
+ "hidden_size": 4096,
19
+ "intermediate_size": 11264,
20
+ "num_hidden_layers": 45,
21
+ "max_seq_len": 262144,
22
+ "vocab_size": 128896,
23
+ "torch_dtype": "bfloat16",
24
+ "use_qk_norm": true,
25
+ "moe_layers_enum": "3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44",
26
+ "num_attention_heads": 64,
27
+ "num_attention_groups": 8,
28
+ "head_dim": 128,
29
+ "use_moe": true,
30
+ "moe_num_experts": 173,
31
+ "moe_top_k": 8,
32
+ "moe_intermediate_size": 1280,
33
+ "share_expert_dim": 1280,
34
+ "moe_layer_offset": 0,
35
+ "moe_every_n_layer": 1,
36
+ "norm_expert_weight": true,
37
+ "moe_router_activation": "sigmoid",
38
+ "moe_router_scaling_factor": 3.0,
39
+ "att_impl_type": "GQA",
40
+ "rope_theta": [
41
+ 5000000.0,
42
+ 10000.0,
43
+ 10000.0,
44
+ 10000.0,
45
+ 5000000.0,
46
+ 10000.0,
47
+ 10000.0,
48
+ 10000.0,
49
+ 5000000.0,
50
+ 10000.0,
51
+ 10000.0,
52
+ 10000.0,
53
+ 5000000.0,
54
+ 10000.0,
55
+ 10000.0,
56
+ 10000.0,
57
+ 5000000.0,
58
+ 10000.0,
59
+ 10000.0,
60
+ 10000.0,
61
+ 5000000.0,
62
+ 10000.0,
63
+ 10000.0,
64
+ 10000.0,
65
+ 5000000.0,
66
+ 10000.0,
67
+ 10000.0,
68
+ 10000.0,
69
+ 5000000.0,
70
+ 10000.0,
71
+ 10000.0,
72
+ 10000.0,
73
+ 5000000.0,
74
+ 10000.0,
75
+ 10000.0,
76
+ 10000.0,
77
+ 5000000.0,
78
+ 10000.0,
79
+ 10000.0,
80
+ 10000.0,
81
+ 5000000.0,
82
+ 10000.0,
83
+ 10000.0,
84
+ 10000.0,
85
+ 5000000.0,
86
+ 10000.0,
87
+ 10000.0,
88
+ 10000.0
89
+ ],
90
+ "use_head_wise_attn_gate": true,
91
+ "sliding_window": 512,
92
+ "use_moe_router_bias": true,
93
+ "need_fp32_gate": true,
94
+ "sink": false,
95
+ "layer_types": [
96
+ "full_attention",
97
+ "sliding_attention",
98
+ "sliding_attention",
99
+ "sliding_attention",
100
+ "full_attention",
101
+ "sliding_attention",
102
+ "sliding_attention",
103
+ "sliding_attention",
104
+ "full_attention",
105
+ "sliding_attention",
106
+ "sliding_attention",
107
+ "sliding_attention",
108
+ "full_attention",
109
+ "sliding_attention",
110
+ "sliding_attention",
111
+ "sliding_attention",
112
+ "full_attention",
113
+ "sliding_attention",
114
+ "sliding_attention",
115
+ "sliding_attention",
116
+ "full_attention",
117
+ "sliding_attention",
118
+ "sliding_attention",
119
+ "sliding_attention",
120
+ "full_attention",
121
+ "sliding_attention",
122
+ "sliding_attention",
123
+ "sliding_attention",
124
+ "full_attention",
125
+ "sliding_attention",
126
+ "sliding_attention",
127
+ "sliding_attention",
128
+ "full_attention",
129
+ "sliding_attention",
130
+ "sliding_attention",
131
+ "sliding_attention",
132
+ "full_attention",
133
+ "sliding_attention",
134
+ "sliding_attention",
135
+ "sliding_attention",
136
+ "full_attention",
137
+ "sliding_attention",
138
+ "sliding_attention",
139
+ "sliding_attention",
140
+ "full_attention",
141
+ "sliding_attention",
142
+ "sliding_attention",
143
+ "sliding_attention"
144
+ ],
145
+ "use_rope_layers": [],
146
+ "num_nextn_predict_layers": 3,
147
+ "partial_rotary_factors": [
148
+ 0.5,
149
+ 1.0,
150
+ 1.0,
151
+ 1.0,
152
+ 0.5,
153
+ 1.0,
154
+ 1.0,
155
+ 1.0,
156
+ 0.5,
157
+ 1.0,
158
+ 1.0,
159
+ 1.0,
160
+ 0.5,
161
+ 1.0,
162
+ 1.0,
163
+ 1.0,
164
+ 0.5,
165
+ 1.0,
166
+ 1.0,
167
+ 1.0,
168
+ 0.5,
169
+ 1.0,
170
+ 1.0,
171
+ 1.0,
172
+ 0.5,
173
+ 1.0,
174
+ 1.0,
175
+ 1.0,
176
+ 0.5,
177
+ 1.0,
178
+ 1.0,
179
+ 1.0,
180
+ 0.5,
181
+ 1.0,
182
+ 1.0,
183
+ 1.0,
184
+ 0.5,
185
+ 1.0,
186
+ 1.0,
187
+ 1.0,
188
+ 0.5,
189
+ 1.0,
190
+ 1.0,
191
+ 1.0,
192
+ 0.5,
193
+ 1.0,
194
+ 1.0,
195
+ 1.0
196
+ ],
197
+ "eos_token_id": [
198
+ 1,
199
+ 2,
200
+ 128007
201
+ ],
202
+ "bos_token_id": 0,
203
+ "attention_other_setting": {
204
+ "attention_type": "sliding_attention",
205
+ "num_attention_heads": 96,
206
+ "num_attention_groups": 8,
207
+ "head_dim": 128,
208
+ "true_head_dim": 128
209
+ },
210
+ "swiglu_limits": [
211
+ 0.0,
212
+ 0.0,
213
+ 0.0,
214
+ 0.0,
215
+ 0.0,
216
+ 0.0,
217
+ 0.0,
218
+ 0.0,
219
+ 0.0,
220
+ 0.0,
221
+ 0.0,
222
+ 0.0,
223
+ 0.0,
224
+ 0.0,
225
+ 0.0,
226
+ 0.0,
227
+ 0.0,
228
+ 0.0,
229
+ 0.0,
230
+ 0.0,
231
+ 0.0,
232
+ 0.0,
233
+ 0.0,
234
+ 0.0,
235
+ 0.0,
236
+ 0.0,
237
+ 0.0,
238
+ 0.0,
239
+ 0.0,
240
+ 0.0,
241
+ 0.0,
242
+ 0.0,
243
+ 0.0,
244
+ 0.0,
245
+ 0.0,
246
+ 0.0,
247
+ 0.0,
248
+ 0.0,
249
+ 0.0,
250
+ 0.0,
251
+ 0.0,
252
+ 0.0,
253
+ 0.0,
254
+ 7,
255
+ 7,
256
+ 0.0,
257
+ 0.0,
258
+ 0.0
259
+ ],
260
+ "swiglu_limits_shared": [
261
+ 0.0,
262
+ 0.0,
263
+ 0.0,
264
+ 0.0,
265
+ 0.0,
266
+ 0.0,
267
+ 0.0,
268
+ 0.0,
269
+ 0.0,
270
+ 0.0,
271
+ 0.0,
272
+ 0.0,
273
+ 0.0,
274
+ 0.0,
275
+ 0.0,
276
+ 0.0,
277
+ 0.0,
278
+ 0.0,
279
+ 0.0,
280
+ 0.0,
281
+ 0.0,
282
+ 0.0,
283
+ 0.0,
284
+ 0.0,
285
+ 0.0,
286
+ 0.0,
287
+ 0.0,
288
+ 0.0,
289
+ 0.0,
290
+ 0.0,
291
+ 0.0,
292
+ 0.0,
293
+ 0.0,
294
+ 0.0,
295
+ 0.0,
296
+ 0.0,
297
+ 0.0,
298
+ 0.0,
299
+ 0.0,
300
+ 0.0,
301
+ 0.0,
302
+ 0.0,
303
+ 0.0,
304
+ 0.0,
305
+ 16,
306
+ 0.0,
307
+ 0.0,
308
+ 0.0
309
+ ],
310
+ "zero_centered": true,
311
+ "max_position_embeddings": 262144
312
+ }
configuration_step3p5.py ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from typing import Any, Optional, Union
2
+
3
+ from transformers.configuration_utils import PretrainedConfig
4
+
5
+
6
+
7
+ class Step3p5Config(PretrainedConfig):
8
+ model_type = "step3p5"
9
+ architectures = ["Step3p5ForCausalLM"]
10
+
11
+ def __init__(
12
+ self,
13
+ hidden_size: int = 4096,
14
+ intermediate_size: int = 11264,
15
+ num_attention_heads: int = 64,
16
+ num_attention_groups: int = 8,
17
+ num_hidden_layers: int = 45,
18
+ max_seq_len: int = 128000,
19
+ vocab_size: int = 128815,
20
+ rms_norm_eps: float = 1e-5,
21
+ moe_intermediate_size: int = 1280,
22
+ moe_num_experts: int = 288,
23
+ moe_top_k: int = 8,
24
+ rope_theta: float = 10000,
25
+ rope_scaling: Optional[dict[str, Any]] = None,
26
+ max_position_embeddings: int = 128000,
27
+ share_expert_dims: int = 1280,
28
+ head_dim: int = 128,
29
+ norm_expert_weight: bool = True,
30
+ layer_types: list[str] = None,
31
+ sliding_window: Optional[int] = None,
32
+ moe_layers_enum: tuple[int] = (3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
33
+ 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
34
+ 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
35
+ 35, 36, 37, 38, 39, 40, 41, 42, 43, 44),
36
+ **kwargs,
37
+ ) -> None:
38
+ self.hidden_size = hidden_size
39
+ self.intermediate_size = intermediate_size
40
+ self.num_attention_heads = num_attention_heads
41
+ self.num_attention_groups = num_attention_groups
42
+ self.num_hidden_layers = num_hidden_layers
43
+ self.max_seq_len = max_seq_len
44
+ self.vocab_size = vocab_size
45
+ self.rms_norm_eps = rms_norm_eps
46
+ self.moe_intermediate_size = moe_intermediate_size
47
+ self.moe_num_experts = moe_num_experts
48
+ self.moe_top_k = moe_top_k
49
+ self.rope_theta = rope_theta
50
+ self.rope_scaling = rope_scaling
51
+ self.max_position_embeddings = max_position_embeddings
52
+ self.share_expert_dim = share_expert_dims
53
+ self.head_dim = head_dim
54
+ self.norm_expert_weight = norm_expert_weight
55
+ self.moe_layers_enum = moe_layers_enum
56
+ self.layer_types = layer_types
57
+ self.sliding_window = sliding_window
58
+ super().__init__(**kwargs)
59
+
model-00001-of-00064.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5624cc147930c8323253ee4d57648a01cce8aaaeceb96142dc9b35a1c0307e0d
3
+ size 4510089164
model-00002-of-00064.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:878af09c54e5d19261bc14b930a9096b574aa9647ba7749891a10a218b50fcd2
3
+ size 3812486132
model-00003-of-00064.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ed5ba6a280e951ba5100c2dd2d638d2f77faf7c8057bafe9cff5a36ba5610fe9
3
+ size 3628073232
model-00004-of-00064.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f33e4f3dafd65138d3a69e68f330024232f0a1aa7dfc5b9b559ed2a7a7dbe3b4
3
+ size 3879857140
model-00005-of-00064.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:dd5a6bd5e8ff1b6a80e93bb9f72baad578ad1bd7fa1a7f49e139e7b40e509353
3
+ size 3879857140
model-00006-of-00064.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3aba70cdd5f8012f350419c43b4112f9eec4c7c29f8fef873583370323897ad4
3
+ size 3628073232
model-00007-of-00064.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:aeef836ba88f32cf8b8164e7562ade441c83e7db00905b62af217952f83646d0
3
+ size 3879857140
model-00008-of-00064.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a8fe428e15b4b1058ae4a2c9a29a238bdbb992c84b2e13f20d9e269ded488e94
3
+ size 3812486132
model-00009-of-00064.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f318861f022f1222933bce4e5eca4905b15268d9df5a69be721b9dd84e6dc417
3
+ size 3628073232
model-00010-of-00064.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:76b7feb6b3439905da4d503ae8206844ba862ed4d30507341ea2422c43aa8311
3
+ size 3879857140
model-00011-of-00064.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:24ad37964b706e6ff09f9bf3e12c08d392ca1204db65a469ca9df881b4892a2a
3
+ size 3879857132
model-00012-of-00064.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:70a8a02b1bf87b9f2ebb5c993737ee9738bfa7f7636600a909d69ea0a4bfacd7
3
+ size 3628073232
model-00013-of-00064.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d5fb52f0a9e06f35975d2612f6583aac9bc97a6b8481113d2b79afc73ed8104a
3
+ size 3879857156
model-00014-of-00064.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4a9e6e81edd0bbc9f48f984c61f28b4af0e1ead088d1e9d6ff2b2cf3650ac68c
3
+ size 3812486148
model-00015-of-00064.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9458a4a0573bab7b3dd74cdff2a5786751b9a1540fa8aeda90a2a9a079355b64
3
+ size 3628073232
model-00016-of-00064.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:76c2cfce27b2ae747fa0b1ee02ada6105c2dc163a3a8dc7da7d954c17e1cc377
3
+ size 3879857156
model-00017-of-00064.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f1e097988027795c58526e29345a158c7ab59613b0e624ba8297989c78dce373
3
+ size 3879857156
model-00018-of-00064.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fc03bf51fef611e82b263274be17a46bcfa4e7b773a046aada486985b2da0211
3
+ size 3628073232
model-00019-of-00064.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f30ccd2eb205e71750bfce444ecc25094f710bc6818116b41ae4c912bd90f135
3
+ size 3879857156
model-00020-of-00064.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a28d11a2a43cae5bfcf9a1d9f77f09c02c9765b0e188093ee9970ee6373bb364
3
+ size 3812486148
model-00021-of-00064.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:96485bdedd6aca4ebc0a87cd43853eef9d73ec7db08fa3e89b97a69a4f60d251
3
+ size 3628073232
model-00022-of-00064.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e92a5ffa1daa21496498b9d839fdfb11f743363ea0a14ed3c5fde4971434d5b7
3
+ size 3879857156
model-00023-of-00064.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:36c654d456ad814a9e8b58eb7d378843df90ec29d941e2c6eb6a06c3a5c0a108
3
+ size 3879857156
model-00024-of-00064.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5d6e1336c73bc505bce0051afc26afb8e221275c314e7d5e88ca2e5f28102cf5
3
+ size 3628073232
model-00025-of-00064.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:804149b9b8b8a96c09f76694e41523a2b758287d4b13624a2d634d840e86df63
3
+ size 3879857156
model-00026-of-00064.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7ce46fada0373a3ed448ad89650d26416ea9228e8ce32c4fdf4ce8d18aac7736
3
+ size 3812486148
model-00027-of-00064.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bea7991e88d048115a15da99dc99980dd08cd2b89211f9ec132e32f8eecb7ad5
3
+ size 3628073232
model-00028-of-00064.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9e3700a09bda9f2e00dad75f3c04d1ee345017d71f1546079cccc6f1230add93
3
+ size 3879857156
model-00029-of-00064.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ae194ab8f09191acc0ac45a800a07a7f8847dd6e967499769857cc9d7ae21213
3
+ size 3879857156
model-00030-of-00064.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:eaf3aaa21eecdf43bd9d1f8889d59a42ff37bed749b39033bc348d7f41696cbd
3
+ size 3628073232
model-00031-of-00064.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8e4d5c2f6978b364bce503aa9572c60911367ddf374091d27400c9900a04d525
3
+ size 3879857156
model-00032-of-00064.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:409d3bfa66fba803c7bad2abf70afc391460a14d22d81bbc7a2f9f5b2555be98
3
+ size 3812486148
model-00033-of-00064.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0ee1b861698948be6c96325e99d993fb15fe276732af8c1c1db66576e4dd5be3
3
+ size 3628073232
model-00034-of-00064.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c38897aac0df2cf728744232f9e3669cf66158d7bc25a80e284aa9982966301f
3
+ size 3879857156
model-00035-of-00064.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a3f6bdb8b5975e386f789154fd6ade2d19db8aaf86ad919e375c4030a7bb9c6b
3
+ size 3879857156
model-00036-of-00064.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b41e79f0b46c1a69ae5449f2216c226219359d63284c730b0b19a92f51db1f97
3
+ size 3628073232
model-00037-of-00064.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:573a7c3eb4c5a9d408eba874042aae12fd81773e87defdcc5b37a3dbeda7bf24
3
+ size 3879857156
model-00038-of-00064.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9fae56646790270cc39c42148b056fa1cd5794a1e38a1884b6df14dad821f6bc
3
+ size 3812486148
model-00039-of-00064.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:96997535de9cfb69a2d83e2b189f88dec260a194bca89c0eb279fdc983ed059a
3
+ size 3628073232
model-00040-of-00064.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2a427495d37e030ee33dfb122e2f0f1a0e6cab7ef06510aa2be1dbc88ad9e8ce
3
+ size 3879857156
model-00041-of-00064.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:708369d113576a113fefdaaa5cecb8d890acbd337815fcdd6198ab4fb5944e67
3
+ size 3879857156
model-00042-of-00064.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:061e43bfb0c323d13e5a1a0019d0827ba375f841f027a1ce998a2243cfdd7c10
3
+ size 3628073232
model-00043-of-00064.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0972fbc505205d6809e00d7881c33e9c7db4d1ca483fb5bd0a7638ea27fee064
3
+ size 3879857156
model-00044-of-00064.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d68df4561ec5f6c9525674d7ac9caf76de4ac46e0b80e66bcd2e0fb347f3c4e6
3
+ size 3812486148
model-00045-of-00064.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:84b273b8cf2ca84d92be432644e4782ca50293953c52e05d13c7c0a0a1e4050f
3
+ size 3628073232
model-00046-of-00064.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:86c4d517487a6b6fed23934215b32795aa4f42eda3e6afb22329486cfe9d72b6
3
+ size 3879857156