Conversation
Collaborator
|
@comaniac Hi, I suggest initializing the |
Contributor
Author
|
Thanks that makes sense. Meanwhile, can you add some comments back to explain why we need to calculate the token usage in this way? |
timethink
pushed a commit
to timethink/sglang
that referenced
this pull request
Mar 9, 2025
XiaobingSuper
pushed a commit
to XiaobingSuper/sglang
that referenced
this pull request
Jan 23, 2026
lujangus
pushed a commit
to tails-mpt/sglang
that referenced
this pull request
Mar 31, 2026
* added CI * poslih * poslih * poslih * poslih * poslih * fixed some broken tests * fix broken test case and fix llama4.py * precommit llama4.py * add init to make test discoverable (sgl-project#173) * Devops/ci (sgl-project#174) * add init to make test discoverable * lower atol rtol and fix random * Devops/ci used normed tensor for testing, worked locally (sgl-project#175) * add init to make test discoverable * lower atol rtol and fix random * pass locally... why fail on ci * done * remove requires grad * Reduce qwen tp process count to 2 (sgl-project#177) * add init to make test discoverable * lower atol rtol and fix random * pass locally... why fail on ci * done * remove requires grad * fix qwen3 tp test * remove dup * Should pass CI without a problem (sgl-project#178) * add init to make test discoverable * lower atol rtol and fix random * pass locally... why fail on ci * done * remove requires grad * fix qwen3 tp test * remove dup * fix tp size * recursively search for tests --------- Co-authored-by: ZhengHSI <zhenghsi@qq.com> Co-authored-by: Yubo Wang <yubowang2019@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.
close #173
This PR fixes the incorrect token usage when jump forward is enabled. Specifically, we introduce a new field
orig_prompt_tokens, which will be set when the first jump forward happens so that we could know the original number of prompt tokens. When returning a response (a chunk in streaming or a complete response), we use the following equations to correct the token usage: