Repository navigation
fix(qwen4_exp cuda): resume identical resends and thinking turns - #124
benthecarman wants to merge 1 commit into
Conversation
Kept entries ended at the prompt's end, and a resume needs a strictly shorter prefix, so an identical resend or a next turn with thinking on (which renders the last prompt token differently) always prefilled in full. Keep the entry at len(prompt) - 1, as the 27B engine does, cut inside the chunk that holds it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
41a14ba to
326fe7f
Compare
|
I tested this branch (326fe7f) against Each case is a two-turn chat. Turn 1 is a document of N tokens plus a question. Turn 2 sends turn 1's reply back, reasoning stripped as clients do, plus a new question. Times are the server's
A test worth adding: the same prompt twice in a row after a hit. When a request resumes from exactly its kept point ( same = run(longer, 10) # the same prompt again: all but its last token kept
assert same.cached == len(longer) - 1 and same.out == warm.out
again = run(longer, 10) # and again: the point it resumed from is kept once more
assert again.cached == len(longer) - 1 and again.out == warm.outThe same extra request would fit in |
…t resends resume (#124), streamed tool calls (#114) - CUDA prompts take bf16 activations by default; --prefill-fp8 restores FP8 prompts; both ranks agree on the precision; block-scaled FP8 checkpoints load (#126) - Flash Next keeps each prompt's state one token early, so identical resends and next thinking turns resume (#124) - Tool-call arguments stream as they are written on the CUDA server (#114) - Before M5, Flash Next hyper-connection projections of 8+ rows run in 8-row tiles with the per-row bits - --checkpoint-slots on CUDA (#125)
|
We measured your fix, ported to 0.6.0's prompt passes, on a GB10 with Flash Next and an 18.7k-token prompt: an identical resend's time to first token fell from 8.3 s to 0.08 s and a thinking-on next turn from 8.4 s to 0.14 s, on one stream and --parallel 4 alike, and every reply is identical to before and to a fresh prefill without drafts. On 0.6.0 prompts also fill packed passes that can share a decode round's forward, so we added the same one-token-early cut there, with a test. Arminova's GB10 run of the branch showed the gap at long context, with turn 2 at 200k going from 112.5 s to 0.141 s, and Arminova's hit-miss-hit observation became the third identical-resend test. |
…t resends resume (ashhart#124), streamed tool calls (#114) - CUDA prompts take bf16 activations by default; --prefill-fp8 restores FP8 prompts; both ranks agree on the precision; block-scaled FP8 checkpoints load (ashhart#126) - Flash Next keeps each prompt's state one token early, so identical resends and next thinking turns resume (ashhart#124) - Tool-call arguments stream as they are written on the CUDA server (#114) - Before M5, Flash Next hyper-connection projections of 8+ rows run in 8-row tiles with the per-row bits - --checkpoint-slots on CUDA (ashhart#125)
…e, lifted from the DeepSeek port) Spill v2's family-neutral, GPU-free store, the DeepSeek port's core/spill/ as it stands on that port's engine, lifted onto v1.0.7 (whose direct_io has the same API): kept states in 2,048-token blocks that turns and forks of a conversation share (the id chain salted with the lineage names them, so a later turn writes only its own blocks), small per-point sections, writes staged through the write-at-keep ring (a kill keeps only fully published points), recovery at open, reads through read slots with all-rank presence and validation, and room made by conversation (issue ashhart#122) under a cap, a disk floor, a quota and a turn bound. - The namespace prefix is the family's (Config.prefix; GLM's is glm-spill-), and open prunes only that family's other builds, names of exactly <prefix><16 hex>, so GLM and DeepSeek can share one spill folder. - Kept although GLM uses only the first (with KV sharding) and not yet the second: owner-sharded layouts (a part-salted lineage, a foreign part's block size) and picture points (manifest version 3); a text point is written as version 2. Switch: none (a library). Nothing calls it before the GLM tier (the spill blocks patch): with no store opened nothing changes, and Zig's lazy analysis leaves it out of the server binary. Tests: the DeepSeek store's tests (format, recovery, crash points, lineage, eviction, concurrent reads) plus a GLM-shaped check of grid turns, the family prune and prefix refusals; its mutants are caught. Measured on the pair: under the GLM tier in round 2's image (g2; the spill blocks patch says what). Credits: Robert Wojciechowski (GitHub @wojo, X @rwojo); spill v2's block store design (2,048-token blocks, lineage, the write-at-keep ring, release and fsync order): BadAd84 (https://github.com/BadAd84), MiaAI-Lab/GLM-5.3-Flash-EXL3-2x-DGX-Sparks-TensorFold#118; GLM patches 0088 and 0110, MiaAI-Lab/GLM-5.3-Flash-EXL3-2x-DGX-Sparks-TensorFold#78 and ashhart#124.
Fixes #98.
Flash Next kept each prompt's state at its end, and a resume needs a strictly shorter prefix. So an identical
resend, or a next turn with thinking on (which renders the last prompt token differently), always prefilled in
full. This keeps the entry at
len(prompt) - 1, as the 27B does, for one stream,--paralleland--tp 2.One DGX Spark,
Vontra/Qwen3.8-Flash-Next-MLX-4bit-MTP, 11.7K-token prompt, time to first token:The same holds with
--parallel 4, and every reply equals its"draft": falsereply. The kept state is takeninside the chunk that holds it, as the 27B's prefill does, so a prompt costs no extra forward.