Skip to content

glm5next: the mixer sites project by name through site::ByName (K-quant, BF16 and F32 mixers open) - #841

Merged
midagedev merged 3 commits into
mainfrom
qglm1
Oct 26, 2026
Merged

midagedev merged 3 commits into
mainfrom
qglm1

Conversation

@midagedev

Copy link
Copy Markdown
Owner

GLM-5.3-Flash files with K-quant, BF16 or F32 weights in the mixers (attention, ssm, indexer, NextN) were refused at plan: each mixer site read Q8_0 only. Census: Unsloth's low-bit GLM files (about 1.2M downloads a month) are blocked this way.

  • The mixer sites now project through the common by-name dense projection site::ByName (crates/gpu/src/site.rs): q8_1 columns for K-quant/NVFP4 sites, the K-quant gemv, token-major results. Its type set is placement::accepts::dense_projected.
  • coverage.rs pins read the kernel tables, not hand lists. The absorbed key/value pair stays Q8_0 until a common head-split entry reads K-quants; tools/model-tax.tsv allows that one row with a dated reason.
  • Fixture variants glmattnk, glmattn4, glmbf16 with their ik dumps.

Evidence (box): ptx identical to base (478 entries); FAIL-first per new clause; the GLM variant e2e batch DONE total=3 red=0; the union fixture batch on main c343a62 + #838 + #836 + this: DONE total=271 red=0 tier=fixture wall=4597s.

A follow-up PR replaces glmattnk/glmattn4 with glmmixk/glmmix4 (the prompt GEMM front raises their recorded budget).

Implemented by Sonnet rounds, reviewed and finished by the lead (Claude Opus).

🤖 Generated with Claude Code

midagedev and others added 2 commits October 27, 2026 02:35
…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]>
@github-actions github-actions Bot added gpu The card engine: crates/gpu*, crates/app model The CPU engine and model files: crates/model, models, hf, gguf, tokenizer, jinja needs-gpu Changes code a card must check, and carries no gate run on a card placement Placement planning: crates/placement tools Tools, recipes, CI and the toolchain: tools/, justfile, .github/, Cargo labels Oct 26, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: MUST_FIX: the plan accepts K-quant indexer sites that the selector refuses at the first step, and two comments now state what is false.

Must fix

1. A K-quant indexer.attn_q_b or indexer.proj passes the plan and fails at the first token

coverage.rs:1582 accepts every dense_projected type (Q3_K to Q6_K, NVFP4) for all Role::Attention matrices except the absorbed pair. The selector does not use ByName: mla.rs:101 gemv_row_major takes q8_0, f32 or bf16 only, and select calls it for n.proj and n.sel.q_b (mla.rs:163).
Path: a GLM file with Q4_K indexer.attn_q_b → plan accepts, the body uploads → the first latent layer returns glm5next selector … q8_0 planes, f32 rows or bf16 words. No fixture variant retypes the indexer's q_b or proj to a K-quant, and the new coverage test has no indexer.* name, so nothing catches it.
The same predicate shape holds for indexer_compressor_ape.weight (2-D, Role::Attention): roles.rs:109 keeps a BF16 one as words, and f32v(w, &n.ape) at mla.rs:87 reads f32. I did not prove such a file exists; check it with the same fix.
Cost: the refusal is cheap at plan and expensive after a multi-GB upload.
Fix: give the selector its own pin, as the absorbed pair has one. Exclude it from the by-name row and add a TypePin with names: Some(is_selector_site) and reads as the other pins list q8_0 and bf16 (f32 as they treat it). Add indexer.attn_q_b.weight Q4_K (an item) and BF16 (none) to the_glm5next_mixer_pins_read_the_dense_entries_by_name. Bump the model-tax.tsv count for the extra pin row.

/// The latent mixer's indexer query and head weights: `mla::select` reads them on the
/// branch stream, row-major (`gemv_row_major`), not through `site::ByName`.
fn is_selector_site(name: &str) -> bool {
    name.ends_with(".indexer.attn_q_b.weight") || name.ends_with(".indexer.proj.weight")
}

and the by-name RowPin: names: Some(|n| !is_absorbed_pair(n) && !is_selector_site(n)).

2. A doc comment sits on the wrong test

act_rule.rs:1061 The four-line doc of site_rel_reads_the_forms_the_launches_name ("Ours is the form the launches read …") is now joined to the new BF16 doc and attaches to a_bf16_site_counts_ik_s_bfloat16_activation. The old test lost its doc, and the new one carries a false one.
Fix: move the BF16 doc and test above that four-line doc, so the old doc is directly above #[test] fn site_rel_reads_the_forms_the_launches_name.

3. Module docs still say the mixer sites are q8_0

kda.rs:12 "[Step] is the q8_0 projections" and mla.rs:19 "a q8_0 gemv of the q_a norm" no longer hold: Step projects by name in any dense type, and the indexer query reads q8_0, f32 or bf16.
Fix: kda.rs:12 → "is the projections at one token, each by the site type of its weight (project)"; mla.rs:19 → "a q8_0, f32 or bf16 gemv".

Non-blocking

⚠ Future PIN date: model-tax.tsv:141 says PIN(2026-10-27); every other PIN in this PR says 2026-10-26. Write the date of the change.

⚠ ByName::gemv is a new function of complexity 30: site.rs:851. The F32 arm repeats the same launch(...) call three times, and both arms decide "window, stage and scatter, or whole" separately. Decide the destination once and run the launch once per arm.

⚠ Test value: a_bf16_site_counts_ik_s_bfloat16_activation compares BF16_REL with itself. Mutant: BF16_REL = 1.0 / 128.0; no assertion turns red. Assert 1.0 / 256.0 literally, or leave the value to the derivation in its doc.

Checked

  • Duplicates: 16 new items checked. The hc_in Q8_0/f32 branch is copied between program.rs:378 and prefill.rs; I did not ask for a merge (the owner would add parameters). dryer: 0 pairs.
  • Complexity: ByName::gemv 30 (new, ⚠ above); PromptProgram::mla 50→63, Nextn::open 26→29 (added branches); others +1 to +2.
  • Silent failure: 9 sites followed. All end in a named error, except finding 1's late timing.
  • Tests: mutation checked on the coverage test (a dropped Q5_0 exclusion turns red) and on site_rel BF16 (value mutant survives, ⚠).
  • Gates: BF16 site_rel rows, the type pins and the model-tax.tsv count moved with dated PINs and reasons.
  • Escape catalog: none matched (no shell changed).

Notes

The PR body gives no nvidia-smi line, no commit hashes for the gate runs, and no command output; "ptx identical" and "FAIL-first per new clause" are claims without evidence here.

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-glm5next/src/body.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)

…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]>

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: CLEAN: the new commits close the selector plan gap and both false comments; what is left is non-blocking.

Since the last review:

  • Must fix 1 (K-quant indexer.attn_q_b / indexer.proj pass the plan, fail at the first token): fixed. coverage.rs:1163 adds a selector pin that reads Q8_0 and BF16 (F32 is not a matrix to the pins). The ape table has its own pin and bf16_words (roles.rs:110) widens it. This matches gemv_row_major (mla.rs:111) and f32v.
  • Must fix 2 (doc on the wrong test): fixed.
  • Must fix 3 (q8_0 module docs): fixed.
  • ⚠ future PIN date: still open (below). Earlier ⚠ items on code these commits do not change are not repeated.

Non-blocking

⚠ PIN date is tomorrow: model-tax.tsv:141 still says PIN(2026-10-27); the other PINs of this change say 2026-10-26. Write the date of the change.

⚠ The !is_selector_site(n) and ape exclusion in the by-name row pin has no test. Mutant: delete both exclusions. For Q8_0, BF16 and Q4_K the item list is the same, so the new test stays green. Only a type no pin reads (for example Q5_0 on indexer.proj.weight) shows it: the mutant lists the "mixer matrices" item as well. Add one Q5_0 assertion that expects the selector item alone.

Checked

  • Duplicates: 4 new items checked (is_selector_site, two pins, the ape suffix); the ape suffix is written three times, and two short copies cost less than a new owner. dryer: 0 pairs.
  • Complexity: PromptProgram::mla 50→63 and Nextn::open 26→29 are added branches, not touched by the new commits; the rest +1 to +2.
  • Silent failure: 3 sites followed (selector pins, ape widening, f32v); each ends in a named plan item or error.
  • Tests: mutation on the new coverage cases: a dropped Q4_K refusal turns red; the row-pin exclusion survives (⚠).
  • Gates: the model-tax.tsv count and reason moved with a dated PIN (date wrong, ⚠); no band moved.
  • Escape catalog: none matched (no shell changed).

Notes

The PR body gives no nvidia-smi line, no commit hashes for the gate runs and no command output; "ptx identical" and "FAIL-first" are claims without evidence here.

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-glm5next/src/body.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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gpu The card engine: crates/gpu*, crates/app model The CPU engine and model files: crates/model, models, hf, gguf, tokenizer, jinja needs-gpu Changes code a card must check, and carries no gate run on a card placement Placement planning: crates/placement tools Tools, recipes, CI and the toolchain: tools/, justfile, .github/, Cargo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant