Why the new vLLM blockwise-FP8 receiver expects the wrong scale shape on some MoE layers

NVIDIA-NeMo/RL #4525, head 74295f6. vLLM links pin v0.29.0, the version in uv.lock.

Before
FP8 values were copied in as-is. Scales went through vLLM's own loader, which adapts them to whatever grid vLLM chose.
This PR
The receiver quantizes the weight itself. It computes the scale shape from weight_block_size (128ร—128).
Status
Open โ€” not fixed in this PR. Setup raises a shape error; nothing is silently wrong. No shipped recipe uses this combination. Raised in the review with a one-line fix. Traced in source, not run on a GPU.

Two pages on this PR, one question each. This one: the setup failure on refined MoE grids.

vLLM blockwise FP8 stores one float32 scale per square block of weights. For MoE layers, when the per-GPU expert width is not a multiple of 128, vLLM picks a smaller square block (refine_fp8_moe_block_shape). It keeps that block in quant_method.moe_block_shape and sizes the scales with it (fp8.py:500, :575). But it still sets layer.weight_block_size to the checkpoint's 128ร—128 (:556). The new receiver reads weight_block_size (vllm_backend.py:2015).

The two grids for one w13 expert slice

Qwen3-30B-A3B at vLLM TP=8, no EP: one expert's w13 on one GPU = [192, 2048] (gate 96 + up 96) expert width per GPU = 768 / 8 = 96 โ†’ 96 % 128 โ‰  0 โ†’ vLLM refines: gcd(128, 128, 96, 2048) = 32 what vLLM allocated block 32ร—32 โ†’ scale [6, 64] what the PR's receiver expects block 128ร—128 โ†’ scale [2, 16] scale sized with moe_block_shape (fp8.py:575) expected shape from weight_block_size (:2015-2029) At setup (building the receive map): actual (E, 6, 64) โ‰  expected (E, 2, 16) ValueError: build_hf_to_local_param_map: FP8 scale target ... has shape (โ€ฆ, 6, 64), expected (โ€ฆ, 2, 16) shape check (:2050-2055) one scale entry vLLM keeps one scale entry the receiver would write TP=4 fails the same way (width 192 โ†’ block 64)

The fix โ€” proposed in the review, not in the PR

Where the fix lands: RL only, one function. vllm_backend.py build_hf_to_local_param_map. No vLLM change: vLLM already publishes the block it used.

@@ vllm_backend.py L2015-L2017 ยท build_hf_to_local_param_map (blockwise FP8 branch)
-                    block_size = getattr(module, "weight_block_size", None)
+                    # vLLM MoE layers may refine the scale grid when the per-rank
+                    # intermediate size is not a multiple of weight_block_size.
+                    block_size = getattr(module.quant_method, "moe_block_shape", None)
+                    if block_size is None:
+                        block_size = getattr(module, "weight_block_size", None)
                    if block_size is None:
                        block_size = module.quant_method.quant_config.weight_block_size

What each piece does. moe_block_shape is the block vLLM's MoE kernel actually reads (fp8.py:790). It equals weight_block_size when nothing was refined (:485), so the cases that work today do not change. Linear layers have no moe_block_shape and fall through to the old lookup. The refined block is always square and divides the expert width, so the quantizer call and the gate/up scale-row split still hold. Not run on a GPU.

๐Ÿ”ด review comment โ€” vllm_backend.py:2016

So what. No shipped recipe hits this: every shipped nccl_reshard FP8 recipe uses MXFP8 (is_mx: true). But the PR's design-doc table marks blockwise-FP8 โ†’ vLLM blockwise FP8 as supported. A user who tries it on a common MoE model at TP=4 or TP=8 without expert parallel gets a setup error. On main it worked. The unit test cannot catch it, because its mock module only has weight_block_size; the review asks for a case with a different moe_block_shape.