perf: Reduce MXFP8 refit weight-transfer overheads - #3294
Conversation
|
Isolated-branch reproduction (follow-up promised in the PR body). Setup: Qwen3-30B-A3B GRPO (OpenMathInstruct-2), 2 nodes x 8 B200,
The saving is confined to the refit phase, exactly as claimed; all compute phases and reward are untouched. |
|
/ok to test 740c825 |
|
/ok to test 3f60f5d |
|
Isolated reproduction at 235B scale (follow-up to the 30B numbers above). Setup: Qwen3-235B-A22B GRPO, 8 nodes x 8 B200 (64 GPUs),
The refit-transfer saving grows with model size (30B: 9.7 -> 3.0 s; 235B: 21.8 -> 7.4 s), because larger weights spend proportionally more of the refit in transport - exactly the phase this PR targets. Batched-shuffle bit-exact verify passed on first refit. |
|
/ok to test 04af034 |
|
/ok to test e06f7a8 |
|
/ok to test 3ebdf9d |
Reduce MXFP8 and ModelOpt refit overhead while preserving transport and checkpoint-engine lifecycle correctness. Signed-off-by: sna <sna@nvidia.com>
3ebdf9d to
b88aa2c
Compare
|
/ok to test b88aa2c |
|
/ok to test 438e20d |
Signed-off-by: sna <sna@nvidia.com>
|
/ok to test 96ba299 |
|
/ok to test 96ba299 |
- Guard offload_after_refit against configs without megatron_cfg - Skip fp8 module import in prepare_refit_info for non-FP8 refits so stubbed quant-backend tests can prepare refit info - Drop duplicate MXFP8 scale clamp already done in quantize_mxfp8_weight - Fix prequantized-load test to compare tensor contents (reshape breaks object identity) and pin the noncolocated PPO mock's refit negotiation Signed-off-by: seonjinn <sna@nvidia.com>
Signed-off-by: seonjinn <sna@nvidia.com>
|
/ok to test 382fa8b |
Signed-off-by: seonjinn <sna@nvidia.com>
|
/ok to test 125f178 |
Signed-off-by: seonjinn <sna@nvidia.com>
|
/ok to test e28239c |
Signed-off-by: seonjinn <sna@nvidia.com>
|
/ok to test 232da17 |
Signed-off-by: seonjinn <sna@nvidia.com>
Signed-off-by: seonjinn <sna@nvidia.com>
…60904 Signed-off-by: seonjinn <sna@nvidia.com> # Conflicts: # nemo_rl/algorithms/grpo.py # nemo_rl/weight_sync/collective_weight_synchronizer.py # nemo_rl/weight_sync/interfaces.py # tests/unit/models/generation/test_vllm_fp8_quantization.py
Signed-off-by: seonjinn <sna@nvidia.com>
Signed-off-by: seonjinn <sna@nvidia.com>
Signed-off-by: seonjinn <sna@nvidia.com>
Signed-off-by: seonjinn <sna@nvidia.com>
Signed-off-by: seonjinn <sna@nvidia.com>
Signed-off-by: seonjinn <sna@nvidia.com>
Signed-off-by: seonjinn <sna@nvidia.com>
Signed-off-by: seonjinn <sna@nvidia.com>
Signed-off-by: seonjinn <sna@nvidia.com>
|
Validation update on Exact PR head
Combined mixed-refit compatibility run This run includes PR #3294 plus the dependent mixed BF16/MXFP8 refit changes; it is not a PR #3294-only performance result.
This also exercises the grouped MXFP8 scale-sidecar routing added in this update. The old path failed on the first Qwen refit; this run completed all repeated refits. |
Fixes six gate-0 failures introduced by porting tests from a newer variant onto NVIDIA-NeMo#3294's fp8.py: - test_mxfp8_moe_checkpoint_scales_survive_layerwise_reload: stub ModelWeightParameter's TP rank/world-size before allocating the fake layer's parameters. The earlier stub call ran only inside _allocate_moe_checkpoint_scales, after the parameters were already built, so parallel_state's uninitialised group tripped construction. - test_checkpoint_refit_preserves_nonsharded_fp8_path: variant C's fp8.load_weights takes (weights, model_runner); drop the stale model_load_weights kwarg assertion. - test_unquantized_nccl_reshard_keeps_existing_refit_lifecycle and test_fp8_flashinfer_trtllm_keeps_existing_refit_lifecycle: variant C's _weight_update_lifecycle has no _maybe_process_fp8_kv_cache hook, so drop the mock and its assertion. - test_prepare_refit_info_reports_only_fp8_weights[False|True]: give vllm_config a non-None quant_config so _uses_unquantized_flashinfer_trtllm short-circuits before probing the opaque object() model. Signed-off-by: seonjinn <sna@nvidia.com>
Use the replayed PR NVIDIA-NeMo#3804 tree on the latest PR NVIDIA-NeMo#3294 and main integration. Signed-off-by: seonjinn <sna@nvidia.com>
|
/ok to test cfbe773 |
@seonjinn, there was an error processing your request: See the following link for more information: https://docs.gha-runners.nvidia.com/cpr/e/2/ |
Summary
Reduce repeated BF16-to-MXFP8 refit work for colocated Sync RL.
The Qwen Sync MXFP8 performance recipes enable the optimization. Async recipes explicitly leave it disabled; Async MXFP8 uses the NCCL Reshard path configured by #3865.
Safety
The prequantized path exchanges metadata before transfer and requires each E4M3 tensor to include its matching
*_scale_from_checkpoint. It rejects incompatible trainer FP8 storage and NCCL Reshard configurations.Results
Historical integrated B200 measurements:
These measurements include the batched MXFP8 MoE shuffle now provided by #3478. A matched current-main A/B is still needed to isolate the remaining changes in this PR.
Validation
python3 -m pytest -q tests/test_mxfp8_rollout_recipes.py(22 passed)