Skip to content

train 1123210552: #2302 #3523 #4515 #4516 (CI only) - #4806

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

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

Conversation

@ashhart

@ashhart ashhart commented Nov 23, 2026

Copy link
Copy Markdown
Owner

CI for a landing train: #2302 #3523 #4515 #4516 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.

jrb-ai and others added 30 commits November 23, 2026 21:05
… kernel contract

The rc kernels follow glue.metal step for step at its bf16 rounding points: embed,
add-norms, output gate, FFN activation, and q/k head norms with RoPE into rings or
pages, one stream's rows or each row at its own position and stream.
window_attention.cu gains the group-10 prompt instances; global decode runs
through tree_attention. ricursive-contract checks them through gates 1-4 with
planted controls; nvcc 13.3 records for the eight launches.
…CUDA graphs

The NVFP4 release's weights and gate; Metal forward.zig's layer order on the rc
kernels. Prompt chunks of one slot, and rounds of rows each at its own position
and slot (several streams, verify windows), replayed from a graph of the round's
row count. ripple-forward checks rounds against one-row steps, bit for bit.
…and kept states

Several streams behind lanes.Backend, a slot of the arena each: shared rounds,
copied drafts verified as chains, draws and logprobs by the shared cuda.sample,
and the prompt cache's states. ripple-serve checks it on synthetic weights.
… gate tools

run and kl drive the CUDA forward directly on one stream; decode rounds replay
graphs unless --eager. compile-cuda-cli builds the CLI without a GPU. The gate
tools compare kl dumps with ricursive_reference.py's logits (KL, top-1, worst
rows, identical dumps, a greedy reply) and turn a chat into the kl command's ids.
…uh, so contract_controls.cu stays at 600 lines

contract_controls_set.cu includes it after contract_dense_controls.cuh; the image is still contract_controls.
…_commands.zig, so main.zig stays at 600 lines

ricursive-contract, ripple-forward and ripple-serve keep their names and usage lines.
The CUDA path took the routing width (top-10, 11 slots) and the shared expert's width (640) from
constants. config.json now selects one of two supported shapes, top-10 with a 640-wide shared
expert or top-5 with a 1280-wide one, and refuses any other value by the field's name. The
pass reads the slots from its scratch, which is sized by the shape; the shared expert's width
is its gate_proj's rows. The MTP layer routes at the main layers' top-k. A captured kernel set
serves the default shape only. The default shape's launches take the same integers as before.

Refs #3368
…ment names the width it reads

Head.init read config.json a second time through widthsIn, after Engine.init had already
selected the same shape into e.widths, so a change to one read could leave the other stale.
It now takes the engine's widths as an argument, and the MTP rule is unchanged: the head's
shared expert may be the main layers' width or the routed width (640), and any other row
count stops the load naming mtp.layers.0.mlp.shared_expert.gate_proj. The lanes load, the
drafted check and the device parity test pass e.widths.

The one-row split path gathers [2, 1, width] blocks into the row the down projection reads,
and that row's width is native.shared_width, not the halved per-rank width; the comment now
names it.

A host test pins the single reader: cuda_mtp.zig holds no widthsIn, its init takes the
engine's widths, and both callers pass them.

Re-pins cuda_mtp.zig, cuda_lanes_load.zig and cuda_mtp_check.zig in the serving fixture.
…ction's split-K

TF_Q35_GROUP_PROJ=1 (default off) runs a ModelOpt checkpoint's same-input
decode projections as one qmmf launch: MLP gate and up, GDN in_proj_qkv and
in_proj_z, in_proj_a and in_proj_b, attention q, k and v. Each block is one
tile and K slice of one projection in that projection's own 16-row instance
body, so its slices, order and cluster sum are those of its own launch.
Clusters are as wide as the widest split and never span two projections.
Pre-sm_90 GPUs, fused or prompt tiles and wider windows keep today's launches.
…wn launch

Rows 1-16, the served Qwen3.8-27B groups plus padding, odd widths and four
projections, adversarial weights, inputs and tensor scales; warm times at 1
and 16 rows.
Pin the reviewed grouped CUDA sources and shorten the new loader comment. Preplan compatible projection runs before launching so mixed FP8/BF16 GDN uses two groups and every fallback remains four separate launches.
TF_DFLASH_QL_SPAN=1 drafts a ModelOpt head over the two vocabulary spans,
as the .a4 and .x3 heads already do. It is off by default.

The views read the stored 64-row tiles and keep the whole head's K slices.
Unpinned, the 320-row tail would sum in eight slices instead of one.
BF16, MXFP8, FP8G and FP8 with an input scale stay on the whole head.

The target still verifies against the whole head.
TF_DFLASH_GRAPH=1 replays the drafter's launches from CUDA graphs, with
the same kernels and arguments in the same order. It is off by default.

A hold graph is keyed by stream count, spanned head and projection role.
An absorb graph is keyed by accepted rows and gather kind. Its gather,
rope and ring nodes take this round's position and ring addresses before
each launch. Prompt chunks and absorbs over 16 rows stay eager.

Startup timing stays eager, so window planning sees the same step cost.
Resizing the scratch drops every graph. A driver refusal falls back to
the eager launches.
@ashhart

ashhart commented Nov 23, 2026

Copy link
Copy Markdown
Owner Author

Stopped at #3523: it moved after it was stacked.

@ashhart ashhart closed this Nov 23, 2026
@ashhart
ashhart deleted the lead/train-1123210552 branch November 23, 2026 23:29
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.

3 participants