Repository navigation
Conversation
The engine kept a prompt cache but advertised no warm turns, so the server never prefilled the next turn's rendering and a follow-up that re-renders earlier rows prefilled the whole conversation again. The capability now follows the cache's presence; the cache rules are unchanged.
… the completed prefix A warm pass ran to the end of the prompt instead of stepping aside when foreground work arrived: the loop checked cancellation but never the yield hook its background passes wire. The pass now keeps its completed prefix and returns error.Yielded at the boundary; the next pass resumes the kept mark.
A planned store kept a warm end off the grid, and under a one-snapshot budget the unusable end evicted the usable mark: the next request resumed at zero. The rules now set warm_usable, and the one-snapshot regression stays.
…prose Tool-call openers quoted inside Markdown inline code spans (`...`) or fenced code blocks (```...``` or ~~~...~~~) in generated assistant prose were treated as live call openers. Quoted `<tool_call>` tags paired with a following real call's `</tool_call>` and rejected it, quoted `<tool_call>NAME<arg_key>...` fragments naming an offered tool streamed bogus arguments, and complete quoted calls inside prose or code blocks executed as tool calls. Add a linear-time Markdown code-span and fence scanner (reply_code.zig) and wire it into whole parsing (tool_parse.zig), streaming call deltas (tool_stream.zig), single-call prose filtering (tool_policy.zig), prose hiding and thinking-tail lifting (reply_text.zig, reply_tool_tail.zig), LFM2 rewrites (tool_lfm2.zig), logprob ranges (logprob_parts.zig), and EOS call closing (chat_generation.zig). While streaming, an inline backtick span containing a tool opener waits until a matching closer confirms code or a paragraph break or end proves it literal. zig build test-tool-parse-host test-tool-visibility-http-host test-thinking-tail-host, zig build test test-golden dev-tools -Dcpu=apple_m1, zig fmt --check build.zig zig, and python3 tools/pr_check.py --base origin/main pass.
… a 4096-row-multiple end The Qwen3.5 CUDA family declared no warm pass, so the server never ran one for it. Both entry points now declare `warm_quiet` (150 ms) and `warm_usable`, `cuda_snaps.cacheRules` reads a family's `warm_usable`, and a CUDA host takes the family's own wait instead of Nemotron's. What the pass keeps is the narrow part: a request's chunk starts never reach its own end, and this family's grid is 4096 rows, so the end survives only when the prompt is an exact multiple of it. A turn under 4096 rows keeps nothing and is cancelled before it runs; a 5000-row turn keeps its 4096 mark but not its end. `prefillFn`'s whole text pass is fixed on main (#2838); this branch carries the enablement only, and #2873's foreground yield goes first. Host tests: the declarations on both entry points, and a family's warm rules and its own wait. Refs #2812
Share the existing chat chunk-start expression through Plan.request. A warm pass computes its own system prefix and uses that same plan, so request-starts caching does not skip the system cut on the background path. The host regression compares warm-prefix and later-request cuts with a 600-token system prefix. Skipping the cut fails the test; preserving it gives the same starts below the warm end. Refs #2812
…ack, the model's repetition past about 300K, and omp's replayReasoningContent
The lane host tests run hand-picked orders; their seeds pick samples, not schedules. test-lane-explore-host wraps the fake target and, before each prompt call, prompt step, batched pass, first draw, one-token step and verified round, lets a seed pick the next arrival, a cancel, the backend's room for live lanes or the memory pressure the host reads. The seed also picks the setup: lanes, requests, a draft head or none, pipelined or verified one-token rounds, early or late speculation, batched or per-stream head drafts, sampled or greedy requests, and for chunked prompts the chunk count and the prompt-row budget. After each schedule every request has finished exactly once with no event after it, ended `length` with all its tokens or `cancelled` only when cancelled, and its tokens are a solo run's (or their prefix); no reply passes max_tokens, the backend never holds more lanes than the host, prompt steps beside a decoder stop at the row budget, a stream's chunks run in order, and no lane or stream is left. A third test replays 16 seeds of each scenario and compares a digest of every yield point's act and every reply. A failure prints its seed and `zig build test-lane-explore-host -Dexplore-seed=S` replays it; -Dexplore-seeds=N sets the sweep (default 200 a scenario) and -Dexplore-tally=true prints what the schedules did. The test binary runs in about 2 s. A planted skipped release on cancel and a removed budget stop each fail at a printed seed that replays. No engine code changes. The nightly Linux host list runs the step.
…ords (value change) Both target loaders (load.zig: load and loadGptq) and the DFlash2 drafter (drafter.zig, Drafter.init) take their inverse frequencies from xpu/rope_table.zig: rope_freq.inverseFrequencies(1e7, 64) for the target's 32 words (attn_prep: 64 rotated dims of 256), (1e7, 128) for the drafter's 64 (dprep: full 128-dim heads). Every word that moves moves by exactly 1 ulp. Target, theta 1e7 over 64: 15 of 32 differ; largest |old - new| 2.980e-8 (word 2), largest relative 1.181e-7. word 2 0x3ebaf81a -> 0x3ebaf81b word 16 0x39a5cb5f -> 0x39a5cb60 word 22 0x37812dac -> 0x37812dab word 3 0x3e61f836 -> 0x3e61f835 word 18 0x38f22ce3 -> 0x38f22ce2 word 26 0x3609cf4b -> 0x3609cf4a word 5 0x3da50957 -> 0x3da50956 word 19 0x3892587f -> 0x3892587e word 28 0x35494c56 -> 0x35494c57 word 7 0x3cf11176 -> 0x3cf11177 word 20 0x3830df51 -> 0x3830df52 word 29 0x34f3499c -> 0x34f3499d word 10 0x3bd4ca14 -> 0x3bd4ca15 word 21 0x37d5c442 -> 0x37d5c441 word 13 0x3abbd3ec -> 0x3abbd3ed Drafter, theta 1e7 over 128: 18 of 64 differ; largest |old - new| 2.980e-8 (word 4), largest relative 1.181e-7. Even words 2j equal the target's word j, old and new, so 15 are the target's above at twice the index: 4 6 10 14 20 26 32 36 38 40 42 44 52 56 58. Three odd words also move: word 25 0x3af19f03 -> 0x3af19f02 word 35 0x391bc44d -> 0x391bc44e word 39 0x3863872d -> 0x3863872c Why the words differ: - Formula order: the loaders computed f32(1e7^(-i / 32)), a negative exponent with no reciprocal; transformers and rope_freq compute 1 / 1e7^(2i / d). - Precision: both old forms kept everything in f64 and rounded to fp32 once (the drafter's f32(1 / 1e7^(2i / 128)) took its reciprocal in f64). transformers rounds 1e7^e to fp32, then takes an fp32 reciprocal: two roundings. Every moved word is a case where those two roundings land 1 ulp from the single one. On all 18 moved words the old word is the nearer one to the exact 1e7^(-2i / d) (checked in 60-digit decimal). So this is a move to transformers' bits, not an accuracy fix. - Theta and exponent handling contribute nothing: 1e7 is exact in fp32 and f64, and 2i / 64 and 2i / 128 are exact in both, so old and new raise the same base to the same exponent. Test (zig build test, through the XPU host tests): rope_table.zig prints the old and new tables side by side with each table's largest absolute and relative difference. The replaced expressions live only in the tests, as references. The target's words are pinned to the transformers 5.22.1 literals that rope_freq's own test holds for 1e7/64. The drafter's are pinned to new 1e7/128 literals, each step correctly rounded in 60-digit decimal; their even words are the 1e7/64 transformers words, and their odd words are not yet checked against torch. The tests also assert exactly the moved indices and at most 1 ulp. Not run on an XPU. Before landing it needs a token A/B of old and new xpu-qwen27 builds on the same ids, and drafted == serial on the new build (XPU_VERIFY_TEST, XPU_DRAFTER with XPU_TREE=15, XPU_MULTI_TEST). Refs #1852.
xpu/rope_table.zig's two tests (the target's and the drafter's words against their old expressions) ran only under the aggregate test step. test-rope-xpu-host runs them alone, without devices or ocloc; the aggregate step still depends on them. Refs #1852.
xgrammar's compile grows with the square of the grammar's text and the server holds one lock across it. A grammar over 512 KiB now gets HTTP 400 before the compiler sees it.
…al of their own A sent grammar is checked where it is read, before compiling. A tool grammar is measured as the grammar for one call, which holds each tool's name and schema once, so the repeat a parallel-call grammar adds no longer refuses tools under the limit (300 KiB of required tools is served); names and many small tools still count. Its 400 names tools. The docs say a JSON schema or a choice list is measured as the server re-serializes it.
Owner
Author
|
Stopped at #3457. |
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.
CI for a landing train: #3457 #3560 #2979 #3588 #2824 #3576 #3341 #3233 #2000 #3038 stacked on main in that order. Nothing merges from this PR: each PR above lands on its own once this tip is green, and this PR is then closed.