Repository navigation
XPU Qwen3.8-27B: decode attention takes a key's twelve exponentials as one vector exp, bit-equal - #4651
Conversation
|
The proofs folder now names the versions both runs used ( |
|
On drafted decode at about 121K being below plain: #3052 is that change for the lone stream. It prices each tree width from the stream's own measured rounds, a context band each, so long contexts draw narrower trees (2.32 nodes a round at 121,022 tokens). Its receipt and this PR's use the same 121,022-token prompt ( |
|
Thanks @Mirrdhyn for the vector-exp work and the detailed parity evidence. One small portability fix is still needed. In Please compute Please make the same hoist in the planted copy in
|
|
Done in Rerun on card 0 (receipt section "Rerun after the review fix",
|
|
Thanks @Mirrdhyn. Both max broadcasts now run before the lane-zero branch, and the planted score-lane fault remains intact. The attached rerun reports all 21 kernels passing and all 12 controls caught; the saved serving rows retain matching hashes and drafter counters. The current head merges cleanly with main. No further source correction or duplicate device run is requested. The parity evidence remains tied to the named compiler and driver versions; exact-tree CI remains before landing.
|
…or exp, bit-equal
…sions they ran on
ec7f6fa to
2124808
Compare
|
Thank you @Mirrdhyn. 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. |
Refs #2543.
attn_decode(Qwen3.8-27B on XPU,zig/kernels/xpu/qwen27/decode.cl) computed twelve scalar exponentials a key:exp(m - mn)andexp(sc - mn)for each of the six query heads of a K/V head. They are now the 16 lanes of one vectorexp(head a's two arguments in lanes a and a + 8), and each head reads its two results back withsub_group_broadcast. The arguments,fmax, the update order and every operand are unchanged, and there is no new branch.Same bytes. The change needs two facts, both measured on the card (
docs/receipts/xpu-qwen27-attn-exp/proofs/):expequals scalarexpon all 4,294,967,296 float bit patterns, NaNs and infinities included: 0 mismatches;fmaxequals scalarfmaxon 536,870,912 pairs (all pairs of 25 special values, nearby and random patterns): 0 mismatches.The kernel contract (card 1) passes: 21 kernels, 12 controls red as planted, 0 limit problems;
attn_decode+attn_mergestay bit-equal to the upstream1a5644892pair at 20 shapes. The new planted control,tf_ctl_attn_exp_lanes(the same kernel with the scores in lanes 0 to 7 only), goes red at gate 3.attn_decodehas 0 spill bytes at 256 GRF.Served, one Arc Pro B70 (card 0, PCIe 5.0 x16). Main
14951bc65against this branch, four fresh servers in the order main, branch, main, branch; Qwen3.8-27B GPTQ g128 with DFlash2,--parallel 1 --context 132096 --prompt-cache-gib 0, greedy, 256 tokens, one warm-up and three measured requests, code prompts. Decode tok/s, median of a pass, mean of the two passes of a side:token_sha256(first 16 hex)9764d2d6fb7cbdbf9764d2d6fb7cbdbf1d59abb499c488411d59abb499c488410ac24914777805610ac2491477780561In every cell the 16 requests (four passes, warm-up included) carry one
token_sha256, drafted and plain share it, and the drafter's drafted, accepted and round counts are identical on both sides. The two paired ratios of a drafted cell differ by 0.001 or less.attn_decodeGPU time in a drafted round (XPU_PROFILE=1, card 0): 4 rows 8.06 to 7.60 ms and 16 rows 33.51 to 30.99 ms at 20,000 tokens (-5.7 % and -7.5 %); 23.12 to 21.72 ms and 95.69 to 90.43 ms at 58,543 tokens (-6.1 % and -5.5 %). Plain decode runs one row a token, so its gain is within 0.2 %.Limits. Code prompts only; one host and one card for the served numbers; token equality at other shapes (text prompts,
XPU_KV_INT8=1, the multi-stream path) was checked on the dev runner and is not in the receipt.The receipt directory has the scripts, every request (
runs/), the contract and limits output, the kernel logs and how to rerun the proofs.CHANGELOG: one Unreleased bullet,
(#4651, refs #2543).