Repository navigation
Conversation
…tion blocks a seat TF_DSV41_POOL_TOKENS is checked against --parallel and --context and cuts the per-request window to the pool. A run is placed first fit; when the free blocks are split the live runs slide down in start order, so a request waits only while too few blocks are free in all. Blocks a request wrote are zeroed before the next run reads them. Host tests cover fit, wait, refuse, reuse, sliding, dirty blocks and the setting; test-dsv41-metal-host runs the package's host checks without a device run.
…the shared pool's runs With a pool set, each KV source has one latent buffer and one index-key buffer for every slot, and a slot binds them at its run's first row: the kernels see the same contiguous per-stream rows at a buffer offset, so no kernel changes. A prompt takes a run of its ids, its max new tokens and one window of drafts (admit), or LaneMemory while too few positions are free; the run goes back on release or a failed prompt. The window ring, carry, taps and prompt tail stay per slot. Unset, every slot allocates and binds as before.
…, a working-set check, the startup line The load reads the setting, refuses it by name when it is out of range, cuts --context to the pool when the pool is smaller, and refuses a pool whose buffers and slot rings pass the GPU's working set before any of them is allocated. The startup line names the pool's positions, bytes a position and MiB; unset it is the old line, which a host test checks. test-dsv41-metal-pool (a device step of its own) drives five requests over eight blocks so live runs slide down and a full pool waits, then four requests through LaneHost that cannot all fit, each reply against unpooled serial decode.
… not the first sixteen A slot past the sixteenth reserved the whole window because its admit had nowhere to go. The target now keeps one entry a slot; test-dsv41-metal-pool checks slot 19 of 20 takes a run sized by its max new tokens.
…ored after runs slid down Host tests apply each plan's moves and zeroes to a byte buffer with the device side's own copy and zero: a run overlapping its own destination slides down intact, a moved seat's writes are counted from its new place, a refused take changes no run or dirty block, and 4,000 random takes and gives keep every live seat's bytes while each new run reads zeros. test-dsv41-metal-pool gains the prompt cache: runs slide under live requests and a kept state restored into a new run, all replies equal serial.
…es, including its default and thinking reserve
…t double-free, reject lossy F32 AWQ scales
… on simdgroup matrices without tensor units - Experts, the attention projections and the loop gates of a chunk take simdgroup-matrix kernels where the GPU has no tensor units; each output is bit-equal to the kernel it replaces. - The contract registers the new kernels with a planted control each.
- A prompt pass reads every expert's and projection's weights once, so 256 rows a pass read them a quarter as often as 64 and fill the expert tiles. - Every row's sums are the same at every chunk width (the routed experts, projections and gates are bit-equal to the one-row kernels); the sliding ring grows to 1,280 keys. - The loop-gates contract probe also runs 200 rows. - Same change as the chunk width of #4608 (a9fae61), which has no effect on a chip without tensor units until a grouped simdgroup-matrix path like #4756's is under it. - Cold 2,048 tokens on an M4 Pro, A-B-B-A: 22.76 and 22.69 s before, 15.53 and 15.52 s after; greedy chat hashes, cold 2,048 (de3c13467508) and 8,192 (dc7ec8d3a016) tokens equal to main's.
- tf_inkling2_ar takes a row count and the strides between rows' blocks, partial sums and outputs, and a threadgroup runs one row's unchanged arithmetic; a visit launched it once a row and role (about 580 launches at 256 rows, 23 us each) and now launches it once a role. - The contract probe runs a batch of two rows with their own blocks, partial sums and two queries each against the float64 oracle and the planted control. - Cold 2,048 tokens on an M4 Pro, A-B-B-A: 15.40 and 15.80 s before, 10.84 and 11.45 s after; greedy chat hashes, cold 2,048 and 8,192 tokens equal to main's.
- tf_ink2_combine found each route by scanning every expert index for each output column (1,024 compares a sum); it now sorts the token's eight route slots by expert id once, equal ids in slot order, and adds them in that order, the same sum as before. - The route-slot-order control now removes the sort. - Cold 2,048 tokens on an M4 Pro, A-B-B-A: 11.78 and 11.84 s before, 9.90 and 9.46 s after; greedy chat hashes, cold 2,048 and 8,192 tokens equal to main's.
…ds no row past the input - A row tile that is not whole read its rows through the next multiple of eight; those rows now read the last row, which only feeds outputs that are never stored, and whole tiles load as before. - A host test runs 1, 7, 9, 45 and 255 rows with the input followed by NaN: with every tile row stored, the tail rows repeat the last row's bytes, and the old loads (the planted control) put NaN there. - The kernel contract's dense shapes stay bit-equal to the matvec kernels and its controls stay red.
…tail - A focused test ends the projection's input at an unmapped page with no slack, binds it zero-copy, and runs under Metal's shader validation, which is the only layer that reports a read past a buffer's end. - The old loads abort there at rows=1 (invalid load at offset 16272 of 16384); the clamped tail reads nothing past the row bound at 1, 7, 8, 9, 16, 17, 45, 46 and 47 rows, and every output byte equals the chunked matvec reference's. - The dense-MMA contract fixture's matvec reference takes `dense`'s exact chunk ladder (32, 16, 8, 4, 2, 1) instead of a 13-row tail in a 16-row tile.
…atch The merged admission test measured 64-row scratch; 256-row chunks leave 6.19 and 15.19 GiB beside the weights on 36 and 48 GiB Macs, 10 and 25 streams at an 8,192 window.
#4756 raises Inkling 2 Mini's prompt chunks to 256 rows. Main's gatesSplit (the three-launch gates, bit for bit the per-row ones) still asserted at most 64 rows, so on a Mac with tensor units, where the simdgroup-matrix gates don't apply, a 256-row chunk would trip it. Its scratch (gate_norm, gate_zeta) is sized by state.max_rows (256) and its kernels guard every row by `rows`, so the bound is 256, as gatesRows' is.
`tf-h3-image-prompt` and `tf-h3-image-decoder` now read the tensor bytes they use into the page cache through the same 16 x 8 MiB reader the transformer's shards use, instead of faulting them in one page at a time. `read_ahead.read` takes byte ranges, so the prompt path reads only its accepted tensors and the decoder only the tensors it converts; the transformer still passes whole shards. (cherry picked from commit 8addc4f) (cherry picked from commit 6eeff19)
The lean checker counts a comment past 120 columns and a comment over two lines alike, so the two doc comments the read-ahead change lengthened are shortened in place. Comments only. (cherry picked from commit e66ef31)
…erts to bf16 (cherry picked from commit a58ebbc)
FrontNames accepted every token_refiner.* tensor, so open also read ahead blocks above g.blocks and their shards. Restrict it to condition_proj's weight and bias, the final norm and the first g.blocks blocks, and cover it with a fixture that parks an extra block's tensors in an opened shard and a second shard.
FrontNames accepted any tensor under a refiner block below g.blocks, so a block tensor loadRefiner never takes was still read ahead. It now accepts a block tensor only by blockTensors' names; the fixture gains one such tensor, which the read-ahead count leaves out.
This was referenced Nov 25, 2026
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.
CI for a landing train: #3278 #4415 #4756 #4909 stacked on main in that order. Nothing merges from this PR: each PR above lands on its own once this tip is green, and this PR is then closed.