Repository navigation
Conversation
… reload wandb comparison against the pr3566verify campaign (same recipe, only this branch's vLLM-side quantization differs) surfaced two gen_kl_error spikes (~9x median) at steps 42 and 78 that never occur across pr3566verify's 544-step history. train/policy_kl_error explodes at the same steps (73.7, 79714.5), the signature of training recomputing a wildly different probability than what was actually generated for a sampled token. Root cause: NvFp4PerTokenQuantizer.process() cloned pending gate/up halves before buffering them, but handed passthrough tensors (attention, router, embeddings, shared experts, ignored-BF16 expert layers) straight through as views into the shared IPC buffer. vLLM's layerwise reload buffers every weight_loader call's arguments — including the tensor — and replays them at layer completion (vllm/model_executor/model_loader/reload/layerwise.py), which can land after the sender has recycled this batch's buffer for a later one (see policy/utils.py's ping-pong double buffering). Confirmed against vLLM 0.26.0 source: `bound_args = loader_signature.bind(*args, **kwargs)` retains the tensor argument by reference, not by value. This is the "cross-batch staleness on passthrough tensors" defect reported separately against PR NVIDIA-NeMo#3566 (upstream, out of scope for this refactor) but it also applies here: this quantizer's own passthrough path had the same gap. Clone every passthrough tensor, matching the pending-half clone already in place. Signed-off-by: Shuang Yu <[email protected]>
… worker PR NVIDIA-NeMo#3566 quantizes routed-expert weights on the Megatron training worker, inside the HF-export iterator, and fuses each expert layer into transport tensors that the vLLM worker expands back before load_weights. This makes NVFP4 a parallel architecture instead of a sibling of the existing FP8/MXFP8 "real quant" rollout path (quantize on the vLLM side at refit-load time). Move quantization to the vLLM worker: NvFp4PerTokenQuantizer quantizes routed-expert projections in NvFp4PerTokenWorkerExtension._load_hf_weights, stateful only over a single gate/up pair (never a whole layer), so the refit stream reverts to plain BF16 and becomes byte-identical to a BF16 run. The Megatron worker's HF-export iterator collapses back to its pre-PR shape (_iter_params_with_optional_kv_scales_impl is byte-identical to origin/main's _iter_params_with_optional_kv_scales); it keeps maybe_init_zmq (sender-side timeout) and all FP4 training-side code untouched. nvfp4_pertoken.py and nvfp4_pertoken_vllm.py merge into a single vLLM-side module (nvfp4_pertoken.py), matching fp8.py's naming: bare <format>.py is the vLLM-side quantizer, and the file is no longer vLLM-free at module scope. get_module_from_param_name moves from a private fp8.py helper to a shared one, reused to probe a layer's owning quant method (the mechanism by which additional_ignore BF16 expert layers are honored on the vLLM side). Two PR NVIDIA-NeMo#3566 defects found during review are out of scope for this change and are reported separately: cross-batch staleness in the layerwise reloader's retained BF16 passthrough tensors, and the policy.quant_cfg / generation.quant_cfg guard-gap in the mutual-exclusion check. Signed-off-by: Shuang Yu <[email protected]>
|
/ok to test 713997d |
3f81e10 to
048263c
Compare
… worker PR NVIDIA-NeMo#3566 quantizes routed-expert weights on the Megatron training worker, inside the HF-export iterator, and fuses each expert layer into transport tensors that the vLLM worker expands back before load_weights. This makes NVFP4 a parallel architecture instead of a sibling of the existing FP8/MXFP8 "real quant" rollout path (quantize on the vLLM side at refit-load time). Move quantization to the vLLM worker: NvFp4PerTokenQuantizer quantizes routed-expert projections in NvFp4PerTokenWorkerExtension._load_hf_weights, stateful only over a single gate/up pair (never a whole layer), so the refit stream reverts to plain BF16 and becomes byte-identical to a BF16 run. The Megatron worker's HF-export iterator collapses back to its pre-PR shape (_iter_params_with_optional_kv_scales_impl is byte-identical to origin/main's _iter_params_with_optional_kv_scales); it keeps maybe_init_zmq (sender-side timeout) and all FP4 training-side code untouched. nvfp4_pertoken.py and nvfp4_pertoken_vllm.py merge into a single vLLM-side module (nvfp4_pertoken.py), matching fp8.py's naming: bare <format>.py is the vLLM-side quantizer, and the file is no longer vLLM-free at module scope. get_module_from_param_name moves from a private fp8.py helper to a shared one, reused to probe a layer's owning quant method (the mechanism by which additional_ignore BF16 expert layers are honored on the vLLM side). Two PR NVIDIA-NeMo#3566 defects found during review are out of scope for this change and are reported separately: cross-batch staleness in the layerwise reloader's retained BF16 passthrough tensors, and the policy.quant_cfg / generation.quant_cfg guard-gap in the mutual-exclusion check. Signed-off-by: Shuang Yu <[email protected]>
… reload wandb comparison against the pr3566verify campaign (same recipe, only this branch's vLLM-side quantization differs) surfaced two gen_kl_error spikes (~9x median) at steps 42 and 78 that never occur across pr3566verify's 544-step history. train/policy_kl_error explodes at the same steps (73.7, 79714.5), the signature of training recomputing a wildly different probability than what was actually generated for a sampled token. Root cause: NvFp4PerTokenQuantizer.process() cloned pending gate/up halves before buffering them, but handed passthrough tensors (attention, router, embeddings, shared experts, ignored-BF16 expert layers) straight through as views into the shared IPC buffer. vLLM's layerwise reload buffers every weight_loader call's arguments — including the tensor — and replays them at layer completion (vllm/model_executor/model_loader/reload/layerwise.py), which can land after the sender has recycled this batch's buffer for a later one (see policy/utils.py's ping-pong double buffering). Confirmed against vLLM 0.26.0 source: `bound_args = loader_signature.bind(*args, **kwargs)` retains the tensor argument by reference, not by value. This is the "cross-batch staleness on passthrough tensors" defect reported separately against PR NVIDIA-NeMo#3566 (upstream, out of scope for this refactor) but it also applies here: this quantizer's own passthrough path had the same gap. Clone every passthrough tensor, matching the pending-half clone already in place. Signed-off-by: Shuang Yu <[email protected]>
|
/ok to test 048263c |
|
/ok to test ecedaf2 |
|
/ok to test b29495f |
|
/ok to test 44c76f2 |
|
/ok to test da158e3 |
|
/ok to test 4df56fe |
|
/ok to test b57931c |
|
/ok to test 12f2878 |
|
/ok to test 91c3d5e |
91c3d5e to
4ca610d
Compare
|
/ok to test 4ca610d |
|
/ok to test b632c96 |
|
/ok to test acde305 |
|
/ok to test acac996 |
|
/ok to test f8fea80 |
sharonyu-115
left a comment
There was a problem hiding this comment.
Thanks for this — it's a substantial and unusually careful piece of integration work. The _dense() fix for stride-0 expanded scale views, the FLASHINFER_TRTLLM hard guard, the "ModelOpt" in class name duck-typing note, and the 275-line design doc all show you chased real failure modes rather than working around symptoms. Two of the workarounds here are correct diagnoses of genuine vLLM 0.26.0 bugs (details below). The perf table and convergence curve are appreciated, as is the honest caveat that they're representative rather than a controlled A/B — no additional numbers requested.
Reviewed by a team of six agents against the pinned upstream sources (vLLM 0.26.0, TransformerEngine @e7c550c5, Megatron-LM @14346b65, Megatron-Bridge @8c46dc42). 25 candidate findings were raised and adversarially challenged; 6 survived and are posted below. Five were dropped for wrong premises and nine as duplicates or disproportionate — I've kept only findings with a verified premise and a concrete fix.
Checks that passed locally: ruff check and ruff format clean on all 66 changed Python files; tools/config_cli.py minimize-check passes on both new recipes; test_recipes_and_test_suites.py 12/12; all 18 tests in test_vllm_nvfp4_pertoken.py pass against vLLM 0.26.0 on CPU. The quantization math was independently verified on CPU — the 6.0 * 448.0 global-scale constant matches vLLM's convention, the E4M3 block scale saturates at exactly 448.0, and the {0,1,44..47} layer selection has no off-by-one. No GPU was available, so kernel numerics and the GB200 path are unverified here.
Two notes that are not defects: the disabled.txt / nightly_gb200.txt split reconciles correctly (the quick variant is genuinely enabled, with a documented rationale for parking the 8n4g driver), and the FlashInfer/TE version skews between extras are pre-existing and intentional.
Generated by Claude Code
|
/ok to test 237ba75 |
Signed-off-by: Shuang Yu <[email protected]>
Signed-off-by: Shuang Yu <[email protected]>
…60916 fix: validate NVFP4 rollout and centralize refit compatibility
Regenerate uv.lock with uv 0.11.28 against the updated Gym metadata. Preserve Ray 2.56.1 and the PR dependency versions, with the registry torch-memory-saver variant matching upstream main at 0.0.10b1. Cover NVFP4 backend validation with omitted, mapping, and typed draft configurations after preserving upstream draft normalization. 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]>
The PR lockfile refresh resolves datasets 5.0.1 and pyarrow 25.0.1. Datasets 5.0.1 combines Arrow chunks while fingerprinting in-memory tables (huggingface/datasets#8339). NemoGymDataset stores raw JSONL lines in extra_env_info, so large inputs exceed the approximately 2 GiB limit of Arrow string's 32-bit offsets during Dataset.from_dict. This raises ArrowInvalid before training starts. Declare extra_env_info as large_string, which uses 64-bit offsets, and keep task_name as string. Preserve raw JSON values, repetition, and the current dependency versions. Explain the schema choice at the construction site. Validation: four full Slurm runs on 2e13bf9 plus this schema fix passed the original training targets and all nine metric checks: 18926860 (SWE1), 18926861 (RLVR), 18926862 (async SWE1), and 18926863 (MOPD). These are not full-run results for the rebased head. The updated loader is executable-code-identical to that tested fix. CPU smoke job 18928236 verifies the updated checkout with datasets 5.0.1/pyarrow 25.0.1; focused Ruff and Pyrefly checks pass. Signed-off-by: Shuang Yu <[email protected]>
50f7ed0 to
f6a2920
Compare
|
/ok to test f6a2920 |
Thanks @terrykong for the review. All good comments. Got them addressed plus a |
|
CI failures to be fixed by #4209 |
|
/ok to test 7a4bf09 |
Hi @terrykong, would you help review the latest change and approve? Thanks! |
Brings #3566 (end-to-end TE NVFP4 training with per-token vLLM rollout) and three smaller commits onto the vLLM 0.29 bump. Conflicts and resolution: - pyproject.toml: main bumped vLLM to 0.26.0 / flashinfer 0.6.14 / nvidia-cutlass-dsl 4.6.0 and pinned quack-kernels==0.6.1; this branch keeps vLLM 0.29.0 / flashinfer 0.6.18 / cutlass-dsl 4.6.2 and takes no quack pin (vLLM 0.29 requires quack-kernels==0.6.4). TransformerEngine 2.18.0 (PyPI) and ModelOpt 43fd41a58 are taken from main: that ModelOpt revision is a release cherry-pick that carries #2054's RoutedExperts vLLM plugin and does not contain #1550's GroupedQuantizer, so the pin note is kept and reworded. flashinfer-cubin index and the cutlass 4.5.x dependency-metadata are main's. - uv.lock: regenerated from this branch's lock; only ModelOpt (0.46.0 @ 43fd41a5), TransformerEngine 2.15.0+git -> 2.18.0 (+ -cu13/-torch wheels, nvdlfw-inspect) and the dropped cutlass libs-base 4.5.0 entry changed. - quantization/fp8.py: main's refactor of the module lookup into quantization/utils.py::resolve_module_from_param_name is taken; the ambiguous-shard fix from 28beca5 (vLLM 0.29 lists `wkv` under two fused modules) is ported into the new resolver, and its tests call the renamed public get_module_from_param_name. - modelopt vllm_quant_backend.py and its test: main's per-expert non-gated W13 emission (superset of a3aa6cd) is taken. Also fixes the pyrefly error from 000cd24: `_tied_embedding_aliases` now accepts `torch.nn.Module | None`. Signed-off-by: Yi-Fu Wu <[email protected]>
… vLLM 0.29 / torch 2.13 Three failures from the first full CI + nightly pass on the merged head: - Async checkpoint saves died at the first save with `DistNetworkError: ... EADDRINUSE` inside torch's process-based DCP checkpointer (`_async_process_executor`): rank 0 probes a port with `get_free_port()` and the daemons then rendezvous on it with a fresh GLOO group, but the port was taken again before the daemon bound it. It hit every DTensor save in the run (L1 GRPO resume, the converter round-trip test, the llama3.2-1b fsdp2tp2 tq_mooncake nightly recipe) after the Automodel bump made daemon creation synchronous across ranks. The Automodel checkpoint manager now opts the daemons into torch's `DCP_USE_PREFIX_STORE=1` mode when `MASTER_ADDR`/`MASTER_PORT` are present, so they join the training process group's TCPStore under a prefix and bind nothing. Unit-tested. - `nvfp4_pertoken.py` (from #3566) called `make_nvfp4_moe_kernel(..., layer=layer)`; vLLM 0.29 dropped that parameter (it already takes `per_token_activation`), so the new `te_nvfp4_pertoken_quick` GB200 recipe died with `TypeError: unexpected keyword argument 'layer'`. - `test_decode_vs_prefill.sh` OOMed on GB200 at the first MoE forward: with `gpu_memory_utilization=0.8` vLLM 0.29 sized a 93 GiB KV cache for Nemotron-3-Nano-30B (TP2) and the FlashInfer TRT-LLM BF16 MoE kernel then could not allocate its 4 GiB workspace (the same test is memory-marginal on `main`'s H100 runners too). The diagnostics tool gains a `--gpu-memory-utilization` flag and the functional test passes 0.7. Co-Authored-By: Claude Fable 5.1 <[email protected]> Signed-off-by: Yi-Fu Wu <[email protected]>
Bring main a9c3178 (25 commits since the previous merge base 702cd79) into the branch on top of the #5 submodule bump (00621c2). Conflicts: - nemo_rl/algorithms/single_controller_utils/setup.py and tests/unit/single_controller/test_setup.py: keep main's sharded Gym stacks (NVIDIA-NeMo#3373), multi-teacher MOPD (NVIDIA-NeMo#4045), critic optimizer rebuild (NVIDIA-NeMo#4213) and Mooncake storage checkpoints (NVIDIA-NeMo#3898) next to the Megatron token-capture setup guards and backend wiring; the vLLM-only capture guard is replaced by the backend-aware one. - tests/unit/models/generation/test_vllm_token_capture_hosting.py: keep main's stripped staged token arrays (NVIDIA-NeMo#4206) on top of the shared vLLM chain-cache prefix resolution. - pyproject.toml (semantic conflict, auto-merged by git): main NVIDIA-NeMo#3566 removed `exclude-dependencies = ["nvidia-cutlass-dsl-libs-base"]` in favour of per-version dependency-metadata overrides for CUTLASS DSL 4.5.x, while this branch's mcore extra pinned nvidia-cutlass-dsl[cu13]==4.8.0.dev0 (68b63da). Without the exclusion that pin drags in the pre-release nvidia-cutlass-dsl-libs-base==4.8.0.dev0, which uv refuses for a transitive dependency, so `uv lock` no longer resolves. Pin 4.6.2 instead: it is the stable release flashinfer-python 0.6.18.post1 actually requires (>=4.6.2a0), and it is the pin NVIDIA-NeMo#4139 uses for the same Megatron-Bridge bump on main. - uv.lock: regenerated from main's copy with uv 0.11.28 (the docker/Dockerfile pin), so it carries main's new git pins (Model-Optimizer, sglang, Lens, TransferQueue, nvidia-resiliency-ext, torch_memory_saver) together with the Gym and Megatron-Bridge main pins and the flashinfer index spelling from #5. `uv lock --check` passes with uv 0.11.28 and 0.12.5. Submodule pins: Automodel follows main (72daceffa); Gym (9fc05c0ff) and Megatron-Bridge (fcea83a85) stay at the #5 pins, which descend from main's. Co-Authored-By: Claude Fable 5.1 <[email protected]> Signed-off-by: Laura Dang <[email protected]>
Bring main a9c3178 (25 commits since the previous merge base 702cd79) into the branch on top of the #5 submodule bump (00621c2). Conflicts: - nemo_rl/algorithms/single_controller_utils/setup.py and tests/unit/single_controller/test_setup.py: keep main's sharded Gym stacks (NVIDIA-NeMo#3373), multi-teacher MOPD (NVIDIA-NeMo#4045), critic optimizer rebuild (NVIDIA-NeMo#4213) and Mooncake storage checkpoints (NVIDIA-NeMo#3898) next to the Megatron token-capture setup guards and backend wiring; the vLLM-only capture guard is replaced by the backend-aware one. - tests/unit/models/generation/test_vllm_token_capture_hosting.py: keep main's stripped staged token arrays (NVIDIA-NeMo#4206) on top of the shared vLLM chain-cache prefix resolution. - pyproject.toml (semantic conflict, auto-merged by git): main NVIDIA-NeMo#3566 removed `exclude-dependencies = ["nvidia-cutlass-dsl-libs-base"]` in favour of per-version dependency-metadata overrides for CUTLASS DSL 4.5.x, while this branch's mcore extra pinned nvidia-cutlass-dsl[cu13]==4.8.0.dev0 (68b63da). Without the exclusion that pin drags in the pre-release nvidia-cutlass-dsl-libs-base==4.8.0.dev0, which uv refuses for a transitive dependency, so `uv lock` no longer resolves. Pin 4.6.2 instead: it is the stable release flashinfer-python 0.6.18.post1 actually requires (>=4.6.2a0), and it is the pin NVIDIA-NeMo#4139 uses for the same Megatron-Bridge bump on main. - uv.lock: regenerated from main's copy with uv 0.11.28 (the docker/Dockerfile pin), so it carries main's new git pins (Model-Optimizer, sglang, Lens, TransferQueue, nvidia-resiliency-ext, torch_memory_saver) together with the Gym and Megatron-Bridge main pins and the flashinfer index spelling from #5. `uv lock --check` passes with uv 0.11.28 and 0.12.5. Submodule pins: Automodel follows main (72daceffa); Gym (9fc05c0ff) and Megatron-Bridge (fcea83a85) stay at the #5 pins, which descend from main's. Co-Authored-By: Claude Fable 5.1 <[email protected]> Signed-off-by: Laura Dang <[email protected]>
What does this PR do?
This PR addresses #3432 by adding an opt-in end-to-end NVFP4 W4A4
reinforcement-learning path on NVIDIA Blackwell GPUs, demonstrated with
Qwen3-30B-A3B-Base GRPO. It upgrades the shared vLLM runtime from 0.25.1 to
0.26.0 for per-token NVFP4 support and includes ModelOpt refit compatibility
fixes required by that upgrade. Additional changes fix existing FP8
checkpoint-name mapping and generation-router probe handling.
During policy training, Transformer Engine applies NVFP4 to routed-expert MLP
computation with per-token activation scaling. The model retains BF16
parameters and FP32 optimizer states, and the current backward path is
dequantized. After each policy update, NeMo RL exports BF16 Hugging Face-named weights
through Megatron Bridge and refits colocated vLLM engines. The vLLM worker
quantizes and packs routed-expert weights while loading each refit, then uses
pre-quantized NVFP4 expert weights with dynamic per-token activation scaling
during rollout.
The architectural boundary is explicit: training owns the BF16 policy weights,
refit transports BF16, and the rollout worker owns quantization into its serving
representation. W4A4 applies to selected routed-expert computations, not the
whole model, optimizer state, or weight-transfer format.
Implementation
NVFP4 computation, and FP4 token alignment. Keeps persistent policy weights
in BF16 and rejects incompatible FP8/FP4 settings and FP4 parameter storage
when generation/refit is enabled. An explicit BF16 catch-all protects
attention, dense MLPs, and shared experts. Startup validation parses the
effective training and evaluation recipes, including inherited autocast
behavior, and validates the required TE environment settings.
NVFP4 routed-expert weight quantization inside the vLLM worker during native
layerwise reload.
nvfp4_pertokenvLLM quantization mode and integrates it withvLLM's layerwise reload lifecycle while preserving CUDA-graph parameter
storage.
IPC lifetime handling, and fatal error propagation rather than serving stale
weights. Pipeline-parallel limitations are noted below.
Determines model eligibility from constructed routed-expert capabilities and
checkpoint mappings rather than an architecture-name allowlist.
replay / R3 receives the routing information required by the training path.
unit coverage, a 20-step GB200 nightly smoke test, and an end-to-end usage
and design guide. The 8-node driver is manual-only; the 4-node quick test
is registered in
nightly_gb200.txt.rejects SingleController at configuration validation. GRPO is the validated
entry point; PPO and distillation emit coverage warnings.
required by this path.
Compatibility fixes required by the vLLM 0.26 upgrade
The vLLM upgrade changes Nemotron-H weight loading to delegate through
AutoWeightsLoaderto eachRoutedExpertslayer. This exposes two regressionsin existing ModelOpt refit paths, addressed here:
getattr, so it cannot resolve names such asw13_input_quantizer._amax.Add temporary aliases during refit, with scoped setup and cleanup in
patches.py.w13payloads as fused gate/up tensors. Emit non-gated batched weights asper-expert payloads so they load correctly under vLLM 0.26.
These changes preserve existing ModelOpt refit behavior after the shared
runtime upgrade. The associated FlashInfer/CUTLASS/Quack dependency alignment
and package-source changes are detailed below.
Other fixes to existing paths
ClientConnectionResetErrorduring/v1/modelsprobing with a 404 responsewithout marking the backend unhealthy or evicting it. Other forwarding
failures retain the existing health handling. Adds failure logging and a
regression test for the disconnected-probe case.
NVFP4 and fixes dotted prefix/substring mapping on the existing FP8 path.
A failed lookup returns
Noneinstead of a partially traversed parent.DeepSeek V4 retains its full checkpoint mapper, applied once before packed
module resolution. This includes behavior fixes as well as code reuse.
NeMo Gym dataset compatibility after the lockfile refresh
The lockfile refresh also resolved
datasetsfrom 5.0.0 to 5.0.1 andpyarrowfrom 24.0.0 to 25.0.1, without changing their direct requirements.Datasets 5.0.1 introduced chunk-independent fingerprinting:
when hashing an in-memory Arrow table to produce its dataset fingerprint, its
serializer calls
combine_chunks()on each column.NemoGymDatasetstores each raw JSONL line inextra_env_info. For the largeSWE1, RLVR, and MOPD inputs, the combined column exceeds ordinary Arrow
string's approximately 2 GiB limit for 32-bit offsets. Construction thereforefails inside fingerprinting with
ArrowInvalid: offset overflow while concatenating arrays, before training starts. Smaller inputs stay below thislimit, which explains why other dataset jobs could pass.
Declare
extra_env_infoasValue("large_string")when constructing thedataset, providing 64-bit offsets, and retain
task_nameasValue("string").This preserves the raw JSON values and repetition behavior and works with
Datasets 5.0.1/PyArrow 25.0.1 without a dependency downgrade.
Dependency updates
This PR upgrades the shared runtime, not only the NVFP4 path. Reviewers of other
recipes should be aware of these:
c3b913b943fd41a5release_v2.152.18.0release packagevLLM upgrade: per-token NVFP4 rollout uses vLLM 0.26's
make_nvfp4_moe_kernel(..., per_token_activation=True)interface. The vLLMextra is aligned to FlashInfer 0.6.14, CUTLASS DSL 4.6.0, and Quack 0.6.1.
The upgrade also requires the following package-resolution changes:
nvidia-cutlass-dsl-libs-baseexclusion with dependencymetadata overrides for CUTLASS 4.5.0–4.5.2, allowing 4.6.x to retain its
required
libs-base/libs-corepackages.flashinfer-cubinthrough the official FlashInfer index acrossextras, instead of restricting that source to SGLang. Version requirements
remain per extra: vLLM requests 0.6.14; MCore requests 0.6.8.post1. This source
mapping does not add the package to extras that do not depend on it.
TE NVFP4 training dependencies: the TE and ModelOpt version changes support
the training path and its TE compatibility requirements.
release_v2.15Git build totransformer-engine[pytorch,core_cu13]==2.18.0. The release separates theCUDA 13 core binaries
from the Torch extension package.
Both
no-build-isolation-packageand thetorchdependency withmatch-runtime=trueremain configured fortransformer-engine-torch.Removing the old monolithic-package entries does not remove those extension
build settings. The locked Torch version remains
2.11.0+cu130.NVTE_WITH_NCCL_EP=0by default; custom builds can opt in with--build-arg NVTE_WITH_NCCL_EP=1.Issues
Related to #3432
Usage
The Qwen3-30B-A3B-Base configuration behind the results below, on 8 nodes with
4 GB200 GPUs per node:
See
docs/design-docs/te-nvfp4-per-token-rollout.mdfor the completeconfiguration and execution flow.
Before your PR is "Ready for review"
Pre checks:
Additional Information
Validation
Coverage shipped in this revision
reload, setup validation, TE FP4 configuration, Megatron worker integration,
boundary-layer exclusions, ModelOpt compatibility, and routing capture.
Regression cases also cover effective precision in training/evaluation,
renamed recipe keys, BF16 fallback ordering, unsupported PP/SingleController
configurations, DeepSeek mapping, disconnected router probes, and combined
FP32-LM-head/NVFP4 patch configuration.
node. It checks the selected backend and precision path, at least 20
quantized refits, stable expert-group counts, and rollout artifacts for every
step.
token-probability ratio error below 1.5, positive reward and valid samples,
finite loss/gradient norms, and nonzero gradients.
it is separate from the registered quick nightly smoke.
These describe committed test coverage, not a claim that all tests have passed
on every subsequent revision.
DFW nightly validation against reference
Compared PR DFW pipeline 68569004
with reference 68179588,
covering 134 matching tests on H100. Counts use the latest attempt per test.
The reference tested RL commit
b03da0f469cdb2882bda83c0f04317c6159ed266;the PR pipeline tested
2e13bf9f8b2d9dd8a5bddb09e3db6141a1b72a11.The revisions differ by nine upstream-main commits plus the PR changes, and
use different CI revisions, so this comparison alone does not establish causality.
Initially, 23 tests failed only in the PR run. All 23 were retried with
fresh experiment state at the same tested PR commit, with training-start
evidence verified and target-step skips excluded:
which completed 25 training steps and all seven checks.
training, with Arrow string-offset overflow.
After those retries, 73 tests passed in both pipelines, 36 failed in both,
four failed only in the PR pipeline, and 21 passed in the PR pipeline but
failed in the reference.
Dataset failure and validated fix
The lockfile refresh resolved Datasets 5.0.1 and PyArrow 25.0.1. Datasets 5.0.1
introduced chunk-independent fingerprinting,
which combines Arrow chunks while hashing an in-memory dataset. NeMo Gym
stores raw JSONL lines in
extra_env_info; these large inputs exceed ordinaryArrow strings' approximately 2 GiB offset limit.
Fix
50f7ed0b1explicitly stores that column as
large_string, using 64-bit offsets.Dependency versions remain unchanged.
All four cases then passed full local Slurm runs on
2e13bf9f8b2dplusthe schema fix, using fresh experiment directories and the original training
targets and metric thresholds:
All four exited successfully without Arrow overflow; all nine metric checks
passed with Datasets 5.0.1 / PyArrow 25.0.1. W&B uploads were disabled.
MOPD's allocation increased from 18 to 45 minutes for local startup; it
completed in 7m48s.
The updated PR checkout also passed CPU loader smoke job
18928236, verifyingraw JSON and Unicode preservation, task names, Arrow types, fingerprinting,
and repetition, plus focused lint, formatting, and type checks. Its loader's
executable code matches the version used in the four full runs.
Interpretation
All 23 initially PR-only failures now have passing evidence: 19 through clean
GitLab retries and four through validation of the schema fix. The GitLab
pipeline itself remains 94 passed / 40 failed. The 36 shared failing tests
were not revalidated; matching failed statuses do not imply matching causes.
These results do not constitute a full-suite pass on the current PR head.
Recorded GB200 nightly result
The registered 4-node × 4-GPU GB200 nightly passed all 20 steps and all test
checks in 31m26s, within the 90-minute limit, with
NRL_FORCE_REBUILD_VENVS=true(2026-09-18, commit2e13bf9f8, job2849377).All seven metric checks passed:
Representative performance
Qwen3-30B-A3B-Base on 8 nodes with 4 GB200 GPUs per node. Both reported runs
enable R3/router replay. All values are medians over the 900 logged steps shared
by the two runs.
The columns identify the BF16-rollout baseline and the NVFP4 W4A4 path.
The exact training-precision configuration of the historical baseline and
immutable run/config references still need to be attached. Until then, treat
these as representative end-to-end run results, not a controlled ablation
establishing that rollout precision was the only changed setting.
Median response length matches to within 0.1%, limiting response-length
variation as an explanation for the throughput difference. The missing
baseline configuration still prevents treating this as an isolated precision
comparison. NVFP4 W4A4 is applied only to routed-expert MLPs; the other modules remain BF16, and
the NVFP4 result includes quantization and weight refit after each policy
update.
There is still substantial headroom on every part of the step. Refit is the
largest added overhead and is profiled in the design doc. Measured policy
training throughput is also lower; the NVFP4 path currently uses dequantized
backward computation, but the table alone does not isolate the cause of the
training-throughput difference. The rollout numbers were measured with
conservative quantization-kernel settings, so generation has room to improve as
well. Follow-up work is planned on all three. The memory figures describe the
vLLM rollout model and KV cache, not the peak memory of the complete colocated
RL process.
Current scope and follow-up
smoke and historical Qwen3-30B-A3B-Base results on 8 nodes. The 8-node recipe
uses Megatron TP=2 / EP=8 / PP=1 and colocated vLLM TP=1 / EP=1 / PP=1.
Runtime results are tied to the revisions stated above.
and checkpoint mappings. Other architectures, dense/hybrid layouts, PPO,
and distillation have no end-to-end validation established here. Dense-only
models and fused shared-expert layouts are rejected. SingleController is
explicitly rejected during setup.
default CUDA IPC refit (
refit_transport=null), vLLM PP=1 / EP=1,BF16 engine precision,
kv_cache_dtype=auto, and the FlashInfer TRT-LLMNVFP4 backend. vLLM PP>1 is rejected for both synchronous and asynchronous
engines; this restriction is on rollout PP. Standalone evaluation,
speculative decoding, and competing quantization/load-format overrides
are unsupported.
linears, and configured boundary layers. The shipped recipe has a final
BF16 catch-all; setup checks effective training and evaluation settings on
representative module paths, and trainer/rollout checks enforce boundary
agreement. These guards do not establish end-to-end support for additional
model architectures.
Follow-up work includes support for cross-stage vLLM PP refits, refit
optimization, native NVFP4 backward computation, and longer stability and
model-quality studies. The faster fused-expert refit prototype discussed in
the design doc is not included. Shared vLLM patch-version enforcement and
executor consolidation remain tracked in #4155. The review question about
whether captured router top-k choices exactly match the fused TRT-LLM kernel's
choices still needs direct evidence; routing-capture coverage alone does not
establish that equivalence.
Historical 900-step quality comparison
The same two runs, over their first 900 shared steps. Blue is the BF16 baseline;
orange is NVFP4 W4A4 per-token rollout.
Reward, response length, and validation accuracy track the BF16 baseline, and
entropy does not collapse. The train-rollout logprob error stays near its ideal
value of 1.0 for both runs. Generation KL error is higher under W4A4, which is
the expected cost of a quantized rollout. These observations are limited to
the reported 900-step window; longer stability validation remains follow-up
work.