Skip to content

Fix sfadamw jax v2 - #52

Merged
priyakasimbeg merged 1 commit into
mlcommons:mainfrom
wyfEmma:fix_sfadamw_v2
Aug 28, 2026
Merged

Fix sfadamw jax v2#52
priyakasimbeg merged 1 commit into
mlcommons:mainfrom
wyfEmma:fix_sfadamw_v2

Conversation

@wyfEmma

@wyfEmma wyfEmma commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Previously the code was normalizing y based on historical data on x.(use_running_average_bn in the model is set to true if update_batch_norm=false, and that running_average_bn derives from historical bn based on x) Now it is updated to:

  1. normalize y based on current batch norm data of y
  2. normalize x based on historical batch norm of x
  3. put x batch norm update in a jitted function.

This aligns with the pytorch implementation

comparison of validation accuracy before and after this PR:
image

Previously we were normalizing y based on historical data on x.(use_running_average_bn in the model would be true if update_batch_norm=false, and that contains historical bn based on x)
Now it is updated to:
1.normalize y based on current batch norm data of y
2.normalize x based on historical bn of x
3. jit x batch norm update
This aligns with pytorch implementation
@wyfEmma
wyfEmma requested a review from a team as a code owner August 27, 2026 18:05
@github-actions

Copy link
Copy Markdown

MLCommons CLA bot All contributors have signed the MLCommons CLA ✍️ ✅

@priyakasimbeg priyakasimbeg 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.

Great catch! thank you Yifan

@priyakasimbeg
priyakasimbeg merged commit 7b05219 into mlcommons:main Aug 28, 2026
7 checks passed
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.

2 participants