Views
No views yet
compressed-tensors format that vLLM and SGLang load natively.Quality below). For a 234 B-parameter MoE this is a worthwhile trade.1from llmcompressor.modifiers.quantization import QuantizationModifier
2from compressed_tensors.quantization import QuantizationArgs, QuantizationScheme
3
4w8a16 = QuantizationScheme(
5 targets=["Linear"],
6 weights=QuantizationArgs(
7 num_bits=8,
8 type="int",
9 symmetric=True,
10 group_size=128,
11 strategy="group",
12 dynamic=False,
13 observer="memoryless_minmax",
14 ),
15)
16
17recipe = QuantizationModifier(
18 config_groups={"w8a16": w8a16},
19 ignore=[
20 "lm_head", # output head — no quant
21 "re:.*router.*", # MoE expert routers — must stay precise
22 "re:.*\\.gate\\b", # router gate layers
23 "re:.*embed_tokens.*",
24 ],
25)ignore list is critical for MoE: quantizing the router or its gate
collapses expert selection and ruins everything downstream.model-NNNNN-of-NNNNN.safetensors (≈ 130 GB total)model.safetensors.index.jsonconfig.json with compression_config describing the W8A16 schemerecipe.yaml — the llmcompressor recipe used.py files1python -m vllm.entrypoints.openai.api_server \
2 --model operationrange/MiniMax-M2.7-8bit \
3 --quantization compressed-tensors \
4 --tensor-parallel-size 8 \
5 --trust-remote-code1python -m sglang.launch_server \
2 --model-path operationrange/MiniMax-M2.7-8bit \
3 --quantization compressed-tensors \
4 --tp-size 8 --ep-size 8 \
5 --tool-call-parser minimax-m2 \
6 --reasoning-parser minimax-append-think \
7 --trust-remote-code \
8 --host 0.0.0.0 --port 8080 \
9 --mem-fraction-static 0.85temperature = 1.0
top_p = 0.95
top_k = 40<think> reasoning are preserved — the router and
embeddings are kept at full precision; only the heavy Linear layers
(attention QKV/O, MLP up/gate/down, MoE expert weights) are INT8.scripts/quant/quantize_rtn_w8a16.py