Skip to content

[OMNIML-3853] Re-key the GLM-5.3-Flash recipe to its BF16 source checkpoint - #2644

Merged
shengliangxu merged 4 commits into
mainfrom
shengliangx/glm-5.3-flash-rekey
Oct 6, 2026
Merged

shengliangxu merged 4 commits into
mainfrom
shengliangx/glm-5.3-flash-rekey

Conversation

@shengliangxu

@shengliangxu shengliangxu commented Oct 2, 2026 •

Copy link
Copy Markdown
Collaborator

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:

$ 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

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?: ❌ — 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

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.

@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 →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

⚙️ Run configuration
  • Configuration used: Repository: NVIDIA/Model-Optimizer/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Enterprise
  • Run ID: 9ad534c1-a8d3-4057-83d1-4ce8e20c613d
📥 Commits

Reviewing files that changed from the base of the PR and between 1085386 and c47804b.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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: 74f842f9-7da3-4909-8e4c-9681191dd484
📥 Commits

Reviewing files that changed from the base of the PR and between f094f89 and c329b4d.

📒 Files selected for processing (3)
  • 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; 6 remain after this review.


📝 Walkthrough

Walkthrough

The recipe metadata, PTQ documentation, and unit test now identify the GLM-5.3-Flash-BF16 recipe. The quantization configuration remains unchanged.

Changes

GLM-5.3-Flash-BF16 recipe references

Layer / File(s) Summary
Update recipe references
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
The recipe descriptions, documented path, and test target now use the GLM-5.3-Flash-BF16 name. The quantization configuration is unchanged.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to c329b

The recipe references are consistently updated, with no identified merge-blocking risk.

🚥 Pre-merge checks | ✅ 6
✅ Passed checks (6 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the change: re-keying the GLM-5.3-Flash recipe to its BF16 source checkpoint.
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 No listed security anti-pattern was introduced. The diff changes only recipe names in YAML and Markdown, plus the test docstring and recipe-path string in tests/unit/recipe/test_glm_5_3_recipe.py. I…
✨ Finishing Touches 💡 1
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
🛠️ Fix failing CI checks 💡
  • Commit to this branch
  • Create a new PR
  • Autopilot · 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 2, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.45%. Comparing base (33e3117) to head (c47804b).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2644      +/-   ##
==========================================
+ Coverage   69.20%   78.45%   +9.25%     
==========================================
  Files         620      620              
  Lines       69618    69618              
==========================================
+ Hits        48178    54619    +6441     
+ Misses      21440    14999    -6441     
Flag Coverage Δ
examples-diffusers 21.05% <ø> (+<0.01%) ⬆️
examples-gpt-oss 13.42% <ø> (-0.03%) ⬇️
examples-hf_ptq 22.86% <ø> (-0.04%) ⬇️
examples-llm_distill 13.49% <ø> (-0.01%) ⬇️
examples-llm_eval 17.40% <ø> (+<0.01%) ⬆️
examples-llm_qat 17.55% <ø> (+0.01%) ⬆️
examples-llm_sparsity 15.83% <ø> (-0.02%) ⬇️
examples-megatron_bridge 26.77% <ø> (-0.15%) ⬇️
examples-specdec_bench 13.19% <ø> (-0.01%) ⬇️
examples-speculative_decoding 17.74% <ø> (-0.06%) ⬇️
examples-torch_onnx 21.60% <ø> (-0.01%) ⬇️
examples-torch_trt 15.22% <ø> (+<0.01%) ⬆️
examples-vllm_serve 13.66% <ø> (-0.01%) ⬇️
gpu 58.42% <ø> (+36.81%) ⬆️
unit 58.63% <ø> (ø)

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.

@shengliangxu
shengliangxu marked this pull request as ready for review October 5, 2026 21:06
@shengliangxu
shengliangxu requested review from a team as code owners October 5, 2026 21:06
@shengliangxu
shengliangxu requested a review from sychen52 October 5, 2026 21:06

@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 (gpt-6.1-sol) — DM the bot to share feedback.

LGTM: the BF16 recipe re-key is consistent, with a justified test-path update that requires human sign-off.

Needs action:

  • Confirm the edit to tests/unit/recipe/test_glm_5_3_recipe.py; it follows the renamed recipe while preserving all quantizer-placement assertions.

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

Type of change: Bug fix

The `unit-3.12(torch_214, tf_min)` job fails on every PR right now.
Examples are #2644 and the `ep_comms` branch. The failing check is the
required `unit-pr-required-check`.

Root cause: `datasets` 5.1.0 came out on 2026-10-05 and requires
`huggingface_hub>=1.31`. The `tf_min` env installs `.[all,dev-test]`
first, which pulls `datasets` 5.1.0. It then installs
`transformers~=4.57.0`, which downgrades `huggingface_hub` below 1.0.
Every test that imports `datasets` then fails with:

```
ImportError: cannot import name 'BucketNotFoundError' from 'huggingface_hub.errors'
```

This PR adds `datasets<5.1` to the `tf_min` pins, next to the existing
`diffusers<0.40` pin that exists for the same hub<1.0 reason. `datasets`
5.0.x still supports `huggingface_hub>=0.25`.

### Testing

- `uv pip compile` of the `tf_min` pins (`transformers~=4.57.0`,
`diffusers<0.40`, `datasets<5.1`) resolves to `datasets==5.0.1` and
`huggingface-hub==0.36.2`.
- In a clean venv, `datasets` 5.1.0 with hub 0.36.2 gives the same
`BucketNotFoundError` as CI. `datasets` 5.0.1 with hub 0.36.2 imports
fine, including `load_dataset`.
- Pre-commit passes. I did not run the full `nox -s unit` session
locally; CI on this PR covers it.

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

- Is this change backward compatible?: ✅ (only the CI test env changes)
- If you copied code from any other sources or added a new PIP
dependency, did you follow guidance in `CONTRIBUTING.md`: N/A
- Did you write any new necessary tests?: N/A
- Did you update
[Changelog](https://github.com/NVIDIA/Model-Optimizer/blob/main/CHANGELOG.rst)?:
N/A
- Did you get Claude approval on this PR?: N/A

### Additional Information

The `trtllm (gpt-oss)` example test fails for a related reason that this
PR does not fix. Its dependency install upgrades the container to
`datasets` 5.1.0 and `huggingface_hub` 1.33.0, and `trackio` then fails
when `trl` writes a model card: `cannot import name 'CommitOperationAdd'
from 'huggingface_hub.hf_api'`.

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


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

## Summary by CodeRabbit

* **Chores**
* Updated the Transformers test environment to use a compatible range of
the datasets package. The test setup also accounts for the Hub version
requirements associated with the selected Transformers version, helping
keep automated test runs consistent.

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

Signed-off-by: Shengliang Xu <[email protected]>
models/<org>/<model_id>/ is keyed by the checkpoint a recipe is *run against*,
but this entry named zai-org/GLM-5.3-Flash, which is itself an FP8 release --
its config.json carries quantization_config.quant_method: fp8. The recipe
produces NVFP4 by post-training quantization, so it has to start from the BF16
weights at zai-org/GLM-5.3-Flash-BF16. Pointing it at the FP8 repo told a user to
quantize an already-quantized checkpoint.

The folder, the recipe's own header and description, the ptq.md entry and the
test's recipe path all move to GLM-5.3-Flash-BF16. Prose that refers to the model
family rather than a path is left alone, as is the released checkpoint's name
(nvidia/GLM-5.3-Flash-NVFP4), which does not change.

Note the released checkpoint's card metadata lists base_model as
zai-org/GLM-5.3-Flash. That names the family, not the weights the PTQ run
consumed; the -BF16 repo is the only one of the two a PTQ recipe can start from.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Signed-off-by: Shengliang Xu <[email protected]>
@shengliangxu
shengliangxu force-pushed the shengliangx/glm-5.3-flash-rekey branch from 7344046 to ada2cc0 Compare October 6, 2026 07:02
@shengliangxu
shengliangxu enabled auto-merge (squash) October 6, 2026 09:05
@shengliangxu
shengliangxu merged commit 3b7a8dc into main Oct 6, 2026
62 of 64 checks passed
@shengliangxu
shengliangxu deleted the shengliangx/glm-5.3-flash-rekey branch October 6, 2026 18:15
@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-10-06 18:16 UTC

@shengliangxu shengliangxu changed the title Re-key the GLM-5.3-Flash recipe to its BF16 source checkpoint [OMNIML-3853] Re-key the GLM-5.3-Flash recipe to its BF16 source checkpoint Oct 8, 2026
kevalmorabia97 pushed a commit that referenced this pull request Nov 5, 2026
### What does this PR do?

Type of change: Bug fix

The `unit-3.12(torch_214, tf_min)` job fails on every PR right now.
Examples are #2644 and the `ep_comms` branch. The failing check is the
required `unit-pr-required-check`.

Root cause: `datasets` 5.1.0 came out on 2026-10-05 and requires
`huggingface_hub>=1.31`. The `tf_min` env installs `.[all,dev-test]`
first, which pulls `datasets` 5.1.0. It then installs
`transformers~=4.57.0`, which downgrades `huggingface_hub` below 1.0.
Every test that imports `datasets` then fails with:

```
ImportError: cannot import name 'BucketNotFoundError' from 'huggingface_hub.errors'
```

This PR adds `datasets<5.1` to the `tf_min` pins, next to the existing
`diffusers<0.40` pin that exists for the same hub<1.0 reason. `datasets`
5.0.x still supports `huggingface_hub>=0.25`.

### Testing

- `uv pip compile` of the `tf_min` pins (`transformers~=4.57.0`,
`diffusers<0.40`, `datasets<5.1`) resolves to `datasets==5.0.1` and
`huggingface-hub==0.36.2`.
- In a clean venv, `datasets` 5.1.0 with hub 0.36.2 gives the same
`BucketNotFoundError` as CI. `datasets` 5.0.1 with hub 0.36.2 imports
fine, including `load_dataset`.
- Pre-commit passes. I did not run the full `nox -s unit` session
locally; CI on this PR covers it.

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

- Is this change backward compatible?: ✅ (only the CI test env changes)
- If you copied code from any other sources or added a new PIP
dependency, did you follow guidance in `CONTRIBUTING.md`: N/A
- Did you write any new necessary tests?: N/A
- Did you update
[Changelog](https://github.com/NVIDIA/Model-Optimizer/blob/main/CHANGELOG.rst)?:
N/A
- Did you get Claude approval on this PR?: N/A

### Additional Information

The `trtllm (gpt-oss)` example test fails for a related reason that this
PR does not fix. Its dependency install upgrades the container to
`datasets` 5.1.0 and `huggingface_hub` 1.33.0, and `trackio` then fails
when `trl` writes a model card: `cannot import name 'CommitOperationAdd'
from 'huggingface_hub.hf_api'`.

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

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

## Summary by CodeRabbit

* **Chores**
* Updated the Transformers test environment to use a compatible range of
the datasets package. The test setup also accounts for the Hub version
requirements associated with the selected Transformers version, helping
keep automated test runs consistent.

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

Signed-off-by: Shengliang Xu <[email protected]>
Signed-off-by: Keval Morabia <[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.

3 participants