Repository navigation
Conversation
… 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.
… near-tie leads in the gate compare
… files in the notices
…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.
…lopment milestone's name
…he root pytest job does not install
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.
Owner
Author
|
Stopped at #3523: it moved after it was stacked. |
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: #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.