Repository navigation
qwen CUDA: DSpine drafter for Qwen3.8-27B, opt-in by --drafter - #2633
Conversation
|
@jschmied, GB10 cells on Exact. Every DSpine reply equals the same request with drafts off, at T=0 and seeded T=1: all 32 agent requests and all 40 chat and code requests. At two streams the two replies can finish in either order, so those are compared as sets. Agent-shaped requests. These use a coding agent's system prompt, three tools, and tool turns carrying one to five source files. Decode tok/s, median of four runs each side:
Chat and code prompts (1 and 2 streams, decode tok/s):
Why. Both drafters propose about the same number of tokens a round (about 15 on chat and code, 17 to 18 on agent requests), so the drafter's cost is level. The difference is acceptance:
So on CUDA it matches your table: a gain on agent turns and a loss on chat and code, which is why opt-in is the right shape. We'll run the same cells on the new head once the kernel records are in, and on the M5 Ultra and M3 Ultra once #2634 serves. |
|
@ashhart thanks, that is the clearest picture yet: exact everywhere, +3 to +20 % on the agent-shaped requests, −9 to −19 % on chat and code, from acceptance alone (8.10 vs 7.27 and 4.20 vs 4.88 committed a round). Opt-in it stays. The records, a float64 table test with four planted controls and the CHANGELOG line are in final CI here and land on this branch as three commits on top of |
|
@ashhart the head is final for your re-run: |
|
@ashhart one correction: the branch conflicted with main on the CHANGELOG, so CI could not run. Replayed on main as |
|
@ashhart main's CHANGELOG moved again within the hour, so I left our CHANGELOG commit out (you place the line at landing; the proposed text is in the body). Head is now |
|
@ashhart CI caught main's new |
|
@jschmied the same cells on |
|
@jschmied, thanks. On Next is the CUDA kernel contract on a GB10 for this head, with |
|
@jschmied, our GB10 cell on this head ( |
… core files read as proposed
…ckend Tencent's DSpine block drafter (tencent/Qwen3.8-27B-DSpine-b16) admitted from its config.json alone: block-causal bridge, exact-sender serial table, independent writes, all-sliding plain-rope layers. The table walk (sender = the chosen candidate's index in the row before) is backend-neutral so the CUDA and Metal drafters share it.
--drafter at tencent/Qwen3.8-27B-DSpine-b16 selects it from its config.json (core.dspine.declared); DFlash2 folders are unchanged. It is a second kind of the CUDA Draft, sharing its tap ring, absorb, context rings, batched frame, head spans, top-k, chain/tree/lane walkers and the lanes Drafter contract: - attention: tf_q35d_attn_partial/merge take the chunk count (33 for the 8,192 window) and a causal flag - layers without the conv, each closed by the code bridge (read code, codebook anchor, gated message, write) - second pass on the GPU: every row's 16 candidates scored after each of the row before's (exact sender), normalized logits; TG = W_write^T (final_norm * head row) built at load through the target head - the walkers read that table (core.dspine.sender), so greedy, sampled draws and trees all follow it - absorb keeps at most the rows the target's tap ring holds (tap_rows - most_verify) behind its newest Draft linears are affine-4 as DFlash2's.
…able rows) shared by every backend; CUDA keeps a thin wrapper
…, attn_partial and attn_merge re-measured
…ender table against float64 with four controls
|
Thank you @jschmied. This is merged into main with your commits under your own name, so you're listed as a TensorFold contributor. It ships in the next release, credited to you in the changelog and the release notes. |
…ne; DSpine's core parts are on main, Metal is open
Figures corrected to the PRs' measured ones (#2699 head runs, #2509, #2633, #2436, #2644, #2593, #2430, #2568), scope fixed (#2253, #2287, #2511, #2569, #2337, #2627, #2351, #2626), unsourced figures dropped (#2181, #2606, #2257's pricing clauses), the shipped #2176, #2565, #2548 and gfx12 silu entries and the first #2625 copy removed, and the #2568 and #2352 entries unwrapped to one line each.
…0 % faster, chat and code 10-19 % slower)
…0 % faster, chat and code 10-19 % slower)
|
Thanks @jschmied! This is in TensorFold 1.2.6, out now: https://github.com/ashhart/TensorFold/releases/tag/v1.2.6
|
qwen35_draft.cu gained the opt-in DSpine draft kernels (#2633), flashnext_hc.cu shares sum_rn and rms_scale with the same SASS (#2666, #2684), and flashnext/cuda_batch.zig keys disk states by the resolved prompt passes (#2287). test-qwen-serving-host and test-gradient-serving fail on main until the pins follow.
qwen35_draft.cu gained the opt-in DSpine draft kernels (#2633), flashnext_hc.cu shares sum_rn and rms_scale with the same SASS (#2666, #2684), and flashnext/cuda_batch.zig keys disk states by the resolved prompt passes (#2287). test-qwen-serving-host and test-gradient-serving fail on main until the pins follow.
qwen35_draft.cu gained the opt-in DSpine draft kernels (#2633), flashnext_hc.cu shares sum_rn and rms_scale with the same SASS (#2666, #2684), and flashnext/cuda_batch.zig keys disk states by the resolved prompt passes (#2287). test-qwen-serving-host and test-gradient-serving fail on main until the pins follow.
, ashhart#2464, ashhart#2375, ashhart#2634) and adds row 29, DSpine (ashhart#2633) Rebased onto main after ashhart#2760's row 28 (Scale index), which stays as on main. DSpine is row 29 with ashhart#2633's final GB10 ranges: agent 2-20 % faster, chat and code 10-19 % slower.
Opt-in only: nothing changes unless
--drafterpoints at a DSpine folder.What this changes
DSpine (
tencent/Qwen3.8-27B-DSpine-b16, revea909c0f5f) as a second kind of the CUDA Qwen3.8-27B drafter, next to DFlash2.core/dspine.zig(be389b24e, backend-neutral, also used by the Metal PR): DSpine's config contract and admission, the per-row sender lookup, and the exact-sender table walk.CUDA (
cb1f9fdc6):--drafter <DSpine folder>selects it from the folder'sdflash_config. New: bridge weights plus two tables built at load (~0.8 GB), 8 kernels inqwen35_dspine.cuh(bridge read, code, message and write; sender lookup and message; the per-sender table; a load-time transpose), and the per-step draft code. Taps, tap ring, absorb, head/top-16 and the chain/tree walkers are DFlash2's. The ring attention kernel gains a chunk count and a block-causal switch; DFlash2 passes the old values (same bits). This argument change is the one seam I'd like your view on.All draft linears affine-4, as DFlash2.
Issue: refs Draft acceptance on a GB10 before a port: tencent DSpine vs DFlash2 for Qwen3.8-27B #2592 (measurement and method), RFC: families compose core blocks: a conformance kit first, then sampler, config, drafter and format loaders #2460 (shared drafter pieces).
Base: main
e5889236b.Checks on this head
d6a84a87d, on maine5889236b, 5 commits, no CHANGELOG commit. Since44fce1c10(where the GB10 checks below ran) the only code change: the DSpine kernels calltf_common::block_sum_serialinstead of a localblock_sum(main'scuda_common_check); registers unchanged,dspine-tableoutputs unchanged on 3 seeds, T=0 trees identical to the old binary 6/6.d6a84a87d(zig, zig-windows, zig-macos-dev-tools, fmt, pytest, release-paths, benchmark-clients), merge state clean.d6a84a87d:cuda_common_check0 violations,cuda_fragment_check0 misses (22 unittests OK), x86zig build test601/601 steps, limits 13.0 and 13.2 0 stale for the DSpine kernels with every control red, live contract 0 problems,pr_check0 errors, lean 0 new.44fce1c10(GB10): full CI set 660/660 steps, lean 0 new,pr_check --pr 2633clean. Limits: 13.0 audit passes with every record current and every control red; 13.2 has no stale DSpine entries (the stale ones are main's pending records). Live kernel contract on the DSpine kernels: 0 problems.dspine-table: pass on 3 seeds, 12/12 controls red. Smoke serve of both drafters OK.core/lanes/draft_tree.zig(Candidates with a backend word layout, the scoring, chain and best-firstgrow), so Metal (qwen27 Metal: DSpine drafter for Qwen3.8-27B, opt-in #2634) uses the same walker; the CUDA file is a thin wrapper. x86zig build test592/592 steps, 8072 tests; GB10 draft host tests 105/105; no kernel changes.Receipt (GB10, trees, 4 prompts a class, 192 tokens, decode tok/s DSpine vs DFlash2)
Draft step 10.3–12.8 ms (DFlash2 10.2–11.5), verify 90–95 ms in both, so the difference is acceptance. Precision A/B (affine-4 / BF16 bridge and second pass / full BF16) moves tokens per round by about ±0.1; affine-4 stays. Full tables in #2592. Memory: +~0.8 GB tables, a 168 MB context buffer a stream (DFlash2 42 MB). The 8192 window is capped by the target rows the tap ring keeps.
Checklist
--drafternames its folder (never the default): the code bridge and exact-sender table on affine-4 projections, and the draft tree walker now shared by every backend incore/lanes; on GB10 agent prompts decode 11-17 % faster than with DFlash2, chat and code 5-7 % slower (qwen CUDA: DSpine drafter for Qwen3.8-27B, opt-in by --drafter #2633, refs Draft acceptance on a GB10 before a port: tencent DSpine vs DFlash2 for Qwen3.8-27B #2592). Thanks to @jschmied.