Repository navigation
Conversation
Signed-off-by: Meng Xin <[email protected]>
Signed-off-by: Meng Xin <[email protected]>
Signed-off-by: Meng Xin <[email protected]>
Signed-off-by: Meng Xin <[email protected]>
Signed-off-by: Meng Xin <[email protected]>
Signed-off-by: Meng Xin <[email protected]>
Signed-off-by: Meng Xin <[email protected]>
Signed-off-by: Meng Xin <[email protected]>
Signed-off-by: Meng Xin <[email protected]>
Signed-off-by: Meng Xin <[email protected]>
…nt-refit Signed-off-by: Meng Xin <[email protected]> # Conflicts: # tests/unit/algorithms/test_grpo.py
Signed-off-by: Meng Xin <[email protected]>
Signed-off-by: Meng Xin <[email protected]>
Signed-off-by: Meng Xin <[email protected]>
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
Signed-off-by: Meng Xin <[email protected]>
Signed-off-by: Meng Xin <[email protected]>
Signed-off-by: Meng Xin <[email protected]>
Signed-off-by: Meng Xin <[email protected]>
Signed-off-by: Meng Xin <[email protected]>
Signed-off-by: Meng Xin <[email protected]>
Signed-off-by: Meng Xin <[email protected]>
This reverts commit 7a06b82. Signed-off-by: Meng Xin <[email protected]>
Signed-off-by: Meng Xin <[email protected]>
Signed-off-by: Meng Xin <[email protected]>
Signed-off-by: Meng Xin <[email protected]>
Signed-off-by: Meng Xin <[email protected]>
Signed-off-by: Meng Xin <[email protected]>
Add distillation-qwen3-1.7b-1n4g-megatron-qa-nvfp4-real (GB200) and the non-colocated sibling of the Qwen3-8B W4A16 nightly, raising the H100 nightly budget to 5548 GPU hours. Make distillation real quant runnable by adding real_quant_export_cpu_offload to distillation_math.yaml. Move the mixed MXFP8/NVFP4 example to a recipe with a manual driver listed in disabled.txt, drop the uncovered Qwen2.5-0.5B real-quant example, and point the guide at configs that tests run. Signed-off-by: Meng Xin <[email protected]>
Grep the native ModelOpt method name in the functional real-quant case and run it in the fast lane. Drop the recipe-pinning test (shipped configs already pass check_outdated_config), the dead DEEPEP_FALLBACK_RECIPES set, duplicated test lines, and the file-path import in the SGLang patches test. Signed-off-by: Meng Xin <[email protected]>
… pyrefly baseline Signed-off-by: Meng Xin <[email protected]>
|
/ok to test eb87715 |
Signed-off-by: Meng Xin <[email protected]>
|
/ok to test 7c95c01 |
Check the RADIO config vLLM builds for the vision model, whose initializer_factor sets ls1/ls2, instead of the checkpoint's remote-code vision_config. The published Nano-Omni RADIOConfig has an empty model_type and no layerscale_value, so the old check rejected it. Dummy-loaded generation workers never download the checkpoint index, so prefetch it at the immutable revision in prepare_refit_info, before the first refit. Signed-off-by: Meng Xin <[email protected]>
|
/ok to test d1b3f2a |
- Run Bridge's check_exportable_quantizers before building the export plan, so recipes with KV-cache or output quantizers fail at startup instead of rolling out without them. - Reject a non-null policy.generation.quant_cfg with real_quant; policy.quant_cfg alone selects the rollout format. - Wrap FP8 MoE reload only when vLLM's quant config holds reciprocal scales, instead of copying vLLM's backend list. - Raise when the RADIO LayerScale loader patch cannot find its anchor. - Test that RealQuantWorker.load_model prepares the unwrapped model. - Point the Nano3 real-quant docs at nvfp4_experts_weightonly.yaml and fix the stale recipe comment. Signed-off-by: Meng Xin <[email protected]>
Signed-off-by: Meng Xin <[email protected]>
|
/ok to test 6a56638 |
mxinO
left a comment
There was a problem hiding this comment.
Deriving vLLM's quantization_config from the calibrated ModelOpt export plan removes the custom NVFP4 methods and, with them, the whole class of policy-vs-generation mode mismatches. Real quant now reuses the base reload lifecycle through named hooks, reject_outdated_real_quant_ignore follows the migration convention, and Policy.get_real_quantization_config checks that every rank agrees. The two open change requests on the RADIO LayerScale identity check (thread) and the cache-only index lookup (thread) are fixed in d1b3f2a.
Inline items:
- (C1) Call Bridge's
check_exportable_quantizersbefore building the export plan, so KV-cache or output quantizers fail at startup instead of rolling out in BF16. - (C2, C3, C4, C5) The Nano3 real-quant docs still name
nano3_nvfp4_weightonly.yaml, which, withoutreal_quant_ignore, quantizes Mambain_proj/out_projand shared experts; point them atnvfp4_experts_weightonly.yaml. - (C6) Reject a non-null
policy.generation.quant_cfgwhenreal_quantis on, instead of ignoring it. - (C7) Decide which FP8 MoE backends to wrap from vLLM's built quant config, not a copied backend list.
- (C8) Raise, not warn, when the RADIO LayerScale loader patch misses its anchor, so the new LayerScale guard can run.
- (C9) Test that
RealQuantWorker.load_modelcalls both MoE scale helpers on the unwrapped model. - (C10) Update the Nano3 recipe comment that still refers to the deleted rollout exclusions.
- (C11) Type
prepare_real_quant_generation_config'spolicyargument asPolicy.
Still open from an earlier thread: the reply on the per-tensor clone promised to add its refit-time cost to the PR description; it is not there yet.
Follow-ups, not asks for this PR:
- (a) Split out a real-quant worker extension class, so the 11
_is_real_quant_model()branches in vllm_quant_backend.py become overrides. The worker class is already picked in one place, vllm_quant_worker.py#L66-L88. - (b)
_apply_vllm_patchescould callensure_vllm_source_compat()instead of repeating its list of source patches (patches.py#L1432-L1436 vs patches.py#L1453-L1457). - (c) No vLLM patch in the repo records the vLLM version it was written against; this is worth a tracking issue.
- (d) Refit skips Bridge's
check_fused_sibling_scales. Only MLA models could hit it, and none ships with real quant.
Validation: CI Lint passes at d1b3f2a; the red pr-description check is only the human review box. Locally at d1b3f2a, the vLLM patch, RADIO and backend unit modules pass (284 tests); at 7c95c01, the other touched vLLM, ModelOpt and algorithm unit modules passed. The mcore-only test_megatron_quant_worker.py was not run.
nemo-rl-review: kind=self harness=claude-code/2.1.331 model=claude-opus-5-5 effort=high review-pr-team=v2 reviewed=d1b3f2a
Signed-off-by: Meng Xin <[email protected]>
|
/ok to test 59999b0 |
Bump Model-Optimizer from cc4b76d7 to 3c815f8d, the merge of NVIDIA/Model-Optimizer#3434. NVFP4 export packing now quantizes with the same reciprocal scale as the Triton fake quant, so real-quant rollout weights match the fake-quantized training weights at rounding boundaries. Signed-off-by: Meng Xin <[email protected]>
|
/ok to test 97f4361 |
Restore logprob preparation to the upstream gather lifecycle and explicit MXFP8 shared-buffer restaging. Preserve open-step gradient guards and the independent checkpoint, refit, warm-up, and optimizer-offload fixes. Signed-off-by: Meng Xin <[email protected]>
|
/ok to test e4791ec |
aroshanghias-nvd
left a comment
There was a problem hiding this comment.
Approving the RADIO / Nano-VL refit changes at e4791ec.
Both issues from my previous review are fixed in d1b3f2a:
- The identity fallback checks vLLM's constructed RADIO config, so the actual Nano-Omni remote-code config is accepted while explicit-scale and non-identity cases remain guarded.
- Generation workers prefetch the checkpoint index at the immutable revision during setup, before refit collectives; refit-time validation remains cache-only.
Four independent focused CPU checks passed on this head: actual Nano-Omni config plus native reload, non-identity rejection, explicit-source-scale rejection, and a genuinely empty generation cache followed by index prefetch and native refit. Successful refits initialize omitted ls1/ls2 to 1.0, and the storage-preservation check passes.
Approval scope: RADIO / Nano-VL. This follow-up validation was CPU-only.
Signed-off-by: Meng Xin <[email protected]>
Signed-off-by: Meng Xin <[email protected]>
|
/ok to test 6f941d9 |
…nt-refit Resolve the nightly GPU-hour budget: main raised it from 5516 to 5524 and this branch raised it to 5548 for its new nightlies; the combined dry run totals 5556. Signed-off-by: Meng Xin <[email protected]>
|
/ok to test 5f631b1 |
Signed-off-by: Meng Xin <[email protected]>
|
/ok to test d7e50ce |
What and why
Adds format-general ModelOpt real-quant rollout to NeMo-RL.
w4a4/w4a16mode helpers (resolve_nvfp4_real_quant_mode,build_vllm_modelopt_nvfp4_config, andnvfp4_quant_algofrom build: update Megatron-Bridge and its runtime dependencies #5005). The mode was derived frompolicy.quant_cfganyway; the calibrated export's ownquantization_configis now the single source for the rollout formatvalidate_real_quant_policy_config,prepare_real_quant_generation_config) between GRPO and distillation; the policy-first startup sequence is written out in each entrypoint. Fake-quant generation is unchangedA rollout format is qualified when ModelOpt can export its canonical tensors and the pinned vLLM ModelOpt loader selects the intended native method for that exact schema. NeMo-RL does not translate unsupported schemas. Depending on vLLM, they may be rejected or may select an unquantized fallback, so representative native methods must be inspected before qualification.
Online refit call flow
Collective refit replaces the IPC/ZMQ transport calls with
broadcast_weights_for_collective()andupdate_weights_from_collective(); the export and native vLLM reload paths are unchanged.Issues
Follows #5005 (merged), which brought the Megatron-Bridge, ModelOpt and runtime versions this PR builds on.
Convergence / perf / functionality proof
Validation
After the review follow-ups (head
eb87715d6): ruff and pyrefly are clean (baseline pruned), and 1,122 unit tests plus 254 vLLM-marked tests pass locally. The later RADIO and self-review fixes (through6a56638e5) pass the touched vLLM (268) and default-lane (564) tests locally; their Megatron-worker tests run in CI. Two nightly recipes were added: Qwen3-1.7B QA distillation with real-quant rollout (GB200) and Qwen3-8B DAPO W4A16 non-colocated. The real-quant nightlies, including both new recipes, are running on this head; results will be added here.After merging main (vLLM 0.33.0): conflicts were resolved against main's vLLM 0.33 code and independently reviewed; every vLLM API the real-quant patches use (ModelOpt MoE/linear methods, MoE backend enums,
moe_quant_config/moe_kernel, layerwise reload) was checked against v0.33.0. Locally, the real-quant config (78), vLLM backend (202), patches (41), RADIO native vision refit including CUDA (36 + 7), refit loader (16), GRPO (507), PPO (113), distillation (36) and config-validation (447) unit tests pass. Since then, full CI passes on the vLLM 0.33 heads (85/85 checks), and the real-quant nightlies ran on vLLM 0.33 (pipeline 83132280): Qwen3-30B-A3B W4A4 real-quant GRPO passed withquantization=modelopt_fp4(gen-KL 0.0159, JS 0.0043); Nano W4A16 real-quant passed (gen-KL 0.0012, max token-mult-prob error 1.026); Qwen3-1.7B QA distillation passed; Qwen3-8B DAPO W4A16 met its metric gates (gen-KL max 0.00127) after updating a stale log check. The benchmark and qualification results below were measured on vLLM 0.29.Earlier: independent aggregate source and dependency-lock review is clean. Fresh qualification of the updated shared stack passed 34 Megatron export/refit tests, eight optimizer/offload tests, and 470 vLLM/refit tests, with no skips or failures. These include installed Bridge fake-quant discovery, four-rank export-group coordination, canonical CPU/GPU byte parity, GDN fake-refit row preservation, and immediate/after-ACK IPC coverage and failure cleanup. Locked native environments and Bridge/export and vLLM ModelOpt plugin imports passed. Shared dependency qualification in #5005 separately covers training/reference/checkpoint and upstream grouped/head/GDN/pipeline-scale regressions. Full CI for these updated heads is pending.
Earlier focused startup validation with the now-pinned Omni Bridge fix passed 72 tests: 15 calibration, 25 Bridge media-export, 8 worker-loading and 24 composed native vision-refit cases, with no skips or failures. These check initial/repeated media parameter values and storage, late LayerScales, folded-checkpoint defaults and CUDA-graph replay. Actual tiny Gemma2/Gemma3 constructors also passed dummy initialization, repeated native reload, derived-normalizer storage checks and embedding-graph replay, including a negative control. These are focused module/configuration checks, not full Super media-model or training qualification.
Earlier functional qualification includes:
Earlier native-layer qualification also passed 70 exact CUDA-graph comparisons after changing packed weights and scales, with captures before and after refit. These cover layer reload and scale preservation. The earlier functional and native-layer results used prior revisions; the benchmark below identifies its measured revision separately.
BF16 vs fake/real NVFP4 W4A4 benchmark
Qwen3-30B-A3B; 128 prompts × 16 responses = 2,048 responses per update; total sequence cap 32,768. Each arm used four GB200 nodes / 16 GPUs, training TP2/CP2/EP16/ETP1 and rollout TP1/EP1, with CUDA graphs enabled, eight concurrent sequences per engine and a 32 GiB KV-cache budget per engine. Fake and real quantization used the same calibrated routed-expert NVFP4 recipe.
The tables report update 3 after two warmup updates, measured at
c2b0d063, before the latest compatibility fixes. All three arms completed three finite updates and repeated trained-weight refits/rollouts.Stage elapsed time (seconds)
Lower is better. Refit is included in preparation, not an additional stage to sum.
Sampled peak GPU memory (GiB/GPU)
Maximum whole-device memory across all 16 GPUs during each stage, sampled every 200 ms; these are sampled, not continuous, peaks.
Real W4A4 rollout throughput was 14,134 output tokens/s, versus 11,548 for BF16 and 9,185 for fake quantization: 1.224× and 1.539×, respectively. Full updates were 9.94% / 28.10% shorter. Refit and policy training were still slower than BF16, and higher-precision logprob computation kept the full-update memory peak near 182–184 GiB/GPU.
Qualification: Fake quantization required ModelOpt QDQ with the Triton MoE backend; BF16 and real quantization used native TRTLLM. These are single measured warmed updates on separate exclusive node groups, not repeated statistical estimates, quality-parity evidence or demonstrated larger-batch/fewer-node capacity. Full-update timers exclude subsequent JSONL/logging overhead.
Qwen3-8B mixed-format qualification
The matched training comparison covers common steps 31-150:
MXFP8 attention projection speed
GB200, vLLM 0.25.1, Qwen3-8B TP2 QKV/O shapes, measured as one CUDA graph over 36 distinct layers and 72 projections. Values above 1.0 mean MXFP8 is faster.
MThe current FlashInfer CuTeDSL MXFP8 path is slower at the rollout decode sizes and crosses over only at prefill-scale batches.
Needs upstream changes
Everything else this PR needs is merged and already pinned on main through #5005:
cc4b76d7together with the required checkpoint, GDN-gate and pipeline-calibration fixesBuilds on #5005 (merged) for the Megatron-Bridge and runtime updates and is up to date with main. This PR has no submodule change; it uses the merged Bridge commit
ae0a1b02already pinned on main by #5005, including the checkpoint-loading fixes, Mamba projection export mappings, and Omni media export boundaries. This PR bumps ModelOpt fromcc4b76d7(pinned by #5005) to3c815f8d, the merge of Model-Optimizer#3434, so NVFP4 export packing matches the fake quant at rounding boundaries; only the ModelOpt lock entry changes. The integration targets vLLM 0.33.0 (main).PR commands and CI
CI:Lfast: the default for most PRs. Runs a fast test subset.CI:L1: dependency or container changes (pyproject.toml,uv.lock,Dockerfile) or broad core changes. Builds a new image and runs unit and functional tests.CI:docs: docs-only changes. Runs doc tests only./ok to test <full-commit-sha>: start CI for that commit. Post again after each push./review: automated review comments. Addmode=strictfor a stricter review,reset=truefor a fresh full review./resolve-conflict: Autobot mergesmaininto this PR and resolves the conflicts. PRs from forks must allow edits by maintainers./review-pr-team <pr-number>for a team review before you ask for human review.