Skip to content

train 1120005354: #2826 #2845 (CI only) - #4117

Closed
ashhart wants to merge 7 commits into
mainfrom
lead/train-1120005354
Closed

ashhart wants to merge 7 commits into
mainfrom
lead/train-1120005354

Conversation

@ashhart

@ashhart ashhart commented Nov 20, 2026

Copy link
Copy Markdown
Owner

CI for a landing train: #2826 #2845 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.

GumbiiDigital and others added 7 commits November 20, 2026 00:53
…final norm over the read row's 128-row block

A chunk that keeps no row already writes only its last layer's keys and values (keysOnly). The prompt's last chunk keeps one row: every layer still writes the whole KV cache and recurrent state, and only rows no head reads skip the last layer's q, o, MLP and final norm.
prompt_tail.zig holds both rules on one Facts; first() uses core prompt_tail, as the CUDA tail does, and refuses taps, images, more than one stream, tensor pairs, the ANE share, MoE and row-dependent projections.

Co-authored-by: ArthurOstapenko <4603588+ArthurOstapenko@users.noreply.github.com>
Co-authored-by: ercumentyildirim <43972346+ercumentyildirim@users.noreply.github.com>
…r units

Keep main’s existing prompt-tail test import after the rebase, and report a successful skip before constructing the synthetic model when prompt passes cannot exceed one 128-row block. Current projection dispatch and barrier ordering remain intact.
…he kept row's tile (#2829)

A prompt chunk before the last reads none of its rows, and the last reads one. Past
the last layer's keys and values, nothing else reaches the other rows, so:

- forward.spanFor: on the last layer every row still runs the input norm, k, v, k's
  norm, RoPE and both page writes. An unread chunk stops there. A read chunk runs q,
  the prefill tile, the gate, o, the residual norm, the MLP and the final norm over
  its last 128 rows only (core's tail), q at its own positions over every key.
  `span` keeps every row, as before, for the checks, the scratch sizing and captures.
- forward/prompt_tail.zig: the HIP facts for core/prompt_tail.zig. A tap on the last
  layer, a trace that reads rows, an image prompt and a readout are readers and keep
  the whole chunk; rocBLAS (its bits vary with rows) refuses the tail only; a last
  layer that is not full attention refuses both. The layer-cancel poll reads no rows.
- engine: advance asks for keys only, prefill for the last row (its logits and the
  MTP head's input, which reads that row alone), spanRows for every row.
- Every rank decides from the same facts (taps, images and rocBLAS are one-rank
  only), so tensor-parallel reduces stay matched.

Host tests: each planted reader refuses; a launch-recording span of a two-layer model
shows an unread chunk's last layer launching only k, v, k's norm and RoPE and the page
writes, a read chunk's queries, attention, o, MLP and final norm over 128 rows from
len - 128, and a tail across two 2,048-row steps; advance, prefill and readout ask
for keys, the tail and every row; the cancel poll reads no rows.
…hunk

`tf-qwen35-test check --only invariants` gains one line a length (1, 63, 64, 65,
1,023, 1,024, 1,025, 2,049 and 4,096 rows). Each runs one chunk three ways: whole
(main's path), with its last row read (the tail) and unread (keys only), then the
next 16 rows over each chunk's caches. The tail's last final row and logits, and
both continuations' rows, must equal the whole chunk's byte for byte. The
invariants phase sizes its engine for the 4,096-row case.
…dling tails checked (#2845 review)

- prompt_tail.zig: `dense`, a `.dense` q, o or MLP product on the last layer (a
  widened BF16 chat checkpoint, or an unquantized tensor in an MLX one: both reach
  Qwen HIP), refuses the tail as rocBLAS does; the keys-only pass stays, as k and v
  run every row either way. Routed and shared experts are weighed too.
- The recorded span's last layer now runs real MLX tiles (gfx1151's affine kernels
  and registry, each kernel named by its symbol); a dense last layer keeps keys
  only and runs every row when read; at 2,175 rows the read row's step runs main's
  tile at main's 127 rows while the first step's one-row piece takes another tile.
- tail_run: the device check adds 2,100, 2,148 and 2,175 rows, whose tails put
  76, 28 and 1 rows in the first 2,048-row step.
@ashhart

ashhart commented Nov 20, 2026

Copy link
Copy Markdown
Owner Author

Landed: #2826 #2845 as main 4f3f564. This PR only carried their CI.

@ashhart ashhart closed this Nov 20, 2026
@ashhart
ashhart deleted the lead/train-1120005354 branch November 20, 2026 04:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants