Skip to content

feat(recipe): add deterministic Nemotron 3 Ultra, Qwen3.5-9B and Moonlight-16B pretrain recipes - #6440

Merged
cuichenx merged 10 commits into
NVIDIA-NeMo:mainfrom
ZhiyuLi-Nvidia:zhiyul/nemotron-3-ultra-deterministic-recipe-main
Oct 15, 2026
Merged

cuichenx merged 10 commits into
NVIDIA-NeMo:mainfrom
ZhiyuLi-Nvidia:zhiyul/nemotron-3-ultra-deterministic-recipe-main

Conversation

@ZhiyuLi-Nvidia

@ZhiyuLi-Nvidia ZhiyuLi-Nvidia commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Add nemotron_3_ultra_pretrain_256gpu_gb200_bf16_ep16_deterministic_config, wrapping the 256-GPU GB200 EP16 recipe with apply_determinism_overrides.
  • The recipe assigns a static cfg.env_vars dict: COMMON_RECIPE_ENV_VARS, the new DETERMINISM_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.
  • Export the recipe from both recipes/nemotronh __init__.py files and add a unit test.

Test plan

🤖 Generated with Claude Code

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>
@ZhiyuLi-Nvidia ZhiyuLi-Nvidia added feature New capabilities, enhancements, or enablement work area:recipe Training recipes and launch configs needs-review PR is ready for code review and waiting on a reviewer labels Oct 13, 2026
@copy-pr-bot

copy-pr-bot Bot commented Oct 13, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

… 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>
@ZhiyuLi-Nvidia ZhiyuLi-Nvidia changed the title feat(recipe): add deterministic Nemotron 3 Ultra GB200 pretrain recipe feat(recipe): add deterministic Nemotron 3 Ultra, Qwen3.5-9B and Moonlight-16B pretrain recipes Oct 13, 2026
…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 and others added 3 commits October 13, 2026 15:19
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>
@ZhiyuLi-Nvidia

Copy link
Copy Markdown
Contributor Author

/ok to test ca1ceb2

@github-actions

Copy link
Copy Markdown
Contributor

Automatic Claude reviews have been retired. To request a pull-request review, post a comment containing:

/review

Add model=claude to use a Claude reviewer (the default is model=codex). mode=light|strict selects the review depth; for example, /review model=claude mode=strict. Comment /review help for all options.

ZhiyuLi-Nvidia and others added 2 commits October 13, 2026 20:42
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>
@ZhiyuLi-Nvidia

Copy link
Copy Markdown
Contributor Author

/ok to test 601a6fe

@copy-pr-bot

copy-pr-bot Bot commented Oct 14, 2026

Copy link
Copy Markdown

/ok to test 601a6fe

@ZhiyuLi-Nvidia, there was an error processing your request: E2

See the following link for more information: https://docs.gha-runners.nvidia.com/cpr/e/2/

@ZhiyuLi-Nvidia

Copy link
Copy Markdown
Contributor Author

/ok to test 601a6fe

@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

@adityavavreNVDA

Copy link
Copy Markdown
Contributor

/ok to test 93b297e

@cuichenx cuichenx added the r0.7.0 Auto-cherrypick to release branch. Apply before merge; cherrypick happens after merge. label 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"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will this impact perf?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes.

There seem no determinism fused gdn kernel yet, which raise an error without this.
Plan to dive into it after the release.

@cuichenx
cuichenx merged commit 7c2c9ba into NVIDIA-NeMo:main Oct 15, 2026
87 of 88 checks passed
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

1 active deployment
test — 93b297eb Deployed Oct 15, 2026 by copy-pr-bot[bot] via cicd-wait-in-queue #22914
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

26.10 area:recipe Training recipes and launch configs feature New capabilities, enhancements, or enablement work needs-review PR is ready for code review and waiting on a reviewer r0.7.0 Auto-cherrypick to release branch. Apply before merge; cherrypick happens after merge.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants