Repository navigation
perf: avoid CPU round trip during NVFP4 refit - #3308
Conversation
Signed-off-by: sna <[email protected]>
Signed-off-by: sna <[email protected]>
Signed-off-by: sna <[email protected]>
Signed-off-by: sna <[email protected]>
Signed-off-by: sna <[email protected]>
Signed-off-by: sna <[email protected]>
Signed-off-by: sna <[email protected]>
|
/ok to test 9643550 |
terrykong
left a comment
There was a problem hiding this comment.
@parthmannan can you also review?
terrykong
left a comment
There was a problem hiding this comment.
Team review of the NVFP4 GPU-resident export path. Nice work — the benchmarks in the description are thorough, and the safety story checks out under scrutiny: all in-repo real_quant recipes inherit the new key via their defaults: chains rooted at grpo_math_1B.yaml; configure_generation_config runs on every entrypoint before workers are built; refit_transport: null is the only route to CUDA IPC so the guard has no false positives; and the cpu=False path yields a fresh packed tensor with stream-synchronized IPC staging, so there is no aliasing hazard. 3 inline suggestions below — the test-lane one is the only item worth addressing before merge.
Generated by Claude Code
…t-refit Signed-off-by: sna <[email protected]>
Signed-off-by: sna <[email protected]>
|
/ok to test 30b4139 |
Signed-off-by: sna <[email protected]>
Signed-off-by: sna <[email protected]>
|
/ok to test 35b966a |
test_vllm_megatron_pipeline_parallel began failing intermittently on L0_Unit_Tests_Mcore (fail, pass, fail across three runs) with 'Failed: Timeout (>120.0s) from pytest-timeout' -- a wall-clock timeout, not an assertion. Measured rather than guessed. Call time for this test: vLLM 0.20 103.80s (PR #3308, job 90163013717) vLLM 0.25 113.10s (this branch, job 89878378208) So 0.25 costs ~9.3s / +9% here, and the headroom under the 120s budget drops from 16.2s to 6.9s. Less than normal run-to-run variance on a shared runner, which is exactly why it flips between pass and fail. The budget was already marginal before this bump -- 86% consumed on 0.20 -- so this raises it to 240s rather than chasing the regression to the second. The measurements and job IDs are recorded at the marker so the next person does not have to re-derive them. Note the +9% is engine-init overhead in a test that builds both a Megatron pp=2 policy and a vLLM engine inside one budget; it is not a generation throughput regression. Signed-off-by: Terry Kong <[email protected]>
Signed-off-by: seonjinn <[email protected]>
|
/ok to test a13023c |
test_vllm_megatron_pipeline_parallel began failing intermittently on L0_Unit_Tests_Mcore (fail, pass, fail across three runs) with 'Failed: Timeout (>120.0s) from pytest-timeout' -- a wall-clock timeout, not an assertion. Measured rather than guessed. Call time for this test: vLLM 0.20 103.80s (PR #3308, job 90163013717) vLLM 0.25 113.10s (this branch, job 89878378208) So 0.25 costs ~9.3s / +9% here, and the headroom under the 120s budget drops from 16.2s to 6.9s. Less than normal run-to-run variance on a shared runner, which is exactly why it flips between pass and fail. The budget was already marginal before this bump -- 86% consumed on 0.20 -- so this raises it to 240s rather than chasing the regression to the second. The measurements and job IDs are recorded at the marker so the next person does not have to re-derive them. Note the +9% is engine-init overhead in a test that builds both a Megatron pp=2 policy and a vLLM engine inside one budget; it is not a generation throughput regression. Signed-off-by: Terry Kong <[email protected]>
What does this PR do?
Real NVFP4 refit quantizes and packs policy weights on GPU, but the existing export path copies every packed tensor to CPU before colocated CUDA IPC copies it back to GPU for vLLM reload.
This PR adds opt-in
generation.real_quant_export_cpu_offload: falsefor colocated CUDA-IPC refit. The CPU path remains the default, and GPU-resident export is rejected for non-colocated or explicit refit transports.Benchmark setup
Impact
Accuracy impact
These are single-seed sampled training rewards, not held-out accuracy. The W4A4 paired step-level reward difference has a 95% CI of
[-0.0711, +0.0239], which includes zero. Training trajectories diverge after the first update, so this benchmark does not claim convergence parity.Correctness
Trade-off
GPU-resident export retains packed tensors on the source GPU during refit, trading the host round trip for additional transient GPU memory. Users can keep the default CPU path when memory headroom is limited.