nameistoken commited on
Commit
87bd574
·
verified ·
1 Parent(s): d52cd35

Add files using upload-large-folder tool

Browse files
.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,202 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright 2026 Alibaba Cloud
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
NOTICE ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Qwen3.6-35B-A3B-Quark-W8A8-INT8
2
+ Copyright (c) 2025-2026 Qwen Team, Alibaba Cloud
3
+
4
+ Original model weights: https://huggingface.co/Qwen/Qwen3.6-35B-A3B
5
+ Distributed by Alibaba Cloud under the Apache License, Version 2.0.
6
+
7
+ This repository contains a derivative work: an INT8 W8A8 post-training
8
+ quantized version of the above model, produced with AMD Quark
9
+ (https://github.com/amd/quark). The original BF16 language-tower weights have
10
+ been transformed into INT8 per-channel weights with per-token dynamic INT8
11
+ activations. The embeddings, lm_head, MoE router (mlp.gate), per-layer
12
+ shared_expert_gate, the entire 27-block ViT vision tower, and the MTP head
13
+ all remain in BF16.
14
+
15
+ Modifications made:
16
+
17
+ - Qwen3_5MoeExperts fused gate_up_proj / down_proj tensors were split
18
+ in-place into ModuleList[256] of per-expert nn.Linear triplets so they
19
+ could be observed by Quark; the resulting key layout is bit-compatible
20
+ with vLLM's FusedMoE.make_expert_params_mapping (no loader changes).
21
+ - Linear weights of the language tower were converted from BF16 to INT8
22
+ with per-output-channel symmetric scales. Activations use per-token
23
+ symmetric dynamic INT8 at runtime.
24
+ - A quantization_config block was appended to config.json
25
+ (quant_method='quark', custom_mode='quark', pack_method='order',
26
+ weight_format='real_quantized').
27
+ - Quark-native quantizer key names were renamed to the vLLM/HF-standard
28
+ layout:
29
+ * *_quantizer.scale -> *_scale
30
+ * *_quantizer.zero_point -> dropped (symmetric quantization)
31
+ * weight_scale squeezed from shape [out, 1] to [out].
32
+ - Shards were re-packed into 7 x ~5 GB files with a matching
33
+ model.safetensors.index.json.
34
+ - All tokenizer / preprocessor / chat_template / generation_config files
35
+ are byte-identical to the upstream Qwen/Qwen3.6-35B-A3B release.
36
+
37
+ The license, attribution and disclaimer-of-warranty terms of the upstream
38
+ Apache-2.0 license (see LICENSE) apply to both the original work and this
39
+ derivative.
README.md ADDED
@@ -0,0 +1,215 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ license_link: https://huggingface.co/Qwen/Qwen3.6-35B-A3B/blob/main/LICENSE
4
+ library_name: transformers
5
+ language:
6
+ - en
7
+ pipeline_tag: image-text-to-text
8
+ base_model: Qwen/Qwen3.6-35B-A3B
9
+ tags:
10
+ - qwen3_5_moe
11
+ - moe
12
+ - mixture-of-experts
13
+ - quantized
14
+ - int8
15
+ - w8a8
16
+ - quark
17
+ - vllm
18
+ - conversational
19
+ - text-generation-inference
20
+ - image-text-to-text
21
+ ---
22
+
23
+ # Qwen3.6-35B-A3B-Quark-W8A8-INT8
24
+
25
+ W8A8 INT8 quantized version of [Qwen/Qwen3.6-35B-A3B](https://huggingface.co/Qwen/Qwen3.6-35B-A3B) produced with [AMD Quark](https://github.com/amd/quark).
26
+
27
+ ## Model Details
28
+
29
+ | | |
30
+ |--------------------|-------------------------------------------------------------------------------------|
31
+ | Base Model | `Qwen/Qwen3.6-35B-A3B` |
32
+ | Architecture | `Qwen3_5MoeForConditionalGeneration` (multimodal: ViT vision + text MoE + MTP head) |
33
+ | Parameters | 35B total / 3B activated per token (256 experts, top-8) + 27-block ViT (BF16) |
34
+ | Quantization | W8A8 INT8 — per-channel weight + per-token dynamic activation |
35
+ | Quantizer | AMD Quark `0.11.1` (`pack_method='order'`, `weight_format='real_quantized'`) |
36
+ | Model Size | ~35 GB (7 shards of ~5 GB) |
37
+ | Original Size | ~67 GB (BF16, 26 shards) |
38
+ | Compression | ~1.93× size reduction |
39
+
40
+ ### Quantization Scheme
41
+
42
+ | Component | dtype | Granularity | Mode |
43
+ |---------------------------------------------------------|-------|-----------------------------|---------------------|
44
+ | Language attention (`q/k/v/o_proj`, `linear_attn.*`) | INT8 | per-channel weight (axis=0) | weight static |
45
+ | Language MoE experts (256 × `gate/up/down_proj` × 40) | INT8 | per-channel weight (axis=0) | weight static |
46
+ | `shared_expert` (`gate/up/down_proj`) | INT8 | per-channel weight (axis=0) | weight static |
47
+ | All activations above | INT8 | per-token (axis=1) | **dynamic** |
48
+ | `lm_head` | BF16 | — | unquantized |
49
+ | `embed_tokens` | BF16 | — | unquantized |
50
+ | MoE router (`mlp.gate`) — top-k gate | BF16 | — | unquantized |
51
+ | `shared_expert_gate` | BF16 | — | unquantized |
52
+ | `visual.*` (27-block ViT + merger) | BF16 | — | unquantized |
53
+ | MTP head | BF16 | — | unquantized |
54
+
55
+ > **Note**: MoE experts are stored as 256 per-expert `nn.Linear` triplets (`gate_proj/up_proj/down_proj`) instead of the upstream fused `gate_up_proj` tensor. This is required so that Quark observers can attach to each expert as a standard `nn.Linear`, and the key layout matches vLLM's `FusedMoE.make_expert_params_mapping` exactly — no loader-side change needed.
56
+
57
+ ## Accuracy
58
+
59
+ GSM8K full **1319**-question test split, served under vLLM, `/v1/chat/completions` with `chat_template_kwargs.enable_thinking=false`, `temperature=0`, `concurrency=16`, `max_tokens=1024`.
60
+
61
+ | Model | Accuracy | Correct |
62
+ |------------------------------------------|------------:|-------------:|
63
+ | `Qwen/Qwen3.6-35B-A3B` (BF16 baseline) | **95.91 %** | 1265 / 1319 |
64
+ | **This model (Quark W8A8 INT8)** | **95.91 %** | 1265 / 1319 |
65
+
66
+ **Δ vs BF16 = 0.00 pp.** The two result sets overlap on 1250 / 1280 questions (Jaccard = 0.9766); each side wins 15 problems the other loses — no systematic regression.
67
+
68
+ Both runs were done on a single AMD MI355X (288 GB HBM3e) at `gpu_memory_utilization=0.55` (BF16) / `0.85` (INT8), `max_model_len=4096`.
69
+
70
+ ## Performance
71
+
72
+ Measured on a single AMD **Radeon 8060S APU (gfx1151, "Strix Halo")** with 128 GB LPDDR5X-8000 unified memory, container `kyuz0/vllm-therock-gfx1151:stable` (vLLM `0.19.2rc1.dev113+g6aa057c9d`, transformers `5.5.4`), TP=1, KV cache BF16 (gfx1151 has no INT8 matrix core).
73
+
74
+ ### Long context — `input=4000 / output=200`, `num_prompts = C * 3`
75
+
76
+ `--max-model-len 4096 --gpu-memory-utilization 0.85`. BF16 baseline is the upstream Qwen3.6-35B-A3B (~67 GB weights).
77
+
78
+ | Concurrency | BF16 req/s | BF16 out tok/s | Quark W8A8 req/s | Quark W8A8 out tok/s | W8A8 / BF16 |
79
+ |------------:|-----------:|---------------:|-----------------:|---------------------:|:-----------:|
80
+ | 1 | 0.044 | 8.83 | **0.060** | **12.02** | **+36%** |
81
+ | 5 | 0.093 | 18.58 | **0.142** | **28.31** | **+52%** |
82
+ | 10 | 0.128 | 25.58 | **0.186** | **37.30** | **+46%** |
83
+ | 20 | 0.163 | 32.53 | **0.240** | **47.98** | **+48%** |
84
+
85
+ ### Short context — `input=512 / output=128`, `--ignore-eos`, bs = num_prompts
86
+
87
+ Typical chat / decode-bound workload:
88
+
89
+ | Batch size | BF16 out tok/s | Quark W8A8 out tok/s | W8A8 / BF16 |
90
+ |-----------:|---------------:|---------------------:|:-----------:|
91
+ | 1 | 13.36 | **17.43** | **+30%** |
92
+ | 8 | 36.47 | **64.91** | **+78%** |
93
+ | 16 | 61.16 | **92.04** | **+50%** |
94
+
95
+ ### Takeaways
96
+
97
+ - **Quark W8A8 beats BF16 at every concurrency we measured on gfx1151**, by +30–78 %. The gfx1151 APU has no INT8 matrix core, so the gain comes from the ~2× smaller weight footprint cutting memory-bandwidth pressure (LPDDR5X is the dominant bottleneck on Strix Halo).
98
+ - **Decode-bound / short-context is where W8A8 shines the most**: at 512 in / 128 out, bs=8 → +78 %. Prefill-heavy long contexts still benefit, just less dramatically.
99
+ - **Fits in unified memory with headroom**: the packed INT8 model is ~35 GB vs ~67 GB BF16, so KV cache and weights no longer compete on a 128 GB Strix Halo box (the BF16 build hit a scheduler regression around C=100 where TTFT blew up to ~187 s — W8A8 avoids that class of pressure entirely).
100
+
101
+ ## How to Use
102
+
103
+ ### With vLLM (Recommended)
104
+
105
+ ```bash
106
+ vllm serve /path/to/Qwen3.6-35B-A3B-Quark-W8A8-INT8 \
107
+ --served-model-name Qwen3.6-35B-A3B-W8A8 \
108
+ --tensor-parallel-size 1 \
109
+ --max-model-len 4096 \
110
+ --gpu-memory-utilization 0.85 \
111
+ --trust-remote-code \
112
+ --port 8000
113
+
114
+ curl http://localhost:8000/v1/chat/completions \
115
+ -H 'Content-Type: application/json' \
116
+ -d '{
117
+ "model": "Qwen3.6-35B-A3B-W8A8",
118
+ "messages": [{"role":"user","content":"Solve: 16 - 3 - 4 = ?"}],
119
+ "max_tokens": 256, "temperature": 0.7,
120
+ "chat_template_kwargs": {"enable_thinking": false}
121
+ }'
122
+ ```
123
+
124
+ - vLLM ≥ `0.19.2rc1` with the `qwen3_5_moe` registration is required.
125
+ - The Qwen3.6 default chat template wraps the response in `<think>...</think>`; pass `enable_thinking=false` if you want the short form.
126
+
127
+ ### Hardware Requirements
128
+
129
+ - **Minimum VRAM**: ~40 GB free for model weights + KV cache, i.e. a single MI300X / MI355X / H100-80G / A100-80G.
130
+ - Can fit on a consumer-class 48 GB card (e.g. W7900D) at `max_model_len` ≤ 4096, whereas the BF16 original (~68 GB of weights) cannot.
131
+
132
+ ## Quantization Details
133
+
134
+ ### Excluded layers (kept BF16)
135
+
136
+ - `lm_head`
137
+ - `model.language_model.layers.*.mlp.shared_expert_gate` (40 × single-output gate)
138
+ - `model.visual.pos_embed`, `model.visual.blocks.*.attn.{qkv,proj}`, `model.visual.blocks.*.mlp.linear_fc{1,2}`, `model.visual.merger.linear_fc{1,2}` (full 27-block ViT + merger)
139
+ - `model.embed_tokens` (not an `nn.Linear`; naturally not touched)
140
+ - MoE top-k router `mlp.gate` — kept BF16 via the custom MoE rewrite (see below)
141
+ - MTP head — kept BF16
142
+
143
+ ### Pre-quantization rewrite
144
+
145
+ The upstream `Qwen3_5MoeExperts` module stores 256 experts as a single fused 3-D tensor (`gate_up_proj: [E, 2·I, H]`, `down_proj: [E, H, I]`). Before quantization this is split in-place into `ModuleList[256]` of three `nn.Linear`s per expert, following the SwiGLU `chunk(2, dim=-1)` semantics (front half = `gate`, back half = `up`). This makes every expert visible to Quark as a standard `nn.Linear`, and the resulting key layout is bit-compatible with vLLM's fused MoE loader.
146
+
147
+ ### Post-export rename
148
+
149
+ Quark's native `custom_mode='quark'` export emits `*_quantizer.scale` / `*_quantizer.zero_point` keys. The published shards here have already been converted to the vLLM/HF-compatible layout:
150
+
151
+ - `*_quantizer.scale` → `*_scale`
152
+ - `*_quantizer.zero_point` → dropped (symmetric quant)
153
+ - `weight_scale` squeezed from `[out, 1]` to `[out]`
154
+
155
+ ### Reproduce
156
+
157
+ A full walkthrough (Docker image, Quark config, MoE split, post-export rename, vLLM serve, GSM8K eval) is documented at <https://github.com/JoursBleu/docs/blob/master/qwen3.5/Qwen3.6-35B-A3B_Quark_W8A8_quantization_guide.md>.
158
+
159
+ Core Quark config fragment:
160
+
161
+ ```python
162
+ from quark.torch.quantization.config.config import (
163
+ QTensorConfig, QuantizationConfig, Config, Dtype,
164
+ )
165
+ from quark.torch.quantization.config.type import (
166
+ RoundType, ScaleType, QSchemeType,
167
+ )
168
+ from quark.torch.quantization.observer import PerChannelMinMaxObserver
169
+
170
+ weight = QTensorConfig(
171
+ dtype=Dtype.int8, observer_cls=PerChannelMinMaxObserver,
172
+ symmetric=True, is_dynamic=False,
173
+ qscheme=QSchemeType.per_channel, ch_axis=0,
174
+ round_method=RoundType.round, scale_type=ScaleType.float,
175
+ )
176
+ act = QTensorConfig(
177
+ dtype=Dtype.int8, observer_cls=PerChannelMinMaxObserver,
178
+ symmetric=True, is_dynamic=True,
179
+ qscheme=QSchemeType.per_channel, ch_axis=1,
180
+ round_method=RoundType.round, scale_type=ScaleType.float,
181
+ )
182
+ cfg = Config(
183
+ global_quant_config=QuantizationConfig(weight=weight, input_tensors=act),
184
+ exclude=[
185
+ "lm_head",
186
+ "*mlp.gate", # MoE router
187
+ "*shared_expert_gate", # per-layer gate
188
+ "*visual*", # vision tower + merger
189
+ "mtp*", # MTP head
190
+ ],
191
+ )
192
+ ```
193
+
194
+ Export with `pack_method='order'`, `weight_format='real_quantized'`, `custom_mode='quark'`, then run the `rename_keys.py` post-processor.
195
+
196
+ ## Citation
197
+
198
+ ```bibtex
199
+ @misc{qwen35moe,
200
+ title = {Qwen3.6-35B-A3B},
201
+ author = {Qwen Team, Alibaba Cloud},
202
+ year = {2026},
203
+ url = {https://huggingface.co/Qwen/Qwen3.6-35B-A3B}
204
+ }
205
+ ```
206
+
207
+ ## License
208
+
209
+ This model is released under the **Apache License, Version 2.0**, following the upstream
210
+ [`Qwen/Qwen3.6-35B-A3B`](https://huggingface.co/Qwen/Qwen3.6-35B-A3B).
211
+
212
+ - Modified files (the INT8-quantized `model-*.safetensors` and the `quantization_config` block in `config.json`) are described in `NOTICE`.
213
+ - A copy of the Apache-2.0 license is provided in `LICENSE`.
214
+
215
+ Original weights © 2025–2026 Qwen Team, Alibaba Cloud. Quantization is a derivative work distributed under Apache-2.0; no warranty of any kind is provided.
chat_template.jinja ADDED
@@ -0,0 +1,154 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {%- set image_count = namespace(value=0) %}
2
+ {%- set video_count = namespace(value=0) %}
3
+ {%- macro render_content(content, do_vision_count, is_system_content=false) %}
4
+ {%- if content is string %}
5
+ {{- content }}
6
+ {%- elif content is iterable and content is not mapping %}
7
+ {%- for item in content %}
8
+ {%- if 'image' in item or 'image_url' in item or item.type == 'image' %}
9
+ {%- if is_system_content %}
10
+ {{- raise_exception('System message cannot contain images.') }}
11
+ {%- endif %}
12
+ {%- if do_vision_count %}
13
+ {%- set image_count.value = image_count.value + 1 %}
14
+ {%- endif %}
15
+ {%- if add_vision_id %}
16
+ {{- 'Picture ' ~ image_count.value ~ ': ' }}
17
+ {%- endif %}
18
+ {{- '<|vision_start|><|image_pad|><|vision_end|>' }}
19
+ {%- elif 'video' in item or item.type == 'video' %}
20
+ {%- if is_system_content %}
21
+ {{- raise_exception('System message cannot contain videos.') }}
22
+ {%- endif %}
23
+ {%- if do_vision_count %}
24
+ {%- set video_count.value = video_count.value + 1 %}
25
+ {%- endif %}
26
+ {%- if add_vision_id %}
27
+ {{- 'Video ' ~ video_count.value ~ ': ' }}
28
+ {%- endif %}
29
+ {{- '<|vision_start|><|video_pad|><|vision_end|>' }}
30
+ {%- elif 'text' in item %}
31
+ {{- item.text }}
32
+ {%- else %}
33
+ {{- raise_exception('Unexpected item type in content.') }}
34
+ {%- endif %}
35
+ {%- endfor %}
36
+ {%- elif content is none or content is undefined %}
37
+ {{- '' }}
38
+ {%- else %}
39
+ {{- raise_exception('Unexpected content type.') }}
40
+ {%- endif %}
41
+ {%- endmacro %}
42
+ {%- if not messages %}
43
+ {{- raise_exception('No messages provided.') }}
44
+ {%- endif %}
45
+ {%- if tools and tools is iterable and tools is not mapping %}
46
+ {{- '<|im_start|>system\n' }}
47
+ {{- "# Tools\n\nYou have access to the following functions:\n\n<tools>" }}
48
+ {%- for tool in tools %}
49
+ {{- "\n" }}
50
+ {{- tool | tojson }}
51
+ {%- endfor %}
52
+ {{- "\n</tools>" }}
53
+ {{- '\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=...></function> block must be nested within <tool_call></tool_call> XML tags\n- Required parameters MUST be specified\n- You may provide optional reasoning for your function call in natural language BEFORE the function call, but NOT after\n- If there is no function call available, answer the question like normal with your current knowledge and do not tell the user about function calls\n</IMPORTANT>' }}
54
+ {%- if messages[0].role == 'system' %}
55
+ {%- set content = render_content(messages[0].content, false, true)|trim %}
56
+ {%- if content %}
57
+ {{- '\n\n' + content }}
58
+ {%- endif %}
59
+ {%- endif %}
60
+ {{- '<|im_end|>\n' }}
61
+ {%- else %}
62
+ {%- if messages[0].role == 'system' %}
63
+ {%- set content = render_content(messages[0].content, false, true)|trim %}
64
+ {{- '<|im_start|>system\n' + content + '<|im_end|>\n' }}
65
+ {%- endif %}
66
+ {%- endif %}
67
+ {%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}
68
+ {%- for message in messages[::-1] %}
69
+ {%- set index = (messages|length - 1) - loop.index0 %}
70
+ {%- if ns.multi_step_tool and message.role == "user" %}
71
+ {%- set content = render_content(message.content, false)|trim %}
72
+ {%- if not(content.startswith('<tool_response>') and content.endswith('</tool_response>')) %}
73
+ {%- set ns.multi_step_tool = false %}
74
+ {%- set ns.last_query_index = index %}
75
+ {%- endif %}
76
+ {%- endif %}
77
+ {%- endfor %}
78
+ {%- if ns.multi_step_tool %}
79
+ {{- raise_exception('No user query found in messages.') }}
80
+ {%- endif %}
81
+ {%- for message in messages %}
82
+ {%- set content = render_content(message.content, true)|trim %}
83
+ {%- if message.role == "system" %}
84
+ {%- if not loop.first %}
85
+ {{- raise_exception('System message must be at the beginning.') }}
86
+ {%- endif %}
87
+ {%- elif message.role == "user" %}
88
+ {{- '<|im_start|>' + message.role + '\n' + content + '<|im_end|>' + '\n' }}
89
+ {%- elif message.role == "assistant" %}
90
+ {%- set reasoning_content = '' %}
91
+ {%- if message.reasoning_content is string %}
92
+ {%- set reasoning_content = message.reasoning_content %}
93
+ {%- else %}
94
+ {%- if '</think>' in content %}
95
+ {%- set reasoning_content = content.split('</think>')[0].rstrip('\n').split('<think>')[-1].lstrip('\n') %}
96
+ {%- set content = content.split('</think>')[-1].lstrip('\n') %}
97
+ {%- endif %}
98
+ {%- endif %}
99
+ {%- set reasoning_content = reasoning_content|trim %}
100
+ {%- if (preserve_thinking is defined and preserve_thinking is true) or (loop.index0 > ns.last_query_index) %}
101
+ {{- '<|im_start|>' + message.role + '\n<think>\n' + reasoning_content + '\n</think>\n\n' + content }}
102
+ {%- else %}
103
+ {{- '<|im_start|>' + message.role + '\n' + content }}
104
+ {%- endif %}
105
+ {%- if message.tool_calls and message.tool_calls is iterable and message.tool_calls is not mapping %}
106
+ {%- for tool_call in message.tool_calls %}
107
+ {%- if tool_call.function is defined %}
108
+ {%- set tool_call = tool_call.function %}
109
+ {%- endif %}
110
+ {%- if loop.first %}
111
+ {%- if content|trim %}
112
+ {{- '\n\n<tool_call>\n<function=' + tool_call.name + '>\n' }}
113
+ {%- else %}
114
+ {{- '<tool_call>\n<function=' + tool_call.name + '>\n' }}
115
+ {%- endif %}
116
+ {%- else %}
117
+ {{- '\n<tool_call>\n<function=' + tool_call.name + '>\n' }}
118
+ {%- endif %}
119
+ {%- if tool_call.arguments is defined %}
120
+ {%- for args_name, args_value in tool_call.arguments|items %}
121
+ {{- '<parameter=' + args_name + '>\n' }}
122
+ {%- set args_value = args_value | string if args_value is string else args_value | tojson | safe %}
123
+ {{- args_value }}
124
+ {{- '\n</parameter>\n' }}
125
+ {%- endfor %}
126
+ {%- endif %}
127
+ {{- '</function>\n</tool_call>' }}
128
+ {%- endfor %}
129
+ {%- endif %}
130
+ {{- '<|im_end|>\n' }}
131
+ {%- elif message.role == "tool" %}
132
+ {%- if loop.previtem and loop.previtem.role != "tool" %}
133
+ {{- '<|im_start|>user' }}
134
+ {%- endif %}
135
+ {{- '\n<tool_response>\n' }}
136
+ {{- content }}
137
+ {{- '\n</tool_response>' }}
138
+ {%- if not loop.last and loop.nextitem.role != "tool" %}
139
+ {{- '<|im_end|>\n' }}
140
+ {%- elif loop.last %}
141
+ {{- '<|im_end|>\n' }}
142
+ {%- endif %}
143
+ {%- else %}
144
+ {{- raise_exception('Unexpected message role.') }}
145
+ {%- endif %}
146
+ {%- endfor %}
147
+ {%- if add_generation_prompt %}
148
+ {{- '<|im_start|>assistant\n' }}
149
+ {%- if enable_thinking is defined and enable_thinking is false %}
150
+ {{- '<think>\n\n</think>\n\n' }}
151
+ {%- else %}
152
+ {{- '<think>\n' }}
153
+ {%- endif %}
154
+ {%- endif %}
config.json ADDED
@@ -0,0 +1,328 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "Qwen3_5MoeForConditionalGeneration"
4
+ ],
5
+ "dtype": "bfloat16",
6
+ "image_token_id": 248056,
7
+ "model_type": "qwen3_5_moe",
8
+ "quantization_config": {
9
+ "algo_config": null,
10
+ "exclude": [
11
+ "model.visual.pos_embed",
12
+ "model.visual.blocks.0.attn.qkv",
13
+ "model.visual.blocks.0.attn.proj",
14
+ "model.visual.blocks.0.mlp.linear_fc1",
15
+ "model.visual.blocks.0.mlp.linear_fc2",
16
+ "model.visual.blocks.1.attn.qkv",
17
+ "model.visual.blocks.1.attn.proj",
18
+ "model.visual.blocks.1.mlp.linear_fc1",
19
+ "model.visual.blocks.1.mlp.linear_fc2",
20
+ "model.visual.blocks.2.attn.qkv",
21
+ "model.visual.blocks.2.attn.proj",
22
+ "model.visual.blocks.2.mlp.linear_fc1",
23
+ "model.visual.blocks.2.mlp.linear_fc2",
24
+ "model.visual.blocks.3.attn.qkv",
25
+ "model.visual.blocks.3.attn.proj",
26
+ "model.visual.blocks.3.mlp.linear_fc1",
27
+ "model.visual.blocks.3.mlp.linear_fc2",
28
+ "model.visual.blocks.4.attn.qkv",
29
+ "model.visual.blocks.4.attn.proj",
30
+ "model.visual.blocks.4.mlp.linear_fc1",
31
+ "model.visual.blocks.4.mlp.linear_fc2",
32
+ "model.visual.blocks.5.attn.qkv",
33
+ "model.visual.blocks.5.attn.proj",
34
+ "model.visual.blocks.5.mlp.linear_fc1",
35
+ "model.visual.blocks.5.mlp.linear_fc2",
36
+ "model.visual.blocks.6.attn.qkv",
37
+ "model.visual.blocks.6.attn.proj",
38
+ "model.visual.blocks.6.mlp.linear_fc1",
39
+ "model.visual.blocks.6.mlp.linear_fc2",
40
+ "model.visual.blocks.7.attn.qkv",
41
+ "model.visual.blocks.7.attn.proj",
42
+ "model.visual.blocks.7.mlp.linear_fc1",
43
+ "model.visual.blocks.7.mlp.linear_fc2",
44
+ "model.visual.blocks.8.attn.qkv",
45
+ "model.visual.blocks.8.attn.proj",
46
+ "model.visual.blocks.8.mlp.linear_fc1",
47
+ "model.visual.blocks.8.mlp.linear_fc2",
48
+ "model.visual.blocks.9.attn.qkv",
49
+ "model.visual.blocks.9.attn.proj",
50
+ "model.visual.blocks.9.mlp.linear_fc1",
51
+ "model.visual.blocks.9.mlp.linear_fc2",
52
+ "model.visual.blocks.10.attn.qkv",
53
+ "model.visual.blocks.10.attn.proj",
54
+ "model.visual.blocks.10.mlp.linear_fc1",
55
+ "model.visual.blocks.10.mlp.linear_fc2",
56
+ "model.visual.blocks.11.attn.qkv",
57
+ "model.visual.blocks.11.attn.proj",
58
+ "model.visual.blocks.11.mlp.linear_fc1",
59
+ "model.visual.blocks.11.mlp.linear_fc2",
60
+ "model.visual.blocks.12.attn.qkv",
61
+ "model.visual.blocks.12.attn.proj",
62
+ "model.visual.blocks.12.mlp.linear_fc1",
63
+ "model.visual.blocks.12.mlp.linear_fc2",
64
+ "model.visual.blocks.13.attn.qkv",
65
+ "model.visual.blocks.13.attn.proj",
66
+ "model.visual.blocks.13.mlp.linear_fc1",
67
+ "model.visual.blocks.13.mlp.linear_fc2",
68
+ "model.visual.blocks.14.attn.qkv",
69
+ "model.visual.blocks.14.attn.proj",
70
+ "model.visual.blocks.14.mlp.linear_fc1",
71
+ "model.visual.blocks.14.mlp.linear_fc2",
72
+ "model.visual.blocks.15.attn.qkv",
73
+ "model.visual.blocks.15.attn.proj",
74
+ "model.visual.blocks.15.mlp.linear_fc1",
75
+ "model.visual.blocks.15.mlp.linear_fc2",
76
+ "model.visual.blocks.16.attn.qkv",
77
+ "model.visual.blocks.16.attn.proj",
78
+ "model.visual.blocks.16.mlp.linear_fc1",
79
+ "model.visual.blocks.16.mlp.linear_fc2",
80
+ "model.visual.blocks.17.attn.qkv",
81
+ "model.visual.blocks.17.attn.proj",
82
+ "model.visual.blocks.17.mlp.linear_fc1",
83
+ "model.visual.blocks.17.mlp.linear_fc2",
84
+ "model.visual.blocks.18.attn.qkv",
85
+ "model.visual.blocks.18.attn.proj",
86
+ "model.visual.blocks.18.mlp.linear_fc1",
87
+ "model.visual.blocks.18.mlp.linear_fc2",
88
+ "model.visual.blocks.19.attn.qkv",
89
+ "model.visual.blocks.19.attn.proj",
90
+ "model.visual.blocks.19.mlp.linear_fc1",
91
+ "model.visual.blocks.19.mlp.linear_fc2",
92
+ "model.visual.blocks.20.attn.qkv",
93
+ "model.visual.blocks.20.attn.proj",
94
+ "model.visual.blocks.20.mlp.linear_fc1",
95
+ "model.visual.blocks.20.mlp.linear_fc2",
96
+ "model.visual.blocks.21.attn.qkv",
97
+ "model.visual.blocks.21.attn.proj",
98
+ "model.visual.blocks.21.mlp.linear_fc1",
99
+ "model.visual.blocks.21.mlp.linear_fc2",
100
+ "model.visual.blocks.22.attn.qkv",
101
+ "model.visual.blocks.22.attn.proj",
102
+ "model.visual.blocks.22.mlp.linear_fc1",
103
+ "model.visual.blocks.22.mlp.linear_fc2",
104
+ "model.visual.blocks.23.attn.qkv",
105
+ "model.visual.blocks.23.attn.proj",
106
+ "model.visual.blocks.23.mlp.linear_fc1",
107
+ "model.visual.blocks.23.mlp.linear_fc2",
108
+ "model.visual.blocks.24.attn.qkv",
109
+ "model.visual.blocks.24.attn.proj",
110
+ "model.visual.blocks.24.mlp.linear_fc1",
111
+ "model.visual.blocks.24.mlp.linear_fc2",
112
+ "model.visual.blocks.25.attn.qkv",
113
+ "model.visual.blocks.25.attn.proj",
114
+ "model.visual.blocks.25.mlp.linear_fc1",
115
+ "model.visual.blocks.25.mlp.linear_fc2",
116
+ "model.visual.blocks.26.attn.qkv",
117
+ "model.visual.blocks.26.attn.proj",
118
+ "model.visual.blocks.26.mlp.linear_fc1",
119
+ "model.visual.blocks.26.mlp.linear_fc2",
120
+ "model.visual.merger.linear_fc1",
121
+ "model.visual.merger.linear_fc2",
122
+ "model.language_model.layers.0.mlp.shared_expert_gate",
123
+ "model.language_model.layers.1.mlp.shared_expert_gate",
124
+ "model.language_model.layers.2.mlp.shared_expert_gate",
125
+ "model.language_model.layers.3.mlp.shared_expert_gate",
126
+ "model.language_model.layers.4.mlp.shared_expert_gate",
127
+ "model.language_model.layers.5.mlp.shared_expert_gate",
128
+ "model.language_model.layers.6.mlp.shared_expert_gate",
129
+ "model.language_model.layers.7.mlp.shared_expert_gate",
130
+ "model.language_model.layers.8.mlp.shared_expert_gate",
131
+ "model.language_model.layers.9.mlp.shared_expert_gate",
132
+ "model.language_model.layers.10.mlp.shared_expert_gate",
133
+ "model.language_model.layers.11.mlp.shared_expert_gate",
134
+ "model.language_model.layers.12.mlp.shared_expert_gate",
135
+ "model.language_model.layers.13.mlp.shared_expert_gate",
136
+ "model.language_model.layers.14.mlp.shared_expert_gate",
137
+ "model.language_model.layers.15.mlp.shared_expert_gate",
138
+ "model.language_model.layers.16.mlp.shared_expert_gate",
139
+ "model.language_model.layers.17.mlp.shared_expert_gate",
140
+ "model.language_model.layers.18.mlp.shared_expert_gate",
141
+ "model.language_model.layers.19.mlp.shared_expert_gate",
142
+ "model.language_model.layers.20.mlp.shared_expert_gate",
143
+ "model.language_model.layers.21.mlp.shared_expert_gate",
144
+ "model.language_model.layers.22.mlp.shared_expert_gate",
145
+ "model.language_model.layers.23.mlp.shared_expert_gate",
146
+ "model.language_model.layers.24.mlp.shared_expert_gate",
147
+ "model.language_model.layers.25.mlp.shared_expert_gate",
148
+ "model.language_model.layers.26.mlp.shared_expert_gate",
149
+ "model.language_model.layers.27.mlp.shared_expert_gate",
150
+ "model.language_model.layers.28.mlp.shared_expert_gate",
151
+ "model.language_model.layers.29.mlp.shared_expert_gate",
152
+ "model.language_model.layers.30.mlp.shared_expert_gate",
153
+ "model.language_model.layers.31.mlp.shared_expert_gate",
154
+ "model.language_model.layers.32.mlp.shared_expert_gate",
155
+ "model.language_model.layers.33.mlp.shared_expert_gate",
156
+ "model.language_model.layers.34.mlp.shared_expert_gate",
157
+ "model.language_model.layers.35.mlp.shared_expert_gate",
158
+ "model.language_model.layers.36.mlp.shared_expert_gate",
159
+ "model.language_model.layers.37.mlp.shared_expert_gate",
160
+ "model.language_model.layers.38.mlp.shared_expert_gate",
161
+ "model.language_model.layers.39.mlp.shared_expert_gate",
162
+ "lm_head"
163
+ ],
164
+ "export": {
165
+ "kv_cache_group": [],
166
+ "min_kv_scale": 0.0,
167
+ "pack_method": "order",
168
+ "weight_format": "real_quantized",
169
+ "weight_merge_groups": null
170
+ },
171
+ "global_quant_config": {
172
+ "bias": null,
173
+ "input_tensors": {
174
+ "ch_axis": 1,
175
+ "dtype": "int8",
176
+ "group_size": null,
177
+ "is_dynamic": true,
178
+ "is_scale_quant": false,
179
+ "mx_element_dtype": null,
180
+ "observer_cls": "PerChannelMinMaxObserver",
181
+ "qscheme": "per_channel",
182
+ "round_method": "round",
183
+ "scale_calculation_mode": null,
184
+ "scale_format": null,
185
+ "scale_type": "float",
186
+ "symmetric": true
187
+ },
188
+ "output_tensors": null,
189
+ "target_device": null,
190
+ "weight": {
191
+ "ch_axis": 0,
192
+ "dtype": "int8",
193
+ "group_size": null,
194
+ "is_dynamic": false,
195
+ "is_scale_quant": false,
196
+ "mx_element_dtype": null,
197
+ "observer_cls": "PerChannelMinMaxObserver",
198
+ "qscheme": "per_channel",
199
+ "round_method": "round",
200
+ "scale_calculation_mode": null,
201
+ "scale_format": null,
202
+ "scale_type": "float",
203
+ "symmetric": true
204
+ }
205
+ },
206
+ "kv_cache_post_rope": false,
207
+ "kv_cache_quant_config": {},
208
+ "layer_quant_config": {},
209
+ "layer_type_quant_config": {},
210
+ "quant_method": "quark",
211
+ "quant_mode": "eager_mode",
212
+ "softmax_quant_spec": null,
213
+ "version": "0.11.1"
214
+ },
215
+ "text_config": {
216
+ "attention_bias": false,
217
+ "attention_dropout": 0.0,
218
+ "attn_output_gate": true,
219
+ "bos_token_id": 248044,
220
+ "dtype": "bfloat16",
221
+ "eos_token_id": 248044,
222
+ "full_attention_interval": 4,
223
+ "head_dim": 256,
224
+ "hidden_act": "silu",
225
+ "hidden_size": 2048,
226
+ "initializer_range": 0.02,
227
+ "layer_types": [
228
+ "linear_attention",
229
+ "linear_attention",
230
+ "linear_attention",
231
+ "full_attention",
232
+ "linear_attention",
233
+ "linear_attention",
234
+ "linear_attention",
235
+ "full_attention",
236
+ "linear_attention",
237
+ "linear_attention",
238
+ "linear_attention",
239
+ "full_attention",
240
+ "linear_attention",
241
+ "linear_attention",
242
+ "linear_attention",
243
+ "full_attention",
244
+ "linear_attention",
245
+ "linear_attention",
246
+ "linear_attention",
247
+ "full_attention",
248
+ "linear_attention",
249
+ "linear_attention",
250
+ "linear_attention",
251
+ "full_attention",
252
+ "linear_attention",
253
+ "linear_attention",
254
+ "linear_attention",
255
+ "full_attention",
256
+ "linear_attention",
257
+ "linear_attention",
258
+ "linear_attention",
259
+ "full_attention",
260
+ "linear_attention",
261
+ "linear_attention",
262
+ "linear_attention",
263
+ "full_attention",
264
+ "linear_attention",
265
+ "linear_attention",
266
+ "linear_attention",
267
+ "full_attention"
268
+ ],
269
+ "linear_conv_kernel_dim": 4,
270
+ "linear_key_head_dim": 128,
271
+ "linear_num_key_heads": 16,
272
+ "linear_num_value_heads": 32,
273
+ "linear_value_head_dim": 128,
274
+ "mamba_ssm_dtype": "float32",
275
+ "max_position_embeddings": 262144,
276
+ "model_type": "qwen3_5_moe_text",
277
+ "moe_intermediate_size": 512,
278
+ "mtp_num_hidden_layers": 1,
279
+ "mtp_use_dedicated_embeddings": false,
280
+ "num_attention_heads": 16,
281
+ "num_experts": 256,
282
+ "num_experts_per_tok": 8,
283
+ "num_hidden_layers": 40,
284
+ "num_key_value_heads": 2,
285
+ "output_router_logits": false,
286
+ "pad_token_id": null,
287
+ "partial_rotary_factor": 0.25,
288
+ "rms_norm_eps": 1e-06,
289
+ "rope_parameters": {
290
+ "mrope_interleaved": true,
291
+ "mrope_section": [
292
+ 11,
293
+ 11,
294
+ 10
295
+ ],
296
+ "partial_rotary_factor": 0.25,
297
+ "rope_theta": 10000000,
298
+ "rope_type": "default"
299
+ },
300
+ "router_aux_loss_coef": 0.001,
301
+ "shared_expert_intermediate_size": 512,
302
+ "tie_word_embeddings": false,
303
+ "use_cache": true,
304
+ "vocab_size": 248320
305
+ },
306
+ "tie_word_embeddings": false,
307
+ "transformers_version": "5.5.4",
308
+ "video_token_id": 248057,
309
+ "vision_config": {
310
+ "deepstack_visual_indexes": [],
311
+ "depth": 27,
312
+ "dtype": "bfloat16",
313
+ "hidden_act": "gelu_pytorch_tanh",
314
+ "hidden_size": 1152,
315
+ "in_channels": 3,
316
+ "initializer_range": 0.02,
317
+ "intermediate_size": 4304,
318
+ "model_type": "qwen3_5_moe",
319
+ "num_heads": 16,
320
+ "num_position_embeddings": 2304,
321
+ "out_hidden_size": 2048,
322
+ "patch_size": 16,
323
+ "spatial_merge_size": 2,
324
+ "temporal_patch_size": 2
325
+ },
326
+ "vision_end_token_id": 248054,
327
+ "vision_start_token_id": 248053
328
+ }
generation_config.json ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token_id": 248044,
3
+ "do_sample": true,
4
+ "eos_token_id": [
5
+ 248046,
6
+ 248044
7
+ ],
8
+ "pad_token_id": 248044,
9
+ "temperature": 1.0,
10
+ "top_k": 20,
11
+ "top_p": 0.95,
12
+ "transformers_version": "5.5.4"
13
+ }
merges.txt ADDED
The diff for this file is too large to render. See raw diff
 
model-00001-of-00007.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a88ef720d2494696e810836403b71058edae003354c8e4f96f7b81ca33a2f6cb
3
+ size 5369246576
model-00002-of-00007.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:faa2512e707804425bd365c5aabfa0cc125fdff05b490269700a9a2548660573
3
+ size 5369957608
model-00003-of-00007.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:39f42ed75c9a95c8b61be6149039c4572f687fc3894818e3f2a659dbf4ed7381
3
+ size 5369674984
model-00004-of-00007.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:49d877d9ce33103cd6274cdd52517f21aa63aa01e5fb0494cb0834c2ef9d4ad6
3
+ size 5369804192
model-00005-of-00007.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c8cc18c2cbc4ef3a0244c7e420c103395be9eba24846ad08953c351b1e36334f
3
+ size 5369638224
model-00006-of-00007.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0f7c1f0d3f94bee734a3ee2c3cd6bce2a93b81b6c62b8c579ed2b590e32539c9
3
+ size 5369789704
model-00007-of-00007.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:791092c656fb64c4e8f2d00a179ea9c47236a961c1cef80130420960987c0b63
3
+ size 4447789320
model.safetensors.index.json ADDED
The diff for this file is too large to render. See raw diff
 
preprocessor_config.json ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "size": {
3
+ "longest_edge": 16777216,
4
+ "shortest_edge": 65536
5
+ },
6
+ "patch_size": 16,
7
+ "temporal_patch_size": 2,
8
+ "merge_size": 2,
9
+ "image_mean": [
10
+ 0.5,
11
+ 0.5,
12
+ 0.5
13
+ ],
14
+ "image_std": [
15
+ 0.5,
16
+ 0.5,
17
+ 0.5
18
+ ],
19
+ "processor_class": "Qwen3VLProcessor",
20
+ "image_processor_type": "Qwen2VLImageProcessorFast"
21
+ }
tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:87a7830d63fcf43bf241c3c5242e96e62dd3fdc29224ca26fed8ea333db72de4
3
+ size 19989343
tokenizer_config.json ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": false,
3
+ "audio_bos_token": "<|audio_start|>",
4
+ "audio_eos_token": "<|audio_end|>",
5
+ "audio_token": "<|audio_pad|>",
6
+ "backend": "tokenizers",
7
+ "bos_token": null,
8
+ "clean_up_tokenization_spaces": false,
9
+ "eos_token": "<|im_end|>",
10
+ "errors": "replace",
11
+ "image_token": "<|image_pad|>",
12
+ "is_local": true,
13
+ "model_max_length": 262144,
14
+ "model_specific_special_tokens": {
15
+ "audio_bos_token": "<|audio_start|>",
16
+ "audio_eos_token": "<|audio_end|>",
17
+ "audio_token": "<|audio_pad|>",
18
+ "image_token": "<|image_pad|>",
19
+ "video_token": "<|video_pad|>",
20
+ "vision_bos_token": "<|vision_start|>",
21
+ "vision_eos_token": "<|vision_end|>"
22
+ },
23
+ "pad_token": "<|endoftext|>",
24
+ "pretokenize_regex": "(?i:'s|'t|'re|'ve|'m|'ll|'d)|[^\\r\\n\\p{L}\\p{N}]?[\\p{L}\\p{M}]+|\\p{N}| ?[^\\s\\p{L}\\p{M}\\p{N}]+[\\r\\n]*|\\s*[\\r\\n]+|\\s+(?!\\S)|\\s+",
25
+ "split_special_tokens": false,
26
+ "tokenizer_class": "TokenizersBackend",
27
+ "unk_token": null,
28
+ "video_token": "<|video_pad|>",
29
+ "vision_bos_token": "<|vision_start|>",
30
+ "vision_eos_token": "<|vision_end|>"
31
+ }
video_preprocessor_config.json ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "size": {
3
+ "longest_edge": 25165824,
4
+ "shortest_edge": 4096
5
+ },
6
+ "patch_size": 16,
7
+ "temporal_patch_size": 2,
8
+ "merge_size": 2,
9
+ "image_mean": [
10
+ 0.5,
11
+ 0.5,
12
+ 0.5
13
+ ],
14
+ "image_std": [
15
+ 0.5,
16
+ 0.5,
17
+ 0.5
18
+ ],
19
+ "processor_class": "Qwen3VLProcessor",
20
+ "video_processor_type": "Qwen3VLVideoProcessor"
21
+ }
vocab.json ADDED
The diff for this file is too large to render. See raw diff