[fix] Fix training and evaluation loss metric calculation in SFT codepath #1893
Draft
SumanthRH wants to merge 1 commit into
Draft
[fix] Fix training and evaluation loss metric calculation in SFT codepath #1893SumanthRH wants to merge 1 commit into
SumanthRH wants to merge 1 commit into
Conversation
Signed-off-by: SumanthRH <sumanthrh99@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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: