Skip to content

train 1116025533: #3474 #2837 #2888 #3383 #3494 #3496 (CI only) - #3499

Closed
ashhart wants to merge 31 commits into
mainfrom
lead/train-1116025533
Closed

ashhart wants to merge 31 commits into
mainfrom
lead/train-1116025533

Conversation

@ashhart

@ashhart ashhart commented Nov 16, 2026

Copy link
Copy Markdown
Owner

CI for a landing train: #3474 #2837 #2888 #3383 #3494 #3496 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.

robertosantosx2 and others added 30 commits November 16, 2026 02:43
Qwen 3.5 on CUDA reserves its forward scratch at startup in its own
device allocation, separate from the weights arena, sized to the
configured --context (capped at the largest forward pass) plus the
verify window. The optional INT8 prompt workspace is reserved before
serving too. A forward past either reservation is refused before any
kernel launches.
fits unwraps pages with a capture, and ledgerPool and release cast in
place of a local used once. The same calls on the same values.
Six growing agent conversations on a shared 8,192-token system prefix with one-offs between turns, two cohorts of
interleaved chats, and unique one-off prompts, replayed through Store.begin/keep/lookup/restore/remove at 4, 8 and
16 GiB. Shared cuts reach the store, so a common system prompt restores as a prefix. A frequency/probation selector
runs beside main's for comparison; production eviction is unchanged. zig build cache-agent-replay prints the records.

Refs #3241
…in eviction (opt-in)

A resumed snapshot gets eight store ticks of recency credit, at most two resumes' worth, so a conversation that keeps
coming back outlives one-off prompts without outliving its use; redundant copies, the active rewind, borrowed
entries and reservations keep main's protections. Off by default: unset, eviction is main's order exactly (host
controls replay main's choices on every trace). Measured through the real store on frozen traces: at 16 GiB agent
loops rebuild 28-34% fewer prompt rows and agent cohorts 24-30% fewer, at 4 GiB 4-18% fewer across agents and chats,
no cell worse on seeds 7, 11 and 23. The replay gains an agent-cohort trace and confirmation runs per seed.
Refs #3241
… windows (#2840)

Bolt sizes its shared slot for every window row and plans its one-expert shared layer once at load for rows 1 to windowRows, with its own act and out rows, so the routed path's plan, act and ymoe are never shared. In a decode window with a side stream the shared up and down kernels run on f.side between a fork and a join; the main stream waits for the join before addBf16, so the sum keeps its order. Windows without a side stream run the same kernels serially; prompt chunks are unchanged. shared-fork covers Bolt with a NaN-poisoned slot and the side stream held back.
… as on one GPU

The draft head's pieces and groups and the rollback replay ran eagerly whenever a
collective was attached. None of them calls the collective: the head's pass carries
no collective and loads its layer whole on rank 0, and the replay is local copies and
DeltaNet launches on each rank. Each graph replays exactly the launches the eager
pass makes, keyed as on one GPU. Main-model windows keep their one-GPU guard (their
passes hold NCCL calls).

Host tests drive runPiece, runGroup and the rollback through a recording driver
with a collective attached, and check every per-round host value moves each key.
test-flashnext-rank-graphs-host runs them. Part of #2835.
…the product

At one row the ranks' gathered blocks [2, 1, width] are already the row [1, 2 * width],
so the out projection reads the gather's buffer and its FP32 gather writes part's row
directly, and the split shared expert's down projection reads its gather as it lands.
The bytes each product reads and part holds are the ones the two-copy path made; more
rows keep the copies. The launch-recording tests expect no interleave copy at one row.
Part of #2835.
C6 of #2444 makes reuse depend on more than the key: a request's
image identities and frame, a namespace, its own chunk starts and
the rows it prefills. The family's Query now carries them through
kv_prompts (a core-side image identity, converted by the CUDA
adapter) and GLM passes its stream's images. The store enforces
none of them yet, so every store user is unchanged.
C6 of #2444 for the resume schedule: as in the copy store, a
planned store cuts and resumes at a request's own chunk starts
when it gives them and on its grid otherwise, so a grid point
inside the request's chunk is never its resume point; the marks,
keeps and both tree walks use one rule. A key of another length
than its prompt now reuses and keeps nothing, and a keep past the
rows a pass prefills is refused. Without starts every store user
cuts where it did.
C6 of #2444 for content: a page matches only when its words, the
words past it, the exact identities of the images over them, and
its namespace and frame are all equal, as the copy store compares
exact image identities beside its key. Two pictures under equal
key words are two branches, text before them stays shared, and a
split keeps an image on both sides. Eviction reads the same
identity, so another namespace's longer prompt never counts as a
conversation moving past a state. Text keys match as before.
A shared cut was recorded by its words alone, so a cut planned in
one namespace or over one picture could flag another identity's
state at the same words as shared, and keep it from its normal
eviction order. The record now hashes the namespace, frame and
image identities too (text in the default namespace hashes the
same words as before). A test through the CUDA adapter shows a
picture reaching the store: text pages shared, image pages not.
…o tokens

The Qwen3.5 CUDA Options take tp, rank and master as Flash Next's do, and
cuda_shard.zig plans the dense hybrid's even split for a rank of a world:
whole query, KV, key and value heads, the packed in_proj_qkv segments, the
MLP rows and the vocabulary in 128-tiles. A width or half off the tiles is
refused by name, never rounded.

No rank serves yet: --tp on the dense family, --tp on qwen3_5_moe (which
shares Options) and --learn-conversations at --tp are each refused by name.

Refs #3325
test-native-options-host builds cuda_options.zig with engine_api alone, so
the test that imported qwen35 there stopped test-host with "no module named
'qwen35' available within module 'root'". The same test now sits beside the
other Qwen3.5 refusal tests in cuda_refusal.zig and reaches set() through
cuda_options.zig; cuda_options.zig is back to main's text.

Refs #3325
Extend the dense BF16 forward with projected Q/K head norms and last-row pooling. Reuse the shared embedding admission and HTTP route, refuse reranking and unsupported options, and add contract controls plus a checkpoint-only FP32 reference and served qualification.
@ashhart

ashhart commented Nov 16, 2026

Copy link
Copy Markdown
Owner Author

CI red on this tip (zig-b); the PRs go on as two smaller trains.

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

4 participants