Ling3.0-Flash-3.58BPW

Mixed-precision AutoRound quantization of inclusionAI/Ling-3.0-flash for vLLM. Text-only; the MTP (next-token-prediction) layer is removed. Checkpoint size 51.94 GiB, 3.58 bits per weight on average over all tensors (packed weights, scales, zero points and BF16 parts).

Precision layout

Component Format
Routed experts, layers 2, 3, 4, 5, 38, 39, 40, 41 W4A16, group 128, symmetric
Routed experts, other 32 MoE layers W3A16, group 128, symmetric
Attention (KDA + MLA) projections W8A16, group 128, symmetric (KDA f_proj kept BF16)
Dense MLP (layers 0–1) W8A16, group 128, symmetric
Routers, shared experts, embeddings, LM head, norms BF16

AutoRound 0.16.1 (SignRound), 400 iterations/block, 1024 × 2048-token calibration samples (chat / code / reasoning / long-context / wikitext prose, production chat template; best-MSE=True). Format auto_round:auto_gptq.

Fidelity vs. BF16

Teacher-forced full-vocabulary KL(P_bf16 ‖ Q_quant) on a held-out set (24 × 1,024 tokens; sources and splits disjoint from calibration):

Domain Positions Mean KL Median KL P99 KL Top-1 agreement PPL bf16 → quant
all 24552 0.08165 0.00279 1.1531 93.39% 2.544 → 2.513
chat 10230 0.06938 0.01114 0.7805 91.96% 3.674 → 3.558
code 5115 0.08211 0.00003 1.6152 97.03% 1.679 → 1.644
math 5115 0.09364 0.00140 1.7289 94.17% 2.217 → 2.209
prose 4092 0.09677 0.00676 1.0741 91.42% 2.024 → 2.103

P99.9 KL 7.4174, max 21.714. vLLM vs. reference decoder on the same windows: top-1 agreement 84.79%, top-20 overlap 78.2% (FAIL).

Evolution vs. Ling3.0-Flash-3.44BPW

Variant Config Size / BPW Mean KL P99 KL Top-1 Prose KL Math P99.9 Code P99.9
Ling3.0-Flash-3.44BPW 128 samples, 200 iters, 2× W4 (2,41) 49.82 GiB / 3.44 0.08767 1.2216 92.88% 0.11341 10.307 13.536
Ling3.0-Flash-3.58BPW 1024 samples, 400 iters, 8× W4 (2–5,38–41), best-MSE 51.93 GiB / 3.58 0.08165 1.1531 93.39% 0.09677 6.406 11.040

Serving (vLLM)

Tested on vLLM 0.32.0 / 0.33.0 (single 64+ GB GPU, ~51.9 GiB of weights). Stock vLLM 0.32/0.33 needs two small patches for this checkpoint; they are not quantization problems but vLLM bugs, and vllm-patch.py in this repo applies them (idempotent, keeps .orig backups, --check / --revert):

python vllm-patch.py              # run with the python of your vLLM environment
vllm serve Beling86/Ling3.0-Flash-3.58BPW --trust-remote-code --dtype bfloat16 --max-model-len 262144
# Where Bug Symptom without the patch
1 quantization/inc/config_parser.py The per-layer bit-width of a fused MoE layer is only read when the class name contains fusedmoe; the class is now RoutedExperts. Every MoE layer silently falls back to the global bits: 4, so the W3 experts get 4-bit containers. CUDA OOM at model construction (at lm_head, ~63 GiB allocated for a 49.8 GiB checkpoint), before any weight is read
2 models/bailing_moe_v3.py bailing_v3_kda_attention (host-syncing KDA state update) is not registered through eager_break_during_capture, so it runs inside CUDA-graph capture. cudaErrorStreamCaptureUnsupported / "operation not permitted when stream is capturing" at state_indices[~has_initial_state]

Without patch 2 you can also run with --compilation-config '{"cudagraph_mode":"FULL_DECODE_ONLY"}' or --enforce-eager.

config.json must contain "model_type": "bailing_hybrid". vLLM detects MLA from it. The first export of this checkpoint lost the key (Ling's remote-code config class has an empty model_type, so transformers 5 dropped it when AutoRound re-saved the config); vLLM then sized the KV cache as plain 32-head attention and died at the first MLA layer with "Layer model.layers.5.self_attn.attn: page size is not divisible by the maximum page size and cannot be padded". The config.json in this repo is fixed; if you downloaded an older copy, fetch it again. The quantization pipeline now restores the key automatically (v3/fix_config.py).

2/3-bit experts run on the Humming kernels, 4/8-bit layers on Marlin. Loading takes ~100 s (49.62 GiB).

Validation gates passed

Coverage, packed layout vs. config, zero points vs. sym, fused-group consistency, size ≤ 52.0 GiB, plan conformance, strict reload (no missing keys) for the KL evaluation.

Downloads last month
56
Safetensors
Model size
15B params
Tensor type
F32
·
I32
·
BF16
·
F16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for Beling86/Ling3.0-Flash-3.58BPW

Quantized
(46)
this model