Views
No views yet
[!TIP] Quantized using llm-compressor with mixed-domain calibration and sensitive-layer protection for maximum accuracy recovery.
[!IMPORTANT] Native W4A4 on DGX Spark (SM121) — confirmed workingThis checkpoint runs true W4A4 via FlashInfer CUTLASS NVFP4 kernel (verified in vLLM logs:FlashInferCutlassNvFp4LinearKernel). Requires:
- vLLM
0.19.1rc1.dev374+g1174723ebor later (includes PR #37725 arch-suffix fix)- FlashInfer ≥ 0.6.8 with SM120f compilation (PR #2650)
- CUDA ≥ 12.9
MTP speculative decoding supported — usemethod: qwen3_next_mtp(dense-model MTP, distinct from the MoEmtpmethod).
| Item | Value |
|---|---|
| Architecture | Dense (27B), 64 layers — 16 × (3 × Gated DeltaNet → FFN + 1 × Gated Attention → FFN) |
| Base model | Qwen/Qwen3.6-27B |
| Fine-tuned by | huihui-ai (abliteration) |
| Quantized by | YuYu1015 |
| Model size | ~28.6 GB (NVFP4 + BF16 MTP/GDN layers, vs ~71.9 GB BF16 original) |
| Context length | Up to 262,144 tokens |
| Thinking mode | Supported (enable_thinking: true/false) |
| Tool calling | Supported (qwen3_coder parser) |
| MTP | Built-in MTP weights (qwen3_next_mtp method) |
| DFlash | Compatible with z-lab/Qwen3.6-27B-DFlash |
| Strategy | Description |
|---|---|
| A. Official baseline | Qwen3ForCausalLM + save_mtp_tensors_to_checkpoint (preserves MTP weights after quantization) |
| C. Mixed-domain calibration | ultrachat_200k (128 chat) + Nemotron-Post-Training-Dataset-v2 (128 reasoning) = 256 total |
| D. Sweet-spot hyperparameters | num_calibration_samples=256, max_seq_length=4096 (quality > quantity) |
B (last-layer protection) incompatible with vLLM fused kernels: Partial ignore of linear layers within a transformer block triggersValueError: All projections need to have same quantization scheme but found multiple.E (SpinQuant R1+R2) incompatible with multi-modal config: llm-compressor'sget_head_dimonly reads top-level config, not Qwen3.6's nestedtext_config.
| Item | Value |
|---|---|
| Method | llm-compressor (main) + compressed-tensors (main) |
| Scheme | NVFP4 W4A4 (E2M1 + FP8 per-group scaling, group size 16) |
| Format | compressed-tensors |
| Calibration datasets | HuggingFaceH4/ultrachat_200k (128) + nvidia/Nemotron-Post-Training-Dataset-v2 (128) |
| Calibration samples (total) | 256 |
| Calibration sequence length | 4096 |
| Hardware | NVIDIA DGX Spark (GB10, 128GB unified memory) |
| Environment | transformers>=5.0,<6 + llm-compressor main + PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True |
| Layer pattern | Reason |
|---|---|
re:.*lm_head | Output head, sensitive to quantization noise |
re:.*embed_tokens$ | Input embeddings |
re:visual.* / re:model.visual.* | Vision encoder |
re:.*mlp.gate$ | FFN gate (dense model; must stay BF16) |
re:.*linear_attn.* | Gated DeltaNet (Mamba) layers — may output zeros if quantized |
mtp.* (all MTP weights) | Reattached in BF16 via save_mtp_tensors_to_checkpoint after quantization |
--speculative-config '{"method": "qwen3_next_mtp", "num_speculative_tokens": 2}'--speculative-config '{"method": "dflash", "model": "z-lab/Qwen3.6-27B-DFlash", "num_speculative_tokens": 15}'Note: On hybrid GDN architectures, MTP may hit a state-rollback bug (vLLM #39273) during high token-rejection rates. Reducenum_speculative_tokensto 1 if you observe degraded output quality.
1vllm serve /path/to/model \
2 --quantization compressed-tensors \
3 --served-model-name qwen3.6-27b \
4 --reasoning-parser qwen3 \
5 --enable-auto-tool-choice \
6 --tool-call-parser qwen3_coder \
7 --attention-backend flash_attn \
8 --kv-cache-dtype auto \
9 --gpu-memory-utilization 0.80 \
10 --max-model-len 131072 \
11 --max-num-batched-tokens 16384 \
12 --max-num-seqs 8 \
13 --enable-prefix-caching \
14 --enable-chunked-prefill \
15 --performance-mode throughput \
16 --speculative-config '{"method":"qwen3_next_mtp","num_speculative_tokens":2}' \
17 --trust-remote-code \
18 --language-model-onlyUsing FlashInferCutlassNvFp4LinearKernel for NVFP4 GEMM--kv-cache-dtype automax-model-len is achievable--language-model-only skips vision encoder profiling for text-only inferencesudo sh -c 'echo 3 > /proc/sys/vm/drop_caches'q_proj / k_proj / v_proj may differ, causing a vLLM warning at load time. Impact on accuracy is typically small but measurable on strict tool-calling JSON schemas.[!TIP] 使用 llm-compressor 搭配混合領域校準與敏感層保護量化,最大化精度保留。
[!IMPORTANT] DGX Spark (SM121) 原生 W4A4 — 已驗證可用此 checkpoint 透過 FlashInfer CUTLASS NVFP4 kernel 跑真 W4A4(vLLM log 可見FlashInferCutlassNvFp4LinearKernel)。需要:
- vLLM
0.19.1rc1.dev374+g1174723eb以上(含 PR #37725 arch-suffix 修復)- FlashInfer ≥ 0.6.8 帶 SM120f 編譯(PR #2650)
- CUDA ≥ 12.9
支援 MTP 投機解碼 — 使用method: qwen3_next_mtp(dense 模型專用,有別於 MoE 的mtp方法)。
| 項目 | 數值 |
|---|---|
| 架構 | Dense(27B),64 層 — 16 × (3 × Gated DeltaNet → FFN + 1 × Gated Attention → FFN) |
| 基礎模型 | Qwen/Qwen3.6-27B |
| 微調者 | huihui-ai(abliteration) |
| 量化者 | YuYu1015 |
| 模型大小 | ~28.6 GB(NVFP4 + BF16 MTP/GDN 層,原版 BF16 約 71.9 GB) |
| Context 長度 | 最高 262,144 tokens |
| 思考模式 | 支援(enable_thinking: true/false) |
| 工具呼叫 | 支援(qwen3_coder parser) |
| MTP | 內建 MTP 權重(qwen3_next_mtp 方法) |
| DFlash | 相容 z-lab/Qwen3.6-27B-DFlash |
| 策略 | 說明 |
|---|---|
| A. 官方基線 | Qwen3ForCausalLM + save_mtp_tensors_to_checkpoint(量化後保留 MTP 權重) |
| C. 混合領域校準 | ultrachat_200k(128 對話)+ Nemotron-Post-Training-Dataset-v2(128 推理)共 256 |
| D. 黃金比例參數 | num_calibration_samples=256、max_seq_length=4096(品質 > 數量) |
B 策略(最後層保護)與 vLLM fused kernel 不相容:對 transformer block 內的 linear 層做 partial ignore 會觸發ValueError: All projections need to have same quantization scheme but found multiple。E 策略(SpinQuant R1+R2)與 multi-modal config 不相容:llm-compressor 的get_head_dim只讀頂層 config,不讀 Qwen3.6 巢狀的text_config。
| 項目 | 數值 |
|---|---|
| 方法 | llm-compressor(main)+ compressed-tensors(main) |
| 方案 | NVFP4 W4A4(E2M1 + FP8 逐群縮放,群組大小 16) |
| 格式 | compressed-tensors |
| 校準資料集 | HuggingFaceH4/ultrachat_200k(128)+ nvidia/Nemotron-Post-Training-Dataset-v2(128) |
| 校準樣本總數 | 256 |
| 校準序列長度 | 4096 |
| 量化硬體 | NVIDIA DGX Spark(GB10, 128GB 統一記憶體) |
| 環境 | transformers>=5.0,<6 + llm-compressor main + PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True |
| 層 pattern | 原因 |
|---|---|
re:.*lm_head | 輸出頭,對量化雜訊敏感 |
re:.*embed_tokens$ | 輸入嵌入 |
re:visual.* / re:model.visual.* | 視覺編碼器 |
re:.*mlp.gate$ | FFN 門控(dense 模型;必須 BF16) |
re:.*linear_attn.* | Gated DeltaNet (Mamba) 層 — 量化後可能輸出零 |
mtp.*(所有 MTP 權重) | 量化後透過 save_mtp_tensors_to_checkpoint 以 BF16 重新掛回 |
--speculative-config '{"method": "qwen3_next_mtp", "num_speculative_tokens": 2}'--speculative-config '{"method": "dflash", "model": "z-lab/Qwen3.6-27B-DFlash", "num_speculative_tokens": 15}'注意:混合 GDN 架構下 MTP 可能觸發 state-rollback bug(vLLM #39273),高 rejection rate 時輸出可能退化。若遇輸出品質下降,請將num_speculative_tokens降為 1。
1vllm serve /path/to/model \
2 --quantization compressed-tensors \
3 --served-model-name qwen3.6-27b \
4 --reasoning-parser qwen3 \
5 --enable-auto-tool-choice \
6 --tool-call-parser qwen3_coder \
7 --attention-backend flash_attn \
8 --kv-cache-dtype auto \
9 --gpu-memory-utilization 0.80 \
10 --max-model-len 131072 \
11 --max-num-batched-tokens 16384 \
12 --max-num-seqs 8 \
13 --enable-prefix-caching \
14 --enable-chunked-prefill \
15 --performance-mode throughput \
16 --speculative-config '{"method":"qwen3_next_mtp","num_speculative_tokens":2}' \
17 --trust-remote-code \
18 --language-model-onlyUsing FlashInferCutlassNvFp4LinearKernel for NVFP4 GEMM--kv-cache-dtype automax-model-len--language-model-only 跳過視覺編碼器 profiling,加速純文字推理啟動sudo sh -c 'echo 3 > /proc/sys/vm/drop_caches'q_proj / k_proj / v_proj 的 per-tensor global scale 可能不一致,vLLM 載入時會印警告。一般精度影響輕微,但在嚴格 tool-calling JSON schema 下可能可測得。