Conversation
Signed-off-by: Sahil Jain <sahilj@nvidia.com>
c619e19 to
c58334f
Compare
Signed-off-by: Sahil Jain <sahilj@nvidia.com>
parthchadha
approved these changes
Mar 21, 2025
parthchadha
reviewed
Mar 21, 2025
terrykong
approved these changes
Mar 21, 2025
parthchadha
pushed a commit
that referenced
this pull request
Mar 21, 2025
Signed-off-by: Sahil Jain <sahilj@nvidia.com> Co-authored-by: Terry Kong <terrycurtiskong@gmail.com> Signed-off-by: Parth Chadha <pchadha@nvidia.com>
KiddoZhu
pushed a commit
that referenced
this pull request
May 6, 2025
Signed-off-by: Sahil Jain <sahilj@nvidia.com> Co-authored-by: Terry Kong <terrycurtiskong@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.
Investigating precision weirdness...
It looks like for SFT, we need to run fp32 (curves look worse without it).
In GRPO, we have peculiar behavior:
with fp32, we have better convergence, but eventual divergence. Logprob errors and KL are high (could be due to bad refit or vLLM's bf16 inference being a poor approximation of 'real' fp32 probabilities). With either bf16 or mixed precision (via fsdp mixed precision), convergence is worse, but it is stable and logprob errors are stable.
Green: fp32, pink: bf16, blue: bf16-mixed.
I'm not convinced mixed precision as implemented here is doing anything at all. Needs further investigation.
Until then, this makes precision configurable and sets default precision to float32 for sft and bfloat16 for grpo.