Repository navigation
fix: validate NVFP4 rollout and centralize refit compatibility - #5
Merged
Conversation
Signed-off-by: Shuang Yu <[email protected]>
Signed-off-by: Shuang Yu <[email protected]>
Signed-off-by: Shuang Yu <[email protected]>
Signed-off-by: Shuang Yu <[email protected]>
Signed-off-by: Shuang Yu <[email protected]>
zhangyimi
merged commit Sep 17, 2026
a65a4e9
into
zhangyimi:codex/nvfp4-pertoken-draft-main-20260805
sharonyu-115
pushed a commit
that referenced
this pull request
Sep 17, 2026
…60916 fix: validate NVFP4 rollout and centralize refit compatibility
sharonyu-115
pushed a commit
that referenced
this pull request
Sep 18, 2026
…60916 fix: validate NVFP4 rollout and centralize refit compatibility
sharonyu-115
pushed a commit
that referenced
this pull request
Sep 18, 2026
…60916 fix: validate NVFP4 rollout and centralize refit compatibility
sharonyu-115
pushed a commit
that referenced
this pull request
Sep 19, 2026
…60916 fix: validate NVFP4 rollout and centralize refit compatibility
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
NVFP4 per-token rollout can inherit unintended module precision, accept unsupported settings, and use different fast-math settings in the main and nightly recipes. This helper PR validates the precision contract, rejects unsupported configurations early, aligns the recipes, and documents the precision options in the exemplar. It also centralizes the ModelOpt MoE refit alias workaround so its implementation and compatibility tests can be reviewed with the other vLLM patches. It targets the source branch of NVIDIA-NeMo#3566.
Precision contract (review #3, #4): add a final BF16 catch-all and validate effective training/evaluation precision using Megatron's native recipe parser. Require RHT and 2D quantization to be disabled, generate the required-env error text from the settings, and document why stochastic rounding is optional with dequantized backward.
Unsupported configurations (#5, #6): reject vLLM PP>1 for either engine mode until refit handles foreign-stage expert weights. Add an explicit SingleController rejection: its vLLM path requires non-colocated rollout, while this mode requires colocation. Training PP and rollout TP are unaffected.
Defaults and entry points (#12, #13): compare copied BF16 boundary defaults with Megatron in tests, read the instantiated trainer fields directly, and pass
entry_point="grpo"explicitly.Engine settings (#16): reject the explicit top-level FlashInfer autotune setting with an actionable error; keep nested
falseaccepted. Update the documented topology limits.Recipes and exemplar (#8, #10): align both FP4 fast-math environment variables in the quick recipe with the main recipe. Add disabled FP4 and BF16 boundary settings to the GRPO exemplar and its reference twin. Both NVFP4 recipes inherit
fp4: e2m1, retain explicit FP4 enablement, and preserve their 2/4 BF16 boundary counts.Nightly timeout (#9): retain 90 minutes. Historical job 2758997 completed in 20m 14s on earlier commit
3a1289911; it does not establish fully cold-start timing.Tests and cleanup (#11, #14, #15): strengthen the DeepSeek fixture to distinguish its full mapper from generic fallback and detect double mapping; rename the per-token ignore constant to
DEFAULT_NVFP4_PERTOKEN_IGNORE; remove the overwritten async test config assignment. ModelOpt defaults and production mapping behavior are unchanged.ModelOpt refit compatibility (#17): move temporary MoE quantizer alias creation and cleanup into
patches.py:modelopt_moe_amax_aliases. The backend invokes it only during refit. Preserve existing attributes and support nested/repeated use and cleanup after partial setup failures. Correct the explanation to identifyNemotronHModel.load_weightsas the loader removed in vLLM 0.26. Tests now call the installed vLLM loader and mapping builder instead of copying their lookup logic. Shared version enforcement, including the routed-experts capture patch, and the repository-wide executor redesign remain in #4155, using the deferral offered in review.Validation: 441 tests passed: 252 Megatron setup tests, 109 SingleController setup tests, and 80 selected NVFP4 generation/refit tests. Slurm jobs 2842720 and 2842754; the SingleController suite required
HF_HOMEto resolve recipe paths. Ruff 0.9.9 lint/import-order/format checks andgit diff --checkpassed; the first commit's two recipeminimize-checkchecks also passed.Tests use the existing
nemo-rl-pr3566-te218-pypi-2026-09-07-v2.sqshcontainer, which differs from the current PR's dependency fingerprint, including Megatron-Bridge. The new end-to-end attempt described below failed before training; no fresh runtime or metric result is claimed. Pyrefly's SingleController configuration check reports one pre-existingmissing-attributeerror on the unchanged checkpoint lookup (config.py:1256); a complete checkout of parent commitb26308a86reproduces the same error at line 1241 (job 2842804).Recipe-group validation on commit
6911767d73f716c012b13253b3b7d598b432a1dd: 31 tests passed acrosstest_config_v2.pyandtest_recipes_and_test_suites.py(Slurm 2842965). Repository-wide recipeminimize-check, expanded-config precision/flag checks for both NVFP4 recipes, andgit diff --checkpassed.Fresh 4-node GB200, 20-step nightly attempt: Slurm job
2842976failed before training (1m 26s) because the code snapshot lacked3rdparty/Automodel-workspace/Automodel, causing uv package-metadata generation to fail. It produced no fresh training metrics or evidence about the 90-minute timeout; the runtime validation remains outstanding. The attempt used the existing TE 2.18 baked image and shared Hugging Face cache, with W&B disabled. No metric thresholds or timeout were changed.Test/cleanup validation on commit
0d23145c659c7127a42114b826380b742af2b326: 84 tests passed (80 NVFP4 generation/refit tests, 2 mapping tests, 2 sparse-refit post-init tests; Slurm jobs 2843152 and 2843161). An in-memory mutation harness confirmed the strengthened DeepSeek test fails at its exact-path assertion when the full mapper is bypassed and when generic mapping is applied afterward; the unchanged production resolver passes. Ruff 0.9.9 lint/import-order/format checks andgit diff --checkpassed. Pyrefly 0.24.2 reports zero errors on the two modified production modules (3 ignored diagnostics). Validation uses the same existing container and dependency-fingerprint caveat noted above.Patch-centralization validation on commit
12e5f9c93b1a29a1e07f63ce4730f40237b03086: 105 tests passed, 1 skipped (25 patch tests and 80 ModelOpt backend tests; Slurm job 2843595). The installed-loader test uses vLLM 0.26.0 with disposable CPU buffers, verifies the missing-attribute failure without aliases, and confirms correct w13/w2 maximum merging with aliases. The existing fake-quant worker inheritance test was skipped because this worker environment lacksmodelopt.torch.quantization.calib; ModelOpt backend tests use their existing stubs. Ruff 0.9.9 lint/import-order/format checks andgit diff --checkpassed. Pyrefly 0.24.2 reports zero errors and zero ignored diagnostics forpatches.py, which also imports directly without loading torch, vLLM, or ModelOpt. This uses the same existing container and dependency limitations noted above; it is not a new end-to-end training run.Review replies on the original PR remain pending and unsubmitted. This helper PR does not change review-thread resolution states.