Views
No views yet
Internal testing artifact. Used for development. Not evaluated for production use. No quality benchmarks beyond a single GSM8K-50 sanity gate (47/50). Passes vibe check.
Qwen/Qwen3.6-27B with the MTP draft head retained in BF16, vision tower retained in BF16, lm_head retained in BF16.model.safetensors (~20.6 GB): single shard
uint8 packed + per-block float8_e4m3fn weight_scale + per-tensor float32 weight_scale_2)model.visual.* tensors)mtp.* tensors)lm_head.weightlinear_attn.conv1d and in_proj_* projectionsconfig.json — quantization_config.ignore lists the 65 entries kept in BF16 (50 vision blocks, 15 MTP modules)hf_quant_config.json — modelopt metadatachat_template.jinja — froggeric/Qwen-Fixed-Chat-Templates (see Patches)tokenizer.json, tokenizer_config.json, preprocessor_config.json, video_preprocessor_config.json, generation_config.jsonlna-lab/GGUF-to-NVFP4-SM120 — credit to Tonoken / LNA-LAB. Recipe doc: docs/MTP_GRAFT_RECIPE.md. VLM-preserving variant: src/quantize/qwen36_27b_vlm_mtp.py.NVFP4_DEFAULT_CFG already excludes linear_attn.conv1d, lm_head, router, mlp.gate, block_sparse_moe.gate. Two ignores added on top:1import modelopt.torch.quantization as mtq
2config = mtq.NVFP4_DEFAULT_CFG
3quant_cfg = dict(config["quant_cfg"])
4quant_cfg["*visual*"] = {"enable": False} # keep vision tower BF16
5quant_cfg["*mtp*"] = {"enable": False} # keep MTP head BF16
6build_config = {"quant_cfg": quant_cfg, "algorithm": config["algorithm"]}neuralmagic/calibration (name="LLM", split="train[:20]") at max_seq_len=8192, applied via tokenizer.apply_chat_template(...). Forward-pass calibration with torch.no_grad() and the model in inference mode.1from modelopt.torch.export import export_hf_checkpoint
2mtq.quantize(model, build_config, forward_loop=...)
3export_hf_checkpoint(model, export_dir=OUT)compressed-tensors.oneshot does not produce a working SM120 NVFP4 checkpoint per lna-lab's notes; modelopt is the path used here.mtp.* (15 tensors for Qwen3.6-27B dense)1from safetensors import safe_open
2from safetensors.torch import load_file, save_file
3# Walk base BF16 shards, collect mtp.* tensors
4shard_to_keys = {...} # via base index.json
5mtp_tensors = {}
6for shard, keys in shard_to_keys.items():
7 with safe_open(BASE/shard, framework="pt") as f:
8 for k in keys: mtp_tensors[k] = f.get_tensor(k)
9# Append into the last quantized shard, BF16
10target = sorted(OUT.glob("model*.safetensors"))[-1]
11existing = load_file(str(target))
12for k, v in mtp_tensors.items():
13 existing[k] = v.to(torch.bfloat16).contiguous()
14save_file(existing, str(target), metadata=meta)
15# Update index.json weight_map + total_size if multi-shardconfig.json1mtp_modules = sorted({".".join(k.split(".")[:-1]) for k in mtp_keys if k.endswith(".weight")})
2cfg["quantization_config"].setdefault("ignore", []).extend(mtp_modules)
3# vision_config stays; language_model_only stays FalseQwen/Qwen3.6-27B chat_template.jinja with froggeric/Qwen-Fixed-Chat-Templates (top-level current version). The upstream template has known silent tool-call drops and <|think_on|>/enable_thinking=false issues; see Qwen/Qwen3.6-27B/discussions/16, discussions/20, and froggeric/.../discussions/2 (the kraka40 / openclaw tool-call fix). Pair with --tool-call-parser qwen3_xml if you serve tool-call workloads.tokenizer_config.json backend key strip — tokenizer.save_pretrained() from transformers>=5 emits "backend": "tokenizers". transformers==4.57.6 (the pin in our serving image) does not recognize this field. The recipe strips it post-export:1import json
2cfg = json.loads(open("tokenizer_config.json").read())
3cfg.pop("backend", None)
4open("tokenizer_config.json", "w").write(json.dumps(cfg, indent=2))mtp.* graft; no fine-tuning, no abliteration, no distillation.1vllm serve <local-path-or-repo-id> \
2 --port 8000 \
3 --max-model-len 65536 \
4 --speculative-config '{"method":"qwen3_5_mtp","num_speculative_tokens":1}' \
5 --kv-cache-dtype fp8_e4m3 \
6 --mamba-cache-mode align \
7 --trust-remote-codeqwen3_5_mtp is what reads text_config.mtp_num_hidden_layers (which Qwen/Qwen3.6-27B ships as 1). The base config does not carry num_nextn_predict_layers, so the qwen3_next_mtp method shown on some Qwen model cards resolves to n_predict=0 on this checkpoint.qwen3_5 model_type.--language-model-only --limit-mm-per-prompt '{"image": 0, "video": 0}'.lna-lab/GGUF-to-NVFP4-SM120 — published the modelopt + MTP-graft recipe used here.sakamakismile/Qwen3.6-27B-Text-NVFP4-MTP — same recipe, text-only variant.froggeric/Qwen-Fixed-Chat-Templates — chat template.Qwen/Qwen3.6-27B — base weights.