the second lane's window (rad_lane1_window_begin / _end): concurrent buffers live across it, not the whole program

rad_buf_concurrent held a buffer for the whole program because the planner cannot tell when lane 1
runs. An architecture whose lane-1 work lies in one stretch of its declared ops now declares it, and
its concurrent buffers live across that window and their own uses, so the drafter's and the heads'
buffers share their bytes again. Ctx holds it: an op on lane 1 outside the window fails the step by
name, and the first lane-0 op past it joins lane 1 first when work is pending there. qwen35_fp8 and
gemma3 declare it from the embedding's all-reduce to the final norm. Qwen3.8 + DFlash2 at 64
sequences with speculation: activation arena 633.99 -> 526.32 MiB a card, upstream's exactly (with
the second lane's own scratch region, KV 86208 -> 93856 tokens against upstream's 95520).
arch_test's fake builder applies the window too, so the pinned steps check every plugin touches its
concurrent buffers only inside it.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
mici81andClaude Opus 5.5 authored and StillDeadcode committed 2026-10-24 11:10:08 +02:00
1 parent 0c813784a0
commit 0d2b502d51
13 files changed
+201 -6

No files matched your search

+11
View File
@@ -446,6 +446,17 @@ int rad_op_writes(RadBuilder* b, rad_op h, const rad_buf* bufs, int n);
* A no-op for a PERSIST or DERIVED buffer, which is live everywhere already. */
int rad_buf_concurrent(RadBuilder* b, rad_buf buf);
/* The second lane's window: every op the architecture issues on lane 1 is declared between
* rad_lane1_window_begin and rad_lane1_window_end, and lane 1 is joined into lane 0 before any op
* declared after the window runs. With a window a rad_buf_concurrent buffer is live over the window
* and its own declared uses instead of the whole program, so buffers used only outside the window
* (a drafter's, the heads') can share its bytes. The runtime holds the architecture to it: an op
* issued on lane 1 outside the window fails the step by name, and the first op past the window
* issued on lane 0 joins lane 1 first when lane 1 has work pending. Optional, one window a program;
* call both at declare, in order. Additive export; RAD_ABI_VERSION does not move. */
int rad_lane1_window_begin(RadBuilder* b);
int rad_lane1_window_end(RadBuilder* b);
/* An uneven shard: this rank's slice of a RAD_SHARD_ROW or RAD_SHARD_COL weight's split dimension
* is [lo, hi) rather than an even 1/tp. Rows of each stacked row part for ROW, columns for COL, in
* the container's unsharded units. The declared extent must already be `hi - lo` (per row part,