Skip to content

fix: deterministic implementation of _float32_rms_norm_fwd#2971

Open
ashors1 wants to merge 3 commits into
mainfrom
ashors/atomic-rmsnorm
Open

fix: deterministic implementation of _float32_rms_norm_fwd#2971
ashors1 wants to merge 3 commits into
mainfrom
ashors/atomic-rmsnorm

Conversation

@ashors1

@ashors1 ashors1 commented Jul 8, 2026

Copy link
Copy Markdown

What does this PR do ?

This PR fixes an issue we're observing with DPO in nemo-rl where the initial loss does not match expectations. Please refer to NVIDIA-NeMo/RL#2662 for details.

Essentially, the current implementation of fp32 rmsnorm causes nondeterminism across grad/no_grad contexts, which is problematic for DPO where we expect the forward passes to be fully deterministic. This PR fixes that nondeterminism by ensuring that rmsnorm is treated as an atomic operation.

Changelog

  • Add specific line by line info of high level changes in this PR.

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 add or update any necessary documentation?

If you haven't finished some of the above items you can still open "Draft" PR.

Additional Information

  • Related to # (issue)

Signed-off-by: Anna Shors <ashors@nvidia.com>
@ashors1 ashors1 requested a review from hemildesai July 8, 2026 18:11
@ashors1 ashors1 requested a review from a team as a code owner July 8, 2026 18:11
@copy-pr-bot

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

@hemildesai

Copy link
Copy Markdown
Contributor

/claude review

@hemildesai

Copy link
Copy Markdown
Contributor

/ok to test 4ced4b6

Comment thread nemo_automodel/components/models/common/utils.py Outdated
Comment thread nemo_automodel/components/models/common/utils.py Outdated
ashors1 and others added 2 commits July 8, 2026 15:22
@akoumpa

akoumpa commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

/ok to test e3a3de0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants