Repository navigation
metal: the dense Qwen3.8-27B from its MLX folder, and the qwen38d row of the e2e gate - #918
Conversation
…ers the dumped ids' embedding rows tools/mlx-fixture-cuts/qwen38d-mlx.json cuts layers 0-3 (three delta layers, one full attention) of mlx-community/Qwen3.8-27B-4bit in their stored bits: 122 tensors, 2,286,737,728 bytes. The directory holds the Metal-only MLX cuts; the CUDA fixture tier and the registry's Cut rows do not read it. Two cut tests plan the fixture and edit the config from the committed real headers. mlx-logits dump dequantizes only the dumped ids' embedding rows, by the rule floatize uses, so the 27B pin fits a 32 GB Mac. The qwen35moe and qwen3moe pins re-dump to the same fnv1a. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01X1hsQfNpqr2jqmpYe8SFXd
An instance's FFN axis is routed or dense. A dense layer's decode runs the experts' pair and fold at one slot, id 0, weight 1, over a one-expert stack; its prompt runs norm_rows, the gate/up GEMM, swiglu_rows and the down GEMM. The e2e gate gains the qwen38d row (the 4-layer cut of Qwen3.8-27B-4bit, its mlx-lm pin at positions 0-3) and the mutants dense_slot_one, dense_weight_half and dense_pass_swiglu_swapped. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01X1hsQfNpqr2jqmpYe8SFXd
…dense file writes its own arch's rope key Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01X1hsQfNpqr2jqmpYe8SFXd
FREE_BAND (0.26) carries a router-flip term a dense session does not have, so the dense prompt's swapped SwiGLU stayed inside it. A session whose layers route nowhere is held to 3Δ a layer (the pass's f16 operand rounding) over its layers in quadrature, and each verdict line names the band it used. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01X1hsQfNpqr2jqmpYe8SFXd
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01X1hsQfNpqr2jqmpYe8SFXd
…_of) Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01X1hsQfNpqr2jqmpYe8SFXd
There was a problem hiding this comment.
Verdict: CLEAN: I built several failure paths for the dense route and each one is blocked in code; the open items below are not blocking.
Non-blocking
⚠ The dense band's derivation does not add the mixer and the FFN: pass.rs:103. The PIN says a layer's update carries at most 3Δ: the mixer at 3Δ (U_L0_REL), the FFN at 1.9Δ. A layer has both, so the bound is about 3.5Δ in quadrature, not 3Δ. The band is still safe (clean worst 2.77e-5 against 2.4e-3). Fix the sentence or the constant before the 64-layer row is gated.
⚠ ffn() builds a router from four zipped options: arena.rs:894. The _ => arm also takes the impossible case "gate_inp present, another buffer absent" and would lay the dense route over a router layer. Build RouterBufs inside one gate_inp.map(..).transpose()?. The comment "made in the order the arena always made them" states no contract: allocation order does not change a result.
⚠ A measured result sits in a comment the comment check does not cover: justfile:152 ("Four of the 27B's layers pick the space token every step"). It has no conditions. Keep "the smoke holds the CLI path, m_logits holds the numbers".
Optimization headroom
- G. Per-launch fixed cost: rows.rs:748. The prompt's dense FFN runs gate GEMM, up GEMM,
swiglu_rowsand down GEMM with 4 barriers. The decode pair and the grouped tile already fusepair_swigluinto the epilogue. A fused pair would remove 1 launch, 1 barrier and 3·m·ff f32 of h/up traffic per layer per pass (m = rows, ff = 17,408 on the 27B) [derived].
Checked
- Duplicates: 14 new items checked, none duplicated.
GATED_ROUTEDis now the one owner of the 256-expert axes. The dense-route skip in the foursession.rswalk wrappers is one fact in four wrappers;walk.rs::ffncannot own it because the CUDArouteruns onFfnRoute::Dense. A new owner would add elements. - Silent failure: 9 sites followed. Each gives a named refusal. The dense route's ids and weights are laid once at open, and no reset zeroes them.
- Tests: mutation checks on
a_dense_layer_has_no_router_group,a_dense_layer_the_launches_cannot_run_is_refused_by_nameand the threeDENSEmutants are red. - Gates: one new band, tighter than before, dated PIN, FAIL-first in the PR body. No gate removed or relaxed.
- Escape catalog: C1 to C4 do not match.
🔨 Shingler, bloomery's review bot: approves a clean pull request and requests changes on a must-fix (how it works)
What and why
Metal runs the dense Qwen3.8-27B. Its MLX folder (
mlx-community/Qwen3.8-27B-4bit) opens and is checked againstmlx-lm.
swiglu_rows(a new kernel inroute.metal) → down GEMM.qwen38drow of the Metal e2e gate.tools/mlx-fixture-cuts/qwen38d-mlx.json,fixture cut): three delta layers and one attention layer.pins/qwen38d.{txt,f32}).tools/mlx-logits.pynow gathers onlythe dumped ids' embedding rows.
dense_slot_one,dense_weight_half,dense_pass_swiglu_swapped.q_free.FREE_BAND(0.26) carries a router-flip term a dense session does not have. The swapped-SwiGLU mutant stayedinside it: worst 1.42e-2, against 2.77e-5 clean.
FREE_BAND_DENSE_LAYER× √layers (2.4e-3 at 4 layers): 3Δ alayer, where Δ is the pass's f16 operand rounding.
Release notes: Added — the dense Qwen3.8-27B runs on Metal from its MLX folder.
Code shape
PIN(2026-10-28):and its derivation. FAIL-first: the swapped-SwiGLU mutant is red under it.cargo fmtandcargo clippyare clean on what I touched.Duplication found or removed: none.
What I ran
On the second M1 Pro, on this branch rebased on main (#916's drain included):
cargo test -p bloomery-metal --lib: 94 passed.gate_metal_qwen35moe_e2e:--row qwen3moeand--row qwen38d: PASS each;q_free: worst 2.769e-5 (dense band 0.0024);q_tensor,q_mark_cutandq_markedall under 3.3e-5.--mutants-all:generate_metalsmoke on the qwen38d split:220,220,220,220,220,220,220,220, the same on two runs. Four of the27B's layers pick the space token. The smoke holds the CLI path;
m_logitsholds the numbers.just remote-static origin/main:mac-static: ok.tools/gate-batch.sh --ledger --tier fixture:gate-fixture-budgetgreen;gate-fixturedeferred to the real tier (real-only).AI use: written and checked with Claude Code.
🤖 Generated with Claude Code
https://claude.ai/code/session_01X1hsQfNpqr2jqmpYe8SFXd