Skip to content

model-hf: the Nemotron-H ModelOpt folder map (Lightning-30B-A3B NVFP4) - #921

Merged
midagedev merged 2 commits into
mainfrom
nvhr1
Oct 28, 2026
Merged

midagedev merged 2 commits into
mainfrom
nvhr1

Conversation

@midagedev

Copy link
Copy Markdown
Owner

nvidia's Nemotron 3.5 Lightning-30B-A3B NVFP4 folder (ModelOpt, safetensors) maps onto the GGUF twin's names and dims, so the existing Nemotron-H MoE engine can read it once the body sites (next PR) admit its NVFP4 dense and FP8 tensors.

  • crates/model-hf/src/arch/nemotron_h.rs: impl FolderMap. NVFP4 routed experts become plane stacks, FP8_B128 mamba projections keep their role, router and bias stay F32, and MTP and KV-cache scales are skipped by name.
  • Refused by name: the wrapper configs (Super, Nano-VL; a later round), the puzzle inner model, dense or latent configs, unknown keys and mixers, and an expert stack other than 0..128.
  • Fixtures: the real shard headers of layers 0, 1 and 5 with the head, the UD-Q4_K_XL twin's header, and the folder's config.json and hf_quant_config.json.

Proof: just gate-model-hf on the box, 98 passed. Swapping in_proj/out_proj, the conv squeeze or the norm reshape each turns three map tests red. The fixture-tier landing batch: 10 items, 0 red, 6 deferred by name.

This was written with AI help (Claude) and reviewed by the maintainer's lead session.

🤖 Generated with Claude Code

`impl FolderMap` for nemotron_h reads nvidia's Lightning NVFP4 folder into the GGUF twin's names and dims: NVFP4
routed experts as stacks of planes, FP8_B128 mamba projections, F32 router and bias, MTP and the KV-cache scales
skipped by name. The wrapper configs (Super, Nano-VL), the puzzle inner model, dense configs, latent MoE, unknown
keys and mixers, and an expert stack other than 0..128 are refused by name. Fixtures: the real shard headers of
layers 0, 1 and 5 with the head, the UD-Q4_K_XL twin's header, and the folder's config and hf_quant_config.
FAIL-first on the box: swapping in_proj/out_proj, the conv squeeze or the norm reshape each turns three map tests red.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions github-actions Bot added the model The CPU engine and model files: crates/model, models, hf, gguf, tokenizer, jinja label Oct 28, 2026
github-actions[bot]
github-actions Bot previously approved these changes Oct 28, 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: no failure path survived; the map refuses every bad input I built by name, and the twin-header test pins names, dims, types, sources and keys.

Non-blocking

⚠ The map is not in MAPS: arch/mod.rs:25. MODEL_TYPES and the two wrapper names are not reachable from folder::open yet, so a Lightning folder is still refused as an unknown model_type. The PR body says "body sites (next PR)" but not that the registration is also deferred. Say so, or add the row.

Checked

  • Duplicates: about 30 new items checked by Grep. The dryer pair mover (nemotron_h.rs:1028, minimaxm3.rs:668) was read: two short copies, and a shared helper adds a name, so no finding. neg_exp, module_class, Section and trunk::sized are reused, not copied. flag has no existing owner.
  • Complexity (crapper): Checkpoint::item (30) and Part::of (27) are even growth, one arm a tensor name. Checkpoint::read (23) is a straight list of config reads and checks. Checkpoint::map (18) is one loop with a skip, a one, an expert and a duplicate-id arm. No split needed.
  • Silent failure: 14 sites followed (parse().ok()? in Part::of and item, is_some_and on moe_latent_size, get(l).copied(), the Kind and Layer matches, the rope_dims filter, counts via Section::count which refuses zero). Each ends in a named refusal. No default is taken. Zero divisors (groups) cannot reach expected() because count is positive.
  • Tests: the twin test checks the sources and the steps of every tensor. Mutants: the in_proj and out_proj swap fails the dims or the sources check. A dropped NegExp fails m.steps. A flipped Origin::File(F32) on the router fails m.origin. The counts in the test comments (401, 93, 282) match their derivations [derived].
  • Gates: none moved. No PIN needed.
  • Escape catalog: no shell or script change; C1 to C4 do not apply.

Notes

  • gpu.json evidence is false: the PR body says just gate-model-hf passed (98) but has no nvidia-smi line, commit hashes or command output. This crate does not need a card.
  • dryer ran and crapper ran (complexity only).

🔨 Shingler, bloomery's review bot: approves a clean pull request and requests changes on a must-fix (how it works)

@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 new commit only moves one inline map type into a Stacks alias; behavior is unchanged.

Since the last review

  • ⚠ (non-blocking) The map is not in MAPS: still open. arch/mod.rs:25 lists no nemotron_h::Checkpoint, and the PR body still says only "body sites (next PR)". A Lightning folder is refused as an unknown model_type until a row is added. Say in the body that the registration is also deferred, or add the row.

Checked

  • Duplicates: 1 new item checked (Stacks). It replaces the one inline type at nemotron_h.rs:961; no other Stacks or same-shaped alias in crates/model-hf. The earlier dryer pair (mover) was read in the last review: no finding.
  • Complexity (crapper): the flagged functions are the same as in the last review. Checkpoint::map is unchanged in complexity (a type annotation moved). No new growth.
  • Silent failure: no new sites. The lifetime 'a on the alias matches the map<'a> signature, so the borrow of the tensor names is the same as before.
  • Tests: no test change; no new test needed for a type alias.
  • Gates: none moved.
  • Escape catalog: no shell or script change; C1 to C4 do not apply.

Notes

  • gpu.json evidence is false: the PR body has no nvidia-smi line, commit hashes or command output. This crate does not need a card.
  • dryer ran and crapper ran (complexity only).

🔨 Shingler, bloomery's review bot: approves a clean pull request and requests changes on a must-fix (how it works)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

model The CPU engine and model files: crates/model, models, hf, gguf, tokenizer, jinja

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant