fix: adjust temperature scaling logic based on engine version#660
Merged
terrykong merged 2 commits intoNVIDIA-NeMo:mainfrom Jul 16, 2025
Merged
fix: adjust temperature scaling logic based on engine version#660terrykong merged 2 commits intoNVIDIA-NeMo:mainfrom
terrykong merged 2 commits intoNVIDIA-NeMo:mainfrom
Conversation
407dd3a to
ff8eff7
Compare
parthchadha
previously approved these changes
Jul 14, 2025
Contributor
parthchadha
left a comment
There was a problem hiding this comment.
LGTM, thanks for the fix! One of our unit tests should have failed when v0=>v1 switch happened but I guess our unit tests were not robust enough.
Contributor
|
@jubick1337 looks like lint check are failing, can you please run pre-commit as suggested at https://github.com/NVIDIA-NeMo/RL/blob/main/CONTRIBUTING.md. |
Signed-off-by: jubick1337 <mattyson.so@gmail.com>
96b0b7d to
c4a0414
Compare
Contributor
Author
|
Hi @parthchadha, Thanks for your help. I fixed the linting. Now mypy check is failing on files I did not change. What should I do next? |
Collaborator
|
Hi @jubick1337 . Thanks for helping make NeMo RL better! The mypy job is expected to fail since we haven't 100% fixed our static typing issues, so you are a.o.k. I've enqueued your PR |
terrykong
approved these changes
Jul 16, 2025
ZhiyuLi-Nvidia
pushed a commit
that referenced
this pull request
Jul 21, 2025
Signed-off-by: jubick1337 <mattyson.so@gmail.com> Signed-off-by: Zhiyu Li <zhiyul@nvidia.com>
jialei777
pushed a commit
to jialei777/nemo-rl
that referenced
this pull request
Jul 23, 2025
…-NeMo#660) Signed-off-by: jubick1337 <mattyson.so@gmail.com> Signed-off-by: Jialei Chen <jialeic@google.com>
KiddoZhu
pushed a commit
that referenced
this pull request
Jul 28, 2025
Signed-off-by: jubick1337 <mattyson.so@gmail.com>
xxman-google
pushed a commit
to xxman-google/NeMo-RL
that referenced
this pull request
Jul 30, 2025
…-NeMo#660) Signed-off-by: jubick1337 <mattyson.so@gmail.com>
FannYYW
pushed a commit
to xxman-google/NeMo-RL
that referenced
this pull request
Aug 5, 2025
…-NeMo#660) Signed-off-by: jubick1337 <mattyson.so@gmail.com>
FannYYW
pushed a commit
to xxman-google/NeMo-RL
that referenced
this pull request
Aug 5, 2025
…-NeMo#660) Signed-off-by: jubick1337 <mattyson.so@gmail.com>
soodoshll
pushed a commit
to soodoshll/RL
that referenced
this pull request
Aug 13, 2025
…-NeMo#660) Signed-off-by: jubick1337 <mattyson.so@gmail.com> Signed-off-by: Qidong Su <qidongs@nvidia.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 ?
This PR fixes a training instability bug by conditionally applying temperature scaling to logits based on the active vLLM engine version.
Issues
List issues that this PR closes (syntax):
Usage
# Add a code snippet demonstrating how to use thisBefore your PR is "Ready for review"
Pre checks:
Additional Information
This fix addresses an issue where logits were being scaled by temperature twice when using vLLM's V1 engine. The V1 engine returns raw, unscaled logits, while the V0 engine returned logits that were already scaled.
The fix checks the VLLM_USE_V1 environment variable to determine if the V1 engine is active and only applies manual temperature division if it is not, ensuring the scaling is performed exactly once.