Skip to content

feat: enable SGLANG_PATCH_TOKENIZER by default - #23409

Merged
ch-wan merged 1 commit into
sgl-project:mainfrom
ByronHsu:enable-patch-tokenizer-default
Apr 22, 2026
Merged

feat: enable SGLANG_PATCH_TOKENIZER by default#23409
ch-wan merged 1 commit into
sgl-project:mainfrom
ByronHsu:enable-patch-tokenizer-default

Conversation

@ByronHsu

@ByronHsu ByronHsu commented Apr 21, 2026

Copy link
Copy Markdown
Collaborator

Default matches the existing TODO in environ.py. Kimi tiktoken tokenizers benefit from cached all_special_tokens / all_special_ids. Users can set SGLANG_PATCH_TOKENIZER=0 to restore the previous behavior.

Ref: #16427
Made-with: Cursor

Motivation

Modifications

Accuracy Tests

Speed Tests and Profiling

Before

    "itl_s": {
      "mean": 0.028426,
      "count": 390144.0,
      "p10": 0.020817,
      "p25": 0.02406,
      "p50": 0.027877,
      "p95": 0.039779,
      "p99": 0.057552
    },

After

"itl_s": {
      "mean": 0.212692,
      "count": 79872.0,
      "p10": 0.103815,
      "p25": 0.132615,
      "p50": 0.180615,
      "p95": 0.37494,
      "p99": 0.394988
    },

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.

Default matches the existing TODO in environ.py. Kimi tiktoken tokenizers
benefit from cached all_special_tokens / all_special_ids (large ITL impact
under high batch size). Users can set SGLANG_PATCH_TOKENIZER=0 to restore
the previous behavior.

Made-with: Cursor
@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!

@ch-wan

ch-wan commented Apr 21, 2026

Copy link
Copy Markdown
Collaborator

/tag-and-rerun-ci

@ch-wan
ch-wan merged commit c090f71 into sgl-project:main Apr 22, 2026
134 of 226 checks passed
caitengwei pushed a commit to caitengwei/sglang that referenced this pull request Jun 1, 2026
Chronostasys pushed a commit to MindLab-Research/sglang that referenced this pull request Aug 24, 2026
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.

2 participants