Skip to content

Fixing extra averaging performed in validation error - #2366

Merged
tianyu-l merged 1 commit into
pytorch:mainfrom
Shagun-G:export-D92888963
Feb 11, 2026
Merged

tianyu-l merged 1 commit into
pytorch:mainfrom
Shagun-G:export-D92888963

Conversation

@Shagun-G

Copy link
Copy Markdown
Contributor

Summary: The change to averaging over microbatches to averaging over the global tokens in D91432940, the train loss computation was fixed to account of the change from mean to sum but not the validation loss computation, thus incurring an extra division computation in the validation loss. The operations here has been changed from a mean to a sum.

Differential Revision: D92888963

Summary: The change to averaging over  microbatches to averaging over the global tokens in D91432940, the train loss computation was fixed to account of the change from mean to sum but not the validation loss computation, thus incurring an extra division computation in the validation loss. The operations here has been changed from a mean to a sum.

Differential Revision: D92888963
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Feb 10, 2026
@meta-codesync

meta-codesync Bot commented Feb 10, 2026

Copy link
Copy Markdown

@Shagun-G has exported this pull request. If you are a Meta employee, you can view the originating Diff in D92888963.

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

thanks for the fix

@tianyu-l
tianyu-l merged commit f80a441 into pytorch:main Feb 11, 2026
10 of 12 checks passed
TXacs pushed a commit to McmillanTAC/torchtitan that referenced this pull request Apr 13, 2026
Summary: The change to averaging over microbatches to averaging over the
global tokens in D91432940, the train loss computation was fixed to
account of the change from mean to sum but not the validation loss
computation, thus incurring an extra division computation in the
validation loss. The operations here has been changed from a mean to a
sum.

Differential Revision: D92888963

Co-authored-by: Shagun Gupta <[email protected]>
ACharacterInASimulation pushed a commit to ACharacterInASimulation/torchtitan that referenced this pull request Apr 21, 2026
Summary: The change to averaging over microbatches to averaging over the
global tokens in D91432940, the train loss computation was fixed to
account of the change from mean to sum but not the validation loss
computation, thus incurring an extra division computation in the
validation loss. The operations here has been changed from a mean to a
sum.

Differential Revision: D92888963

Co-authored-by: Shagun Gupta <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot. fb-exported meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants