Skip to content

Support Nemotron-H Omni wrappers (Nemotron 3.5 Super VL, Bolt 74B-A9B) in plain AutoRound calls - #2512

Merged
wenhuach21 merged 7 commits into
intel:mainfrom
SergiioB:nemotron-h-port
Oct 17, 2026
Merged

wenhuach21 merged 7 commits into
intel:mainfrom
SergiioB:nemotron-h-port

Conversation

@SergiioB

@SergiioB SergiioB commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

What

Makes a plain AutoRound(...) call work for NVIDIA's Nemotron-H Omni wrapper checkpoints (nemotron_h_omni, remote code NemotronH_Omni_Reasoning_V3): Nemotron 3.5 Super VL (native nemotron_h LM) and Nemotron 3.5 Bolt 74B-A9B (remote nemotron_h_puzzle LM). Only the language model is quantized.

Plain nemotron_h text models (e.g. Lightning, supported since #2303) are not changed: the quantized output is byte-identical to main on Transformers 5.12.1 and 5.20.0.

Changes (all scoped to nemotron_h_omni unless noted)

  • auto_round/modeling/nemotron_h_omni.py:
    • registers the language_model.backbone. -> language_model.model. rename (in the registry for the disk-stream skeleton, and as a root key_mapping for a full load);
    • on 5.20, builds Bolt from its remote code, because the native same-name class rejects the puzzle LM, and keeps the remote projector renames;
    • post-load FP32 restore of A_log/D/dt_bias/router bias, plus the gated-norm group_size.
  • special_model_handler.get_predefined_layer_config: BF16 mixer.out_proj scales for nemotron_h_omni only.
  • calib_dataset: optional nemotron-pretraining calibration set (nvidia/Nemotron-Pretraining-Dataset-sample).
  • missing_tensors: the nested-trunk alias, so that quantized LM blocks are not re-copied in BF16.
  • context/model.py: the multimodal disk-stream path keeps the meta skeleton if the processor fails to load, and skips the mixed-meta guard for the skeleton.
  • Generic fixes needed by these models:
    • unfused experts set _experts_implementation on their own nested config;
    • the disk-stream name resolver can combine a family's renames, e.g. RADIO attn.proj;
    • export passes the scale dtype to QuantLinear.

Validation (CPU)

  • Tiny random checkpoints use the real configs' key naming. The comparison against main and the commands are in the PR comment.
  • Unit tests:
    • Transformers 5.20.0: 214 passed (Nemotron / disk-stream / missing-tensor / export set); test/unit/common/models 414 passed, 5 skipped.
    • Transformers 5.12.1: 135 passed.

AI-assisted implementation (disclosed); every line reviewed and owned by the signer.

Register LinearNemotronHMoE with correct expert sizing on
moe_latent_size (up/down [2688, 1024], no gate, relu2 FFN), an omni
wrapper entry that quantizes only the language model (vision tower,
projector, embeddings, lm_head, norms, routers, MTP stay high
precision), nested-config source-key routing, and the post-load fixups
needed for the 88-layer hybrid (mamba/moe/attention) checkpoints of
Nemotron 3.5 Bolt 74B-A9B and Super VL 120B-A12B.

Validated end-to-end on Intel Arc Pro B70 (SYCL): tiny-checkpoint
smoke export (auto_gptq packing) plus a key-mapping check against the
43,079-tensor Super VL index (41,973 matched; remainder intentional).

AI-assisted implementation (disclosed); all changes reviewed and owned
by the signer.

Signed-off-by: Sergio Barrientos <[email protected]>
Signed-off-by: SergiioB <[email protected]>
@AutoRoundBot

This comment has been minimized.

@wenhuach21

Copy link
Copy Markdown
Contributor

@SergiioB, one unit test failed. Could you take a look? Also, could you check compatibility with the latest Transformers version? 5.12 is a little old

@SergiioB

Copy link
Copy Markdown
Contributor Author

Fixed and pushed in 0325873 (also includes the Bolt post-load fix a5ea56e).

Both Azure failures (77964 and XPU 77967 part_common) were the same stale assertion: Nemotron preserves upstream backbone-to-model renames, rather than returning an empty list. The test now independently checks the exact filtered upstream list followed by AutoRound rules; other entries keep the old exact assertion.

Checked Transformers 5.20.0 on CPU. Fixed its new router tuple API and the native/remote omni class-name mapping collision. An unfixed Super VL tiny checkpoint really left all 3 projector weights missing; the corrected load has no missing/unexpected/mismatched keys. Native text (32 tensors), Super VL remote code (58), and Bolt remote code (58) forward and reload every tensor exactly using tiny configs derived from the released configs. Bolt's remote code needs a CPU-compatible RMSNorm dependency; that local prerequisite is not vendored here. Also included tested disk-stream/meta and nested LM alias fixes to avoid copying quantized weights back as BF16. No minimum-version increase: the same loading probes work on 5.12.1.

Tests: 5.20 relevant mapping/unfused-MoE/disk-stream/export suite: 188 passed. Model directory CPU run: 403 passed, 5 skipped, 5 deselected (oversized unrelated GPT-OSS/Llama4/Qwen3-VL quantization cases excluded; the lightweight Llama4 registration case passed separately). The earlier unfiltered run completed both GPT-OSS cases before being stopped at the large Llama4 fixture. 5.12.1 focused export/mapping suite: 83 passed. All changed-file pre-commit hooks passed.

AI assistance was used for implementation and investigation; changes are owned by the DCO signer.

@AutoRoundBot

Copy link
Copy Markdown
Collaborator

/azp run Unit-Test-CUDA-AutoRound

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

Comment thread README.md Resolved
Address review: the BF16 Mamba out_proj scale default now lives in
special_model_handler.get_predefined_layer_config, scoped to nemotron_h,
nemotron_h_omni and nemotron_h_puzzle; other models keep the caller's
scale_dtype. Drop the default_layer_config_patterns_fn registry hook and
the README news entries.

Signed-off-by: SergiioB <[email protected]>
@wenhuach21

Copy link
Copy Markdown
Contributor

Thanks for the fix. As mentioned in [PR #2303](#2303), Nemotron-H is already supported, and its quantization cost has been documented [here](https://github.com/intel/auto-round/blob/main/docs/moe.md).

Could you share the performance difference with and without your PR?

@AutoRoundBot

Copy link
Copy Markdown
Collaborator

/azp run Unit-Test-CUDA-AutoRound

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

Plain nemotron_h text models (e.g. Nemotron 3.5 Lightning) now take main's
fused-MoE path unchanged; their quantized output is byte-identical to main.
Drop the unfused LinearNemotronHMoE, its MODEL_CONFIG entries and the
conversion-mapping overrides: the multimodal load path used by the Omni
wrappers never applied them.

A plain AutoRound(...) call now works for nemotron_h_omni checkpoints
(Super VL with a native nemotron_h LM, Bolt with the remote
nemotron_h_puzzle LM) on Transformers 5.12 and 5.20:
- register the language_model.backbone -> language_model.model rename
  (registry for the disk-stream skeleton, root key_mapping for a full load)
- on 5.20, build Bolt from its remote code and keep the remote projector
  renames instead of the native same-name class mapping
- unfused experts dispatch on their own nested text config
- the disk-stream resolver applies a family's renames in combination
  (RADIO attn.proj -> attention.output.dense)
- FP32 restore of A_log/D/dt_bias/router bias, BF16 out_proj scales and
  the nested-trunk missing-tensor alias are limited to nemotron_h_omni

Signed-off-by: SergiioB <[email protected]>
@SergiioB

Copy link
Copy Markdown
Contributor Author

Thanks. I narrowed the PR (3c0d58b): plain nemotron_h now goes through #2303's path unchanged. The PR only adds support for the Omni wrappers (Super VL, Bolt).

Comparison of main (08d7085) and this PR on CPU. Both use the same call, AutoRound(path, scheme="W4A16", group_size=128, iters=20, nsamples=8, seqlen=128) plus quantize_and_save, on tiny random checkpoints built from the released configs:

case main this PR
Lightning (nemotron_h text), TF 5.12 / 5.20 ok output byte-identical to main (same fused-MoE meta-skeleton path; 3-run median wall time 17.2 s vs 17.7 s)
Super VL (nemotron_h_omni + native LM), TF 5.20 ok ok, same 68 quantized layers; adds BF16 out_proj scales and FP32 SSM/router tensors
Super VL, TF 5.12 fails (hidden_states arg mismatch / no data has been cached) ok, 68 layers, vision/projector 36/36 equal to source
Bolt (nemotron_h_omni + remote nemotron_h_puzzle), TF 5.12, disk-stream fails (no data has been cached) ok, 90/109 layers, same set as our B70 runner
Bolt, TF 5.12, full load LM missing at load (118 keys), so the export falls back to RTN copies (+302 extra tensors) LM loaded and tuned, nothing re-copied
Bolt, TF 5.20 fails at load (Unrecognized model type for subconfig: nemotron_h_puzzle) ok, 92 layers
Bolt, TF 5.12, with a manual language_model.backbone rename ok, but all 92 quantized layers are also re-copied in BF16 (+28% size) no BF16 re-copies

What the PR adds for Lightning: nothing. It is a no-op there.

Pre-existing on main and unchanged here: on TF 5.20 with low_cpu_mem_usage=True, the RADIO vision attn.qkv tensors are saved with shape [64, 64] instead of [192, 64].

A real Bolt 74B W4A16 export on an Arc Pro B70, with vLLM accuracy and speed, will follow.

@SergiioB

Copy link
Copy Markdown
Contributor Author

/azp run Unit-Test-CUDA-AutoRound

@SergiioB SergiioB changed the title Add nemotron_h / nemotron_h_omni unfused-MoE support (Nemotron 3.5 Bolt 74B-A9B, Super VL 120B-A12B) Support Nemotron-H Omni wrappers (Nemotron 3.5 Super VL, Bolt 74B-A9B) in plain AutoRound calls Oct 16, 2026
@azure-pipelines

Copy link
Copy Markdown
Commenter does not have sufficient privileges for PR 2512 in repo intel/auto-round

@wenhuach21
wenhuach21 self-requested a review October 16, 2026 08:51

@wenhuach21 wenhuach21 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.

Thanks for the detailed report, really appreciate this pr!

@wenhuach21
wenhuach21 requested a lite review from Copilot October 16, 2026 11:30
@wenhuach21

Copy link
Copy Markdown
Contributor

/azp run Unit-Test-CUDA-AutoRound

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

Copilot AI 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.

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Copilot review overview

9 open findings
What changed in this PR

Adds load/stream/quantization support for NVIDIA Nemotron-H Omni wrapper checkpoints so plain AutoRound(...) works (quantizing only the language model), while keeping behavior unchanged for plain nemotron_h text models.

Changes:

  • Introduces nemotron_h_omni load-time hooks: checkpoint renames, remote-class preference, and post-load FP32 restoration for sensitive tensors.
  • Extends disk-stream name resolution and missing-tensor detection to account for wrapper-specific naming/renames.
  • Improves export/packing to preserve per-layer scale dtypes and adds Nemotron pretraining calibration dataset option, with new regression/unit tests.
File Description
test/​unit/​common/​utils/​test_missing_tensors.py Adds regression test ensuring Omni nested-trunk alias prevents re-copying quantized LM blocks.
test/​unit/​common/​utils/​test_layer_config_resolver.py Adds tests validating nemotron_h_omni-only scale dtype defaults and explicit override behavior.
test/​unit/​common/​models/​test_nemotron_h.py Adds CPU regressions for Omni mapping registration, disk-stream rename chaining, post-load FP32 restore, and meta-skeleton behavior.
auto_round_extension/​torch/​qlinear_torch_zp.py Adds scale_dtype plumbing so packed scales dtype can match exported metadata.
auto_round_extension/​torch/​qlinear_torch.py Same scale_dtype support for the torch backend QuantLinear.
auto_round/​utils/​model.py Wires Omni mapping registration, remote-class preference, and root key-mapping into MLLM load path.
auto_round/​utils/​missing_tensors.py Adds Omni nested-trunk name aliasing when checking whether tensors are “missing”.
auto_round/​utils/​disk_stream_util.py Allows chaining multiple family renames when resolving checkpoint tensor names; registers Omni mappings for meta builds.
auto_round/​special_model_handler.py Adds predefined layer_config defaults for nemotron_h_omni (BF16 scales for mixer.out_proj).
auto_round/​modeling/​nemotron_h_omni.py New module implementing Omni-specific mapping registration, remote-class preference, and post-load FP32 restoration + group_size patch.
auto_round/​modeling/​fused_moe/​moe_experts_interface.py Ensures _experts_implementation is set on nested expert configs in multimodal wrappers.
auto_round/​export/​export_to_autoround/​qlinear_triton_act.py Adds scale_dtype to exported triton QuantLinear to preserve scale dtype.
auto_round/​export/​export_to_autoround/​export.py Detects whether QuantLinear accepts scale_dtype and forwards scale tensor dtype when packing.
auto_round/​context/​model.py Keeps meta skeleton when processor load fails; skips mixed-meta guard for disk-stream skeleton; applies Omni post-load fixups.
auto_round/​compressors/​layer_config_resolver.py Merges model-type predefined layer_config defaults into user layer_config before normalization.
auto_round/​calib_dataset.py Registers optional nemotron-pretraining calibration dataset loader.

🧠 Review effort: Lite


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread auto_round/calib_dataset.py Resolved
Comment thread auto_round/calib_dataset.py Resolved
Comment thread auto_round/modeling/nemotron_h_omni.py Resolved
Comment thread auto_round/modeling/nemotron_h_omni.py Resolved
Comment thread auto_round/utils/missing_tensors.py Resolved
Comment thread auto_round/utils/missing_tensors.py Resolved
Comment thread auto_round/utils/missing_tensors.py Resolved
Comment thread auto_round/utils/disk_stream_util.py Resolved
- nemotron-pretraining calibration set honors `split` (default train)
- predefined layer_config defaults are not marked fixed_by_user
- set the gated-norm group_size on instances only, not on the class
- missing-tensor check keeps main's per-name logic; the Omni trunk alias
  is only built for language_model.backbone.* names
- log failures in the chained disk-stream rename at debug level

Signed-off-by: SergiioB <[email protected]>
@AutoRoundBot

Copy link
Copy Markdown
Collaborator

/azp run Unit-Test-CUDA-AutoRound

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@wenhuach21
wenhuach21 merged commit ec10a64 into intel:main Oct 17, 2026
47 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants