Skip to content

qwen3moe: the Qwen3-30B-A3B fixture, its reference sets and the chain reader - #832

Merged
midagedev merged 10 commits into
mainfrom
mac-q30b
Oct 26, 2026
Merged

midagedev merged 10 commits into
mainfrom
mac-q30b

Conversation

@midagedev

Copy link
Copy Markdown
Owner

Qwen3-30B-A3B gets a fixture and a chain reader. This is the first step toward running it on Metal. It changes no kernel.

  • Fixture: fixture generate qwen3moe cuts the Instruct-2507 Q4_K_M file to four source layers [6, 8, 9, 47]. That keeps both type sets (Q4_K and Q6_K layers), both transitions, and the real 151,936-row globals (1.95 GB).
  • Reference sets: the new refset family fx-ik-qwen3moe holds three sets (5-token batch, step4-every-node, d1k), dumped by ik.
  • Fixture tier: qwen3moe's real-file gates now defer by name in the fixture tier. gate-gpu-qwen3moe-types opens no model, so it runs under the default profile.
  • Chain reader: chain::arch::qwen3moe reads Qwen3-30B-A3B's plan (attention head 128, no output gate, no shared expert). The card keeps its own instance checks in kind35.

Evidence:

  • Fixture-tier landing batch on the box: 261 items, 1 red (gate-gpu-qwen3moe-types, fixed here and rerun green). 93 items defer to the real tier.
  • just mac-static on a second Mac: rc 0.
  • FAIL-first per new clause (mutant red lines in the round notes). Example: layer map [6,7,9,47] makes hw_fixture_qwen3moe_plan red.

AI use: written and checked with Claude Code.

🤖 Generated with Claude Code

@github-actions github-actions Bot added gpu The card engine: crates/gpu*, crates/app host Host crates: qdot, threads, engram, engram-lab, runtime, sampler, levers, decision, vision, refset 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 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 new tests duplicate an existing tensor-name owner.

Must fix

1. Reuse the existing blk owner

crates/chain/src/arch/qwen3moe/read.rs:652 duplicates crates/model/src/arch/names.rs:7 exactly (kind B, R14). The parent module already imports that owner. Removing the copy avoids maintaining a second spelling of the same tensor-name convention.

Delete the local fn blk at lines 652–654 and add blk to the existing use super::{...} import in mod tests. This removes a function without adding an abstraction.

Non-blocking

⚠ Pin the three reference sets: crates/refset/src/arch/qwen3moe/mod.rs:52.
Changing fixture::IK.sets to &[] leaves this test green: the loop runs zero times, and the common mirror test explicitly excludes this family. Add assert_eq!(fx.sets, &[fixture::BATCH, fixture::STEP4, fixture::D1K]); after let fx so removing a set fails the test.

Checked

Compared both blk definitions and the parent import. Checked the fixture list, the standalone-family exclusion, and the inline suggestion's added line and replacement. Neither finding is excluded by the review rules; no ledger lessons are in force. Static validation only; tests were not run.

Notes

The PR body references round notes for FAIL-first results without attaching them. It supplies no complete GPU gate evidence (card/driver, both commits, commands and output).

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

/// profile dumps behind `fx_`.
#[test]
fn the_fixture_family_stands_without_a_real_twin() {
let fx = &fixture::IK;

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.

Pin the three sets so replacing the family's list with an empty or partial list fails this test.

Suggested change
let fx = &fixture::IK;
let fx = &fixture::IK;
assert_eq!(fx.sets, &[fixture::BATCH, fixture::STEP4, fixture::D1K]);

@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.

Since the last review:

Verdict: CLEAN: the incremental change resolves the must-fix and preserves tensor-name behavior.

Checked

Duplicates: no new definitions; the removed helper exactly matches model::arch::names::blk. The six dryer pairs concern fixture files outside this increment.
Complexity: diagnostics report plan_ffn 18 → 29; this increment does not change that function.
Silent failure: no new sites; the shared helper returns the same formatted string.
Tests: assertions are unchanged. Static inspection confirms existing literal plan-name assertions reject a changed blk. prefix. Tests were not run.
Gates: no pins, thresholds, test cases or assertions changed.
Escape catalog: no patterns matched.

Notes

The PR body cites round notes without attaching the complete FAIL-first results and supplies no complete GPU gate evidence.

Card check: needs-gpu. This pull request changes crates/gpu-gates/src/bin/gate_qwen3moe_twocard.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 a975339 into main Oct 26, 2026
8 of 9 checks passed
midagedev added a commit that referenced this pull request Oct 26, 2026
…guments again

#838 passed the tensor table as an eighth argument after #832 had dropped
it, so the Mac-only gate_metal_qwen35moe_e2e did not compile.

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 host Host crates: qdot, threads, engram, engram-lab, runtime, sampler, levers, decision, vision, refset 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 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