Skip to content

chain, gpu host: Nemotron-H-MoE runs the hybrid walk; the node tier's launch protocol is gone; owner rows for four shared files - #1193

Merged
midagedev merged 4 commits into
mainfrom
seams
Nov 12, 2026
Merged

midagedev merged 4 commits into
mainfrom
seams

Conversation

@midagedev

@midagedev midagedev commented Nov 11, 2026 •

Copy link
Copy Markdown
Owner

한 줄 요약: #1192가 남긴 이음새 정리 — Nemotron-H-MoE도 hybrid 공통 walk로, 노드 tier의 죽은 launch 프로토콜 삭제, 주인 없는 공통 파일에 owner 행.

What and why

Three cleanups of the seams #1192 left, one train because they overlap in crates/gpu.

  • nemomoe. Nemotron-H-MoE implements HybridOps (nemotron_h_moe::Program, its MoE layer as the family's Ffn) and runs chain::hybrid::Walk; its placed step runs walk::layer for a card layer and keeps its own front/shadow/back for a hosted MoE layer. moe_layer splits into moe_in/moe_core/moe_out with the same launches in the same order. Its layers load from chain plans, so Names::mamba/attn/conv_bias and mamba_layer go: one name resolver. crates/chain/src/hybrid/** gets a common-owner row (chain_hybrid) instead of the nemotron_h family glob.
  • tierdead. The node tier's launch/capture protocol had no caller since gpu host: a node tier skips the round trip on a layer with no node pick — the host raises the tier's go itself at the pi #1177 (TierNode::launch/capture, the server arms, handle_capture, the chain and side words). Tags 4 and 5 stay reserved and a node refuses them by name, since both builds speak wire version 9.
  • trunk. (from the review) Both Nemotron-H programs carried the same six Mamba-2/attention op bodies, the rails and the plan-mismatch error; hybrid::Trunk, hybrid::rails and hybrid::mismatch hold them once, and each program keeps its layer lookups, token table and FFN.
  • seams. hosted_hybrid had no caller (hosted_hybrid_at is the one assembly); head64_gqa moves into its tests; sandwich_add (crates/chain/src/residual.rs) had no caller and goes with its 4 tests (a coverage change: the only contract they pinned was the deleted function's); tools/owners.tsv names rows_kit, ffn_situ, token_major and fault_step_order.

Release notes: internal — host-only moves and deletes; no kernel, launch or byte formula changes.

Code shape

  • No second copy. The MoE family's layer order was the second copy of the hybrid trunk's walk; it now runs the walk.
  • Model code holds only architecture facts. The walk gained no branch for the MoE family; the hosted split stays in placed.rs.
  • Dead code is gone.
  • No silent failure. A Launch/Capture frame from an older node 0 is refused by name (pinned in messages_read_back_as_written).
  • Comments state what is true now.
  • No relaxed gate.
  • cargo fmt and cargo clippy are clean; lint count unchanged.

Duplication found or removed: the trunk ops of nemotron_h/program.rs and nemotron_h_moe/program.rs (lifted to hybrid::Trunk); crates/gpu/src/arch/hybrid.rs Names::mamba/attn beside mamba_of/attn_of (removed). Still open, tracked: three prefill_with copies (nemotron_h, nemotron_h_moe, musespark).

What I ran

Card: RTX 3090 + RTX A6000, the maintainers' workstation.

  • just narrow 8d247478e: ptx-scan bloomery-serve / gate_gpu_device / gate_kquant / gate_swap: identical (--no-jit both).
  • tools/gate-batch.sh --tier fixture --ledger over the narrowed list: DONE total=140 red=0 tier=fixture. An earlier run had 20 reds: another job held both cards, so they were lock waits (rc 75), out-of-memory and refused loads. All 20 were green on the rerun with the cards idle.
  • Real tier, gate-gpu-nemotron-h-moe-{e2e,serve,card32,folder} at main 8d24747 and at this head: DONE total=4 red=0 tier=real on both. Every graph_nodes, id, cosine and max|Δ| line is equal; only build ids and pids differ.
  • After the trunk lift (head 6c02503): just narrow 8d247478e identical on all four scans again; fixture batch DONE total=143 red=0; real tier MoE gates DONE total=4 red=0, structure lines equal to main (only a load time differs).
  • cargo test -p bloomery-chain: 77 passed (74 before, +3 new, each with a mutant under .mutants/nemomoe-*.patch that runs red).
  • just mac-check: 89 shapes, 0 red. python3 tools/gate_class.py check: 0 findings. Every tools/check-*.sh: rc 0.

🤖 Generated with Claude Code

https://claude.ai/code/session_01CjHkkjGpdUeLi6Z7fiwRXH

midagedev and others added 3 commits November 11, 2026 14:09
…ssembly) and chain's sandwich_add (no caller, no gate reads it); head64_gqa is test-only; four shared gpu files get owner rows

From a census of transitional seams. hosted_hybrid was one call of hosted_hybrid_tiered with no tier, and nothing
called it. chain::residual::sandwich_add (LFM3 C1's host twin) had no caller and no gate used it as a reference,
unlike its siblings short_conv and out_gate; its four tests go with it (a coverage change of only that function).
ResidualKind::Sandwich stays: LFM3's layer kind. qwen3moe plan.rs's head64_gqa moves into the test module.
tools/owners.tsv names the shared files no row covered: rows_kit.rs, routed_ffn.rs (ffn_situ), token_major.rs,
step_order.rs (fault_step_order).

Host code and tables only: no kernel.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01CjHkkjGpdUeLi6Z7fiwRXH
…the per-layer enqueue frames); Launch and Capture stay reserved and a node refuses them by name

TierNode::launch and capture, the server's Launch and Capture arms and handle_capture, Session.listed, the chain and
side words and their codecs, and TierNode's graph and word fields had no caller once a node tier captured nothing
and took one Enqueue frame a layer. Tags 4 and 5 stay in Tag so a frame from a node 0 of an older build parses, and
Session::handle refuses it by name (both builds speak wire version 9, so the version check does not). The
one-process tier's launch and capture paths are unchanged. messages_read_back_as_written loses the round trips of
the deleted words and pins the reserved-tag refusal.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01CjHkkjGpdUeLi6Z7fiwRXH
…tron_h_moe, nemotron_h_moe::Program); one name resolver; the trunk is a common owner

Nemotron-H-MoE's step was the second order of the hybrid trunk. It now implements HybridOps with its MoE layer as
the family's Ffn (moe_layer split into moe_in, moe_core and moe_out, the same launches in the same order) and runs
Walk on a whole card; the placed step runs walk::layer for a layer with no host share and keeps its own front,
shadow and back for a hosted MoE layer. Its layers load from chain plans, so Names::mamba, Names::attn, conv_bias
and the last caller of mamba_layer go (gqa_layer stays for Solar-Open2). tools/owners.tsv names chain_hybrid
(crates/chain/src/hybrid/**); the nemotron_h family glob no longer owns it.

A move: the same launches in the same order. 3 chain tests, each with its mutant under .mutants/nemomoe-*.patch.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01CjHkkjGpdUeLi6Z7fiwRXH
@github-actions github-actions Bot added dgx-spark The DGX Spark (aarch64, GB10) port 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 tools Tools, recipes, CI and the toolchain: tools/, justfile, .github/, Cargo labels Nov 11, 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 refactor is sound (walk order, rail parity, launch order, the wire refusal), but the new program.rs copies two family-independent helpers from nemotron_h's.

Must fix

1. rails and mismatch are second copies of nemotron_h's

moe program.rs:76 is nemotron_h program.rs:43 plus pub(super), and mismatch differs from nemotron_h's only in the WHAT string. Both are family-independent (Head, DeviceBuffer, GpuError; no Layer variant); the trunk both files already import is the owner. The PR's own checklist says "No second copy"; the residual-rail rule is the kind of fact fixed in one family and missed in the other. Cost now: a two-file move; later: two readers of the rail rule.
Fix — add to crates/gpu/src/arch/hybrid.rs (it gains use crate::head::Head;):

/// A plan part that names a kind of layer the body holds another of.
pub(crate) fn mismatch(what: &'static str, layer: usize, runs: &str) -> GpuError {
    GpuError::shape(what, format!("layer {layer} is not the {runs} its plan names"))
}

/// The residual stream as (the rows a layer reads, the buffer it writes).
pub(crate) fn rails<'b>(
    in_head: bool,
    head: &'b mut Head,
    r: &'b mut DeviceBuffer<f32>,
) -> (&'b DeviceBuffer<f32>, &'b mut DeviceBuffer<f32>) {
    let hin = head.input_mut();
    if in_head { (&*hin, r) } else { (&*r, hin) }
}

Delete the copies in nemotron_h_moe/program.rs and nemotron_h/program.rs; callers become hybrid::rails(self.in_head, …) and hybrid::mismatch(WHAT, l, "…") (placed.rs follows). mamba_at/attn_at/moe_at stay per family: they match each family's own Layer enum.

Non-blocking

⚠ The six mamba/attention op bodies and the in_head flip are also the same knowledge twice: moe program.rs:115 against nemotron_h program.rs:111, differing only in GROUP_16 vs GROUP_5. A trunk-owned rails object (holding head, r, in_head, the flip its end-of-layer method) would remove the field and three flip lines per family — its own piece of work, not this PR's.
⚠ Layers come from spec::read while load support comes from hparams: body.rs:316 sizes by hp.n_trunk and placed.rs:213 indexes hp.experts[l]. A file the two readers parsed differently meets an index panic or a step-time mismatch error, not a load-time named refusal. Is one equality check at load worth it?

Checked

Duplicates: 15 new items grepped (MoePlan, moe_plan, moe_fits, rails, mismatch, StepWalk, owner rows); hits: must-fix 1. moe_fits name-shares qwen3moe plan.rs:875 but checks a different dialect (router dims) — not a duplicate. Dryer pairs unread (tool down), so the Grep check stands alone.
Complexity: crapper down; by hand the moe_layer split lowers per-function complexity and no changed function grew.
Silent failure: 6 sites followed — unreachable! at tier.rs:2247 is guarded by the Pass::Feed return at :2237; the latent-pair mismatch refuses by name (moe.rs:406); retired tags refuse by name (node.rs:2085).
Rail parity re-derived: in_head starts at len.is_multiple_of(2) and flips once per layer in both the walk path and the placed front/shadow/back path (placed.rs:549 embeds at layer 0; StepLeg::new enqueues nothing); the head always reads the last layer's buffer.
Tests: each new chain test's .mutants/ patch turns an assertion red (site list → message text, kinds → (240, 640, 9), shape → the refusal).
Gates: no PIN moved; owners.tsv/families.tsv/gate-class.tsv rows are consistent and overlap-free (chain_plan keeps arch/**, chain_hybrid takes hybrid/**).
Escape catalog: C1–C4 are shell patterns; no shell changed — none matched.

Notes

Dryer and crapper did not run; the duplicate and complexity checks above are the manual pass.
The body's gate evidence carries hashes and gate outputs but not the nvidia-smi line or the model file of CONTRIBUTING.md's list.

Card check: needs-gpu. This pull request changes crates/gpu/src/arch/hybrid.rs, crates/gpu/src/arch/nemotron_h_moe/body.rs, crates/gpu/src/arch/nemotron_h_moe/mod.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)

… and the plan mismatch have one owner (hybrid::Trunk, rails, mismatch); both Nemotron-H programs hold only their embed and FFN ops

nemotron_h::Program and nemotron_h_moe::Program each carried the same six Mamba-2/attention op bodies, the
rails over the head's input and the body's buffer, the side flip and the plan-mismatch error. Trunk holds the
step's Cx, scratch, acts and residual stream and runs those launch groups; each family's program keeps its
layer lookups (its own Layer enum), its token table and its FFN. The MoE body builds one program for the
placed and the whole-card walk. A move: the same launch groups in the same order.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01CjHkkjGpdUeLi6Z7fiwRXH

@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 must-fix is fixed at one owner; the new commits (the Trunk consolidation) add no defect.

Since the last review:

  • Must-fix 1 (rails/mismatch second copies): fixed — one owner each at hybrid.rs:580 and :591; both programs and placed.rs call it.
  • ⚠ six mamba/attention op bodies and the in_head flip duplicated: fixed — Trunk owns them plus the head enqueue; both programs delegate. It removes more fields, bodies and flip lines than it adds.
  • ⚠ layers from spec::read vs hparams support sizes: still open, unchanged (body.rs:316, placed.rs:213); non-blocking.

New commits, hunk by hunk: flip sites unchanged in count and position — the trunk's mamba_out/attn_out (hybrid.rs:640 and :670), each family's ffn_out (nemotron_h program.rs:134, moe program.rs:149), the placed back (placed.rs:614); in_head still starts at layers.len().is_multiple_of(2) on both paths (step.rs:61, body.rs:499). The placed branch still ends in head.enqueue(gpu, w), the call Trunk::enqueue_head makes. No launch, order or byte formula moved — matching the body's identical ptx-scan.

Checked

Duplicates: 4 new items grepped (Trunk with its methods, rails, mismatch); one owner each in hybrid.rs. Trunk name-shares the fixture crate's (fixture hparams facts, a different fact) and mismatch the gate binaries' tolerance helpers — not duplicates. Dryer down, so the Grep stands alone.
Complexity: crapper down; by hand the commits only lower it (six op bodies per family became one-line delegations); no changed function grew.
Silent failure: no new default, clamp or swallowed error; the moved mismatch still refuses by name with each family's WHAT.
Tests: these commits change none; round 1's .mutants/ result stands and the body's real-tier gates at this head are green.
Gates: no PIN moved, no gate file touched.
Escape catalog: C1–C4 are shell patterns; no shell changed — none matched.

Notes

Dryer and crapper did not run (module import errors, diagnostics.md); the duplicate and complexity checks above are the manual pass.
The body's card runs carry both hashes and gate output but not the nvidia-smi line or the model file of CONTRIBUTING's list.

Card check: needs-gpu. This pull request changes crates/gpu/src/arch/hybrid.rs, crates/gpu/src/arch/nemotron_h/program.rs, crates/gpu/src/arch/nemotron_h/step.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 4ffb965 into main Nov 12, 2026
7 checks passed
@midagedev
midagedev deleted the seams branch November 12, 2026 01:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dgx-spark The DGX Spark (aarch64, GB10) port 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 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