Skip to content

card_experts: the ring pass runs the stacks' own route GEMM forms - #876

Merged
midagedev merged 1 commit into
mainfrom
ringfix
Oct 27, 2026
Merged

midagedev merged 1 commit into
mainfrom
ringfix

Conversation

@midagedev

Copy link
Copy Markdown
Owner

MiniMax-M3.1-Flash UD-Q2_K_XL under --place a failed on the second request: the expert stream's ring opened, and the ring pass refused the layer because its i-quant stacks read the grouped GEMM while the ring buffers were made in the 32-value form only.

The ring buffers are now made in the forms the resident stacks read, with the grouped GEMM's kernels where needed (the path Muse Spark's ring already runs). The plan's stream reserve prices the pass in the file's forms (grouped rows are about 2.5 times the 32-value bytes).

Evidence (A6000, --place a --ctx-size 16384, a short request then a 4K-token one, the binary built from this branch):

  • split (default): green, prefill 126.5 tok/s, decode 25.6 tok/s (before: the engine failed at layer 8).
  • BLOOMERY_XSTREAM=off: prefill 97.2 tok/s, decode 25.2 tok/s.
  • a_ring_pass_is_planned_in_its_stacks_largest_forms and a_streaming_plan_keeps_the_streams_room pass.

The NVFP4 folder keeps the 32-value forms, so its bytes and path do not change. Layers whose forms differ are refused by name when the ring is armed.

🤖 Generated with Claude Code

MiniMax-M3.1-Flash UD-Q2_K_XL under `--place a` streamed host experts
into the ring once a call opened after its first unit, and the ring pass
refused the layer: its IQ2_XS/IQ3_XXS/IQ4_XS stacks read the grouped
GEMM, and the ring buffers were armed in the 32-value form only. A short
request followed by a long one failed every time at layer 8.

CardExperts records the one pair of forms its resident layers' stacks
read (RingForms::of) and arms RingGemm in those forms, with the grouped
GEMM's kernels where a form needs them, as Muse Spark's ring already
does. Layers whose forms differ are refused by name at the arming.

The plan's stream reserve prices the pass in the forms the file's routed
stacks read (place_hybrid::ring_forms_planned): the grouped GEMM's q8_1
rows take about 2.5 times the 32-value rows' bytes.

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 labels Oct 27, 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: CLEAN: the ring pass makes its buffers in the forms the resident stacks read, every form mismatch is still refused by name, and I found no failure path I could not refute.

Non-blocking

⚠ Nothing pins that M3's stream plan uses the planned forms: place.rs:170. a_streaming_plan_keeps_the_streams_room runs on an F32 header, so its forms are BLOCKS32. Mutant: stream_bytes passes RingForms::BLOCKS32 instead of ring_forms_planned(..). Every assertion stays green. Direction: one stream_bytes assertion on a header with IQ2_XS/IQ3_XXS routed stacks, equal to ring_pass_bytes_in(.., grouped) plus the ring.

⚠ Plan and runtime disagree on mixed forms: place_hybrid.rs:131 prices the largest form over all layers, while card_experts.rs:380 refuses any layer set whose forms differ. A GGUF with one Q8_0 layer and IQ layers (the PR's own test case 2) plans fine, then fails in arm_ring at the first split prompt. The failure is named and the file failed before this PR, so it is not a regression. Direction: make the plan refuse differing forms by name.

⚠ Fix layers: the PR body has a manual A6000 run but no gate that turns red when the ring pass is planted back to the 32-value form. Is an hw_ gate planned? Also, ring_forms: Option<Option<RingForms>> at card_experts.rs:334 is hard to read; build rose 18 → 20 in complexity, one fold.

Checked

  • Duplicates: 4 new items checked, none duplicated. dryer: 0 pairs. The runtime fold and ring_forms_planned use different rules (second ⚠).
  • Complexity: CardExperts::build 18 → 20, one branch added to an existing function.
  • Silent failure: 4 sites followed (ring_forms None, missing grouped kernels, form mismatch, type with no route GEMM). Each is a named refusal or a skip in the plan.
  • Hot path: arm_ring is load-time. enqueue_rows_ring loses one check and adds no allocation, launch or sync.
  • Tests: a_ring_pass_is_planned_in_its_stacks_largest_forms catches the first-layer-only mutant, |= for &=, and a no-route-GEMM layer read as grouped.
  • Gates: no pins moved. Escape catalog: no match.

Notes

  • The PR body lacks the CONTRIBUTING.md evidence list: no nvidia-smi line, no commit hashes, no just gate-* output.
  • gpu-deepseek41 also calls CardExperts::arm_ring; the grouped forms make its pass larger. Not changed by this diff.

Card check: needs-gpu. This pull request changes crates/gpu/src/card_experts.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)

@midagedev
midagedev merged commit dc85e2c into main Oct 27, 2026
7 checks passed
midagedev added a commit that referenced this pull request Oct 28, 2026
…live server

One runner for what the user-facing pass checked by hand scripts: a short and a >= 4096-token
prompt (counted by /tokenize first; a short count is a named harness FAIL, not a sent prompt),
the first request replayed after the long one (#876's second-request failure as a check), the
reply read from content or reasoning_content, and an off cell's reason read from the refusal
line, not the start banner. A FAIL does not stop the next check; a server that went down skips
the rest naming why. `SESSION rc=` ends the run. --self-test runs 14 cases on the stub, then 9
mutants (the replaced pass scripts' behaviours), each of which must turn its case red.

The stub gains /v1/chat/completions, /tokenize, a fail-at-N mode and plan/load record lines;
with no new knob set its 14 existing scenarios are byte-identical. check-recipes lists the
new self-test, and the registry has runner rows for its four BLOOMERY_SESSION_* defaults.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant