How an FP8 expert weight crosses the nccl_reshard refit, before and after this PR
NVIDIA-NeMo/RL #4525
(refactor(refit): restore canonical HF pre/post hooks). All permalinks pin head 74295f6;
"before" links pin the merge base 66c0925.
Before
Blockwise-FP8 training weights went over the wire as raw FP8 bytes. Their scales took a second, slower path into vLLM's own loader.
This PR
Every quantized source is decoded to BF16 before sending. The receiver quantizes it again into its own format, scales included.
Status
Implemented in this PR. Simpler and allows more format pairs, at 2× the wire bytes for FP8 sources. One regression came with it; see the next page.
Two pages on this PR, one question each. This one: what moves where, before and after.
Background. A refit
copies new weights from training to the generation engine after each step. With refit_transport: nccl_reshard, the big FFN weights
(gate, up, down, dense and MoE) go on a bulk path: one point-to-point NCCL transfer per weight, resharded from training layout to
generation layout. Everything else goes on a misc path: a packed broadcast loaded through the engine's normal weight loader.
Each side describes each weight with a LocalParamSpec: pre builds the send/receive buffer, post commits it.
Dotted words have a short explanation: hover or tap them.
The example is one MoE expert's gate_proj weight, shape [768, 2048], stored as Transformer Engine blockwise FP8
(one scale per 128×128 block, so a [6, 16] scale grid). It goes to a vLLM engine also running blockwise FP8.
On the PR side, the source hook pre
decodes and picks the BF16 wire dtype. The vLLM hook
_blockwise_fp8_receiver_quant_spec
quantizes the weight again on arrival.
One weight, two paths
What this buys, and what it costs
Before
This PR
Who knows the storage format
both ends, plus a negotiated mode
only the hooks on each end
Format pairs allowed at setup
BF16→BF16, blockwise→blockwise, BF16→MXFP8
most pairs (see the PR's design-doc table)
Wire bytes for an FP8 source
1 byte/elem
2 bytes/elem, plus decode + quantize
Who writes the scales
vLLM's loader, via misc
the receiver hook, with the values
So what. The transfer loop no longer cares how either side stores a weight. That is why this PR could delete
refit_payload_mode and the source cache, and allow format pairs main rejected. The price is 2× wire bytes for FP8 sources.
There is no FP8 timing after the change yet; the review asks for one.
Also, the receiver now computes scale shapes itself, where vLLM's loader used to. On one vLLM MoE layout it gets that shape wrong:
page 2.