Skip to content

[Spec][Ngram] Clean up unused stateless batchMatch#22487

Merged
hnyls2002 merged 1 commit intosgl-project:mainfrom
kpham-sgl:kp/ngram-clean-up-deadcode
Apr 11, 2026
Merged

[Spec][Ngram] Clean up unused stateless batchMatch#22487
hnyls2002 merged 1 commit intosgl-project:mainfrom
kpham-sgl:kp/ngram-clean-up-deadcode

Conversation

@kpham-sgl
Copy link
Copy Markdown
Collaborator

Motivation

After #21243, Ngram::batchMatch became stateful. However there is still an old stateless relics left from before (possible result of merge conflicts resolution - my bad).

Note: the stateful batchMatch takes in const std::vector<int64_t>& state_ids while the stateless batchMatch does not. Also the state is only passed down to the Trie build function

Modifications

Remove the dead stateless Ngram::batchMatch code.

Accuracy Tests

N/A

Speed Tests and Profiling

N/A

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.

@kpham-sgl
Copy link
Copy Markdown
Collaborator Author

/tag-and-rerun-ci

@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!

@kpham-sgl
Copy link
Copy Markdown
Collaborator Author

/rerun-test registered/unit/spec/test_ngram_corpus.py

@kpham-sgl
Copy link
Copy Markdown
Collaborator Author

/rerun-test test/registered/spec/test_ngram_speculative_decoding.py

@github-actions
Copy link
Copy Markdown
Contributor

ubuntu-latest (1 test): View workflow run

cd test/ && python3 registered/unit/spec/test_ngram_corpus.py

@github-actions
Copy link
Copy Markdown
Contributor

1-gpu-h100 (1 test): View workflow run

cd test/ && python3 registered/spec/test_ngram_speculative_decoding.py

@hnyls2002 hnyls2002 merged commit aeeff58 into sgl-project:main Apr 11, 2026
137 of 165 checks passed
pyc96 pushed a commit to pyc96/sglang that referenced this pull request Apr 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants