Repository navigation
feat(recipe): add deterministic Nemotron 3 Ultra, Qwen3.5-9B and Moonlight-16B pretrain recipes - #6440
Merged
cuichenx merged 10 commits intoOct 15, 2026
Conversation
Add nemotron_3_ultra_pretrain_256gpu_gb200_bf16_ep16_deterministic_config, which applies apply_determinism_overrides and a static env_vars dict that spreads the new DETERMINISM_ENV_VARS constant next to COMMON_RECIPE_ENV_VARS. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: Zhiyu Li <zhiyul@nvidia.com>
… recipes Wrap qwen35_text_9b_pretrain_8gpu_gb200_bf16_config and moonlight_16b_pretrain_16gpu_h100_bf16_config with apply_determinism_overrides and a static env_vars dict that spreads DETERMINISM_ENV_VARS. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: Zhiyu Li <zhiyul@nvidia.com>
…nd for Qwen3.5-9B - Spread the shared DETERMINISM_ENV_VARS (string values, matching apply_determinism_overrides) in the DSv3 GB300 deterministic recipe. - Qwen3.5 uses Gated DeltaNet; Megatron-Core requires gdn_kernel_backend='torch' under deterministic_mode, so set it as a standalone override in the deterministic Qwen3.5-9B recipe. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: Zhiyu Li <zhiyul@nvidia.com>
ZhiyuLi-Nvidia
requested review from
dingqingy-nv and
malay-nagda
as code owners
October 13, 2026 18:40
Wrap nemotron_3_nano_pretrain_8gpu_gb200_bf16_config with apply_determinism_overrides and the shared DETERMINISM_ENV_VARS, keeping the GB200 HybridEP environment visible on the recipe. A 2-node, 20-step A/B run on the NeMo 26.10.rc5 image matched bitwise on every logged step. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: Zhiyu Li <zhiyul@nvidia.com>
Bridge's initialize_megatron never called megatron.core.tuning.install, which Megatron-Core's own initializer calls under --deterministic-mode. Timed Triton autotuning could therefore pick different kernel configs between ranks and runs, changing the floating-point reduction order. Call tuning.install(deterministic=True) before any kernel runs when model.deterministic_mode is set. Runs without it keep timed autotuning. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: Zhiyu Li <zhiyul@nvidia.com>
Replace the side_effect assertion with a call-order check on a parent mock so a failure reads as an ordering failure. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: Zhiyu Li <zhiyul@nvidia.com>
Contributor
Author
|
/ok to test ca1ceb2 |
Contributor
|
Automatic Claude reviews have been retired. To request a pull-request review, post a comment containing: Add |
The recipe-environment tests parse each builder's env_vars dict with ast and only accept the COMMON_*_ENV_VARS spread plus literal entries. Spreading DETERMINISM_ENV_VARS in the Moonlight H100 and DSv3 GB300 perf recipes failed test_explicit_recipe_environment_invariants and test_every_flat_recipe_builder_declares_its_environment_inline. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: Zhiyu Li <zhiyul@nvidia.com>
Restore the DETERMINISM_ENV_VARS spread in the Moonlight H100 and DSv3 GB300 recipes. The two recipe-environment tests now accept that spread next to the common-default constants and merge its values when checking invariants, and docs/recipe-usage.md documents it as a third shared constant. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: Zhiyu Li <zhiyul@nvidia.com>
Contributor
Author
|
/ok to test 601a6fe |
@ZhiyuLi-Nvidia, there was an error processing your request: See the following link for more information: https://docs.gha-runners.nvidia.com/cpr/e/2/ |
Contributor
Author
|
/ok to test 601a6fe |
Contributor
…-main Signed-off-by: adityavavreNVDA <avavre@nvidia.com>
Contributor
|
/ok to test 93b297e |
cuichenx
approved these changes
Oct 15, 2026
|
|
||
| # Standalone Qwen3.5 override, not part of apply_determinism_overrides: Megatron-Core rejects | ||
| # deterministic_mode with Gated DeltaNet unless the torch kernel backend is used. | ||
| cfg.model.gdn_kernel_backend = "torch" |
Contributor
Author
There was a problem hiding this comment.
Yes.
There seem no determinism fused gdn kernel yet, which raise an error without this.
Plan to dive into it after the release.
3 of 5 tasks
ZhiyuLi-Nvidia
added a commit
to ZhiyuLi-Nvidia/Megatron-Bridge
that referenced
this pull request
Oct 16, 2026
…light-16B pretrain recipes (NVIDIA-NeMo#6440) Signed-off-by: Zhiyu Li <zhiyul@nvidia.com> Signed-off-by: adityavavreNVDA <avavre@nvidia.com> Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com> Co-authored-by: adityavavreNVDA <avavre@nvidia.com> (cherry picked from commit 7c2c9ba) Signed-off-by: Zhiyu Li <zhiyul@nvidia.com>
This branch was successfully deployed
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.
Summary
nemotron_3_ultra_pretrain_256gpu_gb200_bf16_ep16_deterministic_config, wrapping the 256-GPU GB200 EP16 recipe withapply_determinism_overrides.cfg.env_varsdict:COMMON_RECIPE_ENV_VARS, the newDETERMINISM_ENV_VARS(CUBLAS workspace, NCCL Ring,NCCL_EP_HT_EM_AG_SCAN_MODE, TE non-deterministic algo off, Mamba / causal-conv1d deterministic), and the existing Ultra/HybridEP values inline.recipes/nemotronh__init__.pyfiles and add a unit test.Test plan
tests/unit_tests/recipes/nemotronh/test_nemotron_3_ultra.py: 17 passed (run in the NeMo nightly container on the r0.7.0 base before this was cherry-picked onto main; CI covers main)ruff check/ruff formatclean on the changed files🤖 Generated with Claude Code