Skip to content

model-hf: ModelOpt's Qwen3.8-27B NVFP4 folder maps to the dense qwen35 file - #941

Merged
midagedev merged 1 commit into
mainfrom
q38nvmap
Oct 28, 2026
Merged

midagedev merged 1 commit into
mainfrom
q38nvmap

Conversation

@midagedev

Copy link
Copy Markdown
Owner

What and why

ModelOpt's nvidia/Qwen3.8-27B-NVFP4 checkpoint folder now maps to the dense qwen35 file layout. This is the first
step to running that folder on the card. Body support follows in later PRs. The folder's config names the same class as
the dense MLX folder, so the map picks the new family by quantization_config.quant_method == "modelopt".

Release notes: internal — the host-side map for a model the card cannot run yet.

  • Family::Qwen35Hf reads transformers' names, the gammas without the +1, and conv taps [c,1,k]. One hf()
    method owns those facts for Qwen3.8 and this family.
  • FP8 attention and delta-rule projections convert to Q8_0 at load (Use::Q8_0). The NVFP4 feed-forward blocks and
    the head stay NVFP4.
  • The dense next-token layer is left out by the names of its 15 tensors. Any other mtp. name is refused by name.
  • Header fixture: nvidia/Qwen3.8-27B-NVFP4 @ 482ca0f3, layers 0 and 3 plus the globals, cut by HTTP Range. The real
    FP8 scales are F32 scalars, which Format::Fp8Tensor already reads.

Code shape

  • No second copy. trunk::DTYPE is one row now; the name, gamma and tap facts have one owner (hf()).
  • Model code holds only architecture facts.
  • Dead code is gone.
  • No silent failure. Unknown keys, tensors and mtp. names are refused by name.
  • Comments state what is true now.
  • No relaxed gate.
  • cargo fmt and cargo clippy clean; lint count unchanged.

Duplication found or removed (path:line): the dtype root row (trunk.rs), once per family before.

What I ran

cargo test -p bloomery-model-hf --lib          test result: ok. 113 passed; 0 failed; 3 ignored
FAIL-first: Family::of's `if modelopt` → `if false`: 5 hf_dense tests FAILED (restored)
tools/gate-batch.sh --tier fixture --ledger     DONE total=10 red=0 (just affected origin/main)
just remote-static origin/main                  remote rc 0

🤖 Generated with Claude Code

…5 file

Family::Qwen35Hf is the dense Qwen3.5 class as ModelOpt exports it, picked by the config's
quantization_config.quant_method. It reads transformers' names, gammas without the +1 and conv
taps [c,1,k] (one hf() owner of those facts, shared with Qwen3.8); FP8 attention and delta-rule
projections convert to Q8_0 at load, the NVFP4 feed-forward blocks and head stay NVFP4. The dense
next-token layer is left out by the name of each of its 15 tensors; any other mtp. name is refused.
The header fixture is nvidia/Qwen3.8-27B-NVFP4 @ 482ca0f3 layers 0 and 3 plus the globals.

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 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 new family only adds a map for a folder that was refused before, and the existing families map as they did.

Checked

  • Duplicates: about 14 new items checked (Family::hf, projection, next_token, dense_next_token, DTYPE, LANGUAGE_MODEL_ONLY, IMAGE_TOKEN_UNREAD, ROOT_HF_DENSE, the made and projection closures). None duplicated. nemotron_h.rs:61 and minimaxm3.rs:41 still hold their own copy of the dtype text; that code is outside the diff.
  • dryer: 4 pairs, all in text, lm_head and vision. Each is the same if self.hf() { a } else { b } shape over different strings, so they are not the same knowledge. No finding.
  • crapper: map 75 → 78. The growth is one else if for the error text and one branch for the output norm's +1. Harmless. layer has the same kind of growth.
  • Silent failure: 6 sites followed (Family::of with a non-string or missing quant_method; dense_next_token with an unknown mtp. name; the draft refusal; Use::Q8_0 on a format with no source type, type_of returns None; the conv tap shape; the output norm). Each ends in a named refusal or in the old behavior. A ModelOpt Qwen3.6 or text-only folder stays on its MLX family and is refused by tensor name.
  • Regression check: mlx() → hf(), exp → hf in plus_one and the taps, and mlx && → !exp && on the block norms select the same families as before for Qwen3.8, Qwen3.6 and the MLX dense ones.
  • Tests: mutants checked in words. if modelopt → false (the PR's own FAIL-first, 5 tests red). The output norm's PlusOne dropped turns red at output_norm.weight (test lines 406-409). Squeeze and hf swapped in the taps are caught by the tap-shape refusal row. dense_next_token's .contains dropped for true is caught by mtp.zzz.weight and mtp.fc.bias.
  • Gates: no pin moved, no test removed.
  • Escape catalog: no match (no shell code in the diff).

Notes

  • The PR body has no nvidia-smi line. The change is a host-side map and needs no card.

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

@midagedev
midagedev merged commit fdc0cca into main Oct 28, 2026
7 checks passed
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