Skip to content

gpu, placement: Q5_0 routed stacks run in the card's 32-value family (Lightning's ups on the card) - #857

Merged
midagedev merged 2 commits into
mainfrom
q50card
Oct 27, 2026
Merged

midagedev merged 2 commits into
mainfrom
q50card

Conversation

@midagedev

Copy link
Copy Markdown
Owner

Nemotron-3.5-Lightning's UD-Q4_K_XL carries Q5_0 up stacks on 22 of its 23 routed layers. The card's 32-value expert family had no Q5_0 arm, so only layer 1's 128 experts went to the card. Now a Q5_0 routed stack runs in that family beside Q5_1 and Q8_0 downs, placement accepts it, and docs/models.md says so.

Evidence (box, tree 97ea9b2 on main cb8d92e):

  • gate-gpu-nemotron-h-moe-card32, real tier, RTX A6000: PASSED; cosine to the host 0.999967 (card) / 0.999966 (whole, 0 experts on the host), prompt pass 0.999997 / 0.999794, argmax equal, eager = replay bit for bit.
  • Owning gates, tools/gate-batch.sh --tier fixture --round-ledger: DONE total=246 red=0.
  • just ptx-compare cb8d92ebd on gate_gpu_device, gate_kquant, gate_swap, bloomery-serve: identical; gate-ptx-spill green.
  • bloomery-placement --lib: 199 passed.

Implemented by Sonnet rounds, reviewed by the lead.

🤖 Generated with Claude Code

midagedev and others added 2 commits October 27, 2026 10:05
…through the Q5_0 row's packed-layout kernels

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions github-actions Bot added documentation Improvements or additions to documentation gpu The card engine: crates/gpu*, crates/app needs-gpu Changes code a card must check, and carries no gate run on a card placement Placement planning: crates/placement 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: I built no failure path that the code does not block, and I found no duplicate or unneeded element that needs a change before merge.

Non-blocking

⚠ No test pins the layer name of a Q5_0 fault in the relu² form: crates/gpu/src/card_leg.rs:1454. The new _at entry exists so that an id past the stack names its layer. The relu² tests (R2_CASES, hand launches at line 3264) call enqueue_gemv_q5_0_sel with layer 0 and only compare rows. Mutant: the Q5_0 arm calls the wrapper again (LAYER_NONE). No assertion turns red. Direction: for (Q5_0, Q5_0), give Relu2Leg::enqueue an id past the stack and assert f.layer == run.layer, as the arena test does at line 4018.

⚠ relu2_relayout has one caller: crates/placement/src/accepts.rs:445. The call site in moe.rs:121 could read card_sel32_runs(t.ty) && CardFormat::of(t.ty) != Some(accepts::leg_card_format(t.ty)). I keep it as advice because the function lets a test pin the load rule without a card. Remove it if no second caller comes.

Checked

  • Duplicates: 9 new items checked (StackW::resident, relu2_relayout, Sel32.q5, enqueue_gemv_q5_0_sel_at, the Q5_0 arm of leg_card_format). The diff removes two copies (raon1 stack(), the gemm32_stack match). The dryer pair card_leg.rs:977 and :1632 was already two copies and differs in the source of iq. Not a finding.
  • Complexity: enqueue_gemv_q5_0_sel_at (17) is the old body under a new name with one fault parameter. No growth.
  • Silent failure: 4 sites followed. leg_card_format's new arm reaches only programs whose predicates admit Q5_0. Other programs go through card_down_runs or card_gate_up_runs, which exclude Q5_0. Q5_0 in a wrong form is refused by stack.q5_0() and words().
  • Performance: decode path, relu² form. One gpu.q5() borrow per layer; same launch count; no allocation, copy or sync added. The PR body reports ptx-compare identical.
  • Tests: the re-upload test fails if Q5_0 is covered (the stated mutant). The shared-format test fails if the Q5_0 arm is dropped. The R2_CASES rows fail on a wrong layout.
  • Gates: no band or tolerance moved. Escape catalog: no match.

Notes

  • The PR body lacks the nvidia-smi line, both full commit hashes, and the commands with output (CONTRIBUTING.md). gpu.json evidence is false.

Card check: needs-gpu. This pull request changes crates/gpu-gates/src/bin/gate_nemotron_h_moe_card32.rs, crates/gpu/src/arch/nemotron_h_moe/moe.rs, crates/gpu/src/arch/nemotron_h_moe/prefill.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 0175f15 into main Oct 27, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation gpu The card engine: crates/gpu*, crates/app needs-gpu Changes code a card must check, and carries no gate run on a card placement Placement planning: crates/placement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant