Skip to content

feat(megatron): support model config overrides - #3535

Merged
ZhiyuLi-Nvidia merged 3 commits into
NVIDIA-NeMo:mainfrom
CarlosGomes98:cgomes/model-config-overrides
Aug 11, 2026
Merged

ZhiyuLi-Nvidia merged 3 commits into
NVIDIA-NeMo:mainfrom
CarlosGomes98:cgomes/model-config-overrides

Conversation

@CarlosGomes98

@CarlosGomes98 CarlosGomes98 commented Aug 7, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do ?

Allow arbitrary options to be passed to MBridge model_cfg

Issues

List issues that this PR closes (syntax):

Usage

Some feature flags MBridge exposes are not explicitly forwarded by NeMo-RL. This means we must patch NeMo-RL, or submit an MR with that flag. In some cases, it is useful to just directly pass options to MBridge.

...
policy:
  megatron_cfg:
    model_overrides:
      gdn_pre_gated_delta_rule_fusion: true
...

Before your PR is "Ready for review"

Pre checks:

  • Make sure you read and followed Contributor guidelines
  • Did you write any new necessary tests?
  • Did you run the unit tests and functional tests locally? Visit our Testing Guide for how to run tests
  • Did you add or update any necessary documentation? Visit our Document Development Guide for how to write, build and test the docs.

Additional Information

  • ...

@CarlosGomes98
CarlosGomes98 requested review from a team as code owners August 7, 2026 11:18
@copy-pr-bot

copy-pr-bot Bot commented Aug 7, 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.

@github-actions github-actions Bot added the Documentation Improvements or additions to documentation label Aug 7, 2026

@ZhiyuLi-Nvidia ZhiyuLi-Nvidia left a comment

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.

Direction: error out on conflict between model_overrides and first-class megatron_cfg fields.

Comment thread nemo_rl/models/megatron/setup.py Resolved

@ZhiyuLi-Nvidia ZhiyuLi-Nvidia left a comment

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.

Follow-up: merge overrides into provider construction, not post-hoc setattr; add a test that the saved/final model config equals the merged one.

Comment thread nemo_rl/models/megatron/setup.py Resolved
@svcnvidia-nemo-ci svcnvidia-nemo-ci added the waiting-on-customer Waiting on the original author to respond label Aug 8, 2026
@CarlosGomes98
CarlosGomes98 force-pushed the cgomes/model-config-overrides branch from 7f5509c to 806ea43 Compare August 10, 2026 10:06
@svcnvidia-nemo-ci svcnvidia-nemo-ci removed the waiting-on-customer Waiting on the original author to respond label Aug 10, 2026
@ZhiyuLi-Nvidia

Copy link
Copy Markdown
Contributor

/ok to test 806ea43

@ZhiyuLi-Nvidia ZhiyuLi-Nvidia self-assigned this Aug 10, 2026
@ZhiyuLi-Nvidia ZhiyuLi-Nvidia added the CI:Lfast Runs a fast test suite and re-use nightly `main` container (but sync dependencies to PRs version) label Aug 10, 2026

@ZhiyuLi-Nvidia ZhiyuLi-Nvidia left a comment

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.

Lint: strip trailing whitespace at setup.py:772 (one-click suggestion).

Comment thread nemo_rl/models/megatron/setup.py Resolved
@svcnvidia-nemo-ci svcnvidia-nemo-ci added the waiting-on-customer Waiting on the original author to respond label Aug 11, 2026
CarlosGomes98 and others added 3 commits August 11, 2026 09:16
@CarlosGomes98
CarlosGomes98 force-pushed the cgomes/model-config-overrides branch from 285a779 to 99a6e23 Compare August 11, 2026 07:17
@ZhiyuLi-Nvidia

Copy link
Copy Markdown
Contributor

/ok to test 99a6e23

@ZhiyuLi-Nvidia

Copy link
Copy Markdown
Contributor

Thank you @CarlosGomes98 a lot! Awesome feature.
LGTM!

@ZhiyuLi-Nvidia
ZhiyuLi-Nvidia merged commit e45e29d into NVIDIA-NeMo:main Aug 11, 2026
81 checks passed
@svcnvidia-nemo-ci svcnvidia-nemo-ci removed the waiting-on-customer Waiting on the original author to respond label Aug 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI:Lfast Runs a fast test suite and re-use nightly `main` container (but sync dependencies to PRs version) community-request Documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants