Skip to content

train 1117143356: #3393 #3661 #3682 #3215 #1682 #1721 #2009 #2143 #2769 #3690 #3691 (CI only) - #3700

Closed
ashhart wants to merge 32 commits into
mainfrom
lead/train-1117143356
Closed

ashhart wants to merge 32 commits into
mainfrom
lead/train-1117143356

Conversation

@ashhart

@ashhart ashhart commented Nov 17, 2026

Copy link
Copy Markdown
Owner

CI for a landing train: #3393 #3661 #3682 #3215 #1682 #1721 #2009 #2143 #2769 #3690 #3691 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.

sx4im and others added 30 commits November 17, 2026 14:34
A ticket keeps its threadId after its thread is archived or deleted, so
[Open] on a ticket-review approval row navigated to a thread id with no
loaded thread and ThreadView rendered nothing. Only offer [Open] when the
thread is loaded, and show an explanation instead of a blank view when a
thread id has no loaded thread anyway.

Fixes #3387
The new model.test.ts passes {} for a ticket with no thread, but the
parameter type Pick<Ticket, 'threadId'> requires the property. The
implementation already treats a missing threadId as no Open target, so
widen the parameter to match: threadId is optional.
…ntion in pairs (Q27_JOIN)

Before the M5 the 27B's decode attention runs q27_attn_tail, a threadgroup a (KV head, chunk, row), and with six
query heads a KV head only lines 0-5 of its 16-line tile carry the row: lines 8-15, with their own softmax state,
are padding. A drafted window's rows all read the stream's keys below the window, and streams resumed from one
stored prompt on shared KV pages read the same keys too, yet each row loaded and multiplied every chunk alone.

Plan.pair pairs rows over the chunks wholly below the keys they hold alike, at one chunk width: a stream's rows
below its window, and streams of one share group below the group's keys. The lead's threadgroup carries the
rider's six heads in lines 8-13 (q27_attn_pack_b), runs the joint chunks once for both (q27_attn_tail, the rider's
own threadgroup returning there), and the merges read the rider's joint partials from the lead's slot. Each line's
arithmetic is the one it runs alone: line 8 + i mirrors line i's key columns, shuffles and sum order.

The join is a Q27_JOIN build of the same sources (simd_attention.joined); main's pipelines compile from unchanged
text and run every plan without a pair. The runner builds the join before the M5 with a group of 8 heads or fewer
(attention_join.build) and pairs each round's rows; TF_QWEN27_JOIN=0 keeps main's pipelines. Share groups across
streams wait for shared prompt pages on Metal; until then only a window's own rows pair.

Tests: tf-qwen27-attention-share checks pairs against every stream alone through main's kernels and against main's
unpaired plan, bit for bit, with a planted page a false share must show, and times them; tf-qwen27-attention-pages
still matches contiguous caches bit for bit; a host test covers Plan.pair's rules.

Measured on an M3 Ultra (80-core), attention pass at 34,817 keys, main -> pairs: 4 streams x 8-row drafted windows
11.2 -> 6.0 ms (-46%); with streams on one prefix's pages, 8 x 1 row 3.31 -> 2.16 ms and 4 x 1 1.94 -> 1.43.
Served, the 27B on its default contiguous caches, main -> the join, per-stream tokens a second while all decode,
264 replies identical to main's (drafts off and one stream too): drafted at a 32K prompt +29% at 8 streams and
+24% at one, at 8K +3.5% and +2.6%; plain decode (one row a stream, no pairs, main's pipelines) level, and an 8K x 8
repeat of nine runs each puts the join at +0.06% and TF_QWEN27_JOIN=0 at +0.33% against main.
# Conflicts:
#	CHANGELOG.md
…8x128 scales)

GLM-5.3-Flash on Metal reads routed experts stored in the official FP8 checkpoint's format, E4M3 codes with f32 128 x 128 block scales, without conversion. The loader takes a shard's tensors only where the index maps them, so a combined checkpoint can point at whole FP8 shards. The FP8 row sums keep tf_rp_rows_at's lanes and order, and tf-glm-rows-check covers every FP8 launch against each other and against float64.

(cherry picked from commit b3a7b87)
…ith the tiles' bits (#2089)

tf_sq_prep writes each row's 64-input group sums by the tiles' own tree, and with them X as half, rows paired.
The half tiles (tf_sq_mmh) read both after each norm instead of redoing them in every column threadgroup; prompt
rows' chunk pairs (tf_sq_mmx) read the sums. Each path is checked once per shape against the fp32 tiles.
Address tanchunsiong's issue jayleaton/deepseek-v41-tensorfold-spark#55 with ratulsarna's long-context concurrency corroboration. Reprice damaged cache hits, reserve complete prompt and reply ownership before work, and roll back recoverable growth uniformly across ranks before device-table mutation. Host tests cover asymmetric pressure, quota rollback and subsequent admission; reported GPU concurrency remains unqualified.

(cherry picked from commit 874b0e9)
874b0e9 made every rank vote before each window and prefill segment so an asymmetric PoolExhausted rolls back on all ranks. Slot.ensure returns before any check when the end's pages are already mapped, and every rank holds the same lockstep slot lengths, so a window within its mapped pages cannot refuse anywhere; such windows now skip the vote and its two stream drains. Growth past a page boundary still votes and rolls back uniformly. The host test counts votes across mapped and growing ends.

(cherry picked from commit 90d7dcd)
…ing it

The direct target refused a request whose full prompt and reply did not fit the free pool with PoolExhausted, which
the lane host turned into a failed reply (HTTP 500). It now refuses with LaneMemory, before any operation, eviction or
slot change, so the lane host puts the request back at the queue's head until a running request ends, as the round
planner already waits. With nothing else running it still fails, in words: lower --context or --parallel.
vision.metal holds the ViT's epilogues, RoPE, attention, SwiGLU, the aligner's unshuffle and the stream merge,
each registered with the contract against float64.
The "request text: N tokens" figure encoded the raw input on its own. It now
comes from the build itself: the request segment's rows, with the speaker-0
tag the builder adds and, on the default voice, the tokenizer's special
tokens. The family builder records them as Built.text_rows, the default
prompt as encodeCounted's text_tokens, and the check no longer re-encodes.
A test with untagged and space-led inputs checks that the figure equals the
request's share of the assembled rows on both paths; the HTTP fixtures now
expect 4110 (4096 bytes behind the 14-byte tag), which the previous head
reported as 4096.

docs/speech-sampling.md describes the exact --max-frames rule and its
message, and docs/drama-http-voices.md states the limits as they are. The
--speed-up refusal joins the Metal shape check with a test, the generic
check drops its unreachable --speed-up clause and its message no longer
lists context, lanes and TP. The CHANGELOG line comes with the landing.

Co-authored-by: akol1 <15747200+akol1@users.noreply.github.com>
The tower's tensors load as plain BF16 [n, k] matrices for cuBLASLt:
fc1 and fc3 stacked into one gate|up projection, and the patch weight
flattened to 588 columns and zero-padded to 592 so its rows meet the
library's alignment. Every vision_tower tensor is consumed, the device
bytes count the padding, and a failed load drains its uploads before
any buffer is freed.
The drain test called settle directly, so dropping the errdefer in
load, or registering it before the tower's own errdefer, would stay
green. A host test now runs load on a sparse checkpoint against a
fake device whose first upload's wait fails: the buffers must go only
after the context proved the copies done. The sparse checkpoint
helper moves to its own test file so the tower's tests can share it.
Keep original workspace pointers and call construction on default paths. One-part SSD paths borrow the primary pointer; two-part paths assert distinct workspaces and retain their owned sibling. Charge only allocated planes. Refs #3667.
Keep original workspace pointers and call construction on default paths. One-part SSD paths borrow the primary pointer; two-part paths assert distinct workspaces and retain their owned sibling. Charge only allocated planes. Refs #3667.
@ashhart

ashhart commented Nov 17, 2026

Copy link
Copy Markdown
Owner Author

Stopped at #3691.

@ashhart ashhart closed this Nov 17, 2026
@ashhart
ashhart deleted the lead/train-1117143356 branch November 17, 2026 16:22
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.

8 participants