Repository navigation
fix(hip): time shared rows with a token a row, keep lone windows on one token - #2652
Conversation
|
@AbrahamCete thanks, this is a clean, contained piece of #2605, and the receipts are thorough. The change only touches the load-time table, on scratch caches, and the table only prices draft depth, so it can change which width is drafted but not which token comes out. Your equal token hashes and invariants back that up. A one-stream server times exactly as before, since every bucket there has one window. A few things:
As your receipt shows, on its own it changes the decisions but not the speed. The speed is the lane-core piece's to deliver in #2605. None of these blocks: it goes on our landing queue now, and the CHANGELOG line is ours. |
…ne token The depth rule's shared_costs came from rows of one repeated token, which the 35B's MoE routes to one expert set. Rows of different streams route to different experts and cost 3-22% more a forward at 2-64 rows on gfx1151 (ashhart#2605), so the table underpriced shared rounds and the rule folded the rest into an overhead it charged plain rounds too. A forward over two or more windows now times a distinct token a row. A lone window keeps its one repeated token, so the one-stream timings stay as they were.
|
Thanks @ashhart. All three are in, as two new commits on top of 2628baf, so nothing was force-pushed: 6cb4f45 and 89ea115.
Checks on 89ea115, in a clean archive:
The description is updated. The raw data for item 1 ( |
89ea115 to
9f15778
Compare
|
Thank you @AbrahamCete. 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. |
|
Thanks @ashhart. One thing about the landing: the force-push at 07:04 put back the branch as it was rebased at 06:32. So the two commits from your review that I pushed at 06:48 aren't on
|
|
Thanks @AbrahamCete! This is in TensorFold 1.2.6, out now: https://github.com/ashhart/TensorFold/releases/tag/v1.2.6
|
What this changes
The HIP timing piece of #2605, which can go ahead on its own as agreed there.
fillTokensandfillRoundinhip_costs.zig; the id stride is 7919, or 7927 where 7919 divides the vocabulary's span). A lone window keeps its one repeated token, so the one-stream table is unchanged; timing lone windows on distinct tokens made greedy chat at one stream 8.4% slower (this comment).core/lanesis unchanged. The plain price, bounded plain rounds and row split are the maintainers' lane-core branch in HIP: sampled chat at 4 streams on Qwen3.6-35B-A3B is 6% faster with --mtp-drafts 0, because the depth rule underprices sampled drafted rounds #2605; I'll run that on gfx1151 when it's posted.The cost table only steers draft depth, so tokens are unchanged.
main52427c0, three commits: 2628baf, then from review 6cb4f45 (a stride coprime to every span) and 89ea115 (fillRound).atc overlap --json(2026-11-08 22:16 UTC, onmainb558c18): incomplete (limitationspullFilesUnavailable,timeLimit). No open PR shares a file with this branch, andatc wholists none for either file. The branch merges clean withmainb558c18, which changes neitherhip_costs.zig,hip_serve/costs.zignorcore/lanes.Checks on this head
python3 tools/zig/lean_check.py: 398 problems on the base and on this head;lean_new.py: 0 new.zig build test test-golden --summary all: 612/612 steps, 7991 of 8057 passed, 66 skipped.zig build hip-host-test: 68/68.zig build test-qwen35-hip-host: 86 of 88 passed, 2 skipped.zig build check-native-hip-host: 6/6 steps.hip_costs_test.zig, each failing before its change and passing after it:tf-qwen35-test check <35B> --only invariants: 51 passed, 0 failed, 1 skipped.fmt,zig,zig-windows,zig-macos-dev-tools,pytest,release-paths,benchmark-clientson Ubuntu and Windows); the two nightly host jobs skip.Receipt
Main against branch, the cost table. Each run is one fresh server, Qwen3.6-35B-A3B MTP
--parallel 4 --context 4096 --prompt-cache-gib 0. Both arms carried a scratch-only patch that prints the table to stderr at load and changes nothing else. Milliseconds a forward:mainB1, B2mainmain0.97 to 1.01. The head step: 0.72 ms on both.loaded instartup line: 11.1 to 11.5 s on both arms.The decisions, from the server's
donelines andTF_LANE_TRACE, over all requests at four streams:main, 1.36 with this PR; tokens a stream-round 1.97 and 1.81; accepted/drafted 0.59 on both.Main against branch, throughput.
tools/bench_concurrent.py --tokens 256 --reps 3, code and chat, one window for each temperature and level. Servers ran in the order B1 C1 C2 B2, and on each server the windows ran sampled then greedy, one stream then four. Aggregate tok/s:mainB1, B2mainThe sampled four-stream cell alone, on c80a56fc7:
--tokens 256 --reps 5 --temperatures 1.0 --levels 4, 8 servers in the order B1 C1 C2 B2 C3 B3 B4 C4. Aggregate tok/s, one value a server:mainmainmain, 1.39 with this PR. Tokens a stream-round: 2.07 and 1.83. Accepted/drafted: 0.58 and 0.59. Token hashes are equal on every server, and the eight cost tables repeat the ratios above (shared 1.03 to 1.22, lone windows unchanged).Boxes it reaches: HIP, the qwen3_5 family's load-time cost table at two or more served streams. A dense checkpoint reads a row's token only for its embedding row, so its table is not expected to move; not measured (see "Not run").
New switch? None.
Environment, with the TensorFold commit, Zig and backend toolchain, machine and GPU, checkpoint and revision:
main52427c0 against this branch (above); Zig 0.17.0; hipcc with HIP 7.1.52801 and Ubuntu clang 21.1.8; Ryzen AI Max+ 395 (gfx1151), Linux 7.0;TensorFold/Qwen3.6-35B-A3B-MLX-4bit-MTPat f84b054c5677 (the five safetensors' sha256 equal the Hub's).Paths and platforms the change reaches, which I ran and which I could not: HIP shared rounds and the one-stream path on gfx1151, sampled and greedy. Not run: other AMD chips.
Exactness, from
token_shaagainstmain: equal in every cell, and in every request of every arm. Greedy: code9f2923ac14d0, chata8c28b8297b4. Sampled, one hash for each stream's seed: code5d7effdcf06f,306e0fe05bc2,bc55cc799f87,bd3964ef7930; chat460edda16244,0eba9c9d3070,15d18697d5f1,d813ade7fc53. Drafted against serial, solo against together and resumed against fresh: the invariants above (drafted == serialandsolo == together, greedy and seeded at temperature 1, 4 streams;resumed == fresh).Main against this branch, same machine and checkpoint: above.
Decode speed before and after, from
tools/bench_openai.py --tokens 256 --reps 5 --temperatures 1.0,0, servers in the order B1 C1 C2 B2, median decode tok/s:mainB1, B2mainPrompt speed: n/a. The change only touches the load-time table that prices draft depth; the prompt path is untouched.
Licence of any new weights or drafter: n/a.
Raw receipts, so the comparison can be repeated: https://gist.github.com/AbrahamCete/22d833227178a24391c73192b0ab586f. It holds the bench JSON files, each server's log with the printed cost table and its
donelines, the lane traces, the scripts, and the print patch.Checklist
"draft": false, a resumed prompt equals a fresh one, and concurrent equals solo.--drafter, no slower than without it, greedy and sampled. (Every cell is within its run spread. The largest move, sampled chat at four streams, is -0.9% over four servers an arm, with a standard deviation of 1.3 to 1.9 tok/s. No--drafterpath changes.)