Full standalone model: FP8 attention/shared + NVFP4 dense + GPTQ-MXFP4 experts + MTP draft + stitched index
Browse files- .gitattributes +1 -0
- LICENSE +25 -0
- chat_template.jinja +119 -0
- config.json +453 -0
- generation_config.json +12 -0
- hybrid-ct-00000.safetensors +3 -0
- hybrid-ct-00001.safetensors +3 -0
- hybrid-ct-00002.safetensors +3 -0
- model.safetensors.index.json +0 -0
- mtp-draft/config.json +425 -0
- mtp-draft/model-mtp-inputscales.safetensors +3 -0
- mtp-draft/model-mtp.safetensors +3 -0
- mtp-draft/model.safetensors.index.json +0 -0
- recipe.yaml +99 -0
- tokenizer.json +3 -0
- tokenizer_config.json +34 -0
- vllm_overlay/INSTALL.md +71 -0
- vllm_overlay/hybrid_mxfp4_ct.py +86 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
tokenizer.json filter=lfs diff=lfs merge=lfs -text
|
LICENSE
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
MIT License
|
| 2 |
+
|
| 3 |
+
This repository repackages, without re-quantization, tensors from:
|
| 4 |
+
- zai-org/GLM-5.2 (MIT) — the base model
|
| 5 |
+
- RedHatAI/GLM-5.2-NVFP4-FP8 (MIT) — FP8/NVFP4 compressed-tensors quantization
|
| 6 |
+
- festr2/GLM-5.2-BF16-AMDMXFP4experts (MIT) — MXFP4 (AMD Quark-calibrated)
|
| 7 |
+
routed-expert and MTP-expert tensors
|
| 8 |
+
|
| 9 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
| 10 |
+
of this software and associated documentation files (the "Software"), to deal
|
| 11 |
+
in the Software without restriction, including without limitation the rights
|
| 12 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
| 13 |
+
copies of the Software, and to permit persons to whom the Software is
|
| 14 |
+
furnished to do so, subject to the following conditions:
|
| 15 |
+
|
| 16 |
+
The above copyright notice and this permission notice shall be included in all
|
| 17 |
+
copies or substantial portions of the Software.
|
| 18 |
+
|
| 19 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 20 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| 21 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
| 22 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
| 23 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
| 24 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
| 25 |
+
SOFTWARE.
|
chat_template.jinja
ADDED
|
@@ -0,0 +1,119 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[gMASK]<sop>
|
| 2 |
+
{%- set effective_reasoning_effort = 'high' if reasoning_effort is defined and reasoning_effort == 'high' else 'max' -%}
|
| 3 |
+
{%- if (enable_thinking is not defined or enable_thinking) and effective_reasoning_effort is not none -%}<|system|>Reasoning Effort: {{ effective_reasoning_effort | capitalize }}{%- endif -%}
|
| 4 |
+
{%- if tools -%}
|
| 5 |
+
{%- macro tool_to_json(tool) -%}
|
| 6 |
+
{%- set ns_tool = namespace(first=true) -%}
|
| 7 |
+
{{ '{' -}}
|
| 8 |
+
{%- for k, v in tool.items() -%}
|
| 9 |
+
{%- if k != 'defer_loading' and k != 'strict' -%}
|
| 10 |
+
{%- if not ns_tool.first -%}{{- ', ' -}}{%- endif -%}
|
| 11 |
+
{%- set ns_tool.first = false -%}
|
| 12 |
+
"{{ k }}": {{ v | tojson(ensure_ascii=False) }}
|
| 13 |
+
{%- endif -%}
|
| 14 |
+
{%- endfor -%}
|
| 15 |
+
{{- '}' -}}
|
| 16 |
+
{%- endmacro -%}
|
| 17 |
+
<|system|>
|
| 18 |
+
# Tools
|
| 19 |
+
|
| 20 |
+
You may call one or more functions to assist with the user query.
|
| 21 |
+
|
| 22 |
+
You are provided with function signatures within <tools></tools> XML tags:
|
| 23 |
+
<tools>
|
| 24 |
+
{% for tool in tools %}
|
| 25 |
+
{%- if 'function' in tool -%}
|
| 26 |
+
{%- set tool = tool['function'] -%}
|
| 27 |
+
{%- endif -%}
|
| 28 |
+
{% if tool.defer_loading is not defined or not tool.defer_loading %}
|
| 29 |
+
{{ tool_to_json(tool) }}
|
| 30 |
+
{% endif %}
|
| 31 |
+
{% endfor %}
|
| 32 |
+
</tools>
|
| 33 |
+
|
| 34 |
+
For each function call, output the function name and arguments within the following XML format:
|
| 35 |
+
<tool_call>{function-name}<arg_key>{arg-key-1}</arg_key><arg_value>{arg-value-1}</arg_value><arg_key>{arg-key-2}</arg_key><arg_value>{arg-value-2}</arg_value>...</tool_call>{%- endif -%}
|
| 36 |
+
{%- macro visible_text(content) -%}
|
| 37 |
+
{%- if content is string -%}
|
| 38 |
+
{{- content }}
|
| 39 |
+
{%- elif content is iterable and content is not mapping -%}
|
| 40 |
+
{%- for item in content -%}
|
| 41 |
+
{%- if item is mapping and item.type == 'text' -%}
|
| 42 |
+
{{- item.text }}
|
| 43 |
+
{%- elif item is string -%}
|
| 44 |
+
{{- item }}
|
| 45 |
+
{%- elif item is mapping and item.type in ['image', 'image_url', 'video', 'video_url', 'audio', 'audio_url', 'input_audio'] -%}
|
| 46 |
+
{%- set media_type = item.type | replace('_url', '') | replace('input_', '') -%}
|
| 47 |
+
{{- "<reminder>You are unable to process this " ~ media_type ~ " because you don't have multi-modal input ability. Try different methods.</reminder>" }}
|
| 48 |
+
{%- endif -%}
|
| 49 |
+
{%- endfor -%}
|
| 50 |
+
{%- else -%}
|
| 51 |
+
{{- content }}
|
| 52 |
+
{%- endif -%}
|
| 53 |
+
{%- endmacro -%}
|
| 54 |
+
{%- set ns = namespace(last_user_index=-1) -%}
|
| 55 |
+
{%- for m in messages %}
|
| 56 |
+
{%- if m.role == 'user' %}
|
| 57 |
+
{%- set ns.last_user_index = loop.index0 -%}
|
| 58 |
+
{%- endif %}
|
| 59 |
+
{%- endfor %}
|
| 60 |
+
{%- for m in messages -%}
|
| 61 |
+
{%- if m.role == 'user' -%}<|user|>{{ visible_text(m.content) }}
|
| 62 |
+
{%- elif m.role == 'assistant' -%}
|
| 63 |
+
<|assistant|>
|
| 64 |
+
{%- set content = visible_text(m.content) %}
|
| 65 |
+
{%- if m.reasoning_content is string %}
|
| 66 |
+
{%- set reasoning_content = m.reasoning_content %}
|
| 67 |
+
{%- elif '</think>' in content %}
|
| 68 |
+
{%- set reasoning_content = content.split('</think>')[0].split('<think>')[-1] %}
|
| 69 |
+
{%- set content = content.split('</think>')[-1] %}
|
| 70 |
+
{%- endif %}
|
| 71 |
+
{%- if ((clear_thinking is defined and not clear_thinking) or loop.index0 > ns.last_user_index) and reasoning_content is defined -%}
|
| 72 |
+
{{ '<think>' + reasoning_content + '</think>'}}
|
| 73 |
+
{%- else -%}
|
| 74 |
+
{{ '<think></think>' }}
|
| 75 |
+
{%- endif -%}
|
| 76 |
+
{%- if content.strip() -%}
|
| 77 |
+
{{ content.strip() }}
|
| 78 |
+
{%- endif -%}
|
| 79 |
+
{% if m.tool_calls %}
|
| 80 |
+
{% for tc in m.tool_calls %}
|
| 81 |
+
{%- if tc.function %}
|
| 82 |
+
{%- set tc = tc.function %}
|
| 83 |
+
{%- endif %}
|
| 84 |
+
{{- '<tool_call>' + tc.name -}}
|
| 85 |
+
{% set _args = tc.arguments %}{% for k, v in _args.items() %}<arg_key>{{ k }}</arg_key><arg_value>{{ v | tojson(ensure_ascii=False) if v is not string else v }}</arg_value>{% endfor %}</tool_call>{% endfor %}
|
| 86 |
+
{% endif %}
|
| 87 |
+
{%- elif m.role == 'tool' -%}
|
| 88 |
+
{%- if loop.first or (messages[loop.index0 - 1].role != "tool") %}
|
| 89 |
+
{{- '<|observation|>' -}}
|
| 90 |
+
{%- endif %}
|
| 91 |
+
{%- if m.content is string -%}
|
| 92 |
+
{{- '<tool_response>' + m.content + '</tool_response>' -}}
|
| 93 |
+
{%- elif m.content is iterable and m.content is not mapping and m.content and m.content.0.type == "tool_reference" -%}
|
| 94 |
+
{{- '<tool_response><tools>\n' -}}
|
| 95 |
+
{% for tr in m.content %}
|
| 96 |
+
{%- for tool in tools -%}
|
| 97 |
+
{%- if 'function' in tool -%}
|
| 98 |
+
{%- set tool = tool['function'] -%}
|
| 99 |
+
{%- endif -%}
|
| 100 |
+
{%- if tool.name == tr.name -%}
|
| 101 |
+
{{- tool_to_json(tool) + '\n' -}}
|
| 102 |
+
{%- endif -%}
|
| 103 |
+
{%- endfor -%}
|
| 104 |
+
{%- endfor -%}
|
| 105 |
+
{{- '</tools></tool_response>' -}}
|
| 106 |
+
{%- elif m.content is iterable and m.content is not mapping and m.content and m.content.0 is mapping and m.content.0.output is defined -%}
|
| 107 |
+
{%- for tr in m.content -%}
|
| 108 |
+
{{- '<tool_response>' + tr.output + '</tool_response>' -}}
|
| 109 |
+
{%- endfor -%}
|
| 110 |
+
{%- else -%}
|
| 111 |
+
{{- '<tool_response>' + visible_text(m.content) + '</tool_response>' -}}
|
| 112 |
+
{% endif -%}
|
| 113 |
+
{%- elif m.role == 'system' -%}
|
| 114 |
+
<|system|>{{ visible_text(m.content) }}
|
| 115 |
+
{%- endif -%}
|
| 116 |
+
{%- endfor -%}
|
| 117 |
+
{%- if add_generation_prompt -%}
|
| 118 |
+
<|assistant|>{{- '<think></think>' if (enable_thinking is defined and not enable_thinking) else '<think>' -}}
|
| 119 |
+
{%- endif -%}
|
config.json
ADDED
|
@@ -0,0 +1,453 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"GlmMoeDsaForCausalLM"
|
| 4 |
+
],
|
| 5 |
+
"attention_bias": false,
|
| 6 |
+
"attention_dropout": 0.0,
|
| 7 |
+
"bos_token_id": 0,
|
| 8 |
+
"dtype": "bfloat16",
|
| 9 |
+
"eos_token_id": [
|
| 10 |
+
154820,
|
| 11 |
+
154827,
|
| 12 |
+
154829
|
| 13 |
+
],
|
| 14 |
+
"ep_size": 1,
|
| 15 |
+
"first_k_dense_replace": 3,
|
| 16 |
+
"head_dim": 64,
|
| 17 |
+
"hidden_act": "silu",
|
| 18 |
+
"hidden_size": 6144,
|
| 19 |
+
"index_head_dim": 128,
|
| 20 |
+
"index_n_heads": 32,
|
| 21 |
+
"index_share_for_mtp_iteration": true,
|
| 22 |
+
"index_skip_topk_offset": 3,
|
| 23 |
+
"index_topk": 2048,
|
| 24 |
+
"index_topk_freq": 4,
|
| 25 |
+
"index_topk_pattern": null,
|
| 26 |
+
"indexer_rope_interleave": true,
|
| 27 |
+
"indexer_types": [
|
| 28 |
+
"full",
|
| 29 |
+
"full",
|
| 30 |
+
"full",
|
| 31 |
+
"shared",
|
| 32 |
+
"shared",
|
| 33 |
+
"shared",
|
| 34 |
+
"full",
|
| 35 |
+
"shared",
|
| 36 |
+
"shared",
|
| 37 |
+
"shared",
|
| 38 |
+
"full",
|
| 39 |
+
"shared",
|
| 40 |
+
"shared",
|
| 41 |
+
"shared",
|
| 42 |
+
"full",
|
| 43 |
+
"shared",
|
| 44 |
+
"shared",
|
| 45 |
+
"shared",
|
| 46 |
+
"full",
|
| 47 |
+
"shared",
|
| 48 |
+
"shared",
|
| 49 |
+
"shared",
|
| 50 |
+
"full",
|
| 51 |
+
"shared",
|
| 52 |
+
"shared",
|
| 53 |
+
"shared",
|
| 54 |
+
"full",
|
| 55 |
+
"shared",
|
| 56 |
+
"shared",
|
| 57 |
+
"shared",
|
| 58 |
+
"full",
|
| 59 |
+
"shared",
|
| 60 |
+
"shared",
|
| 61 |
+
"shared",
|
| 62 |
+
"full",
|
| 63 |
+
"shared",
|
| 64 |
+
"shared",
|
| 65 |
+
"shared",
|
| 66 |
+
"full",
|
| 67 |
+
"shared",
|
| 68 |
+
"shared",
|
| 69 |
+
"shared",
|
| 70 |
+
"full",
|
| 71 |
+
"shared",
|
| 72 |
+
"shared",
|
| 73 |
+
"shared",
|
| 74 |
+
"full",
|
| 75 |
+
"shared",
|
| 76 |
+
"shared",
|
| 77 |
+
"shared",
|
| 78 |
+
"full",
|
| 79 |
+
"shared",
|
| 80 |
+
"shared",
|
| 81 |
+
"shared",
|
| 82 |
+
"full",
|
| 83 |
+
"shared",
|
| 84 |
+
"shared",
|
| 85 |
+
"shared",
|
| 86 |
+
"full",
|
| 87 |
+
"shared",
|
| 88 |
+
"shared",
|
| 89 |
+
"shared",
|
| 90 |
+
"full",
|
| 91 |
+
"shared",
|
| 92 |
+
"shared",
|
| 93 |
+
"shared",
|
| 94 |
+
"full",
|
| 95 |
+
"shared",
|
| 96 |
+
"shared",
|
| 97 |
+
"shared",
|
| 98 |
+
"full",
|
| 99 |
+
"shared",
|
| 100 |
+
"shared",
|
| 101 |
+
"shared",
|
| 102 |
+
"full",
|
| 103 |
+
"shared",
|
| 104 |
+
"shared",
|
| 105 |
+
"shared"
|
| 106 |
+
],
|
| 107 |
+
"initializer_range": 0.02,
|
| 108 |
+
"intermediate_size": 12288,
|
| 109 |
+
"kv_lora_rank": 512,
|
| 110 |
+
"max_position_embeddings": 1048576,
|
| 111 |
+
"mlp_bias": false,
|
| 112 |
+
"mlp_layer_types": [
|
| 113 |
+
"dense",
|
| 114 |
+
"dense",
|
| 115 |
+
"dense",
|
| 116 |
+
"sparse",
|
| 117 |
+
"sparse",
|
| 118 |
+
"sparse",
|
| 119 |
+
"sparse",
|
| 120 |
+
"sparse",
|
| 121 |
+
"sparse",
|
| 122 |
+
"sparse",
|
| 123 |
+
"sparse",
|
| 124 |
+
"sparse",
|
| 125 |
+
"sparse",
|
| 126 |
+
"sparse",
|
| 127 |
+
"sparse",
|
| 128 |
+
"sparse",
|
| 129 |
+
"sparse",
|
| 130 |
+
"sparse",
|
| 131 |
+
"sparse",
|
| 132 |
+
"sparse",
|
| 133 |
+
"sparse",
|
| 134 |
+
"sparse",
|
| 135 |
+
"sparse",
|
| 136 |
+
"sparse",
|
| 137 |
+
"sparse",
|
| 138 |
+
"sparse",
|
| 139 |
+
"sparse",
|
| 140 |
+
"sparse",
|
| 141 |
+
"sparse",
|
| 142 |
+
"sparse",
|
| 143 |
+
"sparse",
|
| 144 |
+
"sparse",
|
| 145 |
+
"sparse",
|
| 146 |
+
"sparse",
|
| 147 |
+
"sparse",
|
| 148 |
+
"sparse",
|
| 149 |
+
"sparse",
|
| 150 |
+
"sparse",
|
| 151 |
+
"sparse",
|
| 152 |
+
"sparse",
|
| 153 |
+
"sparse",
|
| 154 |
+
"sparse",
|
| 155 |
+
"sparse",
|
| 156 |
+
"sparse",
|
| 157 |
+
"sparse",
|
| 158 |
+
"sparse",
|
| 159 |
+
"sparse",
|
| 160 |
+
"sparse",
|
| 161 |
+
"sparse",
|
| 162 |
+
"sparse",
|
| 163 |
+
"sparse",
|
| 164 |
+
"sparse",
|
| 165 |
+
"sparse",
|
| 166 |
+
"sparse",
|
| 167 |
+
"sparse",
|
| 168 |
+
"sparse",
|
| 169 |
+
"sparse",
|
| 170 |
+
"sparse",
|
| 171 |
+
"sparse",
|
| 172 |
+
"sparse",
|
| 173 |
+
"sparse",
|
| 174 |
+
"sparse",
|
| 175 |
+
"sparse",
|
| 176 |
+
"sparse",
|
| 177 |
+
"sparse",
|
| 178 |
+
"sparse",
|
| 179 |
+
"sparse",
|
| 180 |
+
"sparse",
|
| 181 |
+
"sparse",
|
| 182 |
+
"sparse",
|
| 183 |
+
"sparse",
|
| 184 |
+
"sparse",
|
| 185 |
+
"sparse",
|
| 186 |
+
"sparse",
|
| 187 |
+
"sparse",
|
| 188 |
+
"sparse",
|
| 189 |
+
"sparse",
|
| 190 |
+
"sparse"
|
| 191 |
+
],
|
| 192 |
+
"model_type": "glm_moe_dsa",
|
| 193 |
+
"moe_intermediate_size": 2048,
|
| 194 |
+
"moe_layer_freq": 1,
|
| 195 |
+
"n_group": 1,
|
| 196 |
+
"n_routed_experts": 256,
|
| 197 |
+
"n_shared_experts": 1,
|
| 198 |
+
"norm_topk_prob": true,
|
| 199 |
+
"num_attention_heads": 64,
|
| 200 |
+
"num_experts_per_tok": 8,
|
| 201 |
+
"num_hidden_layers": 78,
|
| 202 |
+
"num_key_value_heads": 64,
|
| 203 |
+
"num_nextn_predict_layers": 1,
|
| 204 |
+
"pad_token_id": 154820,
|
| 205 |
+
"pretraining_tp": 1,
|
| 206 |
+
"q_lora_rank": 2048,
|
| 207 |
+
"qk_head_dim": 256,
|
| 208 |
+
"qk_nope_head_dim": 192,
|
| 209 |
+
"qk_rope_head_dim": 64,
|
| 210 |
+
"quantization_config": {
|
| 211 |
+
"quant_method": "hybrid_mxfp4_ct",
|
| 212 |
+
"moe": {
|
| 213 |
+
"quant_method": "mxfp4"
|
| 214 |
+
},
|
| 215 |
+
"linear": {
|
| 216 |
+
"config_groups": {
|
| 217 |
+
"group_0": {
|
| 218 |
+
"format": "float-quantized",
|
| 219 |
+
"input_activations": {
|
| 220 |
+
"actorder": null,
|
| 221 |
+
"block_structure": null,
|
| 222 |
+
"dynamic": true,
|
| 223 |
+
"group_size": 128,
|
| 224 |
+
"num_bits": 8,
|
| 225 |
+
"observer": null,
|
| 226 |
+
"observer_kwargs": {},
|
| 227 |
+
"scale_dtype": null,
|
| 228 |
+
"strategy": "group",
|
| 229 |
+
"symmetric": true,
|
| 230 |
+
"type": "float",
|
| 231 |
+
"zp_dtype": null
|
| 232 |
+
},
|
| 233 |
+
"output_activations": null,
|
| 234 |
+
"targets": [
|
| 235 |
+
"re:.*self_attn\\..*"
|
| 236 |
+
],
|
| 237 |
+
"weights": {
|
| 238 |
+
"actorder": null,
|
| 239 |
+
"block_structure": [
|
| 240 |
+
128,
|
| 241 |
+
128
|
| 242 |
+
],
|
| 243 |
+
"dynamic": false,
|
| 244 |
+
"group_size": null,
|
| 245 |
+
"num_bits": 8,
|
| 246 |
+
"observer": "memoryless_minmax",
|
| 247 |
+
"observer_kwargs": {},
|
| 248 |
+
"scale_dtype": null,
|
| 249 |
+
"strategy": "block",
|
| 250 |
+
"symmetric": true,
|
| 251 |
+
"type": "float",
|
| 252 |
+
"zp_dtype": null
|
| 253 |
+
}
|
| 254 |
+
},
|
| 255 |
+
"group_1": {
|
| 256 |
+
"format": "nvfp4-pack-quantized",
|
| 257 |
+
"input_activations": {
|
| 258 |
+
"actorder": null,
|
| 259 |
+
"block_structure": null,
|
| 260 |
+
"dynamic": "local",
|
| 261 |
+
"group_size": 16,
|
| 262 |
+
"num_bits": 4,
|
| 263 |
+
"observer": "static_minmax",
|
| 264 |
+
"observer_kwargs": {},
|
| 265 |
+
"scale_dtype": "torch.float8_e4m3fn",
|
| 266 |
+
"strategy": "tensor_group",
|
| 267 |
+
"symmetric": true,
|
| 268 |
+
"type": "float",
|
| 269 |
+
"zp_dtype": null
|
| 270 |
+
},
|
| 271 |
+
"output_activations": null,
|
| 272 |
+
"targets": [
|
| 273 |
+
"re:.*\\.mlp\\.(gate_proj|up_proj|down_proj)$"
|
| 274 |
+
],
|
| 275 |
+
"weights": {
|
| 276 |
+
"actorder": null,
|
| 277 |
+
"block_structure": null,
|
| 278 |
+
"dynamic": false,
|
| 279 |
+
"group_size": 16,
|
| 280 |
+
"num_bits": 4,
|
| 281 |
+
"observer": "memoryless_minmax",
|
| 282 |
+
"observer_kwargs": {},
|
| 283 |
+
"scale_dtype": "torch.float8_e4m3fn",
|
| 284 |
+
"strategy": "tensor_group",
|
| 285 |
+
"symmetric": true,
|
| 286 |
+
"type": "float",
|
| 287 |
+
"zp_dtype": null
|
| 288 |
+
}
|
| 289 |
+
},
|
| 290 |
+
"group_2": {
|
| 291 |
+
"format": "float-quantized",
|
| 292 |
+
"input_activations": {
|
| 293 |
+
"actorder": null,
|
| 294 |
+
"block_structure": null,
|
| 295 |
+
"dynamic": true,
|
| 296 |
+
"group_size": 128,
|
| 297 |
+
"num_bits": 8,
|
| 298 |
+
"observer": null,
|
| 299 |
+
"observer_kwargs": {},
|
| 300 |
+
"scale_dtype": null,
|
| 301 |
+
"strategy": "group",
|
| 302 |
+
"symmetric": true,
|
| 303 |
+
"type": "float",
|
| 304 |
+
"zp_dtype": null
|
| 305 |
+
},
|
| 306 |
+
"output_activations": null,
|
| 307 |
+
"targets": [
|
| 308 |
+
"re:.*\\.mlp\\.shared_experts\\.(gate_proj|up_proj|down_proj)$"
|
| 309 |
+
],
|
| 310 |
+
"weights": {
|
| 311 |
+
"actorder": null,
|
| 312 |
+
"block_structure": [
|
| 313 |
+
128,
|
| 314 |
+
128
|
| 315 |
+
],
|
| 316 |
+
"dynamic": false,
|
| 317 |
+
"group_size": null,
|
| 318 |
+
"num_bits": 8,
|
| 319 |
+
"observer": "memoryless_minmax",
|
| 320 |
+
"observer_kwargs": {},
|
| 321 |
+
"scale_dtype": null,
|
| 322 |
+
"strategy": "block",
|
| 323 |
+
"symmetric": true,
|
| 324 |
+
"type": "float",
|
| 325 |
+
"zp_dtype": null
|
| 326 |
+
}
|
| 327 |
+
}
|
| 328 |
+
},
|
| 329 |
+
"format": "mixed-precision",
|
| 330 |
+
"global_compression_ratio": null,
|
| 331 |
+
"ignore": [
|
| 332 |
+
"model.layers.0.self_attn.indexer.weights_proj",
|
| 333 |
+
"model.layers.1.self_attn.indexer.weights_proj",
|
| 334 |
+
"model.layers.2.self_attn.indexer.weights_proj",
|
| 335 |
+
"model.layers.3.mlp.gate",
|
| 336 |
+
"model.layers.4.mlp.gate",
|
| 337 |
+
"model.layers.5.mlp.gate",
|
| 338 |
+
"model.layers.6.self_attn.indexer.weights_proj",
|
| 339 |
+
"model.layers.6.mlp.gate",
|
| 340 |
+
"model.layers.7.mlp.gate",
|
| 341 |
+
"model.layers.8.mlp.gate",
|
| 342 |
+
"model.layers.9.mlp.gate",
|
| 343 |
+
"model.layers.10.self_attn.indexer.weights_proj",
|
| 344 |
+
"model.layers.10.mlp.gate",
|
| 345 |
+
"model.layers.11.mlp.gate",
|
| 346 |
+
"model.layers.12.mlp.gate",
|
| 347 |
+
"model.layers.13.mlp.gate",
|
| 348 |
+
"model.layers.14.self_attn.indexer.weights_proj",
|
| 349 |
+
"model.layers.14.mlp.gate",
|
| 350 |
+
"model.layers.15.mlp.gate",
|
| 351 |
+
"model.layers.16.mlp.gate",
|
| 352 |
+
"model.layers.17.mlp.gate",
|
| 353 |
+
"model.layers.18.self_attn.indexer.weights_proj",
|
| 354 |
+
"model.layers.18.mlp.gate",
|
| 355 |
+
"model.layers.19.mlp.gate",
|
| 356 |
+
"model.layers.20.mlp.gate",
|
| 357 |
+
"model.layers.21.mlp.gate",
|
| 358 |
+
"model.layers.22.self_attn.indexer.weights_proj",
|
| 359 |
+
"model.layers.22.mlp.gate",
|
| 360 |
+
"model.layers.23.mlp.gate",
|
| 361 |
+
"model.layers.24.mlp.gate",
|
| 362 |
+
"model.layers.25.mlp.gate",
|
| 363 |
+
"model.layers.26.self_attn.indexer.weights_proj",
|
| 364 |
+
"model.layers.26.mlp.gate",
|
| 365 |
+
"model.layers.27.mlp.gate",
|
| 366 |
+
"model.layers.28.mlp.gate",
|
| 367 |
+
"model.layers.29.mlp.gate",
|
| 368 |
+
"model.layers.30.self_attn.indexer.weights_proj",
|
| 369 |
+
"model.layers.30.mlp.gate",
|
| 370 |
+
"model.layers.31.mlp.gate",
|
| 371 |
+
"model.layers.32.mlp.gate",
|
| 372 |
+
"model.layers.33.mlp.gate",
|
| 373 |
+
"model.layers.34.self_attn.indexer.weights_proj",
|
| 374 |
+
"model.layers.34.mlp.gate",
|
| 375 |
+
"model.layers.35.mlp.gate",
|
| 376 |
+
"model.layers.36.mlp.gate",
|
| 377 |
+
"model.layers.37.mlp.gate",
|
| 378 |
+
"model.layers.38.self_attn.indexer.weights_proj",
|
| 379 |
+
"model.layers.38.mlp.gate",
|
| 380 |
+
"model.layers.39.mlp.gate",
|
| 381 |
+
"model.layers.40.mlp.gate",
|
| 382 |
+
"model.layers.41.mlp.gate",
|
| 383 |
+
"model.layers.42.self_attn.indexer.weights_proj",
|
| 384 |
+
"model.layers.42.mlp.gate",
|
| 385 |
+
"model.layers.43.mlp.gate",
|
| 386 |
+
"model.layers.44.mlp.gate",
|
| 387 |
+
"model.layers.45.mlp.gate",
|
| 388 |
+
"model.layers.46.self_attn.indexer.weights_proj",
|
| 389 |
+
"model.layers.46.mlp.gate",
|
| 390 |
+
"model.layers.47.mlp.gate",
|
| 391 |
+
"model.layers.48.mlp.gate",
|
| 392 |
+
"model.layers.49.mlp.gate",
|
| 393 |
+
"model.layers.50.self_attn.indexer.weights_proj",
|
| 394 |
+
"model.layers.50.mlp.gate",
|
| 395 |
+
"model.layers.51.mlp.gate",
|
| 396 |
+
"model.layers.52.mlp.gate",
|
| 397 |
+
"model.layers.53.mlp.gate",
|
| 398 |
+
"model.layers.54.self_attn.indexer.weights_proj",
|
| 399 |
+
"model.layers.54.mlp.gate",
|
| 400 |
+
"model.layers.55.mlp.gate",
|
| 401 |
+
"model.layers.56.mlp.gate",
|
| 402 |
+
"model.layers.57.mlp.gate",
|
| 403 |
+
"model.layers.58.self_attn.indexer.weights_proj",
|
| 404 |
+
"model.layers.58.mlp.gate",
|
| 405 |
+
"model.layers.59.mlp.gate",
|
| 406 |
+
"model.layers.60.mlp.gate",
|
| 407 |
+
"model.layers.61.mlp.gate",
|
| 408 |
+
"model.layers.62.self_attn.indexer.weights_proj",
|
| 409 |
+
"model.layers.62.mlp.gate",
|
| 410 |
+
"model.layers.63.mlp.gate",
|
| 411 |
+
"model.layers.64.mlp.gate",
|
| 412 |
+
"model.layers.65.mlp.gate",
|
| 413 |
+
"model.layers.66.self_attn.indexer.weights_proj",
|
| 414 |
+
"model.layers.66.mlp.gate",
|
| 415 |
+
"model.layers.67.mlp.gate",
|
| 416 |
+
"model.layers.68.mlp.gate",
|
| 417 |
+
"model.layers.69.mlp.gate",
|
| 418 |
+
"model.layers.70.self_attn.indexer.weights_proj",
|
| 419 |
+
"model.layers.70.mlp.gate",
|
| 420 |
+
"model.layers.71.mlp.gate",
|
| 421 |
+
"model.layers.72.mlp.gate",
|
| 422 |
+
"model.layers.73.mlp.gate",
|
| 423 |
+
"model.layers.74.self_attn.indexer.weights_proj",
|
| 424 |
+
"model.layers.74.mlp.gate",
|
| 425 |
+
"model.layers.75.mlp.gate",
|
| 426 |
+
"model.layers.76.mlp.gate",
|
| 427 |
+
"model.layers.77.mlp.gate",
|
| 428 |
+
"lm_head"
|
| 429 |
+
],
|
| 430 |
+
"kv_cache_scheme": null,
|
| 431 |
+
"quant_method": "compressed-tensors",
|
| 432 |
+
"quantization_status": "compressed",
|
| 433 |
+
"sparsity_config": {},
|
| 434 |
+
"transform_config": {},
|
| 435 |
+
"version": "0.15.1.dev22+g792acec"
|
| 436 |
+
}
|
| 437 |
+
},
|
| 438 |
+
"rms_norm_eps": 1e-05,
|
| 439 |
+
"rope_interleave": true,
|
| 440 |
+
"rope_parameters": {
|
| 441 |
+
"rope_theta": 8000000,
|
| 442 |
+
"rope_type": "default"
|
| 443 |
+
},
|
| 444 |
+
"routed_scaling_factor": 2.5,
|
| 445 |
+
"scoring_func": "sigmoid",
|
| 446 |
+
"tie_word_embeddings": false,
|
| 447 |
+
"topk_group": 1,
|
| 448 |
+
"topk_method": "noaux_tc",
|
| 449 |
+
"transformers_version": "5.13.0.dev0",
|
| 450 |
+
"use_cache": true,
|
| 451 |
+
"v_head_dim": 256,
|
| 452 |
+
"vocab_size": 154880
|
| 453 |
+
}
|
generation_config.json
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_from_model_config": true,
|
| 3 |
+
"eos_token_id": [
|
| 4 |
+
154820,
|
| 5 |
+
154827,
|
| 6 |
+
154829
|
| 7 |
+
],
|
| 8 |
+
"pad_token_id": 154820,
|
| 9 |
+
"temperature": 1.0,
|
| 10 |
+
"transformers_version": "5.13.0.dev0",
|
| 11 |
+
"top_p": 0.95
|
| 12 |
+
}
|
hybrid-ct-00000.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ec5d602153f78fc2d725a1c05a1284bdfb91e91733569eb27bf46e66191fee9c
|
| 3 |
+
size 8939483840
|
hybrid-ct-00001.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ae035e0d7df1c54fbdb94bdc739b04dbdc45089ee5eead3bd4021c6a66f9e7a1
|
| 3 |
+
size 9319166416
|
hybrid-ct-00002.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1dffb512bbff15d9b15e8d81d493d6f052d24abf1153b9ccaccb3b273832059d
|
| 3 |
+
size 2654458848
|
model.safetensors.index.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
mtp-draft/config.json
ADDED
|
@@ -0,0 +1,425 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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_k_dense_replace": 3,
|
| 15 |
+
"head_dim": 192,
|
| 16 |
+
"hidden_act": "silu",
|
| 17 |
+
"hidden_size": 6144,
|
| 18 |
+
"index_head_dim": 128,
|
| 19 |
+
"index_n_heads": 32,
|
| 20 |
+
"index_share_for_mtp_iteration": true,
|
| 21 |
+
"index_skip_topk_offset": 3,
|
| 22 |
+
"index_topk": 2048,
|
| 23 |
+
"index_topk_freq": 4,
|
| 24 |
+
"index_topk_pattern": null,
|
| 25 |
+
"indexer_rope_interleave": true,
|
| 26 |
+
"indexer_types": [
|
| 27 |
+
"full",
|
| 28 |
+
"full",
|
| 29 |
+
"full",
|
| 30 |
+
"shared",
|
| 31 |
+
"shared",
|
| 32 |
+
"shared",
|
| 33 |
+
"full",
|
| 34 |
+
"shared",
|
| 35 |
+
"shared",
|
| 36 |
+
"shared",
|
| 37 |
+
"full",
|
| 38 |
+
"shared",
|
| 39 |
+
"shared",
|
| 40 |
+
"shared",
|
| 41 |
+
"full",
|
| 42 |
+
"shared",
|
| 43 |
+
"shared",
|
| 44 |
+
"shared",
|
| 45 |
+
"full",
|
| 46 |
+
"shared",
|
| 47 |
+
"shared",
|
| 48 |
+
"shared",
|
| 49 |
+
"full",
|
| 50 |
+
"shared",
|
| 51 |
+
"shared",
|
| 52 |
+
"shared",
|
| 53 |
+
"full",
|
| 54 |
+
"shared",
|
| 55 |
+
"shared",
|
| 56 |
+
"shared",
|
| 57 |
+
"full",
|
| 58 |
+
"shared",
|
| 59 |
+
"shared",
|
| 60 |
+
"shared",
|
| 61 |
+
"full",
|
| 62 |
+
"shared",
|
| 63 |
+
"shared",
|
| 64 |
+
"shared",
|
| 65 |
+
"full",
|
| 66 |
+
"shared",
|
| 67 |
+
"shared",
|
| 68 |
+
"shared",
|
| 69 |
+
"full",
|
| 70 |
+
"shared",
|
| 71 |
+
"shared",
|
| 72 |
+
"shared",
|
| 73 |
+
"full",
|
| 74 |
+
"shared",
|
| 75 |
+
"shared",
|
| 76 |
+
"shared",
|
| 77 |
+
"full",
|
| 78 |
+
"shared",
|
| 79 |
+
"shared",
|
| 80 |
+
"shared",
|
| 81 |
+
"full",
|
| 82 |
+
"shared",
|
| 83 |
+
"shared",
|
| 84 |
+
"shared",
|
| 85 |
+
"full",
|
| 86 |
+
"shared",
|
| 87 |
+
"shared",
|
| 88 |
+
"shared",
|
| 89 |
+
"full",
|
| 90 |
+
"shared",
|
| 91 |
+
"shared",
|
| 92 |
+
"shared",
|
| 93 |
+
"full",
|
| 94 |
+
"shared",
|
| 95 |
+
"shared",
|
| 96 |
+
"shared",
|
| 97 |
+
"full",
|
| 98 |
+
"shared",
|
| 99 |
+
"shared",
|
| 100 |
+
"shared",
|
| 101 |
+
"full",
|
| 102 |
+
"shared",
|
| 103 |
+
"shared",
|
| 104 |
+
"shared"
|
| 105 |
+
],
|
| 106 |
+
"initializer_range": 0.02,
|
| 107 |
+
"intermediate_size": 12288,
|
| 108 |
+
"kv_lora_rank": 512,
|
| 109 |
+
"max_position_embeddings": 1048576,
|
| 110 |
+
"mlp_layer_types": [
|
| 111 |
+
"dense",
|
| 112 |
+
"dense",
|
| 113 |
+
"dense",
|
| 114 |
+
"sparse",
|
| 115 |
+
"sparse",
|
| 116 |
+
"sparse",
|
| 117 |
+
"sparse",
|
| 118 |
+
"sparse",
|
| 119 |
+
"sparse",
|
| 120 |
+
"sparse",
|
| 121 |
+
"sparse",
|
| 122 |
+
"sparse",
|
| 123 |
+
"sparse",
|
| 124 |
+
"sparse",
|
| 125 |
+
"sparse",
|
| 126 |
+
"sparse",
|
| 127 |
+
"sparse",
|
| 128 |
+
"sparse",
|
| 129 |
+
"sparse",
|
| 130 |
+
"sparse",
|
| 131 |
+
"sparse",
|
| 132 |
+
"sparse",
|
| 133 |
+
"sparse",
|
| 134 |
+
"sparse",
|
| 135 |
+
"sparse",
|
| 136 |
+
"sparse",
|
| 137 |
+
"sparse",
|
| 138 |
+
"sparse",
|
| 139 |
+
"sparse",
|
| 140 |
+
"sparse",
|
| 141 |
+
"sparse",
|
| 142 |
+
"sparse",
|
| 143 |
+
"sparse",
|
| 144 |
+
"sparse",
|
| 145 |
+
"sparse",
|
| 146 |
+
"sparse",
|
| 147 |
+
"sparse",
|
| 148 |
+
"sparse",
|
| 149 |
+
"sparse",
|
| 150 |
+
"sparse",
|
| 151 |
+
"sparse",
|
| 152 |
+
"sparse",
|
| 153 |
+
"sparse",
|
| 154 |
+
"sparse",
|
| 155 |
+
"sparse",
|
| 156 |
+
"sparse",
|
| 157 |
+
"sparse",
|
| 158 |
+
"sparse",
|
| 159 |
+
"sparse",
|
| 160 |
+
"sparse",
|
| 161 |
+
"sparse",
|
| 162 |
+
"sparse",
|
| 163 |
+
"sparse",
|
| 164 |
+
"sparse",
|
| 165 |
+
"sparse",
|
| 166 |
+
"sparse",
|
| 167 |
+
"sparse",
|
| 168 |
+
"sparse",
|
| 169 |
+
"sparse",
|
| 170 |
+
"sparse",
|
| 171 |
+
"sparse",
|
| 172 |
+
"sparse",
|
| 173 |
+
"sparse",
|
| 174 |
+
"sparse",
|
| 175 |
+
"sparse",
|
| 176 |
+
"sparse",
|
| 177 |
+
"sparse",
|
| 178 |
+
"sparse",
|
| 179 |
+
"sparse",
|
| 180 |
+
"sparse",
|
| 181 |
+
"sparse",
|
| 182 |
+
"sparse",
|
| 183 |
+
"sparse",
|
| 184 |
+
"sparse",
|
| 185 |
+
"sparse",
|
| 186 |
+
"sparse",
|
| 187 |
+
"sparse",
|
| 188 |
+
"sparse"
|
| 189 |
+
],
|
| 190 |
+
"model_type": "glm_moe_dsa",
|
| 191 |
+
"moe_intermediate_size": 2048,
|
| 192 |
+
"moe_layer_freq": 1,
|
| 193 |
+
"n_group": 1,
|
| 194 |
+
"n_routed_experts": 256,
|
| 195 |
+
"n_shared_experts": 1,
|
| 196 |
+
"norm_topk_prob": true,
|
| 197 |
+
"num_attention_heads": 64,
|
| 198 |
+
"num_experts_per_tok": 8,
|
| 199 |
+
"num_hidden_layers": 78,
|
| 200 |
+
"num_key_value_heads": 64,
|
| 201 |
+
"num_nextn_predict_layers": 1,
|
| 202 |
+
"pad_token_id": 154820,
|
| 203 |
+
"pretraining_tp": 1,
|
| 204 |
+
"q_lora_rank": 2048,
|
| 205 |
+
"qk_head_dim": 256,
|
| 206 |
+
"qk_nope_head_dim": 192,
|
| 207 |
+
"qk_rope_head_dim": 64,
|
| 208 |
+
"rms_norm_eps": 1e-05,
|
| 209 |
+
"rope_interleave": true,
|
| 210 |
+
"rope_parameters": {
|
| 211 |
+
"rope_theta": 8000000,
|
| 212 |
+
"rope_type": "default"
|
| 213 |
+
},
|
| 214 |
+
"routed_scaling_factor": 2.5,
|
| 215 |
+
"scoring_func": "sigmoid",
|
| 216 |
+
"tie_word_embeddings": false,
|
| 217 |
+
"topk_group": 1,
|
| 218 |
+
"topk_method": "noaux_tc",
|
| 219 |
+
"transformers_version": "5.12.0",
|
| 220 |
+
"use_cache": true,
|
| 221 |
+
"v_head_dim": 256,
|
| 222 |
+
"vocab_size": 154880,
|
| 223 |
+
"quantization_config": {
|
| 224 |
+
"config_groups": {
|
| 225 |
+
"group_0": {
|
| 226 |
+
"input_activations": {
|
| 227 |
+
"dynamic": false,
|
| 228 |
+
"num_bits": 4,
|
| 229 |
+
"type": "float",
|
| 230 |
+
"group_size": 16
|
| 231 |
+
},
|
| 232 |
+
"weights": {
|
| 233 |
+
"dynamic": false,
|
| 234 |
+
"num_bits": 4,
|
| 235 |
+
"type": "float",
|
| 236 |
+
"group_size": 16
|
| 237 |
+
},
|
| 238 |
+
"targets": [
|
| 239 |
+
"Linear"
|
| 240 |
+
]
|
| 241 |
+
}
|
| 242 |
+
},
|
| 243 |
+
"ignore": [
|
| 244 |
+
"lm_head",
|
| 245 |
+
"model.layers.0.mlp*",
|
| 246 |
+
"model.layers.0.self_attn*",
|
| 247 |
+
"model.layers.0.self_attn.indexer*",
|
| 248 |
+
"model.layers.1.mlp*",
|
| 249 |
+
"model.layers.1.self_attn*",
|
| 250 |
+
"model.layers.1.self_attn.indexer*",
|
| 251 |
+
"*shared_experts*",
|
| 252 |
+
"model.layers.10.self_attn*",
|
| 253 |
+
"model.layers.10.self_attn.indexer*",
|
| 254 |
+
"model.layers.11.self_attn*",
|
| 255 |
+
"model.layers.11.self_attn.indexer*",
|
| 256 |
+
"model.layers.12.self_attn*",
|
| 257 |
+
"model.layers.12.self_attn.indexer*",
|
| 258 |
+
"model.layers.13.self_attn*",
|
| 259 |
+
"model.layers.13.self_attn.indexer*",
|
| 260 |
+
"model.layers.14.self_attn*",
|
| 261 |
+
"model.layers.14.self_attn.indexer*",
|
| 262 |
+
"model.layers.15.self_attn*",
|
| 263 |
+
"model.layers.15.self_attn.indexer*",
|
| 264 |
+
"model.layers.16.self_attn*",
|
| 265 |
+
"model.layers.16.self_attn.indexer*",
|
| 266 |
+
"model.layers.17.self_attn*",
|
| 267 |
+
"model.layers.17.self_attn.indexer*",
|
| 268 |
+
"model.layers.18.self_attn*",
|
| 269 |
+
"model.layers.18.self_attn.indexer*",
|
| 270 |
+
"model.layers.19.self_attn*",
|
| 271 |
+
"model.layers.19.self_attn.indexer*",
|
| 272 |
+
"model.layers.2.mlp*",
|
| 273 |
+
"model.layers.2.self_attn*",
|
| 274 |
+
"model.layers.2.self_attn.indexer*",
|
| 275 |
+
"model.layers.20.self_attn*",
|
| 276 |
+
"model.layers.20.self_attn.indexer*",
|
| 277 |
+
"model.layers.21.self_attn*",
|
| 278 |
+
"model.layers.21.self_attn.indexer*",
|
| 279 |
+
"model.layers.22.self_attn*",
|
| 280 |
+
"model.layers.22.self_attn.indexer*",
|
| 281 |
+
"model.layers.23.self_attn*",
|
| 282 |
+
"model.layers.23.self_attn.indexer*",
|
| 283 |
+
"model.layers.24.self_attn*",
|
| 284 |
+
"model.layers.24.self_attn.indexer*",
|
| 285 |
+
"model.layers.25.self_attn*",
|
| 286 |
+
"model.layers.25.self_attn.indexer*",
|
| 287 |
+
"model.layers.26.self_attn*",
|
| 288 |
+
"model.layers.26.self_attn.indexer*",
|
| 289 |
+
"model.layers.27.self_attn*",
|
| 290 |
+
"model.layers.27.self_attn.indexer*",
|
| 291 |
+
"model.layers.28.self_attn*",
|
| 292 |
+
"model.layers.28.self_attn.indexer*",
|
| 293 |
+
"model.layers.29.self_attn*",
|
| 294 |
+
"model.layers.29.self_attn.indexer*",
|
| 295 |
+
"model.layers.3.self_attn*",
|
| 296 |
+
"model.layers.3.self_attn.indexer*",
|
| 297 |
+
"model.layers.30.self_attn*",
|
| 298 |
+
"model.layers.30.self_attn.indexer*",
|
| 299 |
+
"model.layers.31.self_attn*",
|
| 300 |
+
"model.layers.31.self_attn.indexer*",
|
| 301 |
+
"model.layers.32.self_attn*",
|
| 302 |
+
"model.layers.32.self_attn.indexer*",
|
| 303 |
+
"model.layers.33.self_attn*",
|
| 304 |
+
"model.layers.33.self_attn.indexer*",
|
| 305 |
+
"model.layers.34.self_attn*",
|
| 306 |
+
"model.layers.34.self_attn.indexer*",
|
| 307 |
+
"model.layers.35.self_attn*",
|
| 308 |
+
"model.layers.35.self_attn.indexer*",
|
| 309 |
+
"model.layers.36.self_attn*",
|
| 310 |
+
"model.layers.36.self_attn.indexer*",
|
| 311 |
+
"model.layers.37.self_attn*",
|
| 312 |
+
"model.layers.37.self_attn.indexer*",
|
| 313 |
+
"model.layers.38.self_attn*",
|
| 314 |
+
"model.layers.38.self_attn.indexer*",
|
| 315 |
+
"model.layers.39.self_attn*",
|
| 316 |
+
"model.layers.39.self_attn.indexer*",
|
| 317 |
+
"model.layers.4.self_attn*",
|
| 318 |
+
"model.layers.4.self_attn.indexer*",
|
| 319 |
+
"model.layers.40.self_attn*",
|
| 320 |
+
"model.layers.40.self_attn.indexer*",
|
| 321 |
+
"model.layers.41.self_attn*",
|
| 322 |
+
"model.layers.41.self_attn.indexer*",
|
| 323 |
+
"model.layers.42.self_attn*",
|
| 324 |
+
"model.layers.42.self_attn.indexer*",
|
| 325 |
+
"model.layers.43.self_attn*",
|
| 326 |
+
"model.layers.43.self_attn.indexer*",
|
| 327 |
+
"model.layers.44.self_attn*",
|
| 328 |
+
"model.layers.44.self_attn.indexer*",
|
| 329 |
+
"model.layers.45.self_attn*",
|
| 330 |
+
"model.layers.45.self_attn.indexer*",
|
| 331 |
+
"model.layers.46.self_attn*",
|
| 332 |
+
"model.layers.46.self_attn.indexer*",
|
| 333 |
+
"model.layers.47.self_attn*",
|
| 334 |
+
"model.layers.47.self_attn.indexer*",
|
| 335 |
+
"model.layers.48.self_attn*",
|
| 336 |
+
"model.layers.48.self_attn.indexer*",
|
| 337 |
+
"model.layers.49.self_attn*",
|
| 338 |
+
"model.layers.49.self_attn.indexer*",
|
| 339 |
+
"model.layers.5.self_attn*",
|
| 340 |
+
"model.layers.5.self_attn.indexer*",
|
| 341 |
+
"model.layers.50.self_attn*",
|
| 342 |
+
"model.layers.50.self_attn.indexer*",
|
| 343 |
+
"model.layers.51.self_attn*",
|
| 344 |
+
"model.layers.51.self_attn.indexer*",
|
| 345 |
+
"model.layers.52.self_attn*",
|
| 346 |
+
"model.layers.52.self_attn.indexer*",
|
| 347 |
+
"model.layers.53.self_attn*",
|
| 348 |
+
"model.layers.53.self_attn.indexer*",
|
| 349 |
+
"model.layers.54.self_attn*",
|
| 350 |
+
"model.layers.54.self_attn.indexer*",
|
| 351 |
+
"model.layers.55.self_attn*",
|
| 352 |
+
"model.layers.55.self_attn.indexer*",
|
| 353 |
+
"model.layers.56.self_attn*",
|
| 354 |
+
"model.layers.56.self_attn.indexer*",
|
| 355 |
+
"model.layers.57.self_attn*",
|
| 356 |
+
"model.layers.57.self_attn.indexer*",
|
| 357 |
+
"model.layers.58.self_attn*",
|
| 358 |
+
"model.layers.58.self_attn.indexer*",
|
| 359 |
+
"model.layers.59.self_attn*",
|
| 360 |
+
"model.layers.59.self_attn.indexer*",
|
| 361 |
+
"model.layers.6.self_attn*",
|
| 362 |
+
"model.layers.6.self_attn.indexer*",
|
| 363 |
+
"model.layers.60.self_attn*",
|
| 364 |
+
"model.layers.60.self_attn.indexer*",
|
| 365 |
+
"model.layers.61.self_attn*",
|
| 366 |
+
"model.layers.61.self_attn.indexer*",
|
| 367 |
+
"model.layers.62.self_attn*",
|
| 368 |
+
"model.layers.62.self_attn.indexer*",
|
| 369 |
+
"model.layers.63.self_attn*",
|
| 370 |
+
"model.layers.63.self_attn.indexer*",
|
| 371 |
+
"model.layers.64.self_attn*",
|
| 372 |
+
"model.layers.64.self_attn.indexer*",
|
| 373 |
+
"model.layers.65.self_attn*",
|
| 374 |
+
"model.layers.65.self_attn.indexer*",
|
| 375 |
+
"model.layers.66.self_attn*",
|
| 376 |
+
"model.layers.66.self_attn.indexer*",
|
| 377 |
+
"model.layers.67.self_attn*",
|
| 378 |
+
"model.layers.67.self_attn.indexer*",
|
| 379 |
+
"model.layers.68.self_attn*",
|
| 380 |
+
"model.layers.68.self_attn.indexer*",
|
| 381 |
+
"model.layers.69.self_attn*",
|
| 382 |
+
"model.layers.69.self_attn.indexer*",
|
| 383 |
+
"model.layers.7.self_attn*",
|
| 384 |
+
"model.layers.7.self_attn.indexer*",
|
| 385 |
+
"model.layers.70.self_attn*",
|
| 386 |
+
"model.layers.70.self_attn.indexer*",
|
| 387 |
+
"model.layers.71.self_attn*",
|
| 388 |
+
"model.layers.71.self_attn.indexer*",
|
| 389 |
+
"model.layers.72.self_attn*",
|
| 390 |
+
"model.layers.72.self_attn.indexer*",
|
| 391 |
+
"model.layers.73.self_attn*",
|
| 392 |
+
"model.layers.73.self_attn.indexer*",
|
| 393 |
+
"model.layers.74.self_attn*",
|
| 394 |
+
"model.layers.74.self_attn.indexer*",
|
| 395 |
+
"model.layers.75.self_attn*",
|
| 396 |
+
"model.layers.75.self_attn.indexer*",
|
| 397 |
+
"model.layers.76.self_attn*",
|
| 398 |
+
"model.layers.76.self_attn.indexer*",
|
| 399 |
+
"model.layers.77.self_attn*",
|
| 400 |
+
"model.layers.77.self_attn.indexer*",
|
| 401 |
+
"model.layers.8.self_attn*",
|
| 402 |
+
"model.layers.8.self_attn.indexer*",
|
| 403 |
+
"model.layers.9.self_attn*",
|
| 404 |
+
"model.layers.9.self_attn.indexer*",
|
| 405 |
+
"model.layers.78.eh_proj*",
|
| 406 |
+
"model.layers.78.self_attn*",
|
| 407 |
+
"model.layers.78.self_attn.indexer*",
|
| 408 |
+
"model.layers.78.mlp.gate*",
|
| 409 |
+
"model.layers.78.mlp.shared_experts*",
|
| 410 |
+
"*embed_tokens*",
|
| 411 |
+
"*shared_head*",
|
| 412 |
+
"*mtp_block.self_attn*",
|
| 413 |
+
"*mtp_block.mlp.gate",
|
| 414 |
+
"*eh_proj*",
|
| 415 |
+
"*enorm*",
|
| 416 |
+
"*hnorm*"
|
| 417 |
+
],
|
| 418 |
+
"quant_algo": "NVFP4",
|
| 419 |
+
"producer": {
|
| 420 |
+
"name": "modelopt",
|
| 421 |
+
"version": "0.39.0.dev290+gf9d9a71de.d20260214"
|
| 422 |
+
},
|
| 423 |
+
"quant_method": "modelopt"
|
| 424 |
+
}
|
| 425 |
+
}
|
mtp-draft/model-mtp-inputscales.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b324090fb2ae84803015c454e6161b7da802b1fb6a16b89e8fa79f3f9767762f
|
| 3 |
+
size 86168
|
mtp-draft/model-mtp.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0ade0e3da08e7e6c7b1f20e4c4e8d5d3b26b81103cea22f2ead9909c7d3d0732
|
| 3 |
+
size 6014594896
|
mtp-draft/model.safetensors.index.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
recipe.yaml
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
default_stage:
|
| 2 |
+
default_modifiers:
|
| 3 |
+
QuantizationModifier:
|
| 4 |
+
config_groups:
|
| 5 |
+
attention_shared_experts:
|
| 6 |
+
targets: ['re:.*self_attn\..*']
|
| 7 |
+
weights:
|
| 8 |
+
num_bits: 8
|
| 9 |
+
type: float
|
| 10 |
+
symmetric: true
|
| 11 |
+
group_size: null
|
| 12 |
+
strategy: block
|
| 13 |
+
block_structure: [128, 128]
|
| 14 |
+
dynamic: false
|
| 15 |
+
actorder: null
|
| 16 |
+
scale_dtype: null
|
| 17 |
+
zp_dtype: null
|
| 18 |
+
observer: memoryless_minmax
|
| 19 |
+
observer_kwargs: {}
|
| 20 |
+
input_activations:
|
| 21 |
+
num_bits: 8
|
| 22 |
+
type: float
|
| 23 |
+
symmetric: true
|
| 24 |
+
group_size: 128
|
| 25 |
+
strategy: group
|
| 26 |
+
block_structure: null
|
| 27 |
+
dynamic: true
|
| 28 |
+
actorder: null
|
| 29 |
+
scale_dtype: null
|
| 30 |
+
zp_dtype: null
|
| 31 |
+
observer: null
|
| 32 |
+
observer_kwargs: {}
|
| 33 |
+
output_activations: null
|
| 34 |
+
format: null
|
| 35 |
+
dense_mlp:
|
| 36 |
+
targets: ['re:.*\.mlp\.(gate_proj|up_proj|down_proj)$']
|
| 37 |
+
weights:
|
| 38 |
+
num_bits: 4
|
| 39 |
+
type: float
|
| 40 |
+
symmetric: true
|
| 41 |
+
group_size: 16
|
| 42 |
+
strategy: tensor_group
|
| 43 |
+
block_structure: null
|
| 44 |
+
dynamic: false
|
| 45 |
+
actorder: null
|
| 46 |
+
scale_dtype: torch.float8_e4m3fn
|
| 47 |
+
zp_dtype: null
|
| 48 |
+
observer: memoryless_minmax
|
| 49 |
+
observer_kwargs: {}
|
| 50 |
+
input_activations:
|
| 51 |
+
num_bits: 4
|
| 52 |
+
type: float
|
| 53 |
+
symmetric: true
|
| 54 |
+
group_size: 16
|
| 55 |
+
strategy: tensor_group
|
| 56 |
+
block_structure: null
|
| 57 |
+
dynamic: local
|
| 58 |
+
actorder: null
|
| 59 |
+
scale_dtype: torch.float8_e4m3fn
|
| 60 |
+
zp_dtype: null
|
| 61 |
+
observer: static_minmax
|
| 62 |
+
observer_kwargs: {}
|
| 63 |
+
output_activations: null
|
| 64 |
+
format: null
|
| 65 |
+
# v2: shared experts re-quantized to block-FP8 (from BF16), was NVFP4 in v1
|
| 66 |
+
shared_experts_fp8:
|
| 67 |
+
targets: ['re:.*\.mlp\.shared_experts\.(gate_proj|up_proj|down_proj)$']
|
| 68 |
+
weights:
|
| 69 |
+
num_bits: 8
|
| 70 |
+
type: float
|
| 71 |
+
symmetric: true
|
| 72 |
+
group_size: null
|
| 73 |
+
strategy: block
|
| 74 |
+
block_structure: [128, 128]
|
| 75 |
+
dynamic: false
|
| 76 |
+
actorder: null
|
| 77 |
+
scale_dtype: null
|
| 78 |
+
zp_dtype: null
|
| 79 |
+
observer: memoryless_minmax
|
| 80 |
+
observer_kwargs: {}
|
| 81 |
+
input_activations:
|
| 82 |
+
num_bits: 8
|
| 83 |
+
type: float
|
| 84 |
+
symmetric: true
|
| 85 |
+
group_size: 128
|
| 86 |
+
strategy: group
|
| 87 |
+
block_structure: null
|
| 88 |
+
dynamic: true
|
| 89 |
+
actorder: null
|
| 90 |
+
scale_dtype: null
|
| 91 |
+
zp_dtype: null
|
| 92 |
+
observer: null
|
| 93 |
+
observer_kwargs: {}
|
| 94 |
+
output_activations: null
|
| 95 |
+
format: null
|
| 96 |
+
targets: [Linear]
|
| 97 |
+
ignore: ['re:^model\.layers\.[0-2]\..*re:.*mlp\.gate.*', 're:.*indexer\.weights_proj$',
|
| 98 |
+
lm_head]
|
| 99 |
+
bypass_divisibility_checks: false
|
tokenizer.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:19e773648cb4e65de8660ea6365e10acca112d42a854923df93db4a6f333a82d
|
| 3 |
+
size 20217442
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"backend": "tokenizers",
|
| 3 |
+
"clean_up_tokenization_spaces": false,
|
| 4 |
+
"do_lower_case": false,
|
| 5 |
+
"eos_token": "<|endoftext|>",
|
| 6 |
+
"extra_special_tokens": [
|
| 7 |
+
"<|endoftext|>",
|
| 8 |
+
"[MASK]",
|
| 9 |
+
"[gMASK]",
|
| 10 |
+
"[sMASK]",
|
| 11 |
+
"<sop>",
|
| 12 |
+
"<eop>",
|
| 13 |
+
"<|system|>",
|
| 14 |
+
"<|user|>",
|
| 15 |
+
"<|assistant|>",
|
| 16 |
+
"<|observation|>",
|
| 17 |
+
"<|begin_of_image|>",
|
| 18 |
+
"<|end_of_image|>",
|
| 19 |
+
"<|begin_of_video|>",
|
| 20 |
+
"<|end_of_video|>",
|
| 21 |
+
"<|begin_of_audio|>",
|
| 22 |
+
"<|end_of_audio|>",
|
| 23 |
+
"<|begin_of_transcription|>",
|
| 24 |
+
"<|end_of_transcription|>"
|
| 25 |
+
],
|
| 26 |
+
"is_local": false,
|
| 27 |
+
"local_files_only": false,
|
| 28 |
+
"model_max_length": 1048576,
|
| 29 |
+
"model_specific_special_tokens": {},
|
| 30 |
+
"pad_token": "<|endoftext|>",
|
| 31 |
+
"padding_side": "left",
|
| 32 |
+
"remove_space": false,
|
| 33 |
+
"tokenizer_class": "TokenizersBackend"
|
| 34 |
+
}
|
vllm_overlay/INSTALL.md
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Loading this checkpoint in vLLM
|
| 2 |
+
|
| 3 |
+
Two small extensions are required (tested on vLLM ~0.11.x lineages that have
|
| 4 |
+
`Mxfp4Config` with a MoE method and `CompressedTensorsConfig`).
|
| 5 |
+
|
| 6 |
+
## 1. Register the hybrid quant config
|
| 7 |
+
|
| 8 |
+
Copy `hybrid_mxfp4_ct.py` into
|
| 9 |
+
`vllm/model_executor/layers/quantization/hybrid_mxfp4_ct.py`
|
| 10 |
+
and add one import at the END of that package's `__init__.py`:
|
| 11 |
+
|
| 12 |
+
```python
|
| 13 |
+
from . import hybrid_mxfp4_ct # noqa: F401
|
| 14 |
+
```
|
| 15 |
+
|
| 16 |
+
(Or import it from any plugin/startup hook that runs before engine init —
|
| 17 |
+
`@register_quantization_config` does the rest.)
|
| 18 |
+
|
| 19 |
+
## 2. Index-authoritative tensor filter (required)
|
| 20 |
+
|
| 21 |
+
This checkpoint's MXFP4 expert shard files also contain BF16 dense tensors that
|
| 22 |
+
`model.safetensors.index.json` deliberately maps to the `hybrid-ct-*.safetensors`
|
| 23 |
+
files instead. vLLM's safetensors iterator yields every tensor in every file it
|
| 24 |
+
opens, which would KeyError on the duplicates — it must skip tensors the index
|
| 25 |
+
maps elsewhere. In `vllm/model_executor/model_loader/weight_utils.py`, inside
|
| 26 |
+
`safetensors_weights_iterator(...)` after the files list is built:
|
| 27 |
+
|
| 28 |
+
```python
|
| 29 |
+
# Build {file -> allowed tensor names} from the index (no-op for normal
|
| 30 |
+
# checkpoints, where every in-file tensor maps to its own file).
|
| 31 |
+
_allowed_by_file = None
|
| 32 |
+
if sorted_files:
|
| 33 |
+
_idx = os.path.join(os.path.dirname(sorted_files[0]),
|
| 34 |
+
"model.safetensors.index.json")
|
| 35 |
+
if os.path.isfile(_idx):
|
| 36 |
+
try:
|
| 37 |
+
with open(_idx) as fh:
|
| 38 |
+
_wm = json.load(fh)["weight_map"]
|
| 39 |
+
_allowed_by_file = {}
|
| 40 |
+
for _n, _f in _wm.items():
|
| 41 |
+
_allowed_by_file.setdefault(_f, set()).add(_n)
|
| 42 |
+
except Exception:
|
| 43 |
+
_allowed_by_file = None
|
| 44 |
+
|
| 45 |
+
def _index_excludes(st_file, name):
|
| 46 |
+
if _allowed_by_file is None:
|
| 47 |
+
return False
|
| 48 |
+
return name not in _allowed_by_file.get(os.path.basename(st_file), ())
|
| 49 |
+
```
|
| 50 |
+
|
| 51 |
+
then, in the per-tensor loop(s), first thing:
|
| 52 |
+
|
| 53 |
+
```python
|
| 54 |
+
if _index_excludes(st_file, name):
|
| 55 |
+
continue
|
| 56 |
+
```
|
| 57 |
+
|
| 58 |
+
## 3. Serve
|
| 59 |
+
|
| 60 |
+
```bash
|
| 61 |
+
vllm serve /path/to/this/repo --trust-remote-code --tensor-parallel-size 4 \
|
| 62 |
+
--kv-cache-dtype fp8
|
| 63 |
+
```
|
| 64 |
+
|
| 65 |
+
Notes:
|
| 66 |
+
- The MoE path needs an MXFP4-capable MoE backend. Verified end-to-end with the
|
| 67 |
+
B12X backend on GB10/SM121 (`VLLM_USE_B12X_MOE=1`); other backends untested.
|
| 68 |
+
- Speculative decoding: the checkpoint carries its native layer-78 MTP block
|
| 69 |
+
(MXFP4 draft experts). Enable with your usual `--speculative-config`.
|
| 70 |
+
- Expert `weight_scale` tensors are raw **uint8** e8m0 bytes — if your loader
|
| 71 |
+
casts scales by dtype, ensure it treats them as uint8 (a float cast corrupts).
|
vllm_overlay/hybrid_mxfp4_ct.py
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# SPDX-License-Identifier: Apache-2.0
|
| 2 |
+
"""Hybrid quantization config: festr2 MXFP4 routed experts + RedHat
|
| 3 |
+
compressed-tensors (block-FP8 self_attn / NVFP4 mlp+shared) everything-else,
|
| 4 |
+
in one GLM-5.2 checkpoint.
|
| 5 |
+
|
| 6 |
+
Selected when config.json declares quant_method: "hybrid_mxfp4_ct".
|
| 7 |
+
Mounted at vllm/model_executor/layers/quantization/hybrid_mxfp4_ct.py, imported
|
| 8 |
+
via a 2-line append to that package's __init__ overlay.
|
| 9 |
+
|
| 10 |
+
Design (verified against production-3.75 sources):
|
| 11 |
+
- RoutedExperts -> Mxfp4Config.get_quant_method -> Mxfp4MoEMethod (b12x
|
| 12 |
+
fp4_e8m0_k32 kernel via VLLM_USE_B12X_MOE, backend auto).
|
| 13 |
+
- Everything else (LinearBase incl. MLA projections, Attention KV method,
|
| 14 |
+
dense/shared mlp) -> CompressedTensorsConfig, fed RedHat's verbatim
|
| 15 |
+
quantization_config as the "linear" sub-dict.
|
| 16 |
+
- Branch order matters: intercept RoutedExperts BEFORE delegating, else the CT
|
| 17 |
+
half would claim the MoE and build an NVFP4 MoE method.
|
| 18 |
+
"""
|
| 19 |
+
|
| 20 |
+
import torch
|
| 21 |
+
|
| 22 |
+
from vllm.model_executor.layers.quantization import register_quantization_config
|
| 23 |
+
from vllm.model_executor.layers.quantization.base_config import QuantizationConfig
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+
def _routed_experts_cls():
|
| 27 |
+
# Lazy import (avoid import cycles at package-init time).
|
| 28 |
+
from vllm.model_executor.layers.fused_moe import RoutedExperts
|
| 29 |
+
return RoutedExperts
|
| 30 |
+
|
| 31 |
+
|
| 32 |
+
@register_quantization_config("hybrid_mxfp4_ct")
|
| 33 |
+
class HybridMxfp4CtConfig(QuantizationConfig):
|
| 34 |
+
"""Compose Mxfp4 (routed experts) with compressed-tensors (the rest)."""
|
| 35 |
+
|
| 36 |
+
def __init__(self, moe, linear):
|
| 37 |
+
super().__init__()
|
| 38 |
+
self.moe = moe
|
| 39 |
+
self.linear = linear
|
| 40 |
+
|
| 41 |
+
@classmethod
|
| 42 |
+
def get_name(cls) -> str:
|
| 43 |
+
return "hybrid_mxfp4_ct"
|
| 44 |
+
|
| 45 |
+
@classmethod
|
| 46 |
+
def get_min_capability(cls) -> int:
|
| 47 |
+
return 80 # mxfp4 floor; CT is lower
|
| 48 |
+
|
| 49 |
+
def get_supported_act_dtypes(self):
|
| 50 |
+
return [torch.bfloat16]
|
| 51 |
+
|
| 52 |
+
@classmethod
|
| 53 |
+
def get_config_filenames(cls):
|
| 54 |
+
return []
|
| 55 |
+
|
| 56 |
+
def is_mxfp4_quant(self, prefix, layer):
|
| 57 |
+
# hidden-size rounding helpers treat MoE as mxfp4
|
| 58 |
+
return isinstance(layer, _routed_experts_cls())
|
| 59 |
+
|
| 60 |
+
@classmethod
|
| 61 |
+
def from_config(cls, config):
|
| 62 |
+
from vllm.model_executor.layers.quantization.mxfp4 import Mxfp4Config
|
| 63 |
+
from vllm.model_executor.layers.quantization.compressed_tensors.compressed_tensors import ( # noqa: E501
|
| 64 |
+
CompressedTensorsConfig,
|
| 65 |
+
)
|
| 66 |
+
|
| 67 |
+
moe = Mxfp4Config.from_config(config.get("moe", {}))
|
| 68 |
+
lin_cfg = dict(config["linear"])
|
| 69 |
+
# CT head-piping is skipped when top-level quant_method != CT
|
| 70 |
+
# (weight_utils.py:259-274); forward head counts defensively.
|
| 71 |
+
for k in ("total_num_heads", "total_num_kv_heads"):
|
| 72 |
+
if k in config:
|
| 73 |
+
lin_cfg.setdefault(k, config[k])
|
| 74 |
+
return cls(moe, CompressedTensorsConfig.from_config(lin_cfg))
|
| 75 |
+
|
| 76 |
+
def get_quant_method(self, layer, prefix):
|
| 77 |
+
# Propagate the model-supplied fused-module map to both halves.
|
| 78 |
+
self.moe.packed_modules_mapping = self.packed_modules_mapping
|
| 79 |
+
self.linear.packed_modules_mapping = self.packed_modules_mapping
|
| 80 |
+
if isinstance(layer, _routed_experts_cls()):
|
| 81 |
+
return self.moe.get_quant_method(layer, prefix)
|
| 82 |
+
return self.linear.get_quant_method(layer, prefix)
|
| 83 |
+
|
| 84 |
+
def apply_vllm_mapper(self, hf_to_vllm_mapper):
|
| 85 |
+
# Keep CT target/ignore remapping intact.
|
| 86 |
+
self.linear.apply_vllm_mapper(hf_to_vllm_mapper)
|