[Spec][Ngram] 3/N: Fix synchronization issues in Ngram.cpp#21186
Merged
hnyls2002 merged 15 commits intosgl-project:mainfrom Mar 23, 2026
Merged
[Spec][Ngram] 3/N: Fix synchronization issues in Ngram.cpp#21186hnyls2002 merged 15 commits intosgl-project:mainfrom
Ngram.cpp#21186hnyls2002 merged 15 commits intosgl-project:mainfrom
Conversation
- Rename module/extension (ngram_corpus_cpp), sources, and TrieCache→Trie - Update ngram_worker and registered tests Made-with: Cursor
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
synchronize() previously only checked if the queue was empty, missing the window where the worker has dequeued an item but hasn't finished inserting it. Use a pending_count tracked from asyncInsert through insert completion, and wait on a condition_variable instead of spinning. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
9 tasks
c5d14d4 to
4928754
Compare
Collaborator
|
/rerun-ut test_ngram_corpus.py |
Collaborator
|
/rerun-ut test_ngram_speculative_decoding.py |
Contributor
|
✅ Triggered |
Contributor
|
✅ Triggered |
Contributor
Contributor
Collaborator
Interesting, can you open a fix for that? |
hnyls2002
approved these changes
Mar 23, 2026
5 tasks
0-693
pushed a commit
to 0-693/sglang
that referenced
this pull request
Mar 25, 2026
…ject#21186) Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.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.
Motivation
Part of Ngram refactoring series, following #21181
Modifications
Accuracy Tests
Benchmarking and Profiling
Checklist
Review Process
/tag-run-ci-label,/rerun-failed-ci,/tag-and-rerun-ci