Repository navigation
cuda: share prompt steps with running replies by default (decode-share 0.25) - #3486
Conversation
|
@bikepresentball, thank you. we applied the series to main and read the resolution order end to end: the flag wins, the environment's Three things must change before this can move. The two new comments over the line limit have to come down to On the default itself: your own tables show the short-prompt aggregate falling from 77.8 to 71.0 tok/s and the
|
) The series takes zig/src/core/lane_host.zig to 601 lines on main 25de9d7 (lean 222). The comment above the decode-share resolution becomes the trailing comment of its first line; no code changes.
|
Built per your word, at the branch head (c016af2): the CUDA engine's default arms only past 32,768 remaining rows, so the short cells the review held against a default stay at main's — 1×2k 34.6 vs 34.8 tok/s, 4×2k 53.9 vs 54.8 aggregate (within run noise, against the unconditional default's 77.8 → 71.0) — and the starvation past the threshold is cured as the flag cures it (starved streams 8.3-26.1 tok/s armed against 1.0-2.7 off). The exactness receipt is the comparison you named: four concurrent distinct ~143k-token prompts, same build, share armed against |
c016af2 to
e759c55
Compare
) The series takes zig/src/core/lane_host.zig to 601 lines on main 25de9d7 (lean 222). The comment above the decode-share resolution becomes the trailing comment of its first line; no code changes.
|
Independent corroboration landed on #3397: Razumasu's paired GB10 matrix (official 1.2.9 binary) shows the same mechanism and direction as the PR's tables — starved-stream decode recovering (3.72 to 9.43 tok/s staggered), every matched pair's completion text identical across the off/on arms, and the TTFT cost — matching this PR's same-build per-stream receipts from a second box. |
|
/atc exchange c7b7127ec0b69582f23a49133a390b3e7a4776bb0e8066d10d3c99fdb73504f9 |
|
Hi @bikepresentball, thank you. The comments are one line each, the exactness receipt now compares each stream under the armed default with the same request with the share off on one build and with distinct prompts, and the tables say both arms are built from source. The 32,768-row threshold keeps the short cells at main's pace, with the flag and
|
|
Thanks @bikepresentball. The source and receipt requests are resolved, and no new engine change is needed. The 600-line limit covers source files, not the changelog, so the long changelog entry is fine as it is. What remains is ours: a GB10 check of short 1-, 2- and 4-stream decode and time to first token, plus long-fill starvation, with each stream's token hashes matched against a base build. We will run it and post the result here.
|
|
I trial-merged The first boundary detail I would clarify is that the default arms at 32,768 or more rows remaining with a live decoder. In the existing cap fixture I added the neighboring values: 32,767 gives no cap, while 32,768 and 32,769 give the 512-row cap. The flag and environment precedence cases also ran. The description currently says “more than” 32,768. These were host checks, so the GB10 throughput, latency and token-hash comparisons remain open. Igor Lessio - AIFLOW LABS |
|
Right — the description's current wording already states it that way ("arms only while a filling prompt has
|
LaneHost.Info gains default_decode_share (?f64, null): the flag wins, the env's TENSORFOLD_PREFILL_SHARE wins over it (and never opts into the chunk cap), other backends pass null. LaneHost.init resolves: the flag unchanged; no flag plus an engine default with no env share arms the default's complement and offers the cap (the chunk-invariant gate unchanged); an env share keeps its time-only meaning; the env's row budget survives, as under the flag. The CUDA engine opts in at 0.25 (ashhart#3397 receipt, cold 128k beside fills: default 6.9-8.5 tok/s; 0.25: 58.6-69.1, 4x+, sha-identical outputs, TTFT unchanged). Host tests in lane_host_decode_share_test.zig style fail to compile on main (no such field).
The CUDA engine no longer arms a default decode-share: the flag and TENSORFOLD_PREFILL_SHARE stay the only opt-ins, so no measured cell pays the short-prompt cost unasked. LaneHost.Info.default_decode_share and the resolution order stay (flag > env > engine default > null), covered by the host tests. New comments trimmed to the 120-column lean rule.
) The series takes zig/src/core/lane_host.zig to 601 lines on main 25de9d7 (lean 222). The comment above the decode-share resolution becomes the trailing comment of its first line; no code changes.
LaneHost arms the CUDA engine's 0.25 default only while a filling prompt has default_arm_rows (32,768) left: past it the long prompt shares its steps beside live decoders and takes the 512-row chunk hint, exactly as --decode-share 0.25 does; below it the prompt fills whole at main's pace, so the short-prompt cells the review measured pay nothing. The flag keeps sharing every long prompt; the env keeps its time-only meaning and never arms the cap (env_share marks it, so an explicit 1 holds the default off). Host tests cover the threshold on both sides of capRows and longStep.
zig fmt + the 600-line rule forced the resolution out of lane_host.zig; the module carries fromDecode/withDecode/resolved/capped; no behavior change (same precedence: flag wins, env beats a default and never arms the cap, a default arms past Share.default_arm_rows); the glm/flashnext test call sites migrate to capRows' 2-arg form with each stream's live remaining rows.
e8babf4 to
b8ce2d6
Compare
|
Thank you @bikepresentball. 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. |
Change (4 files + changelog)
LaneHost.Info.default_decode_share(?f64, null) stays: the flag wins, the env'sTENSORFOLD_PREFILL_SHAREbeats an engine default and never arms the chunk cap, an engine default arms long fills only, other backends pass null. The CUDA engine passes 0.25.The conditional (this revision): an engine default arms only while a filling prompt has
Share.default_arm_rows(32,768) rows or more left. Past the threshold the long prompt shares its steps beside live decoders and takes the 512-row chunk hint, exactly as--decode-share 0.25does; below it the prompt fills whole at main's pace, so no measured short-prompt cell pays anything.Share.defaultedmarks an engine-armed host solongStep,srptStepandcapRowsgate on the prompt's remaining rows;Share.env_sharemarks the env's share so an explicitTENSORFOLD_PREFILL_SHARE=1holds the default off. The flag shares every long prompt, unchanged.Receipt (same GB10, base commit vs this branch, Qwen3.8-27B MLX-4bit + DFlash2
@50307d4c, temperature 0, both binaries built from source)The review's bar and its numbers, client-side aggregate tok/s of short prompts (the flag's decode-share 0.25 unconditional made these 77.8 → 71.0; the conditional keeps them at main's):
Starvation beside a filling long prompt, decode-phase tok/s of the streams sharing the GPU (4× cold ~126k+):
The conditional delivers the flag's cure for the fills that suffer the starvation and costs the short cells nothing.
Exactness
Four concurrent distinct ~143k-token prompts (distinct text removes #3397's identical-prompt race from the comparison), same branch build, temperature 0: each stream's full reply under the armed default against the same request with the share held off (
TENSORFOLD_PREFILL_SHARE=1). All four streams byte-identical: sha256 and token counts match on every stream (5632/6519/6070/4300 completion tokens each side — long replies, not 512-token stubs).Costs, stated plainly
An armed long fill's first token comes later (the documented
--decode-sharetrade, now scoped to fills past the threshold): in the 4× cold cohort the filling prompts' TTFTs ran +141→+867 s armed against +143→+679 s off. Short prompts' TTFTs are unchanged (they never arm).Tests
Host tests in
lane_host_decode_share_test.zig: the default arms the share and the cap past the threshold and never below it (both sides of 32,768 incapRows, and a livelongStepbeside a decoder that shares and owes the round above the threshold and stays whole and debt-free below it); the flag and the env beat the default; an env share of 1 holds it off. Lean check: 0 new findings against the base commit;lane_host.zigandlane_host_fill.zigstay at 600 lines or under (the 600-line commit @ashhart landed on this branch is preserved). The full host suite passes except the pre-existing failing step that fails identically on the base commit.