Skip to content

allow requests with exactly context_len total tokens#22546

Merged
hnyls2002 merged 3 commits into
sgl-project:mainfrom
opherlieber:fix-request-bounds
Apr 30, 2026
Merged

allow requests with exactly context_len total tokens#22546
hnyls2002 merged 3 commits into
sgl-project:mainfrom
opherlieber:fix-request-bounds

Conversation

@opherlieber
Copy link
Copy Markdown
Contributor

Motivation

Requests with total length prompt_length+max_new_tokens=context_len should be allowed. This is exactly what the auto-truncate code below truncates to, and also the same way VLLM checks.

Modifications

Allow requests with exactly context_len total tokens.

Accuracy Tests

Speed Tests and Profiling

Checklist

Review and Merge Process

  1. Ping Merge Oncalls to start the process. See the PR Merge Process.
  2. Get approvals from CODEOWNERS and other reviewers.
  3. Trigger CI tests with comments or contact authorized users to do so.
    • Common commands include /tag-and-rerun-ci, /tag-run-ci-label, /rerun-failed-ci
  4. After green CI and required approvals, ask Merge Oncalls or people with Write permission to merge the PR.

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@yushengsu-thu yushengsu-thu self-assigned this Apr 13, 2026
@b8zhong b8zhong added the run-ci label Apr 24, 2026
@yushengsu-thu yushengsu-thu enabled auto-merge (squash) April 29, 2026 06:07
@hnyls2002 hnyls2002 disabled auto-merge April 30, 2026 08:12
@hnyls2002 hnyls2002 merged commit 99c0b62 into sgl-project:main Apr 30, 2026
370 of 445 checks passed
vguduruTT pushed a commit to vguduruTT/sglang that referenced this pull request May 2, 2026
Co-authored-by: Ethan (Yusheng) Su <yushengsu.thu@gmail.com>
LucQueen pushed a commit to LucQueen/sglang that referenced this pull request May 12, 2026
Co-authored-by: Ethan (Yusheng) Su <yushengsu.thu@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants