Repository navigation
feat(lanes): a prompt pass a chunk a round, between the other streams' rounds - #623
Merged
Merged
Conversation
…' rounds A backend may give `prefill_step`: one chunk of the prompt pass, false while chunks remain. The lane host then queues an admitted request as filling and runs one chunk per loop, so streams already decoding keep their rounds during a long prompt instead of waiting for it. A cancel between chunks releases the lane. Backends without `prefill_step` run the pass whole, as before. The stream's opening (first token, first drafts) moves from engine.zig to lanes/open.zig, shared by the whole and the chunked pass; engine.zig stays under 600 lines. Exactness: on the fake target, two streams filled a chunk a round with rounds between emit the same tokens, greedy and sampled, as both prefilled whole; the lane host serves the fake's exact tokens for two filling requests and cancels one between chunks with its lane freed.
This was referenced Oct 10, 2026
Owner
|
Thank you, @BlivionIaG. This is merged into main (1184cdb), your commit as it was, and it ships in 1.0.6. It's the hook we want for chunked prompts with lane batching: streams already decoding keep their rounds through a long prompt. We'll wire our own families to it. We checked that the whole-pass path is unchanged. |
Merged
8 tasks done
8 tasks done
BlivionIaG
added a commit
to BlivionIaG/TensorFold
that referenced
this pull request
Oct 10, 2026
… and model checks The HIP branch's engine (ashhart#490) on ashhart#463's runtime and the kernel launches of ashhart#617 and ashhart#621: the lane rounds with MTP drafts, the paged attention cache and the radix prompt cache (ashhart#625), chunked prompts (ashhart#623), CUDA-graph rounds, the memory plan, and tensor parallelism over RCCL (comm/: the library, the rank link, the group). The native server takes it with `zig build native-hip -Dhip-arch=...` and the serve flags it lists (ashhart#624); `tf-qwen35-test` runs the model checks on a GPU. `zig build test` compiles both against stub kernels. The engine reads the policy (`--policy`, TF_POLICY) once and hands the kernels `Launcher.Choices`; a GPU other than the one the kernels were built for is refused with both names. round_shape.zig stays in the family: its only reader is the plan.
Closed
8 tasks done
jschmied
pushed a commit
to jschmied/TensorFold
that referenced
this pull request
Oct 11, 2026
…loaded at runtime), masks in the lane core, enforced by Qwen3.5-2B on Metal Thanks @BobClawblaw. Conflicts with ashhart#623 kept both (lane_host.zig's fillOne/unfill beside the constraint; addStream's two changes ported into lanes/open.zig: drawFirst for the first token, no pipelined first step under a grammar; both engine tests kept).
jschmied
pushed a commit
to jschmied/TensorFold
that referenced
this pull request
Oct 11, 2026
lane_host.zig was 641 lines once ashhart#578's warm turns and memory requeue met ashhart#623's prompt chunks. The status read and the two counters behind it (tokens delivered in the last 2 s, each live stream's tokens) move unchanged, so it is 592 lines. lean_check reports main's 542 problems.
This was referenced Oct 12, 2026
ashhart
pushed a commit
that referenced
this pull request
Oct 16, 2026
… and model checks The HIP branch's engine (#490) on #463's runtime and the kernel launches of #617 and #621: the lane rounds with MTP drafts, the paged attention cache and the radix prompt cache (#625), chunked prompts (#623), CUDA-graph rounds, the memory plan, and tensor parallelism over RCCL (comm/: the library, the rank link, the group). The native server takes it with `zig build native-hip -Dhip-arch=...` and the serve flags it lists (#624); `tf-qwen35-test` runs the model checks on a GPU. `zig build test` compiles both against stub kernels. The engine reads the policy (`--policy`, TF_POLICY) once and hands the kernels `Launcher.Choices`; a GPU other than the one the kernels were built for is refused with both names. round_shape.zig stays in the family: its only reader is the plan.
ashhart
pushed a commit
that referenced
this pull request
Oct 16, 2026
… and model checks The HIP branch's engine (#490) on #463's runtime and the kernel launches of #617 and #621: the lane rounds with MTP drafts, the paged attention cache and the radix prompt cache (#625), chunked prompts (#623), CUDA-graph rounds, the memory plan, and tensor parallelism over RCCL (comm/: the library, the rank link, the group). The native server takes it with `zig build native-hip -Dhip-arch=...` and the serve flags it lists (#624); `tf-qwen35-test` runs the model checks on a GPU. `zig build test` compiles both against stub kernels. The engine reads the policy (`--policy`, TF_POLICY) once and hands the kernels `Launcher.Choices`; a GPU other than the one the kernels were built for is refused with both names. round_shape.zig stays in the family: its only reader is the plan.
BlivionIaG
pushed a commit
to BlivionIaG/TensorFold
that referenced
this pull request
Oct 20, 2026
…n the other streams' rounds Thanks @BlivionIaG.
BlivionIaG
pushed a commit
to BlivionIaG/TensorFold
that referenced
this pull request
Oct 20, 2026
…loaded at runtime), masks in the lane core, enforced by Qwen3.5-2B on Metal Thanks @BobClawblaw. Conflicts with ashhart#623 kept both (lane_host.zig's fillOne/unfill beside the constraint; addStream's two changes ported into lanes/open.zig: drawFirst for the first token, no pipelined first step under a grammar; both engine tests kept).
BlivionIaG
pushed a commit
to BlivionIaG/TensorFold
that referenced
this pull request
Oct 20, 2026
lane_host.zig was 641 lines once ashhart#578's warm turns and memory requeue met ashhart#623's prompt chunks. The status read and the two counters behind it (tokens delivered in the last 2 s, each live stream's tokens) move unchanged, so it is 592 lines. lean_check reports main's 542 problems.
BlivionIaG
added a commit
to BlivionIaG/TensorFold
that referenced
this pull request
Oct 20, 2026
… and model checks The HIP branch's engine (ashhart#490) on ashhart#463's runtime and the kernel launches of ashhart#617 and ashhart#621: the lane rounds with MTP drafts, the paged attention cache and the radix prompt cache (ashhart#625), chunked prompts (ashhart#623), CUDA-graph rounds, the memory plan, and tensor parallelism over RCCL (comm/: the library, the rank link, the group). The native server takes it with `zig build native-hip -Dhip-arch=...` and the serve flags it lists (ashhart#624); `tf-qwen35-test` runs the model checks on a GPU. `zig build test` compiles both against stub kernels. The engine reads the policy (`--policy`, TF_POLICY) once and hands the kernels `Launcher.Choices`; a GPU other than the one the kernels were built for is refused with both names. round_shape.zig stays in the family: its only reader is the plan.
BlivionIaG
added a commit
to BlivionIaG/TensorFold
that referenced
this pull request
Oct 20, 2026
… and model checks The HIP branch's engine (ashhart#490) on ashhart#463's runtime and the kernel launches of ashhart#617 and ashhart#621: the lane rounds with MTP drafts, the paged attention cache and the radix prompt cache (ashhart#625), chunked prompts (ashhart#623), CUDA-graph rounds, the memory plan, and tensor parallelism over RCCL (comm/: the library, the rank link, the group). The native server takes it with `zig build native-hip -Dhip-arch=...` and the serve flags it lists (ashhart#624); `tf-qwen35-test` runs the model checks on a GPU. `zig build test` compiles both against stub kernels. The engine reads the policy (`--policy`, TF_POLICY) once and hands the kernels `Launcher.Choices`; a GPU other than the one the kernels were built for is refused with both names. round_shape.zig stays in the family: its only reader is the plan.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this changes
The lane core's chunked prompt rounds. This is the
lane_host.zigshared-code slice tracked in #491. It doesn't depend on any HIP PR, and no backend uses it yet; the Qwen3.5 HIP engine will be the first.Backend.VTable.prefill_step(optional): one chunk of the prompt pass, returning false while chunks remain. With it,LaneHostputs an admitted request in afillingqueue and runs one chunk per loop, between the other streams' rounds. Streams already decoding keep their rounds through a long prompt instead of waiting for all of it. A cancel between chunks releases the lane.prefill_step, nothing changes: the pass runs whole, as today.engine.zigtolanes/open.zig. Both the whole pass and the chunked pass use it, andengine.zigstays under 600 lines.Engine.addStreamis the same code as before.Receipt
mainat bec00ae, head d7b134c. Zig 0.17.0, on macOS (Apple silicon) and Linux 7.1.7.expected 0, found 1); with the stream opened before its last chunk, both tests fail.prefill_stepyet; the whole-pass path is unchanged).zig build test test-golden -Dcpu=apple_m1: 137/137 steps, 761/762 tests (1 skipped); golden 309/319 equal, 0 unexpected.zig build test: 37/37 steps, 372/372 tests.zig fmt --checkis clean on the changed files. On the whole tree it reportstokenizer.zig,native/cuda.zigandtests/moe_bench.zig, the same asmainat bec00ae.lean_check.py: 542 problems, the same asmain.Checklist
"draft": false, a resumed prompt equals a fresh one, and concurrent equals solo. (A chunked pass is held to the whole pass's tokens, with other streams' rounds between its chunks.)prefill_steprun the same path.)