Skip to content

train 1125142722: #4718 #4998 (CI only) - #5065

Closed
ashhart wants to merge 5 commits into
mainfrom
lead/train-1125142722
Closed

ashhart wants to merge 5 commits into
mainfrom
lead/train-1125142722

Conversation

@ashhart

@ashhart ashhart commented Nov 25, 2026

Copy link
Copy Markdown
Owner

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

jschmied and others added 5 commits November 25, 2026 14:27
…ged in whole 128-byte reads

tf_ink2_loop_project_qkv tiles 16 rows by 16 outputs, so a one-row decode left 15 of 16 threads idle and
re-read its weights in 32-column slices. For up to 16 rows, tf_ink2_loop_qkv_rows1/4/16 run a warp per 32
output columns: the warp stages its 32 weight rows 64 columns at a time with whole-row 128-byte reads and the
rows' inputs, and each thread runs its output's rows over the same ascending FP32 chain, so the BF16 results
are tf_ink2_loop_project_qkv's. Prompt chunks keep tf_ink2_loop_project_qkv.
…places, its usage on every SM

projectQkvTiles keeps tf_ink2_loop_project_qkv's 16x16-tile launch callable at any row count (prompts take
it as before); the contract's ProjectQkv now names it in replaces, so gate 3 compares the decode kernels'
q, k and v bytes with the tiles' on the same inputs at every served shape. The control told one
row fewer stays red against the tiles.

tf_ink2_loop_qkv_rows1/4/16 compiled with nvcc 13.0 -cubin -O3 per SM: 128/128/90 registers on sm_80,
128/128/88 on sm_86 and sm_89, 86/90/103 on sm_120 as on sm_121; static shared bytes and the 32-thread bound
as on sm_121, no stack or spills.
Refs #4961

Use ceiling-power-of-two sp_matvec_{1,2,4,8,16,32} dispatch in inkling2/metal/forward.zig
so non-power-of-two widths up to 32 rows read weights once instead of 2x-4x, and 64-row
prefills dispatch 32+32.

Guard X row loads in core/bf16_matvec.metal (early return for a.rows == 0 and branchless
min(r, active - 1u) clamping on partial tiles), and tile ROWS > 16 into <=16-row sub-chunks
inside the single 32-row kernel to avoid acc[32] register spilling while preserving exact
FP32 serial summation order.

Add host dispatch and Metal tight-buffer exactness tests for inkling2 dense(), and exercise
partial-tile row counts (5, 9, 17) in llama matvec contract probes.
@ashhart ashhart closed this Nov 25, 2026
@ashhart ashhart reopened this Nov 25, 2026
@ashhart

ashhart commented Nov 25, 2026

Copy link
Copy Markdown
Owner Author

Landed: #4718 #4998 as main 8d3f8f9. This PR only carried their CI.

@ashhart ashhart closed this Nov 25, 2026
@ashhart
ashhart deleted the lead/train-1125142722 branch November 25, 2026 16:24
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