Skip to content

gpu, gpu-solar2, model: Solar-Open2 plan bp on a tier side shared with GLM-5.3-Flash (stacked on #599) - #602

Merged
midagedev merged 15 commits into
mainfrom
sbp2
Oct 21, 2026
Merged

midagedev merged 15 commits into
mainfrom
sbp2

Conversation

@midagedev

Copy link
Copy Markdown
Owner

Solar-Open2 gets plan bp: the stage runs on one card and an expert tier sits on the second card. GLM-5.3-Flash's tier code moves into common owners, and both families call them.

This PR stacks on #599. Review only the last commit, 85c2801. The PR becomes one commit once #599 lands.

What changes

  • gpu host::leg_tier: TierSide, LegFamily, node_family and hang_tiers, lifted from GLM's tier.rs. GLM tier code is −420 lines, the common owners +297.
  • gpu-deepseek41 shared_routed: an opt-in tier layer, made of front_tiered, the tier back and the batch join.
    • The common prompt walker joins a tier layer's rows before the back.
    • MiMo2 and MiniMax-M3 still refuse a tier.
  • model: Solar's describe and its place and host readers, plus the tier reserve.
    • PIN(2026-10-21) on the meta bp clause: it is now a plan, not PlaceError::Tier.
  • gate_solar2_twocard (new, recipe gate-gpu-solar2-twocard): the two-card run against the same plan with every tier segment on the stage card. Decode, call and group bits must be equal.
    • GLM's twocard gate shares its helpers through shared/tier_twocard.rs.

Evidence (this head; A6000, and both cards for the two-card gate)

  • gate-gpu-solar2-twocard PASSED on the real file (92 s, BLOOMERY_CARD=both) and on the fixture (11 s).
    • 5 mutants each turn their own clause red: the tier boundary at the step, the tier boundary at the batch join, the join reading live places, an extra graph node, and a layer with no tier.
  • Fixture tier batch: 21 items, 0 red, 5 deferred by name. It covers:
    • glm5next twocard, e2e, nvtier and residency;
    • solar2 e2e, prefill and serve;
    • ds41 tier and twocard, qwen38 twocard and routed-legs;
    • gpu-lib, gpu-gates-lib and both meta gates.
  • gate-gpu-minimaxm3-e2e (418 s) and -prefill (72 s) PASS on the real file, because shared_routed changed.
  • canon-check against the base: 1349/1349 entries identical, so the change is a host move. just check rc 0, just mac-lint 11.

Known limits

  • gate_solar2_serve has no standing --place bp arm. A manual --place bp serve run loaded on both cards and answered a chat request.
  • GLM's ffn.rs still holds its own copy of the tier join (~200 lines). Moving GLM onto shared_routed's tier layer is a follow-up.

This work was written with AI help: the implementation round ran as a Claude subagent, and the review, the merge onto #599 and the gate runs were done by Claude.

🤖 Generated with Claude Code

@midagedev midagedev added the needs-gpu Changes code a card must check, and carries no gate run on a card label Oct 21, 2026
@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 placement Placement planning: crates/placement tools Tools, recipes, CI and the toolchain: tools/, justfile, .github/, Cargo labels Oct 21, 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: accepted K-quant prompts fail, memory totals omit an allocation, and malformed vocabulary data is hidden.

Must fix

1. Allocate the activation forms the loaded projections require

crates/gpu-minimaxm3/src/prefill.rs:175 Both pools omit q128. The loader accepts Q3_K–Q6_K in PROJ and INDEX (body.rs:272–287). A prompt reaching one of these projections calls project_wide, then WideActsMut::quantize, which returns the missing-q128 error (site.rs:817). Decode allocates its forms from the loaded sites. This is kind A: an accepted model cannot prefill. Add a mixed-quant case that fails when q128 allocation is removed.
Resolve the forms at their allocator so every accepted projection type can prefill. Replace Batch::new with:

pub fn new(
    gpu: &Gpu,
    (d, shape): (&Dims, &MsaShape),
    rows: usize,
    stores: &[Store],
) -> Result<Batch, GpuError> {
    let stream = gpu.stream();
    let q_width = d.heads * HEAD;
    let wants = |width| {
        let tys: Vec<_> = stores.iter().flat_map(Store::sites)
            .filter(|s| s.k() == width).map(|s| s.ty()).collect();
        WideActs::wants_of(&tys)
    };
    Ok(Batch {
        rows: BatchRows::new(stream, (d, shape), rows)?,
        msa: MsaScratch::new(stream, shape, rows, d.ctx)?,
        wide: WideActs::new(stream, wants(d.embd), rows, d.embd)?,
        arm: WideActs::new(stream, wants(q_width), rows, q_width)?,
        route: GemmRoute::new(stream, rows, 1)?,
        gemm: GemmKernels::load(gpu.context())?,
    })
}

Update the call in body.rs:549:

let batch = crate::prefill::Batch::new(
    gpu, (&dims, &msa), crate::prefill::T_MAX, &stores,
)?;

2. Count the new hidden-row buffer

crates/gpu-deepseek41/src/shared_routed.rs:381 new allocates h at line 360, but bytes omits it. Both models underreport resident memory by 4 * cap * max(ff, dense_ff) bytes [derived, f32 elements]. Routed::batch_bytes forwards this sum to Solar's prompt reserve check (body.rs:848,968) and MiniMax's scratch check (body.rs:575,659). This is kind B: a proven omission with a mechanical fix.
Correct the shared sum at its owner so both checks count the existing allocation. Insert after Some(&self.x1s),:

Some(&self.h),

3. Refuse non-string vocabulary entries

crates/gpu-gates/src/bin/gate_minimaxm3_e2e.rs:269 A numeric tokenizer.ggml.tokens array becomes empty pieces. smoke passes them to piece_text and prints blank output; its success checks cover logits and the fault word, not vocabulary types. model/src/arch/mod.rs:792–805 reads only the explicit size or array length. This is kind B: malformed input becomes a plausible value consumed by the diagnostic.
Validate here before the diagnostic hides malformed model data. Replace:

fn pieces_of(split: &gguf::Split) -> Result<Vec<String>, GateError> {
    match split.value("tokenizer.ggml.tokens") {
        Some(gguf::Value::Array(items)) => items.iter().enumerate()
            .map(|(i, v)| match v {
                gguf::Value::String(s) => Ok(s.clone()),
                _ => Err(format!(
                    "tokenizer.ggml.tokens[{i}] is not a string"
                ).into()),
            }).collect(),
        _ => Err("the file holds no tokenizer.ggml.tokens array".into()),
    }
}

Non-blocking

⚠ Exercise ranked selection through the prefill body: crates/gpu-gates/src/bin/gate_minimaxm3_prefill.rs:81 prompts stop at 17 rows. Scoring returns early while visible blocks fit within top_k (attn.rs:162), so removing the body's score call escapes these cases; the MSA gate calls the kernels directly. Add a bounded body case above 128 * top_k live keys and assert the selection or attention result.

Checked

Duplicates: the activation fix reuses the existing WideActs::wants_of owner.
Complexity: diagnostics list 15 new high-complexity functions; no complexity-only finding retained.
Silent failure: followed the vocabulary fallback to the printed smoke output.
Tests: the prefill cases do not exercise K-quant projections or ranked selection through the body. Mutation reasoning was static.
Gates: no gate-relaxation finding retained.
Escape catalog: none of the retained findings depends on C1–C4. No ledger lessons are in force.

Notes

No CUDA gates ran during this review. The PR's summaries lack the nvidia-smi line, paired hashes, model path and gate command output required for GPU evidence.
Validated against the supplied full diff (mode=full).

Card check: needs-gpu. This pull request changes crates/app/src/arch/solar2/mod.rs, crates/gpu-deepseek41/Cargo.toml, crates/gpu-deepseek41/src/block.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)

Some(&self.probs),
Some(&self.weights),
Some(&self.sh),
Some(&self.x1s),

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.

Count the hidden-row buffer allocated at line 360 in the total used by the reserve checks.

Suggested change
Some(&self.x1s),
Some(&self.x1s),
Some(&self.h),

@midagedev
midagedev force-pushed the sbp2 branch 2 times, most recently from 95b5145 to 5ba2c4b Compare October 21, 2026 11:32
midagedev and others added 15 commits October 21, 2026 22:35
…list walk beside the token list (gqa_flash_seg_mma_p16_blocks)

The _p12_sel entry keeps its md5; the new entry walks ascending 128-position block ids per (row, key head) in place,
so a prompt row stages no gathered copy. A block past the cache raises PoolSelect, a zero count key_count.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…cores, the per-key-head block pick and the flash over the picks, with its gate

runtime::msa is the host twin (the block max of four unscaled dots, the local blocks forced, low id first on a tie, every
block kept below 17). gate_minimaxm3_msa holds ids to it at counts across the block edges up to 32768, the attention
bit-identical to dense where every block is kept and inside the f64 band elsewhere; five mutants red.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…e step, its e2e gate; Solar's routed block, open and e2e harness lifted into common owners

MiniMax-M3 (R4a): the card body (GQA K/V beside the f16 index-key cache MSA reads, the F32 indexer projections), the
decode step (per-head q/k norm, partial NeoX rope 64 of 128, MSA past the three dense layers), the dense and routed FFN
on SwiGLU-OAI, host and card experts through the common shell, the shared expert, and the open. Decode only: a prompt
batch and slots > 1 are refused by name. gate_minimaxm3_e2e runs the common lcpp e2e clauses on ref_minimaxm3_a..e.

Lifts, so the next hybrid family attaches cheaply:
- gpu-solar2/ffn.rs -> gpu-deepseek41/shared_routed.rs (a generic Routed block with a dense lead arm); Solar's ffn.rs is
  an alias.
- block FFN and the q8 pair kernel take the activation as an argument (V4.1's clamp is a wrapper);
  ds41_shexp_gate_up{,_q8_0_mcol} change PTX with values held by their owning gates.
- one_card_run / agreed / hosted_hybrid (gpu model.rs), Site::of_file, site::vector, hosted_stacks (Solar and MiMo call
  them); place_hybrid's KvLayout carries the index keys; arena_leg reads its rule from the host form.
- gate-side: shared/lcpp_e2e.rs out of gate_solar2_e2e (570 -> 86 lines), solar2_seat 286 -> 178.

Two kernel entries for the four-slot routed counts (ds41_ffn_handoff_4, ds41_ffn_card_acc_4), pinned in ptx-shapes and
the unsafe ratchet. The e2e gate's layer_outputs and top_logprobs clauses are red on the borrowed Solar band: the
divergence opens at near-tie top-4 flips (the next round adds the teacher-forced arm and the family's own band).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01REHZMoiqEUnFCPxtpyc1Pg
…2e harness, and MiniMax-M3's own band (R4b)

- lcpp_e2e: forced_layers_near_<slug>. Each layer runs alone at each position on the oracle's own
  input. The flip-free sites' feed-forward output is held to a ratio band over the one-sided
  Q8_K/Q8_0 activation gap. The router must agree with the oracle wherever the oracle's 4th-5th
  margin is above the f32 sum-order band. The free chain is bounded only over the prefix the run's
  routing holds (sqrt(prefix) * eps_forced), and top_logprobs is deferred by name for MiniMax-M3.
- gpu-minimaxm3: Body::forced_row (forced.rs); the attention sub-layer is shared with the step
  through AttendParts.
- gpu, gpu-deepseek41: the route ids and selection bias read back; the host step port keeps each
  layer's ids of the last step.
- refset consumers and the gate-paths derive row for minimaxm3.

gate-gpu-minimaxm3-e2e green on the A6000 (414 s): forced flips on the oracle's own input 0;
flip-free ratio worst 2.68 (band 10); prefix 3, ceiling 0.0043. Solar-Open2 e2e/prefill fixture
and gpu-gates lib green, box check rc 0, mac-lint 11.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…th families call; MiniMax-M3's prompt batch (R5a)

- gpu-deepseek41 prompt_walk: the walker's owner. It splits a group into units, stages their rows on
  the host, walks the layers with the routed block over the unit's slots, then runs the head and
  checks the fault word. A family supplies only its attention (BatchAttention).
- gpu-solar2 prefill: Solar's half only, the KDA and NoPE-GQA mixers over a unit's rows
  (879 -> 645 lines). This is a move: the fixture gate prints the base's lines exactly.
- gpu-minimaxm3 prefill: MiniMax's half. Every row's index key is appended before any row scores,
  each row selects blocks over its own live count, then the selected flash runs. T_MAX 16 comes from
  the 64 MiB scratch term: the decode flash keeps 2.6 MB of partials per row.
- gates: shared/prefill_clauses.rs holds the four clauses. gate_solar2_prefill keeps its seat open
  and its doc. gate_minimaxm3_prefill (new) bounds the layers before the routing prefix and defers
  the logits comparison by name.

canon-check de1fc7806 --worktree: 1349 of 1349 identical. A6000: gate-gpu-minimaxm3-prefill and -e2e
PASSED, gate-gpu-solar2-prefill real and fixture PASSED, solar2-e2e fixture and gpu-gates lib green.
Box check rc 0, mac-lint 11. FAIL-first: a K/V swap and a unit row that sees later rows' index keys
each turn the prefill clauses red.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…solo and in the v41-load group as the e2e

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…at Solar-Open2 now shares (R5b)

- app arch: HybridCfg and the blanket Open/Prompt/Keep for one-sequence hybrid bodies; Solar's module
  131 -> 78 lines, MiniMax-M3's new (74).
- serve_seats/hybrid.rs: Family, Hybrid<F>, its Log, Seat and Tiered impls, lifted from solar2.rs
  (383 -> 172); serve_seats/minimaxm3.rs and `bloomery-serve --model minimaxm3` at plan a.
- shared/serve_gate.rs: the four serve clauses; gate_solar2_serve keeps its seat and doc (247 -> 92),
  gate_minimaxm3_serve (new) adds place_bp_is_refused.
- model: MiniMax-M3's reasoning tags <mm:think> </mm:think> and turn end [e~[ from its chat template.

gate-gpu-solar2-serve fixture: clause lines identical to the base's. gate-gpu-minimaxm3-serve: the
refusal clauses PASS; load_and_listen waits on the minimax-m2 pre-tokenizer (next commit).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
… with llama-tokenize; MiniMax-M3's serve gate whole

Pre::MiniMaxM2 runs GPT4O's one expression as the reference's std::regex
fallback runs it on the collapsed text (a non-ASCII letter is both a
capital and a lowercase letter; the symbol run's tail takes slashes). The
whitespace tail, the contraction and the one-piece split are lifted out of
the qwen35 and deepseek matchers into one copy each.

The tokenizer-minimaxm3 set (llama.cpp-solar2's llama-tokenize) and the
gate's cases and corpus tests hold our ids to it in both parse modes.
FAIL-first: digits in fours, the tail without '/', no give-back to a
non-ASCII letter, and the name dropped from NAMES each turn a test red.

serve_gate's MAX_TOKENS goes 64 -> 512 (PIN 2026-10-21): MiniMax-M3's
greedy answer ends its turn at 143 tokens, so the turn-end clause read a
cut answer; red at 64, green at 512 on the same binary.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…results refused, non-string vocab refused, one bias and vector owner, unused API and Family::Flags removed, prefill activation forms from the loaded sites

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…xm3, as every serve recipe does

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…stage rows

The index head kernel appends a value row beside each index key to a
ctx x d f16 plane nothing reads, one plane every selecting layer shares.
The MiniMax-M3 body makes it in its step scratch, but the plan never
counted it: at the serving default context (131072 after the halving)
the load refused itself by name, scratch 125.9 MB against the plan's
100.7 MB. KvLayout's stage position bytes now add the widest selector's
key row once beside the rope tables.

FAIL-first: under the old rule the_m3_cache_is_the_released_files_bytes
reads 2560 for 5120 and the new the_selectors_share_one_sink_row is red.
The serve smoke at the defaults loads in 28.4 s with the fix.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
… card) on a tier side GLM shares

- gpu host::leg_tier: TierSide, LegFamily, node_family, hang_tiers lifted from GLM-5.3-Flash's tier.rs;
  GLM and Solar both call them (GLM tier code -420, common +297).
- gpu-deepseek41 shared_routed: an opt-in tier layer (front_tiered, the tier back and the batch join),
  so Solar's routed block serves tier experts; MiMo2 and MiniMax-M3 still refuse a tier.
- model: Solar's describe and place readers, the tier reserve (PIN(2026-10-21) on the meta bp clause:
  a plan now, not PlaceError::Tier).
- gates: gate_solar2_twocard (new, recipe gate-gpu-solar2-twocard): the two-card run against the same
  plan on the stage card alone, bits equal for decode, call and group; 5 mutants each red on its own
  clause. GLM's twocard gate shares its helpers through shared/tier_twocard.rs.

canon-check 4478ffdd0 --worktree: 1349 of 1349 entries identical. gate-gpu-solar2-twocard real 78 s
and fixture 22 s PASSED; glm5next-twocard and solar2-e2e fixture PASSED; box check rc 0, lint 11.

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