Repository navigation
Conversation
…file's K-quant, BF16 and F32 attention, ssm, indexer and NextN weights open Co-Authored-By: Claude Opus 5.5 <[email protected]>
…s, and glm's coverage row allows its absorbed-pair pin Co-Authored-By: Claude Opus 5.5 <[email protected]>
…heir own pins, so a type its gemv does not read is refused at plan; a BF16 position table loads widened Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ont of its weight type (Q8_0, K-quant, BF16), split weights through a stage and a strided copy Co-Authored-By: Claude Opus 5.5 <[email protected]>
…me; the common head counts its launches per row count; the GLM mixer variants under new tags Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
Verdict: MUST_FIX: scatter is copied byte for byte into two crates; one owner must serve both.
Must fix
1. scatter is defined twice (kind B, duplicate of an existing owner)
gemm.rs:946 and site.rs:1029 are the same function: same (rows, m) and (at, stride) arguments, same dtod_2d call with the same Pitched fields. The only difference is gpu.stream() against a stream argument. A fix to the pitch rule in one copy would leave the other wrong.
Cost: the fix removes a function and two imports, and adds one pub.
Fix: in crates/gpu/src/site.rs make the existing one public (pub fn scatter(, body unchanged). In crates/gpu-glm5next/src/gemm.rs delete fn scatter, change the call at line 857 and the import at line 71:
site::scatter(gpu.stream(), &*q, (n, m), y, (p.at, stride))?;use bloomery_gpu::{Gpu, GpuError};Non-blocking
⚠ site.rs:300: resident_gemv_cols_on went from pub(crate) to pub, and its only caller outside site.rs is program38.rs in the same crate. Keep it pub(crate).
Optimization headroom
- E Less work: gemm.rs:855-858. A part of an unjoined projection is written to the stage, then copied. Per part, per layer, per prompt batch: 1 launch and 2·m·rows·4 bytes (read and write) [derived]. A GEMM output stride would remove both. This needs a kernel change, so it is its own piece of work.
Checked
- Duplicates: 24 new items checked; hit:
scatter(finding 1). dryer: 0 pairs. - Complexity:
GemmFront::project17→31 andcheck11→17 are new type dispatch in one owner;PromptProgram::mla50→64 is more by-name branches, no split asked;ByName::gemv_on29 is a type match, one owner. No#[kernel]body touched. - Silent failure: 6 sites followed (
mandat + rowsguards,Dst::Querywith a stride, missing q8_1 form, Q5_0, unjoined parts, HC fn type). Each gives a named error.dtod_2dchecks its bounds. - Tests: head unit test (three-row Q5_K head against the one-row head, bit for bit). Mutant: swap
self.mandself.n_vocabintoken_major.enqueue; the test turns red.by_name_extratable: mutantRowMajortoColMajorturns it red. Gate g4: all-NaN start buffers mean an unwritten row fails. - Gates: pins moved with a dated
PIN(2026-10-26)and a reason (act_rule BF16, coverage TypePins and RowPins, model-tax rows, g4 error text). The new g4 bandNEARhas a derivation. - Performance: touches the prompt path (GEMM front).
projectbuilds three smallVecs per call, about 100 per prompt batch; the term is negligible beside the GEMM. No new sync point. Class: new type dispatch on an existing GEMM, no new kernel (ptx 478 = 478 per the PR body). - Escape catalog:
fixture-requant.shwas read for C1 to C4. Thecaseand the array expansion are fine. No match.
Notes
- The PR body gives a derived +28…40 % pp and says it is not measured.
CONTRIBUTING.mdasks for thenvidia-smiline, both commit hashes, the model file and thejust gate-*commands with output. The body has a batch summary only. Please add it so the gate result can be read on its card.
Card check: needs-gpu. This pull request changes crates/gpu-gates/src/act_rule.rs, crates/gpu-gates/src/bin/gate_glm5next_e2e.rs, crates/gpu-gates/src/bin/gate_glm5next_gemm.rs … and carries no gate run on a card (CONTRIBUTING's evidence list); a maintainer adds gpu-verified after one.
🔨 Shingler, bloomery's review bot: approves a clean pull request and requests changes on a must-fix (how it works)
| (Dst::Query, _) => gemm(gpu, &k, dense, (w, p), &x_in, m, q)?, | ||
| (Dst::Caller(y), stride) => { | ||
| gemm(gpu, &k, dense, (w, p), &x_in, m, q)?; | ||
| scatter(gpu, &*q, (n, m), y, (p.at, stride))?; |
There was a problem hiding this comment.
site::scatter in crates/gpu/src/site.rs is the same function; make it pub and call it here, then delete fn scatter below and the Pitched, dtod_2d import.
| scatter(gpu, &*q, (n, m), y, (p.at, stride))?; | |
| site::scatter(gpu.stream(), &*q, (n, m), y, (p.at, stride))?; |
Stacked on #841 (its 3 commits are the first ones here); merge #841 first.
GLM-5.3-Flash prompt front. A prompt batch projects each mixer site through the GEMM front of its weight type (Q8_0, K-quant, BF16); split weights go through a stage buffer and a strided copy. No new kernel (ptx 478 = 478). Derived: pp +28…40 % on a K-quant mixer file against the chunked gemv; not measured (no such file on the box). The mixer variants are remade under new tags (glmmixk, glmmix4) because the front raises the recorded budget; the sets are keyed by path, so no file a set names changed.
Qwen3.8. K-quant embedding rows, a Q5_K head (up to eight rows through the common head), and the dense sites by name through
site::ByName. The head's launches per row count have one owner,head::HeadLaunches; the gates count from it. Opens the dense side of Unsloth's UD-IQ1_S, IQ1_M, Q2_K_XL and IQ3_XXS files (proven on fixture variants q38glue and q38dense, not on the real files).Evidence (box): FAIL-first per new clause (q38glue verify node count was red at 117 vs 116 before
HeadLaunches); the train 3 fixture batch on main 511262a + #841 + this + #835 + #843 + #844 + #848: DONE total=272 red=0 tier=fixture wall=3961s.Implemented by Sonnet rounds, reviewed and finished by the lead (Claude Opus).
🤖 Generated with Claude Code