Views
No views yet
Qwen/Qwen3.6-27B, produced with Intel's AutoRound.auto-round (default recipe, 200 iters, torch.compile)linear_attn.in_proj_a/b, and MTP's fusion fc are kept unquantized (they're small and benefit from full precision)eugr/spark-vllm-docker fork 0.19.1rc1.dev39+g7055d32a7):1vllm serve Lorbus/Qwen3.6-27B-int4-AutoRound \
2 --dtype half \
3 --max-model-len 262144 \
4 --gpu-memory-utilization 0.85 \
5 --kv-cache-dtype tq-t4nc \
6 --max-num-seqs 3 \
7 --reasoning-parser qwen3 \
8 --enable-auto-tool-choice \
9 --tool-call-parser qwen3_xml \
10 --port 8888 --host 0.0.0.0 \
11 --trust-remote-code \
12 --compilation-config.cudagraph_mode none \
13 --speculative-config '{"method": "mtp", "num_speculative_tokens": 1}'--kv-cache-dtype tq-t4nc (TurboQuant 4-bit) halves KV memory vs fp8. Use --kv-cache-dtype fp8 for mainline vLLM without the TurboQuant fork.--compilation-config.cudagraph_mode none is currently needed on Blackwell consumer (SM120/SM121) GPUs — CUDA graph capture hits a cudaErrorStreamCaptureInvalidated on the MTP module in some vLLM nightlies.--speculative-config enables the model's native MTP head as a built-in drafter.1from openai import OpenAI
2client = OpenAI(base_url="http://localhost:8888/v1", api_key="EMPTY")
3r = client.chat.completions.create(
4 model="Lorbus/Qwen3.6-27B-int4-AutoRound",
5 messages=[{"role": "user", "content": "Write a quicksort in Python."}],
6 max_tokens=512,
7)
8print(r.choices[0].message.content)1from transformers import AutoModelForCausalLM, AutoTokenizer
2m = AutoModelForCausalLM.from_pretrained(
3 "Lorbus/Qwen3.6-27B-int4-AutoRound",
4 trust_remote_code=True,
5 device_map="auto",
6)
7tok = AutoTokenizer.from_pretrained("Lorbus/Qwen3.6-27B-int4-AutoRound")
8msg = [{"role": "user", "content": "Explain quantum computing briefly."}]
9ids = tok.apply_chat_template(msg, add_generation_prompt=True, return_tensors="pt").to(m.device)
10print(tok.decode(m.generate(ids, max_new_tokens=256)[0]))| Field | Value |
|---|---|
| Base | Qwen/Qwen3.6-27B |
| Method | AutoRound (intel/auto-round), default recipe |
| Scheme | W4A16 (4-bit weights, FP16 activations) |
| Bits | 4 |
| Group size | 128 |
| Symmetric | yes |
| Packing format | auto_round:auto_gptq |
| Unquantized layers | linear_attn.in_proj_a/b, mtp.fc, all LayerNorms and RMSNorms, router gates |
| Calibration samples | 128 (default) |
| Iterations | 200 |
| torch.compile | enabled |
| GPU used for quant | 1× RTX 5090 (32 GB, SM120), low_gpu_mem_usage=True |
| Quant wall time | ~1h 40min |
linear_attn.in_proj_a/b: these are low-rank projections in Qwen3.6's Gated DeltaNet. Their shapes are not divisible by 32 (group_size), so AutoRound skips them. They account for a tiny fraction of parameters.mtp.fc: the Multi-Token Prediction fusion layer. AutoRound initially quantized it to GPTQ-packed INT4, but vLLM's Qwen3_5MTP loader expects an unquantized fc.weight. We dequantized it to BF16 so MTP works natively. If you use this quant without MTP, the fc weight is still there and harmless.auto-round run on a Qwen3.5/3.6 model packs mtp.fc as INT4. In that form, vLLM skips
loading the layer entirely (param name mismatch between fc.qweight and the expected fc.weight),
which makes MTP speculative decoding produce 0% acceptance.mtp.fc back to BF16 after AutoRound finishes. The layer is only
~100 MB (5120 × 10240 × 2 bytes) so the file size impact is negligible. Result: MTP works
out of the box and reaches ~80-90% draft acceptance on typical prompts.| Prompt type | max_tokens | Throughput |
|---|---|---|
| "Write a haiku" | 128 | 58 tok/s |
| "Explain quantum computing in 3 paragraphs" | 256 | 60 tok/s |
| "Write 8 paragraphs about deep learning history" | 1024 | 60 tok/s |
| "What is 127*83? Show reasoning" | 256 | 61 tok/s |
--speculative-config removed): ~32 tok/s. The 2x speedup comes from MTP speculative decoding with ~85% acceptance.image_url content part. Image quantization was not the focus here; MoonViT encoder weights are kept at their original precision (BF16/FP16 as in the base model).bits: 4 at group_size: 128 prioritizes throughput/memory over maximal accuracy. For accuracy-critical work, try the auto-round-best recipe (1000 iters, ~5-10x slower) or a higher bit width.partial_rotary_factor RoPE scaling is preserved, so 262K should work.1pip install auto-round-nightly
2
3auto-round \
4 --model Qwen/Qwen3.6-27B \
5 --scheme W4A16 \
6 --format auto_round \
7 --output_dir Qwen3.6-27B-int4-AutoRound \
8 --enable_torch_compile \
9 --low_gpu_mem_usage \
10 --device_map 0mtp.fc for MTP compatibility — see the dequant_mtp_fc.py script below:1#!/usr/bin/env python3
2"""Dequantize mtp.fc from GPTQ INT4 back to bf16 so vLLM's MTP loader picks it up."""
3import json, shutil
4from pathlib import Path
5import torch
6from safetensors import safe_open
7from safetensors.torch import save_file
8
9BASE = Path("Qwen3.6-27B-int4-AutoRound")
10EXTRA = BASE / "model_extra_tensors.safetensors"
11INDEX = BASE / "model.safetensors.index.json"
12
13tensors = {}
14with safe_open(EXTRA, framework="pt") as f:
15 meta = f.metadata() or {}
16 for k in f.keys():
17 tensors[k] = f.get_tensor(k)
18
19qw = tensors["mtp.fc.qweight"] # [1280, 5120] int32
20qz = tensors["mtp.fc.qzeros"] # [80, 640] int32
21sc = tensors["mtp.fc.scales"] # [80, 5120] fp16
22
23in_features = qw.shape[0] * 8 # 10240
24out_features = qw.shape[1] # 5120
25group_size = 128
26num_groups = in_features // group_size # 80
27
28def unpack_int32_4bit(packed, axis, factor=8):
29 dev = packed.device
30 shifts = torch.arange(0, 32, 4, device=dev, dtype=torch.int32)
31 expanded = (packed.unsqueeze(axis + 1) >> shifts.view([8 if i == axis + 1 else 1 for i in range(packed.ndim + 1)])) & 0xF
32 new_shape = list(packed.shape); new_shape[axis] *= factor
33 return expanded.reshape(new_shape).to(torch.int8)
34
35w_int = unpack_int32_4bit(qw, axis=0) # [10240, 5120]
36z_int = unpack_int32_4bit(qz, axis=1) # [80, 5120]
37
38w_grouped = w_int.view(num_groups, group_size, out_features).to(torch.float32)
39w_fp32 = (w_grouped - z_int.unsqueeze(1).to(torch.float32)) * sc.unsqueeze(1).to(torch.float32)
40w_final = w_fp32.view(in_features, out_features).t().contiguous().to(torch.bfloat16) # [5120, 10240]
41
42# Replace
43for k in ("mtp.fc.qweight", "mtp.fc.qzeros", "mtp.fc.scales"):
44 del tensors[k]
45tensors["mtp.fc.weight"] = w_final
46
47save_file(tensors, str(EXTRA), metadata=meta)
48
49# Update index
50idx = json.loads(INDEX.read_text())
51for k in ("mtp.fc.qweight", "mtp.fc.qzeros", "mtp.fc.scales"):
52 idx["weight_map"].pop(k, None)
53idx["weight_map"]["mtp.fc.weight"] = EXTRA.name
54# Recompute total_size
55from collections import defaultdict
56shard_sizes = defaultdict(int)
57for sf in set(idx["weight_map"].values()):
58 with safe_open(BASE / sf, framework="pt") as f:
59 for k in f.keys():
60 t = f.get_tensor(k)
61 shard_sizes[sf] += t.numel() * t.element_size()
62idx["metadata"]["total_size"] = sum(shard_sizes.values())
63INDEX.write_text(json.dumps(idx, indent=2))1@article{cheng2023autoround,
2 title = {Optimize Weight Rounding via Signed Gradient Descent for the Quantization of LLMs},
3 author = {Cheng, Wenhua and Zhang, Weiwei and Shen, Haihao and Cai, Yiyang and He, Xin and Lv, Kaokao and Liu, Yi},
4 journal = {arXiv preprint arXiv:2309.05516},
5 year = {2023}
6}