Skip to content

[Nemotron 3.5 Super VL] Update the NemotronH NVFP4 PTQ recipe to the Nemotron 3.5 Super VL checkpoint - #2819

Merged
juhi10071998 merged 1 commit into
mainfrom
nemotron_3_5_super_naming
Oct 15, 2026
Merged

juhi10071998 merged 1 commit into
mainfrom
nemotron_3_5_super_naming

Conversation

@juhi10071998

@juhi10071998 juhi10071998 commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do?

Type of change: Refactor + docs. No behavior change.

Moves the NemotronH aggressive-mse NVFP4 PTQ recipe from the architecture tier to the checkpoint
tier, under the name the model is actually released as:

modelopt_recipes/model_type/nemotron_h/ptq/nvfp4-aggressive-mse.yaml
  -> modelopt_recipes/models/nvidia/NVIDIA-Nemotron-3.5-Super-VL-120B-A12B-BF16/ptq/nvfp4-mse.yaml

Why the checkpoint tier. The recipe was written against, and only ever validated on, one
checkpoint: nvidia/NVIDIA-Nemotron-3.5-Super-VL-120B-A12B-BF16. Under models/<org>/<model_id>/
the folder path is the hub path, so the entry states which checkpoint it reproduces instead of
implying it is the recommended setting for every NemotronH hybrid. It also matches the existing
NVIDIA-Nemotron-3-Super-120B-A12B-BF16/ptq/nvfp4-mse precedent. This is a move, not an alias —
one name, so nobody has to work out which of two paths to use.

Scope of the claim. The recipe reproduces the released precision assignment, not the released
weights. The published nvidia/NVIDIA-Nemotron-3.5-Super-VL-120B-A12B-NVFP4 is refined by
quantization-aware distillation after this stage, which no PTQ recipe performs. The header,
metadata.description, ptq.md and the changelog all say so explicitly. Flagging it because
models/README.md says a release is backfilled only when its model card describes a PTQ recipe —
this entry is the PTQ stage of that pipeline rather than a claim to reproduce the artefact, and
I am happy to move it back or reword further if reviewers read that rule more strictly.

The 43 quant_cfg rules are unchanged. Only the path, the header comments and
metadata.description differ, plus # modelopt-schema: modelopt.recipe.config.ModelOptPTQRecipe
replacing the deprecated metadata.recipe_type: ptq.

Also updated: modelopt_recipes/ptq.md (the architecture-tier entry is folded into a
checkpoint-tier entry carrying its full detail), the NemotronH-Omni-W4A4-QAD tutorial README,
which now selects the new path, and CHANGELOG.rst.

One consequence worth a reviewer's opinion: model_type/nemotron_h/ no longer exists, so other
NemotronH hybrids fall back to general/. That was already the situation before #2703 landed, and
nothing shipped in between — the recipe is absent from every released tag (0.48.0rc0, 0.47.0,
0.47.0rc2, 0.47.0rc1, 0.46.1), since it merged after the rc0 cut. No published wheel contains the
old path, and all references to it were in-repo and are updated here. If you would rather keep an
architecture-tier recipe for the family, say so and I will restore one that is genuinely generic.

Usage

python examples/hf_ptq/hf_ptq.py \
  --pyt_ckpt_path  <NVIDIA-Nemotron-3.5-Super-VL-120B-A12B-BF16> \
  --recipe         models/nvidia/NVIDIA-Nemotron-3.5-Super-VL-120B-A12B-BF16/ptq/nvfp4-mse \
  --calib_with_images --calib_size 32 --batch_size 1 \
  --trust_remote_code \
  --use_seq_device_map --gpu_max_mem_percentage 0.5 \
  --export_path    <quantized-checkpoint>

The runtime notes from #2703 still apply: --use_seq_device_map and --gpu_max_mem_percentage 0.5
are both required for a ~232 GiB checkpoint on 4x184 GiB, and --calib_with_images matters on VL
checkpoints because the vision tower must see image batches even though it stays BF16.

Testing

Run on 1 node x 4 x 184 GiB, transformers 5.13.0 / torch 2.12.0a0, against this branch rebased onto
de53aca3a.

tests/unit/recipe/test_nemotron_3_5_super_vl_recipe.py 11 passed
tests/examples/hf_ptq/test_nemotron_vl_calib.py 11 passed
full tests/unit/recipe/ suite 505 passed
tools/precommit/check_modelopt_recipes.py exits 0
end-to-end hf_ptq, --calib_size 32 rc=0, 28:22, 0 tracebacks

Because the quantization rules are unchanged, the meaningful check is byte-level rather than a
benchmark. Two exports were produced on the same base commit, differing only in which recipe
they were pointed at:

  • A — this branch, models/nvidia/NVIDIA-Nemotron-3.5-Super-VL-120B-A12B-BF16/ptq/nvfp4-mse
  • B — plain origin/main at de53aca3a, model_type/nemotron_h/ptq/nvfp4-aggressive-mse

Holding the base fixed matters: de53aca3a itself touches quant_aware_conversion.py, so a
comparison against an older export would have conflated that fix with this rename. Both arms were
verified to carry the identical quant_aware_conversion.py (24aa840e46…).

A vs B
shards 8/8 byte-identical (md5)
quantizers inserted 43,917 on both arms
tensors 169,569, 0 duplicates, delta 0
NVFP4 scales 42,179
MTP tensors 4,120
vision tensors 457, all BF16
KV scales 1 k_scale + 1 v_scale, both MTP, none on the backbone
source names preserved verbatim 43,079 / 43,079 on both arms
size 69.86 GiB

So the moved recipe selects the same 43,917 quantizers through the checkpoint tier that the
pre-move recipe selects through the architecture tier, and the resulting checkpoint is identical
byte for byte.

Byte-identity is the right test here and GSM8K is not: two runs over byte-identical artefacts of
this checkpoint differed by ~1.1 pp, so no single benchmark number could have resolved a change
this small.

The run also confirms the moved path resolves at runtime rather than falling back:

[load_recipe] loading: <builtin>/models/nvidia/NVIDIA-Nemotron-3.5-Super-VL-120B-A12B-BF16/ptq/nvfp4-mse.yaml
Inserted 43917 quantizers

Before your PR is "Ready for review"

  • Is this change backward compatible?: Yes. The old path never shipped in a release, so no published
    wheel exposes it, and every in-repo reference is updated here.
  • If you copied code from other sources or added a new PIP dependency, did you follow CONTRIBUTING.md?:
    N/A; no new dependency or copied code.
  • Did you write any new necessary tests?: No new tests. tests/unit/recipe/test_nemotron_h_recipe.py
    is renamed to test_nemotron_3_5_super_vl_recipe.py to match the recipe, and its 11 cases are
    otherwise unchanged and still green.
  • Did you update Changelog?: Yes.

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: NVIDIA/Model-Optimizer/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Enterprise
  • Run ID: edf63973-404d-44b9-94fb-ccbdb5caef34
📥 Commits

Reviewing files that changed from the base of the PR and between 8fa51c4 and 789bc83.

📒 Files selected for processing: 5
  • CHANGELOG.rst
  • examples/megatron_bridge/tutorials/NemotronH-Omni-W4A4-QAD/README.md
  • modelopt_recipes/models/nvidia/NVIDIA-Nemotron-3.5-Super-VL-120B-A12B-BF16/ptq/nvfp4-mse.yaml
  • modelopt_recipes/ptq.md
  • tests/unit/recipe/test_nemotron_3_5_super_vl_recipe.py

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review.

📝 Walkthrough

The change replaces the Nemotron-H aggressive-MSE recipe references with a checkpoint-specific Nemotron 3.5 Super VL NVFP4-MSE recipe. It updates recipe metadata and documentation, the tutorial command, and the recipe test path.

Changes: Nemotron 3.5 Super VL recipe

Layer / File(s) Summary
Define the checkpoint-specific recipe
modelopt_recipes/models/nvidia/NVIDIA-Nemotron-3.5-Super-VL-120B-A12B-BF16/ptq/nvfp4-mse.yaml, modelopt_recipes/ptq.md
The recipe description now identifies the BF16 source checkpoint and distinguishes the PTQ recipe’s precision assignments from the released checkpoint’s additional quantization-aware distillation. The PTQ guide adds calibration and Megatron-Core details, and removes the Nemotron-H recipe entry and architecture-aware references.
Update recipe references and validation
examples/megatron_bridge/tutorials/NemotronH-Omni-W4A4-QAD/README.md, tests/unit/recipe/test_nemotron_3_5_super_vl_recipe.py, CHANGELOG.rst
The tutorial link and PTQ command, unit test recipe path, and changelog entry now refer to the Nemotron 3.5 Super VL recipe.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Refactor

Merge Risk: ⚪ Minimal · up to 789bc

The tutorial and test now use the checkpoint-specific recipe, with no remaining tracked references to the removed path. No actionable merge-blocking risk was identified.

Pre-merge checks: Passed 6
Passed Passed checks: 6 passed
Check name Status Explanation
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Security Anti-Patterns Passed PASS. The PR changes only recipe/docs files and renames a Python unit test while changing its recipe path string. The added Python lines introduce no torch.load, numpy.load, trust_remote_code, eval/ex…
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly describes the main change: moving the NemotronH NVFP4 PTQ recipe to the Nemotron 3.5 Super VL checkpoint-specific recipe.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.61%. Comparing base (de53aca) to head (91e7772).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2819      +/-   ##
==========================================
+ Coverage   69.45%   78.61%   +9.15%     
==========================================
  Files         653      653              
  Lines       72522    72522              
==========================================
+ Hits        50372    57011    +6639     
+ Misses      22150    15511    -6639     
Flag Coverage Δ
examples-diffusers 20.20% <ø> (-0.02%) ⬇️
examples-gpt-oss 13.54% <ø> (+0.02%) ⬆️
examples-hf_ptq 23.30% <ø> (-0.03%) ⬇️
examples-llm_distill 13.62% <ø> (+0.02%) ⬆️
examples-llm_eval 17.33% <ø> (+0.05%) ⬆️
examples-llm_qat 17.58% <ø> (-0.01%) ⬇️
examples-llm_sparsity 15.84% <ø> (+0.01%) ⬆️
examples-megatron_bridge 26.62% <ø> (-0.17%) ⬇️
examples-specdec_bench 13.31% <ø> (+0.02%) ⬆️
examples-speculative_decoding 17.57% <ø> (-0.06%) ⬇️
examples-torch_onnx 21.57% <ø> (-0.03%) ⬇️
examples-torch_trt 15.29% <ø> (+0.01%) ⬆️
examples-vllm_serve 14.96% <ø> (+0.04%) ⬆️
gpu 59.51% <ø> (+37.63%) ⬆️
unit 59.92% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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

LGTM

@juhi10071998 juhi10071998 changed the title Key the NemotronH NVFP4 PTQ recipe to the Nemotron 3.5 Super VL checkpoint [Nemotron 3.5 Super VL] Update the NemotronH NVFP4 PTQ recipe to the Nemotron 3.5 Super VL checkpoint Oct 15, 2026
The aggressive-MSE NVFP4 recipe is the PTQ stage for NVIDIA Nemotron 3.5
Super VL, but sat under `model_type/nemotron_h/` and named the model
nowhere, so nothing connected it to the release it was written for and the
QAD tutorial selected it by a path that named neither.

Move it to the released source checkpoint's model-hub path,
`models/nvidia/NVIDIA-Nemotron-3.5-Super-VL-120B-A12B-BF16/ptq/nvfp4-mse`,
and select it from there in the QAD tutorial. One recipe, one path: a
checkpoint-keyed entry alongside the architecture one would have been two
names for the same body.

The recipe has not shipped in any release -- it merged after the 0.48.0rc0
cut -- so no published `--recipe` path points at the old location and the
move needs no compatibility alias.

Scope is stated in the header, the description and ptq.md: running this
reproduces the released precision assignment, not the released weights.
The published NVFP4 checkpoint is refined by quantization-aware
distillation after this stage, which no PTQ recipe performs.

A recipe that declares no `$import` has to declare its schema, so it gains
the `# modelopt-schema:` comment and drops the deprecated
`metadata.recipe_type`.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Juhi Mittal <juhim@nvidia.com>
@juhi10071998
juhi10071998 force-pushed the nemotron_3_5_super_naming branch from 789bc83 to 91e7772 Compare October 15, 2026 17:16
@juhi10071998
juhi10071998 merged commit f0daaa2 into main Oct 15, 2026
70 of 72 checks passed
@juhi10071998
juhi10071998 deleted the nemotron_3_5_super_naming branch October 15, 2026 20:31
@github-actions

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-10-15 20:32 UTC

meenchen added a commit that referenced this pull request Oct 15, 2026
### What does this PR do?

Type of change: New feature

Adds one checkpoint-specific AutoQuantize recipe for
`nvidia/NVIDIA-Nemotron-3.5-Super-VL-120B-A12B-BF16`, following the
layout merged in #2819. The recipe lives at
`models/nvidia/NVIDIA-Nemotron-3.5-Super-VL-120B-A12B-BF16/auto_quantize/nvfp4_mse_fp8_mtp_fixed_at_4p9bits`,
alongside the checkpoint's PTQ recipe, rather than advertising these
tuning choices as defaults for all Nemotron-H models. The previous
architecture-tier path was only in this unmerged PR and is not retained
as an alias.

Gradient-based sensitivity scoring searches decoder modules and
`lm_head` over weight-MSE NVFP4, FP8, and BF16 at a 4.9-effective-bit
search budget. MTP routed/shared experts stay fixed at MSE-calibrated
NVFP4 W4A4; other MTP modules and vision/audio remain BF16. MTP KV uses
calibrated FP8 scales collected during fixed-baseline calibration and
preserved after search. Backbone KV uses fixed-range FP8 casting
(`use_constant_amax`, amax 448), without stored KV scales.

The move changes no imports, quantization rules, search settings, or
cost exclusions. Static NVFP4 is locally costed at 4.5 bits per weight,
including one FP8 scale per 16 weights. Fixed MTP and configured
non-language modules are excluded from the search cost, so the target is
not an all-parameter checkpoint-size guarantee. This generates a
mixed-precision search candidate; it does not reproduce the published
QAD-refined NVFP4 weights.

### Usage

```bash
python examples/hf_ptq/hf_ptq.py \
  --pyt_ckpt_path nvidia/NVIDIA-Nemotron-3.5-Super-VL-120B-A12B-BF16 \
  --recipe models/nvidia/NVIDIA-Nemotron-3.5-Super-VL-120B-A12B-BF16/auto_quantize/nvfp4_mse_fp8_mtp_fixed_at_4p9bits \
  --calib_size 128 \
  --use_seq_device_map \
  --export_path <quantized-checkpoint>
```

Review the checkpoint's modeling code before adding
`--trust_remote_code` if required. The example AutoQuantize CLI
currently rejects `--calib_with_images`; the sibling PTQ recipe's
image-calibration invocation does not apply to this CLI path.

### Testing

Rebased onto `f0daaa241`, the merge of #2819. Tested on CPU with Python
3.12.13, PyTorch 2.13.0, Transformers 5.14.0, and pytest 9.1.1:

```bash
PYTHONPATH=. HF_HUB_OFFLINE=1 TRANSFORMERS_OFFLINE=1 python -m pytest \
  tests/unit/recipe tests/unit/torch/models/test_nemotron_h_mtp.py \
  -q --disable-warnings --tb=short
PYTHONPATH=. HF_HUB_OFFLINE=1 TRANSFORMERS_OFFLINE=1 python -m pytest \
  tests/unit/torch/quantization/test_autoquant.py \
  -k fixed_ptq_baseline -q --disable-warnings --tb=short
```

Results: **605 passed** in 15.97 seconds, plus **6 passed** in 7.91
seconds. This includes all eight moved AutoQuantize cases, the eleven
upstream checkpoint-specific PTQ cases, and the MTP suite. AutoQuantize
regressions cover resolved search/fixed groups, NVFP4 costs,
routed/shared-expert formats, calibrated MTP KV collection and exported
scales, and backbone KV casting without scales.

A semantic comparison against the previously published recipe confirms
that every non-metadata YAML field is unchanged. The new checkpoint path
loads as `ModelOptAutoQuantizeRecipe` using its schema comment, without
deprecated `metadata.recipe_type`. Changed-file pre-commit checks
passed; the environment-creating recipe hook was skipped and its actual
`tools/precommit/check_modelopt_recipes.py` validator passed separately
in the dependency-equipped environment. Staged credential audit and diff
checks passed.

No production-model GPU E2E, accuracy, or speculative-acceptance test
was rerun for this path/metadata move. CPU KV tests disable NVFP4
weight/input quantizers. The GPU PTQ E2E results in #2819 are not
validation of this AutoQuantize recipe; fresh CI remains required.

### Before your PR is "*Ready for review*"

Followed the [contributor
guidelines](https://github.com/NVIDIA/Model-Optimizer/blob/main/CONTRIBUTING.md)
and [security
guidance](https://github.com/NVIDIA/Model-Optimizer/blob/main/SECURITY.md#security-coding-practices-for-contributors).
Commits are signed and include DCO sign-offs.

- Is this change backward compatible?: Yes; the architecture-tier
AutoQuantize path never merged or shipped.
- If you copied code from other sources or added a new PIP dependency,
did you follow guidance in CONTRIBUTING.md?: N/A; no new runtime
dependency or copied third-party code.
- Did you write any new necessary tests?: Yes; runtime recipe
regressions use the checkpoint-specific path.
- Did you update Changelog?: Yes.
- Did you get Claude approval on this PR?: No new approval claimed.

### Additional Information

Uses the existing AutoQuantize fixed-baseline composition and the MTP
loading/calibration/export support merged in #2581. No loader, MTP
implementation, image-calibration, or expert-parallel changes are
included. Naming and placement follow #2819, but the recipe performs a
new sensitivity-driven assignment rather than the sibling PTQ recipe's
fixed assignment.

---------

Signed-off-by: weimingc <17592131+meenchen@users.noreply.github.com>
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