Skip to content

[OMNIML-3853] Backfill checkpoint aliases for nine published NVFP4 releases - #2643

Merged
shengliangxu merged 1 commit into
mainfrom
shengliangx/backfill-2026-published-recipes
Oct 2, 2026
Merged

shengliangxu merged 1 commit into
mainfrom
shengliangx/backfill-2026-published-recipes

Conversation

@shengliangxu

@shengliangxu shengliangxu commented Oct 2, 2026 •

Copy link
Copy Markdown
Collaborator

What does this PR do?

Type of change: New recipes (checkpoint aliases)

Backfills the recipes behind nine NVFP4 checkpoints NVIDIA published in 2026, so each is reachable from its source model's hub path. Every recipe named here already exists in-tree — each entry is a thin alias that imports one wholesale, so nothing is duplicated and editing a base recipe flows through to every alias pointing at it.

The mapping came from the engineer who produced each release, not from inspecting the checkpoints:

Source model Recipe Published as
zai-org/GLM-5.1, GLM-5.2 general/ptq/nvfp4_experts_only_input_scale1-kv_fp8_cast nvidia/GLM-5.{1,2}-NVFP4
MiniMaxAI/MiniMax-M2.5 general/ptq/nvfp4_experts_only-kv_fp8_cast nvidia/MiniMax-M2.5-NVFP4
deepseek-ai/DeepSeek-V3.1, V3.2 general/ptq/nvfp4_omlp_only-kv_fp8_cast nvidia/DeepSeek-V3.{1,2}-NVFP4
Qwen/Qwen3-235B-A22B-{Instruct,Thinking}-2507 general/ptq/nvfp4_omlp_only-kv_fp8_cast matching -NVFP4 releases
Qwen/Qwen3.6-27B model_type/qwen3_5/ptq/w4a16_nvfp4_mse-fp8_attn-kv_fp8_cast nvidia/Qwen3.6-27B-NVFP4
MiniMaxAI/MiniMax-M3 model_type/minimax_m3_vl/ptq/mxfp8_nvfp4_experts nvidia/MiniMax-M3-NVFP4

Checked before recording

Each release was verified against its own published artifacts. hf_quant_config.json confirms NVFP4 (MIXED_PRECISION for Qwen3.6-27B and MiniMax-M3) with an FP8 KV cache, and every model card documents post-training quantization with no mention of quantization-aware training or distillation. That last check matters: QAD retrains the weights while leaving the quantization layout identical, so a PTQ recipe can match every module and format and still not reproduce such a release — and no structural check would catch it.

One documented deviation, noted in the recipe comment and in ptq.md: the published Qwen3.6-27B checkpoint also carries input_scale parameters on its W4A16 layers, inserted by a separate calibration pass after the evaluated checkpoint was produced. Running this recipe reproduces the W4A16 scheme that was evaluated, not those extra scales.

Usage

python examples/hf_ptq/hf_ptq.py \
    --pyt_ckpt_path zai-org/GLM-5.1 \
    --recipe models/zai-org/GLM-5.1/ptq/nvfp4_experts_only_input_scale1-kv_fp8_cast \
    --export_path <output>

Testing

  • tests/unit/recipe/ — 450 passed. All nine aliases load through load_recipe and inherit the expected algorithm (max for the general recipes, mse for Qwen3.6-27B and MiniMax-M3), matching how each was described.
  • pre-commit passes on all changed files.
  • 14 failures in the local run are pre-existing and environment-only — a broken transformer_engine .so in the dev venv; they reproduce identically on unmodified main.

Not covered: numerics. Nothing here asserts accuracy or that running a recipe reproduces a released checkpoint's weights bit-for-bit.

Not included

Releases from the same tracking list that are deliberately out of scope: five whose owner has not yet confirmed a recipe; the three DeepSeek-V4 releases, whose recipe lives in examples/deepseek/deepseek_v4 rather than a recipe file; Qwen3.8-Flash-Next, which copies PLE and MTP from a separate FP8 checkpoint and is not expressible as a recipe; the Qwen3-Next pair, which needs a recipe that does not exist yet; and a handful described loosely enough that the mapping would be inference rather than a statement from the engineer who built them.

Before your PR is "Ready for review"

  • Is this change backward compatible?: ✅ — purely additive. Nine new alias files plus a docs and changelog entry; no existing recipe path, body or API changes.
  • If you copied code from any other sources or added a new PIP dependency, did you follow guidance in CONTRIBUTING.md: ✅ — no new dependencies, no source changes.
  • Did you write any new necessary tests?: ✅ — the aliases are exercised by the shipped-recipe sweep in tests/unit/recipe/test_loader.py, which discovers every PTQ recipe from disk.
  • Did you update Changelog?: ✅
  • Did you get Claude approval on this PR?: ❌ — not yet run.

🤖 Generated with Claude Code

@copy-pr-bot

copy-pr-bot Bot commented Oct 2, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@coderabbitai

coderabbitai Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

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: 0dbd07d9-dadd-4ee3-b6ac-86cd484380e2

📥 Commits

Reviewing files that changed from the base of the PR and between e68eb44 and 43f2060.

📒 Files selected for processing (13)
  • CHANGELOG.rst
  • modelopt_recipes/models/MiniMaxAI/MiniMax-M2.5/ptq/nvfp4_experts_only-kv_fp8_cast.yaml
  • modelopt_recipes/models/MiniMaxAI/MiniMax-M3/ptq/mxfp8_nvfp4_experts.yaml
  • modelopt_recipes/models/Qwen/Qwen3-235B-A22B-Instruct-2507/ptq/nvfp4_omlp_only-kv_fp8_cast.yaml
  • modelopt_recipes/models/Qwen/Qwen3-235B-A22B-Thinking-2507/ptq/nvfp4_omlp_only-kv_fp8_cast.yaml
  • modelopt_recipes/models/Qwen/Qwen3.6-27B/ptq/w4a16_nvfp4_mse-fp8_attn-kv_fp8_cast.yaml
  • modelopt_recipes/models/deepseek-ai/DeepSeek-V3.1/ptq/nvfp4_omlp_only-kv_fp8_cast.yaml
  • modelopt_recipes/models/deepseek-ai/DeepSeek-V3.2/ptq/nvfp4_omlp_only-kv_fp8_cast.yaml
  • modelopt_recipes/models/zai-org/GLM-5.1/ptq/nvfp4_experts_only_input_scale1-kv_fp8_cast.yaml
  • modelopt_recipes/models/zai-org/GLM-5.2/ptq/nvfp4_experts_only_input_scale1-kv_fp8_cast.yaml
  • modelopt_recipes/models/zai-org/GLM-5.3-Flash-BF16/ptq/nvfp4_experts_dense_mlp-kv_fp8_cast.yaml
  • modelopt_recipes/ptq.md
  • tests/unit/recipe/test_glm_5_3_recipe.py

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


📝 Walkthrough

Walkthrough

The change adds nine checkpoint-specific NVFP4 recipe aliases that import existing recipes. It adds the aliases to the PTQ catalog and updates the GLM-5.3-Flash recipe, catalog entry, and test to use the GLM-5.3-Flash-BF16 name.

Changes

Checkpoint recipe aliases

Layer / File(s) Summary
Add model-specific recipe aliases
modelopt_recipes/models/MiniMaxAI/*/ptq/*, modelopt_recipes/models/Qwen/*/ptq/*, modelopt_recipes/models/deepseek-ai/*/ptq/*, modelopt_recipes/models/zai-org/GLM-5.1/ptq/*, modelopt_recipes/models/zai-org/GLM-5.2/ptq/*
Adds aliases for MiniMax, Qwen, DeepSeek, and GLM checkpoints. Each imports an existing general or architecture recipe and describes its quantization configuration. The Qwen3.6-27B description notes that the alias does not reproduce additional input_scale parameters.
Document checkpoint aliases
modelopt_recipes/ptq.md, CHANGELOG.rst
Adds the aliases to the PTQ catalog and records the nine checkpoint aliases in the changelog.
Update the GLM-5.3-Flash checkpoint reference
modelopt_recipes/models/zai-org/GLM-5.3-Flash-BF16/ptq/*, modelopt_recipes/ptq.md, tests/unit/recipe/test_glm_5_3_recipe.py
Updates the recipe name and catalog path to GLM-5.3-Flash-BF16. The test now targets that recipe; its wildcard-precedence scope is unchanged.

Priority: ➖ Normal

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

Change: Feature

Merge Risk: ⚪ Minimal · up to 43f20

The new aliases and renamed GLM recipe have consistent in-repository paths. No identified issue currently blocks merging.

🚥 Pre-merge checks | ✅ 6
✅ 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 pull-request diff contains no Python changes under modelopt or examples. Its only Python change is in tests/unit/recipe/test_glm_5_3_recipe.py, where the docstring and recipe path chan…
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the main change: adding checkpoint aliases for nine published NVFP4 releases.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


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

@shengliangxu
shengliangxu marked this pull request as ready for review October 2, 2026 18:05
@shengliangxu
shengliangxu requested review from a team as code owners October 2, 2026 18:05
@shengliangxu
shengliangxu requested a review from h-guo18 October 2, 2026 18:05

@cjluo-nv cjluo-nv left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bot review (claude-opus-5-5) — DM the bot to share feedback.

I'm nudging rather than approving: the nine new aliases are fine, but moving the GLM-5.3-Flash recipe breaks an existing --recipe path, and the PR asks a maintainer to decide that.

Needs action:

  • Confirm that breaking models/zai-org/GLM-5.3-Flash/... is acceptable, or drop the second commit. Its new key, -BF16, disagrees with the published card's base_model: zai-org/GLM-5.3-Flash.

No action needed:

  • Design: this adds no new system. Every file is a thin imports: + $import: base alias, the same pattern as the existing models/Qwen/Qwen3.5-397B-A17B alias. All the base recipes they point at exist under general/ptq/ and model_type/{qwen3_5,minimax_m3_vl}/ptq/.
  • Size: no core-logic lines; the diff is YAML, docs and a one-line test path change.
  • Licensing: the new headers match LICENSE_HEADER.
  • The edit to test_glm_5_3_recipe.py is justified: it only follows the renamed path, and no assertions changed. No other in-repo references to the old path remain.
  • The existing shipped-recipe sweep in tests/unit/recipe/test_loader.py loads the new aliases. The PR doesn't check numerics, and says so.

@codecov

codecov Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.92%. Comparing base (e68eb44) to head (a0135b2).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2643      +/-   ##
==========================================
+ Coverage   69.71%   78.92%   +9.21%     
==========================================
  Files         612      612              
  Lines       68391    68391              
==========================================
+ Hits        47678    53978    +6300     
+ Misses      20713    14413    -6300     
Flag Coverage Δ
examples-diffusers 21.37% <ø> (+0.02%) ⬆️
examples-gpt-oss 13.62% <ø> (+0.01%) ⬆️
examples-hf_ptq 23.22% <ø> (+0.03%) ⬆️
examples-llm_distill 13.69% <ø> (+<0.01%) ⬆️
examples-llm_eval 17.65% <ø> (+0.02%) ⬆️
examples-llm_qat 17.79% <ø> (+0.01%) ⬆️
examples-llm_sparsity 16.07% <ø> (+<0.01%) ⬆️
examples-megatron_bridge 26.92% <ø> (+0.24%) ⬆️
examples-specdec_bench 13.39% <ø> (+0.01%) ⬆️
examples-speculative_decoding 17.99% <ø> (-0.01%) ⬇️
examples-torch_onnx 21.93% <ø> (+<0.01%) ⬆️
examples-torch_trt 15.43% <ø> (+0.01%) ⬆️
examples-vllm_serve 13.87% <ø> (+0.01%) ⬆️
gpu 58.51% <ø> (+36.93%) ⬆️
unit 59.55% <ø> (+<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.

Each release's PIC named the recipe they used; all nine already exist in-tree, so
every entry here is a thin alias that imports one wholesale rather than copying a
body. Mapping, with the recipe as given by the engineer who produced the release:

  zai-org/GLM-5.1, GLM-5.2        general/ptq/nvfp4_experts_only_input_scale1-kv_fp8_cast
  MiniMaxAI/MiniMax-M2.5          general/ptq/nvfp4_experts_only-kv_fp8_cast
  deepseek-ai/DeepSeek-V3.1,V3.2  general/ptq/nvfp4_omlp_only-kv_fp8_cast
  Qwen/Qwen3-235B-A22B-{Instruct,Thinking}-2507
                                  general/ptq/nvfp4_omlp_only-kv_fp8_cast
  Qwen/Qwen3.6-27B                model_type/qwen3_5/ptq/w4a16_nvfp4_mse-fp8_attn-kv_fp8_cast
  MiniMaxAI/MiniMax-M3            model_type/minimax_m3_vl/ptq/mxfp8_nvfp4_experts

All nine releases were checked against their own artifacts before being recorded:
hf_quant_config.json confirms NVFP4 (MIXED_PRECISION for Qwen3.6-27B and
MiniMax-M3) with an FP8 KV cache, and every model card documents post-training
quantization with no mention of quantization-aware training or distillation --
which matters because QAD retrains the weights while leaving the quantization
layout identical, so no PTQ recipe would reproduce such a release.

Qwen3.6-27B carries one documented deviation: the published checkpoint also has
input_scale parameters on its W4A16 layers, inserted by a separate calibration
pass after the evaluated checkpoint was produced. The recipe reproduces the W4A16
scheme that was evaluated, not those extra scales; the recipe comment says so.

Not included, and why: five releases whose PIC has not replied yet (Qwen3.8-27B,
Qwen3.6-35B-A3B, Qwen3.5-122B-A10B, gemma-4-31B-it, Qwen3-Coder-480B-A35B); the
three DeepSeek-V4 releases, whose recipe lives in examples/deepseek/deepseek_v4
or a model card rather than a recipe file; Qwen3.8-Flash-Next, which copies PLE
and MTP from a separate FP8 checkpoint and so is not expressible as a recipe; the
Qwen3-Next pair, which needs a recipe that does not exist yet; and five releases
described loosely enough that the recipe would be my inference rather than the
PIC's statement.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Signed-off-by: Shengliang Xu <[email protected]>
@shengliangxu
shengliangxu force-pushed the shengliangx/backfill-2026-published-recipes branch from 43f2060 to a0135b2 Compare October 2, 2026 18:16
@shengliangxu shengliangxu changed the title Backfill checkpoint aliases for nine published NVFP4 releases, and re-key GLM-5.3-Flash to its BF16 source Backfill checkpoint aliases for nine published NVFP4 releases Oct 2, 2026

@cjluo-nv cjluo-nv left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bot review (bedrock-claude-opus-5-5) — DM the bot to share feedback.

Approving: the only concern from the last review is resolved. The GLM-5.3-Flash move is gone, so the PR now only adds nine thin alias files, a docs entry and a changelog entry.

No action needed.

No action needed:

  • ✔️ Resolved since the last review: the models/zai-org/GLM-5.3-Flash/... rename is no longer in the diff, and that directory is still on the branch. The test_glm_5_3_recipe.py edit is gone too.
  • Design: no new system here. Each file uses the existing imports: + $import: base alias pattern. All the base recipes these aliases point at exist under general/ptq/, model_type/qwen3_5/ptq/ and model_type/minimax_m3_vl/ptq/.
  • Size and licensing: there are no core-logic lines, only YAML and docs. The new headers are the standard NVIDIA Apache-2.0 header.
  • Tests: the existing shipped-recipe sweep in tests/unit/recipe/test_loader.py loads the new aliases. The PR does not check numerics, and says so.

@shengliangxu
shengliangxu enabled auto-merge (squash) October 2, 2026 18:48
@shengliangxu
shengliangxu merged commit 67a68f8 into main Oct 2, 2026
57 checks passed
@shengliangxu
shengliangxu deleted the shengliangx/backfill-2026-published-recipes branch October 2, 2026 19:15
@github-actions

github-actions Bot commented Oct 2, 2026

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

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

**Type of change:** Bug fix (recipe keyed to the wrong source
checkpoint)

This is a bug, not a renaming preference.
`modelopt_recipes/models/<org>/<model_id>/` is keyed by the checkpoint a
recipe is *run against*, and the quantization work behind
`nvidia/GLM-5.3-Flash-NVFP4` was always done against
`zai-org/GLM-5.3-Flash-BF16`. The entry named `zai-org/GLM-5.3-Flash`
instead — a repo that was never used here, and that could not have been,
because it is already an FP8 release:

```console
$ curl -s https://huggingface.co/zai-org/GLM-5.3-Flash/raw/main/config.json | jq .quantization_config.quant_method
"fp8"

$ curl -s https://huggingface.co/zai-org/GLM-5.3-Flash-BF16/raw/main/config.json | jq .quantization_config
null
```

The recipe produces NVFP4 by post-training quantization, so it has to
start from BF16 weights. As keyed, it pointed users at an
already-quantized checkpoint, which the recipe cannot be run against.
The entry moves to `zai-org/GLM-5.3-Flash-BF16`, the model it was always
for.

Moved with `git mv` (recorded as a 95% rename), along with the three
places that referenced the old path: the recipe's header comment and
`metadata.description`, the `ptq.md` entry, and the recipe path in
`tests/unit/recipe/test_glm_5_3_recipe.py`. Prose in `ptq.md` that
refers to the model *family* rather than a path is left alone, and the
released checkpoint keeps its own name — `nvidia/GLM-5.3-Flash-NVFP4` is
unchanged.

**On the Hub metadata.** The released checkpoint's card currently lists
`base_model` as `zai-org/GLM-5.3-Flash`. That reference is wrong too and
is being corrected on the Hub — it is not evidence against this change.
The quantization work was always done against
`zai-org/GLM-5.3-Flash-BF16`; `zai-org/GLM-5.3-Flash` was never used as
a source, and could not have been, since it is already FP8.

### Usage

```bash
python examples/hf_ptq/hf_ptq.py \
    --pyt_ckpt_path zai-org/GLM-5.3-Flash-BF16 \
    --recipe models/zai-org/GLM-5.3-Flash-BF16/ptq/nvfp4_experts_dense_mlp-kv_fp8_cast \
    --export_path <output>
```

### Testing

- `tests/unit/recipe/` — 434 passed. `test_glm_5_3_recipe.py` follows
the new path; verified separately that the new path loads (11
`quant_cfg` entries) and the old one now raises `ValueError`.
- Checked there are no remaining references to
`models/zai-org/GLM-5.3-Flash/` anywhere in the tree, including launcher
YAMLs.
- `pre-commit` passes on all three changed files.
- The 14 failures in the local run are pre-existing and environment-only
— a broken `transformer_engine` `.so` in the dev venv; they reproduce
identically on unmodified `main`.

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

- Is this change backward compatible?: ⚠️ — `--recipe
models/zai-org/GLM-5.3-Flash/ptq/nvfp4_experts_dense_mlp-kv_fp8_cast`
stops resolving and becomes `.../GLM-5.3-Flash-BF16/...`. That is the
fix: the old path named a checkpoint the recipe cannot be run against,
so anyone following it was being pointed at the wrong model.
- If you copied code from any other sources or added a new PIP
dependency, did you follow guidance in `CONTRIBUTING.md`: ✅ — no new
dependencies, no source changes.
- Did you write any new necessary tests?: ✅ — existing coverage follows
the renamed path.
- Did you update
[Changelog](https://github.com/NVIDIA/Model-Optimizer/blob/main/CHANGELOG.rst)?:
❌ — a recipe-path correction with no user-facing feature change; happy
to add an entry if you would rather it be recorded.
- Did you get Claude approval on this PR?: ❌ — not yet run.

### Additional Information

Split out of #2643 (checkpoint aliases for nine published NVFP4
releases) so this path change is reviewable on its own. The two PRs are
independent and can merge in either order.

🤖 Generated with [Claude Code](https://claude.com/claude-code)


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Documentation**
* Updated the GLM-5.3-Flash recipe references to identify the BF16
checkpoint as the target. The quantization configuration remains
unchanged.
* **Tests**
* Updated the recipe test to cover wildcard precedence for the BF16
checkpoint.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Signed-off-by: Shengliang Xu <[email protected]>
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
shengliangxu added a commit that referenced this pull request Oct 8, 2026
…Gemma-4 MoE releases (#2647)

### What does this PR do?

**Type of change:** New recipes (checkpoint aliases)

Continues the 2026 published-checkpoint backfill started in #2643, with
three more NVFP4 releases. Each entry is a thin alias importing an
existing general recipe wholesale — no duplicated `quant_cfg`, and
editing a base recipe flows through to every alias pointing at it.

| Source model | Recipe | Published as |
|---|---|---|
| `moonshotai/Kimi-K2.7-Code` |
`general/ptq/nvfp4_experts_only_input_scale1-kv_fp8_cast` |
`nvidia/Kimi-K2.7-Code-NVFP4` |
| `google/gemma-4-26B-A4B-it` |
`general/ptq/nvfp4_experts_only-kv_fp8_cast` |
`nvidia/Gemma-4-26B-A4B-NVFP4` |
| `google/diffusiongemma-26B-A4B-it` |
`general/ptq/nvfp4_experts_only-kv_fp8_cast` |
`nvidia/diffusiongemma-26B-A4B-it-NVFP4` |

#### How these were verified

Unlike #2643, where each engineer named a recipe file outright, these
three were described in prose ("NVFP4 experts only, input activation
scale 1.0, calibration free"; "nvfp4 experts only, default dataset, 1024
samples"). So the mapping was checked against the published checkpoints
before being recorded:

- **Format and method.** All three are NVFP4 with an FP8 KV cache, and
every model card documents post-training quantization with no mention of
quantization-aware training or distillation. That check matters because
QAD retrains the weights while leaving the quantization layout identical
— a PTQ recipe could match every module and format and still not
reproduce such a release.
- **Scope.** Both Gemma releases list dense MLPs, router, attention,
vision tower and `lm_head` in `exclude_modules`, leaving only the routed
experts quantized. Kimi-K2.7-Code additionally excludes its shared
experts.
- **`input_scale1` vs plain experts-only.** This is what separates the
Kimi recipe from the Gemma one. The `input_scale1` recipe pins expert
activation amax to a constant 2688.0 (`E2M1_MAX * E4M3_MAX`), so the
exported `input_scale` is exactly 1.0. Kimi-K2.7-Code's sampled expert
`input_scale` tensors are exactly 1.0; the Gemma releases' are
calibrated values, so they take the plain recipe.
- **KV mode.** Neither Gemma release exports `k_scale` tensors, which is
what cast mode produces (`use_constant_amax`, no KV calibration) —
consistent with the already-merged `GLM-5.1`/`Kimi-K2.6` entries, which
use `-kv_fp8_cast` recipes and likewise export none. A calibrated KV
cache exports a non-1.0 `k_scale`.
- **A naming quirk worth knowing:** `diffusiongemma` nests its decoder
under `model.decoder.layers` rather than `model.language_model.layers`.
The recipe's `*.experts.*` patterns match either way, so no
model-specific body is needed.

**What this cannot establish: calibration.** A checkpoint does not
record whether max, MSE, or something else was used, so that rests on
what each engineer said — the Gemma pair used the default, which is max.
Kimi-K2.7-Code is calibration-free on the activation side by
construction.

#### Second commit: name the release in the Qwen3.8-27B description

`models/Qwen/Qwen3.8-27B/ptq/nvfp4_w4a4_mlp_fp8_attn_local_hessian`
already reproduces `nvidia/Qwen3.8-27B-NVFP4`, and `ptq.md` says so —
but the recipe's own `metadata.description` did not, so on its own the
file reads like an unrelated AutoQuantize artifact. Every other
checkpoint entry names its release, so a coverage audit that reads the
recipes can miss this one. (It missed mine.)

Checked against the published checkpoint before asserting it: MLP
`gate`/`up`/`down_proj` NVFP4, `self_attn` and `linear_attn` projections
FP8, `lm_head` NVFP4, `mtp*` excluded, no KV quantization — and the
model card names local-Hessian calibration on 2,048 samples. All
matching, including the unusual NVFP4 `lm_head`.

### Usage

```bash
python examples/hf_ptq/hf_ptq.py \
    --pyt_ckpt_path google/gemma-4-26B-A4B-it \
    --recipe models/google/gemma-4-26B-A4B-it/ptq/nvfp4_experts_only-kv_fp8_cast \
    --export_path <output>
```

### Testing

- `tests/unit/recipe/` — 460 passed. All three aliases load through
`load_recipe`, inherit `algorithm: max` from their base, and resolve to
32 `quant_cfg` entries.
- The aliases are swept by the shipped-recipe discovery in
`tests/unit/recipe/test_loader.py`, which finds every PTQ recipe from
disk, so they are covered without a bespoke test.
- `pre-commit` passes on all changed files.
- The 14 failures in the local run are pre-existing and environment-only
— a broken `transformer_engine` `.so` in the dev venv; they reproduce
identically on unmodified `main`.

Not covered: **numerics**. Nothing here asserts accuracy or that running
a recipe reproduces a released checkpoint's weights bit-for-bit.

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

- Is this change backward compatible?: ✅ — purely additive. Three new
alias files plus a docs and changelog entry; no existing recipe path,
body or API changes.
- If you copied code from any other sources or added a new PIP
dependency, did you follow guidance in `CONTRIBUTING.md`: ✅ — no new
dependencies, no source changes.
- Did you write any new necessary tests?: ✅ — covered by the
shipped-recipe sweep.
- Did you update
[Changelog](https://github.com/NVIDIA/Model-Optimizer/blob/main/CHANGELOG.rst)?:
✅
- Did you get Claude approval on this PR?: ❌ — not yet run.

### Additional Information

Three more releases from the same tracking list are verified for scope
and KV mode but still need their calibration method confirmed by the
engineer who produced them (a checkpoint cannot reveal it):
`moonshotai/Kimi-K2.5`, `Qwen/Qwen3.5-397B-A17B` (the non-V2 release),
and `zai-org/GLM-5.1`. They will follow separately.

🤖 Generated with [Claude Code](https://claude.com/claude-code)


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **New Features**
* Added checkpoint recipes for Kimi-K2.7-Code, Gemma 4 26B A4B, and
DiffusionGemma 26B A4B, with NVFP4 quantization and FP8 KV-cache
options.
* Added documentation identifying the published checkpoints and their
available recipe configurations.
* Updated the Qwen 3.8 27B recipe description to identify its published
checkpoint.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: Shengliang Xu <[email protected]>
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
@shengliangxu shengliangxu changed the title Backfill checkpoint aliases for nine published NVFP4 releases [OMNIML-3853] Backfill checkpoint aliases for nine published NVFP4 releases Oct 8, 2026
shengliangxu added a commit that referenced this pull request Oct 9, 2026
### What does this PR do?

**Type of change:** Bug fix (checkpoint alias pointed at the wrong
recipe)

`models/zai-org/GLM-5.1/` aliases
`general/ptq/nvfp4_experts_only_input_scale1-kv_fp8_cast`. It should
alias the plain `general/ptq/nvfp4_experts_only-kv_fp8_cast`.

The `input_scale1` recipe pins the expert activation amax to a constant
2688.0 (`E2M1_MAX * E4M3_MAX`), so every exported expert `input_scale`
is exactly 1.0 and no activation statistics are collected. That is a
visible property of the published checkpoint, and GLM-5.1 does not have
it:

| Release | Expert `input_scale`, 8 randomly sampled | |
|---|---|---|
| `nvidia/GLM-5.2-NVFP4` | 8 of 8 exactly `1.0` | matches `input_scale1`
|
| `nvidia/GLM-5.1-NVFP4` | 0 of 8 equal to 1.0, spanning `3.4e-4` …
`1.3e-2` | ordinary calibration |

So GLM-5.1 used ordinary activation calibration and takes the plain
experts-only recipe. **GLM-5.2 is correct and is not touched.**

Scope and KV mode were re-checked against the release and are unchanged
— routed experts only, FP8 KV cache in cast mode. Only the activation
handling was wrong. Verified after the change that the alias now
resolves identically to its base, that the pinned `2688.0` amax is gone
from the resolved config, and that GLM-5.2 still carries it.

#### How this happened

The recipes were collected by asking the engineer behind each release.
GLM-5.1 and GLM-5.2 were answered together in one line naming
`input_scale1`. That was recorded for both without checking the one
property the recipe is named for. #2643 merged it.

#### One thing left open

**Max versus MSE is not recoverable from a checkpoint** — calibration
leaves no trace in the exported tensors, which is why the sampling above
can settle `input_scale1` but not this. The `max` variant here reflects
the general default, not a confirmed fact. If GLM-5.1 used MSE, the
follow-up is a one-line change of the import to
`general/ptq/nvfp4_experts_only_mse-kv_fp8_cast`; scope, KV mode and
activation handling all stay as they are in this PR.

This PR is still strictly closer to the release than what is on `main`
today, which misstates activation handling outright.

### Usage

```bash
python examples/hf_ptq/hf_ptq.py \
    --pyt_ckpt_path zai-org/GLM-5.1 \
    --recipe models/zai-org/GLM-5.1/ptq/nvfp4_experts_only-kv_fp8_cast \
    --export_path <output>
```

### Testing

- `tests/unit/recipe/` — 461 passed.
- Verified the new path resolves to a config identical to
`general/ptq/nvfp4_experts_only-kv_fp8_cast`, that `constant_amax:
2688.0` no longer appears in it, that the old path now raises
`ValueError`, and that GLM-5.2 still resolves with the pinned amax.
- `pre-commit` passes on both changed files.
- The 14 failures in the local run are pre-existing and environment-only
— a broken `transformer_engine` `.so` in the dev venv; they reproduce
identically on unmodified `main`.

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

- Is this change backward compatible?: ⚠️ — `--recipe
models/zai-org/GLM-5.1/ptq/nvfp4_experts_only_input_scale1-kv_fp8_cast`
stops resolving and becomes `.../nvfp4_experts_only-kv_fp8_cast`. That
is the fix: the old path named a recipe that does not produce this
release.
- If you copied code from any other sources or added a new PIP
dependency, did you follow guidance in `CONTRIBUTING.md`: ✅ — no new
dependencies, no source changes.
- Did you write any new necessary tests?: ✅ — covered by the
shipped-recipe sweep in `tests/unit/recipe/test_loader.py`.
- Did you update
[Changelog](https://github.com/NVIDIA/Model-Optimizer/blob/main/CHANGELOG.rst)?:
❌ — corrects an alias added in the same unreleased cycle (#2643), which
`CONTRIBUTING.md` says to skip. Happy to add one if you would rather it
be recorded.
- Did you get Claude approval on this PR?: ❌ — not yet run.

🤖 Generated with [Claude Code](https://claude.com/claude-code)


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Documentation**
* Clarified that GLM-5.1 uses calibrated expert activation scales, while
GLM-5.2 pins them to 1.0.
* Updated the GLM-5.1 recipe description to note max calibration and an
FP8 KV cache in cast mode.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Signed-off-by: Shengliang Xu <[email protected]>
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
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.

2 participants