Repository navigation
Add constrained_json_whitespace_pattern to ServerArgs - #1438
Merged
Merged
Conversation
merrymercy
reviewed
Sep 16, 2024
merrymercy
approved these changes
Sep 16, 2024
5 tasks done
timethink
pushed a commit
to timethink/sglang
that referenced
this pull request
Mar 9, 2025
2 tasks done
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Sep 16, 2026
…l-project#1435 census walk), needles 6/6, but D still took ~9.5 s per 100k prompt, serial. py-spy on TP0 around the flip: 17 % presence probe (batch_exists_v2 stat()ing 100k stems on disk), 12 % draft page flags (a Python genexpr per page), 7 % blake2 of the same stems for find/ref/draft, 4 % lazy pinning -- the KV/draft pre-pin of sgl-project#1436 never ran (its anchor missed the sgl-project#1427 lines; only the mamba arena was pre-pinned). Now: KV/draft arenas pre-pinned at bind; presence answered from the arena (COMPLETE slot = present, one C call per width) before any disk stat; key128 cached; draft row checks and resolve_rows as tensor ops. Tests: arena 1427/1424/1433/0828, told 1400, 861, 931, 706 green.
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Sep 16, 2026
…he cache-hit batch of a 100k prompt (then ~80 tok/s decode); py-spy on TP0: 27 % presence probe -- batch_exists_v2 formatting, hashing (blake2 in Python + a ctypes array per key) and set-checking 300k stems, 13 % page transfer. BLAKE2b (RFC 7693) in arena.c, verified against hashlib on 280 stems; arena_find_stems answers a whole prefix by stem in one C call; batch_exists_v2 takes the leading COMPLETE KV prefix from that call, checks only the remainder the old way and asks the component pools lazily for the pages the trailing rule inspects. The redundant sgl-project#1438 block is gone (_readable_stems already asks the arena). Tests: arena claim (5, incl. C-vs-Python key), 1427/1424/1433/0828/1400/861/931/706 green.
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.
CC @qeternity @max99x
Motivation
It's hard to find a single whitespace pattern that works for all models(see dottxt-ai/outlines#691). I think it's better to leave the choice to the users.
Related PR: #1277
Modifications
constrained_json_whitespace_patternis added toServerArgswith the default value set toNone(usesoutlinesdefault value).Checklist
CI States
Latest PR Test (Base): ❌ Missing
run-cilabel -- add it to run CI tests.Latest PR Test (Extra): ❌ Blocked --
run-ciis required first.