What W4A16 means
The combination keeps the weights small (memory-bound) while activations stay
in BF16 (math-bound). With QAT the model trains with the quantization in the
loop, so the weights round well during inference.
Calibration
Convert a BF16 HuggingFace checkpoint to INT4 withtools/convert_hf_to_int4.py
(GPTQ via llmcompressor):
The output is a HuggingFace directory with per-group INT4 weights and scales.
Point
--hf-checkpoint at it; SGLang autodetects the quantization at load time.
Enabling QAT
QAT is currently driven by environment variables passed through Ray’s runtime env rather than CLI flags. The canonical recipe isexamples/infra_features/low_precision/run-qwen3-30B-A3B-int4.sh:
--hf-checkpoint with a BF16 --ref-load torch_dist directory
so the KL anchor stays full-precision.
Tuning
Pairs with
- R3. Keeps MoE routing stable across the quantized forward.
- P2P weight transfer. INT4 weights are 4× smaller, so weight sync transfers less data.
- Speculative decoding. Compounds for end-to-end rollout speedup.
When QAT is not appropriate
- The model fits comfortably without it.
- The model architecture is still in development; introduce QAT after a BF16 baseline.
- Tasks that are highly precision-sensitive (some math and safety eval suites).

