Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[test] Lower number of top logprobs to get rid of -inf #3212

Merged
merged 1 commit into from
Jan 30, 2025

Conversation

ByronHsu
Copy link
Collaborator

@ByronHsu ByronHsu commented Jan 30, 2025

Motivation

One of the latest CI failed (test_srt_endpoint_with_penalizers.py) https://github.com/sgl-project/sglang/actions/runs/13006304270/job/36334676037.

This is a known issue #2955. In short, if the returned logprob contains -inf, fastapi will crash because it cannot handle -inf by default (fastapi/fastapi#8912).

The latest rope implementation makes the distribution more spiky likely due to the higher precision (now rope uses fp32, but before was bf16). The correctness is guaranteed as all other tests have passed.

The temporary solution is to lower top_logprobs_num because if the number is large, it is more likely the latter probs will be -inf, especially with penalty. e.g
image

This PR is to fix the CI. In the meantime, I will see if i can add a threshold for the logit processor or make fastapi able to handle -inf

Modifications

Checklist

@ByronHsu
Copy link
Collaborator Author

@zhyncs let's see if the CI can pass. It is constantly passing on my local h100.

@ByronHsu
Copy link
Collaborator Author

@zhyncs it passed

@zhyncs zhyncs merged commit 20453ce into main Jan 30, 2025
17 checks passed
@zhyncs zhyncs deleted the byhsu/fix-inf-logprob branch January 30, 2025 10:01
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.

2 participants