Choose a precision
Rollout × training compatibility
Each row is a rollout (inference) precision; each column is the trainer’s forward precision. ✅ = supported; ✗ = not supported.
Two rules enforced in the reference script
(
scripts/run_qwen3_30b_a3b.py):
--rollout-mxfp8and--rollout-fp8are mutually exclusive.--train-mxfp8requires--rollout-mxfp8(no MXFP8-train + FP8-rollout combo).
Unified training recipe
The forward pass in training matches rollout. The backward pass and master
weights remain BF16, which keeps the gradient signal stable. Weights are
re-quantized on each weight-update sync to sglang.
Modes
1. BF16 train + FP8 inference
The lowest-friction path. SGLang loads FP8 weights while the trainer keeps a BF16torch_dist checkpoint. There is precision drift between the two paths;
on MoE workloads, pair this with R3 (and optionally TIS).
2. Unified block-wise FP8 (DeepSeek-style)
Rollout and training share the same block-wise FP8 quantization. This is the recipe to use on Hopper, and the recipe DeepSeek-V3 / DeepSeek-R1 ship in. Block layout is 128×128 with FP32 scales.
Set
NVTE_FP8_BLOCK_SCALING_FP32_SCALES=1 in the Ray runtime env to use FP32
scales (miles/ray/actor_group.py already sets this in the actor env).
For models that already ship 128×128 block-wise FP8 weights (DeepSeek-V3,
DeepSeek-R1, Qwen/Qwen3-30B-A3B-FP8), point --hf-checkpoint at the
block-wise FP8 directory and let SGLang autodetect. Otherwise convert with
tools/convert_hf_to_fp8.py.
For MoE workloads, also consider --use-rollout-routing-replay (R3). The
canonical recipe leaves it commented out by default but the flag is available.
Reference recipes:
examples/infra_features/low_precision/run-qwen3-4b-fp8.sh— single-node Qwen3-4B.examples/infra_features/low_precision/run-qwen3-30b-a3b-fp8-two-nodes.sh— two-node Qwen3-30B-A3B.
3. Unified MXFP8 (Blackwell)
MXFP8 uses a finer block layout (1×32) with UE8M0 (power-of-two) scales packed asuint8. Weights are stored as float8_e4m3fn. This is the format wired
into the Blackwell path of the Qwen3-30B-A3B reference script.
Hardware: Blackwell only — B200, B300, GB200, GB300. The reference script
asserts the GPU class on enable (scripts/run_qwen3_30b_a3b.py).
Train flags — same Megatron knobs as FP8, with mxfp8 recipe:
*.weight tensor whose last dim is divisible by
32, except layernorm, embed, router, mlp.gate., norm, lm_head,
eh_proj, weights_proj (tools/convert_hf_to_mxfp8.py). The HF
config is rewritten with:
- No DeepEP / DeepGEMM yet — MoE all-to-all uses the cutlass MoE runner, which does not currently support EP. Plan EP/PP accordingly.
--train-mxfp8requires--rollout-mxfp8(the script enforces this).
scripts/run_qwen3_30b_a3b.py
with --rollout-mxfp8 --train-mxfp8 --hardware B200. There is no dedicated
shell script under examples/infra_features/low_precision/ yet.
4. NVFP4 (experimental)
NVFP4 is FP4 E2M1 with 1D block scaling (group size 16) and a two-level scale (per-block FP8 + per-tensor FP32), following the TransformerEngine NVFP4 reference. Today only MoE expert GEMMs are quantized; dense layers stay in their original precision. The full unified NVFP4 recipe is in development.Hardware support
When BF16 is enough
- Dense models below ~30 B.
- A100 hardware (no FP8 GEMM).
- AMD hardware today.
- Bring-up of a new model architecture, where clean BF16 numerics simplify debugging.

