NVIDIA / NVIDIA/Model-Optimizer

hf_ptq.py: deprecated --auto_quantize_bits CLI flag silently no-ops instead of enabling AutoQuantize

Open
#2,230 1 comment 0 reactions 1 assignee View on GitHub

@meenchen is already working on this.

Since Aug 24, 2026.

Dominant language
Python
Stars
3.8k
Forks
604
Avg merge
2d 8h
Merged PRs (30d)
142

Description

Description

examples/hf_ptq/hf_ptq.py's deprecated --auto_quantize_bits CLI flag (and its siblings --auto_quantize_method, --auto_quantize_score_size, --auto_quantize_cost_model, --auto_quantize_active_moe_expert_ratio) is documented as still enabling the AutoQuantize CLI path via a conversion shim:

# Deprecated AutoQuantize CLI flags: kept as a backward-compat shim that converts them into an
# AutoQuantizeConfig on the fly (see _auto_quantize_config_from_cli). Prefer --recipe. The old
# CLI also lives on the 0.45 branch.
parser.add_argument(
    "--auto_quantize_bits",
    ...
)

_auto_quantize_config_from_cli does not exist anywhere in the file (or the repo). quantize_main() only enables AutoQuantize by checking whether --recipe resolves to a ModelOptAutoQuantizeRecipe; args.auto_quantize_bits is never read in the actual quantization path.

Effect: a legacy command still relying on --auto_quantize_bits (e.g. carried over from the 0.45 branch's CLI) silently runs plain PTQ instead of AutoQuantize, with no warning or error pointing back at the cause.

Fix

Fixed in #2129 by rejecting --auto_quantize_bits at parse_args() instead of letting it silently no-op, pointing users at an AutoQuantize --recipe.

Found via a CodeRabbit review comment on that PR.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.