Repository navigation
Support Nemotron-H Omni wrappers (Nemotron 3.5 Super VL, Bolt 74B-A9B) in plain AutoRound calls - #2512
Conversation
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]>
This comment has been minimized.
This comment has been minimized.
|
@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 |
…l (Bolt 74B-A9B) Signed-off-by: SergiioB <[email protected]>
Signed-off-by: SergiioB <[email protected]>
9cb27c9 to
0445026
Compare
Signed-off-by: SergiioB <[email protected]>
|
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. |
|
/azp run Unit-Test-CUDA-AutoRound |
|
Azure Pipelines successfully started running 1 pipeline(s). |
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]>
|
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? |
|
/azp run Unit-Test-CUDA-AutoRound |
|
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]>
|
Thanks. I narrowed the PR (3c0d58b): plain Comparison of main (08d7085) and this PR on CPU. Both use the same call,
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 A real Bolt 74B W4A16 export on an Arc Pro B70, with vLLM accuracy and speed, will follow. |
|
/azp run Unit-Test-CUDA-AutoRound |
|
Commenter does not have sufficient privileges for PR 2512 in repo intel/auto-round |
wenhuach21
left a comment
There was a problem hiding this comment.
Thanks for the detailed report, really appreciate this pr!
|
/azp run Unit-Test-CUDA-AutoRound |
|
Azure Pipelines successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
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
The function acceptssplitbut currently ignores it and always loadssplit=\"train\"with… · New The function acceptssplitbut currently ignores it and always loadssplit=\"train\"with… · Newnormalize_item()unconditionally setsfixed_by_user = True, so these injected predefined… · Newget_checkpoint_conversion_mapping()returning an empty list is not the same as “native mapping… · New Settinggroup_sizeon the class (module.__class__.group_size = ...) is a global side effect… · New This runs inside_is_truly_missing()for every source tensor name; for non-Omni names it now… · New This runs inside_is_truly_missing()for every source tensor name; for non-Omni names it now… · New This runs inside_is_truly_missing()for every source tensor name; for non-Omni names it now… · New In the first (single-transform) loop you log the exception at debug level, but in this second… · New
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_omniload-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.
- 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]>
|
/azp run Unit-Test-CUDA-AutoRound |
|
Azure Pipelines successfully started running 1 pipeline(s). |


What
Makes a plain
AutoRound(...)call work for NVIDIA's Nemotron-H Omni wrapper checkpoints (nemotron_h_omni, remote codeNemotronH_Omni_Reasoning_V3): Nemotron 3.5 Super VL (nativenemotron_hLM) and Nemotron 3.5 Bolt 74B-A9B (remotenemotron_h_puzzleLM). Only the language model is quantized.Plain
nemotron_htext 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_omniunless noted)auto_round/modeling/nemotron_h_omni.py:language_model.backbone.->language_model.model.rename (in the registry for the disk-stream skeleton, and as a rootkey_mappingfor a full load);A_log/D/dt_bias/router bias, plus the gated-normgroup_size.special_model_handler.get_predefined_layer_config: BF16mixer.out_projscales fornemotron_h_omnionly.calib_dataset: optionalnemotron-pretrainingcalibration 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._experts_implementationon their own nested config;attn.proj;Validation (CPU)
test/unit/common/models414 passed, 5 skipped.AI-assisted implementation (disclosed); every line reviewed and owned by the signer.