Skip to content

[fix] Fix training and evaluation loss metric calculation in SFT codepath #1893

Draft
SumanthRH wants to merge 1 commit into
NovaSky-AI:mainfrom
SumanthRH:fix-eval-accum
Draft

[fix] Fix training and evaluation loss metric calculation in SFT codepath #1893
SumanthRH wants to merge 1 commit into
NovaSky-AI:mainfrom
SumanthRH:fix-eval-accum

Conversation

@SumanthRH

@SumanthRH SumanthRH commented Jul 14, 2026

Copy link
Copy Markdown
Member

What does this PR do?

Fixes training and evaluation loss metric calculation in the SFT codepath.

TLDR: The current SFT codepath uses the correct loss value during the optimization step, but the loss metrics that are logged are incorrect.

This PR unifies the scaling for the SFT and the RL codepath. Loss metrics and the loss value used during the optimization step are now the same.

A detailed explanation of the aggregation in SFT codepath is here: https://docs.google.com/document/d/19G4xeUjP1O1kKrg53wTUUyr0rErHEEh37Inn2djS_nQ/edit?tab=t.0

h/t @avigyabb for the find

TODO:

  • E2E SFT test

Signed-off-by: SumanthRH <sumanthrh99@gmail.com>
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.

1 participant