Skip to content

refactor(examples): rename llm_ptq → hf_ptq (symlink for back-compat)#1759

Open
Edwardf0t1 wants to merge 2 commits into
mainfrom
rename-llm-ptq-to-hf-ptq
Open

refactor(examples): rename llm_ptq → hf_ptq (symlink for back-compat)#1759
Edwardf0t1 wants to merge 2 commits into
mainfrom
rename-llm-ptq-to-hf-ptq

Conversation

@Edwardf0t1

@Edwardf0t1 Edwardf0t1 commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Type of change: refactor / deprecation (examples)

Follow-up to #1705 (which consolidated examples/vlm_ptq into examples/llm_ptq). Since that example now covers Hugging Face LLM and VLM PTQ, the llm_ptq name is a misnomer. This renames the directory to examples/hf_ptq and leaves a relative symlink examples/llm_ptq → hf_ptq so existing paths/commands keep working during a deprecation window.

Requested by @kevalmorabia97 on #1705 (with the symlink-for-back-compat approach), targeted for the same 0.46 release as the consolidation.

Changes

  • git mv examples/llm_ptq → examples/hf_ptq and tests/examples/llm_ptq → tests/examples/hf_ptq (the CI runner maps the matrix name to both examples/<name> and tests/examples/<name>).
  • Add a tracked back-compat symlink examples/llm_ptq → hf_ptq.
  • Update CI matrices and all repo path references (docs, READMEs, agent skills, launcher/debugger tools, tests) from llm_ptq to hf_ptq.
  • Keep Python identifiers / test-util module names (run_llm_ptq_command, llm_ptq_utils) — they name the LLM-PTQ task, not the directory.
  • Preserve the CODEOWNERS team slug (modelopt-examples-llm_ptq-codeowners) and historical CHANGELOG entries; add a CHANGELOG deprecation note.

Back-compat caveats (inherent to git directory symlinks)

  • ✅ Linux/macOS CLI usage and Python cwd/pytest resolution work through the symlink.
  • ⚠️ Windows git checkouts don't materialize symlinks by default (low impact — this example is Linux-only in practice).
  • ⚠️ GitHub web doesn't follow directory symlinks, so legacy external deep-links to examples/llm_ptq/... won't navigate in. All internal references are repointed to hf_ptq, so the symlink is only for legacy external/CLI use.

Usage (unchanged via symlink)

# New canonical path
cd examples/hf_ptq
scripts/huggingface_example.sh --model <hf_model> --quant fp8

# Old path still works (forwards via symlink)
cd examples/llm_ptq && scripts/huggingface_example.sh --model <hf_model> --quant fp8

Testing

  • bash -n on moved/edited shell scripts (new path + via symlink).
  • py_compile on moved/edited Python; test re-export shim repointed to examples/hf_ptq/example_utils.
  • Verified git tracks examples/llm_ptq as a single symlink (mode 120000), not a duplicated tree (no pre-commit / pytest double-processing).
  • pre-commit run on all changed files passes.

Before your PR is "Ready for review"

  • Is this change backward compatible?: ✅ (relative symlink keeps examples/llm_ptq paths valid; see caveats above)
  • Did you write any new necessary tests?: N/A (pure rename; existing tests moved with the dir)
  • Did you update Changelog?: ✅

Additional Information

Follow-up (later release): remove the examples/llm_ptq symlink once external references have migrated.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation

    • Reorganized post-training quantization examples directory structure with backward compatibility support.
    • Consolidated vision-language model quantization into the unified HF quantization example.
    • Updated all documentation links and references to reflect the new examples organization.
  • Chores

    • Updated CI/CD workflows, test infrastructure, and deployment tooling to use reorganized examples.

The example covers Hugging Face LLM and VLM PTQ, so "llm_ptq" is a misnomer
since the vlm_ptq consolidation. Rename the directory to examples/hf_ptq and
leave a relative symlink examples/llm_ptq -> hf_ptq so existing paths and
commands keep working through a deprecation window.

- git mv examples/llm_ptq -> examples/hf_ptq and
  tests/examples/llm_ptq -> tests/examples/hf_ptq (CI maps the matrix name to
  both examples/<name> and tests/examples/<name>).
- Add back-compat symlink examples/llm_ptq -> hf_ptq (tracked as a symlink).
- Update CI matrices and all repo path references (docs, READMEs, skills,
  launcher/debugger tools, tests) from llm_ptq to hf_ptq. Python identifiers
  and test-util module names (run_llm_ptq_command, llm_ptq_utils) are kept.
- Preserve the CODEOWNERS team slug and historical CHANGELOG entries; add a
  CHANGELOG deprecation note for the rename.

Follow-up to the examples/vlm_ptq -> examples/llm_ptq consolidation (#1705),
targeted for the same 0.46 release.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Zhiyu Cheng <zhiyuc@nvidia.com>
@coderabbitai

coderabbitai Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Renames the examples/llm_ptq directory to examples/hf_ptq, adds a backward-compatibility symlink at examples/llm_ptq, and consolidates examples/vlm_ptq into examples/hf_ptq (accessible via --vlm flag). All references across documentation, CI workflows, launcher scripts, agent skills, source docstrings, and tests are updated accordingly.

Changes

llm_ptq → hf_ptq rename and vlm_ptq consolidation

Layer / File(s) Summary
Symlink, CODEOWNERS, CHANGELOG, and vlm_ptq deprecation
examples/llm_ptq, .github/CODEOWNERS, CHANGELOG.rst, examples/vlm_ptq/README.md, examples/vlm_ptq/scripts/huggingface_example.sh, examples/hf_ptq/fsdp2.yaml
Creates examples/llm_ptqhf_ptq symlink. Updates CODEOWNERS to own /examples/hf_ptq and removes the /examples/vlm_ptq entry. CHANGELOG documents the rename with symlink and vlm_ptq consolidation. vlm_ptq/README.md is marked deprecated, and the VLM shim script is updated to forward to examples/hf_ptq.
CI workflow updates
.github/workflows/_example_tests_runner.yml, .github/workflows/example_tests.yml
Both trtllm-pr and trtllm-non-pr job matrices now run hf_ptq instead of llm_ptq. The reusable runner's input description string is updated to match.
Launcher and debugger tool script updates
tools/launcher/common/hf/ptq.sh, tools/launcher/common/eagle3/hf_ptq.sh, tools/launcher/examples/Qwen/Qwen3-8B/hf_ptq.yaml, tools/debugger/CLAUDE.md, tools/debugger/README.md
HF_EXAMPLE in ptq.sh and the eagle3 launcher entrypoint are retargeted to examples/hf_ptq. Qwen3-8B YAML comments and uv run example commands are updated. Debugger documentation examples are updated.
Agent skill documentation updates
.agents/skills/common/environment-setup.md, .agents/skills/deployment/references/support-matrix.md, .agents/skills/ptq/SKILL.md, .agents/skills/ptq/references/slurm-setup-ptq.md, .agents/skills/ptq/references/unsupported-models.md
All agent skill Markdown files updated to reference examples/hf_ptq for environment detection, PTQ guidance steps, SLURM multi-node commands, support matrix sources, and unsupported models references.
README, docs/source, and example documentation updates
README.md, docs/source/..., examples/deepseek/..., examples/gpt-oss/README.md, examples/llm_eval/README.md, examples/llm_qat/..., examples/megatron_bridge/quantize.py, examples/model_hub/README.md, examples/pruning/..., examples/speculative_decoding/README.md, examples/vllm_serve/README.md, modelopt/recipe/presets.py, modelopt/torch/quantization/utils/numeric_utils.py
README.md news and technique/support-matrix links, all docs/source RST guides, and all per-example READMEs, notebooks, and source docstrings updated to point to examples/hf_ptq.
Test utility and test path updates
tests/_test_utils/examples/run_command.py, tests/_test_utils/examples/llm_ptq_utils.py, tests/_test_utils/examples/hf_ptq_example_utils.py, tests/examples/hf_ptq/*, tests/examples/llm_eval/test_llm_eval.py, tests/examples/speculative_decoding/test_eagle_offline_ptq.py, tests/gpu/torch/export/test_unified_hf_export_and_check_safetensors.py, tests/gpu/torch/quantization/test_gpt_oss_mxfp4_nvfp4_cast_cuda.py
run_llm_ptq_command renamed to run_hf_ptq_command and propagated to all call sites. sys.path and directory constants updated from examples/llm_ptq to examples/hf_ptq across test utilities and individual test files.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • NVIDIA/Model-Optimizer#1737: Both PRs modify CHANGELOG.rst; the retrieved PR reorganizes release-note and quantization guidance in the same version section that this PR updates for the llm_ptqhf_ptq rename.

Suggested reviewers

  • kevalmorabia97
  • ChenhanYu
  • jenchen13
  • cjluo-nv
🚥 Pre-merge checks | ✅ 5 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 22.22% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: renaming llm_ptq to hf_ptq with backward compatibility via symlink.
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 PR contains no security anti-patterns per SECURITY.md: no torch.load(weights_only=False), numpy.load(allow_pickle=True), trust_remote_code=True, eval/exec calls, or # nosec comments. Changes are do...

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch rename-llm-ptq-to-hf-ptq

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

@github-actions

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://NVIDIA.github.io/Model-Optimizer/pr-preview/pr-1759/

Built to branch gh-pages at 2026-06-17 01:29 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@coderabbitai coderabbitai Bot 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.

Warning

CodeRabbit couldn't request changes on this pull request because it doesn't have sufficient GitHub permissions.

Please grant CodeRabbit Pull requests: Read and write permission and re-run the review.

👉 Steps to fix this

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.agents/skills/ptq/SKILL.md (1)

108-108: ⚠️ Potential issue | 🟡 Minor

Correct the launcher script path to match the actual template location.

Line 108 references common/hf_ptq/hf_ptq.sh, which does not exist. The correct path is common/hf/ptq.sh, as documented in the launcher guide itself. Replace common/hf_ptq/hf_ptq.sh with common/hf/ptq.sh.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.agents/skills/ptq/SKILL.md at line 108, The launcher script path referenced
in the SKILL.md file is incorrect. Locate the reference to
`common/hf_ptq/hf_ptq.sh` on line 108 and replace it with the correct path
`common/hf/ptq.sh` to match the actual template location documented in the
launcher guide.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.agents/skills/ptq/references/unsupported-models.md:
- Line 150: In the unsupported-models.md file, replace the broken documentation
link `examples/hf_ptq/moe.md` with the correct path `examples/hf_ptq/README.md`.
The README file contains the actual MoE quantization documentation that should
be referenced instead of the non-existent moe.md file.

In `@README.md`:
- Line 33: The README.md file contains anchor links pointing to sections in
examples/hf_ptq/README.md that do not exist as markdown headings. To fix this,
either add the missing sections (`#llama-4`,
`#model-quantization-and-trt-llm-conversion`, and
`#deploy-fp8-quantized-model-using-vllm`) as properly formatted markdown headings
in examples/hf_ptq/README.md, or update the links in the main README to
reference only the existing anchors (`#support-matrix` and
`#hugging-face-supported-models`). Choose the approach that best maintains the
documentation structure and user experience.

---

Outside diff comments:
In @.agents/skills/ptq/SKILL.md:
- Line 108: The launcher script path referenced in the SKILL.md file is
incorrect. Locate the reference to `common/hf_ptq/hf_ptq.sh` on line 108 and
replace it with the correct path `common/hf/ptq.sh` to match the actual template
location documented in the launcher guide.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 36b1e7eb-b9ba-4047-a71d-d2be1dedff6f

📥 Commits

Reviewing files that changed from the base of the PR and between 6c32c37 and d182e62.

📒 Files selected for processing (65)
  • .agents/skills/common/environment-setup.md
  • .agents/skills/deployment/references/support-matrix.md
  • .agents/skills/ptq/SKILL.md
  • .agents/skills/ptq/references/slurm-setup-ptq.md
  • .agents/skills/ptq/references/unsupported-models.md
  • .github/CODEOWNERS
  • .github/workflows/_example_tests_runner.yml
  • .github/workflows/example_tests.yml
  • CHANGELOG.rst
  • README.md
  • docs/source/deployment/3_unified_hf.rst
  • docs/source/guides/10_recipes.rst
  • docs/source/guides/_compress_quantized_models.rst
  • docs/source/guides/_customized_model_quantization.rst
  • docs/source/index.rst
  • examples/deepseek/README.md
  • examples/deepseek/deepseek_v4/quantize_to_nvfp4.py
  • examples/gpt-oss/README.md
  • examples/hf_ptq/.gitignore
  • examples/hf_ptq/README.md
  • examples/hf_ptq/cast_mxfp4_to_nvfp4.py
  • examples/hf_ptq/example_utils.py
  • examples/hf_ptq/fsdp2.yaml
  • examples/hf_ptq/hf_ptq.py
  • examples/hf_ptq/multinode_ptq.py
  • examples/hf_ptq/nemotron_vl_calib.py
  • examples/hf_ptq/notebooks/1_FP4-FP8_PTQ_Min-Max_Calibration.ipynb
  • examples/hf_ptq/notebooks/2_PTQ_AWQ_Calibration.ipynb
  • examples/hf_ptq/notebooks/3_PTQ_AutoQuantization.ipynb
  • examples/hf_ptq/requirements.txt
  • examples/hf_ptq/run_tensorrt_llm.py
  • examples/hf_ptq/scripts/huggingface_example.sh
  • examples/hf_ptq/scripts/parser.sh
  • examples/hf_ptq/vlm_utils.py
  • examples/llm_eval/README.md
  • examples/llm_ptq
  • examples/llm_qat/README.md
  • examples/llm_qat/llama_factory/README.md
  • examples/llm_qat/notebooks/QAT_QAD_Walkthrough.ipynb
  • examples/megatron_bridge/quantize.py
  • examples/model_hub/README.md
  • examples/pruning/minitron/NVIDIA-Nemotron-Nano-9B-v2/README.md
  • examples/speculative_decoding/README.md
  • examples/vllm_serve/README.md
  • examples/vlm_ptq/README.md
  • examples/vlm_ptq/scripts/huggingface_example.sh
  • modelopt/recipe/presets.py
  • modelopt/torch/quantization/utils/numeric_utils.py
  • tests/_test_utils/examples/llm_ptq_example_utils.py
  • tests/_test_utils/examples/run_command.py
  • tests/examples/hf_ptq/_extensions/test_torch_extensions.py
  • tests/examples/hf_ptq/test_cast_mxfp4_to_nvfp4.py
  • tests/examples/hf_ptq/test_deploy.py
  • tests/examples/hf_ptq/test_example_utils.py
  • tests/examples/hf_ptq/test_hf_ptq_args.py
  • tests/examples/hf_ptq/test_llm_ptq.py
  • tests/examples/hf_ptq/test_vlm_ptq.py
  • tests/examples/speculative_decoding/test_eagle_offline_ptq.py
  • tests/gpu/torch/export/test_unified_hf_export_and_check_safetensors.py
  • tests/gpu/torch/quantization/test_gpt_oss_mxfp4_nvfp4_cast_cuda.py
  • tools/debugger/CLAUDE.md
  • tools/debugger/README.md
  • tools/launcher/common/eagle3/hf_ptq.sh
  • tools/launcher/common/hf/ptq.sh
  • tools/launcher/examples/Qwen/Qwen3-8B/hf_ptq.yaml

Comment thread .agents/skills/ptq/references/unsupported-models.md Outdated
Comment thread README.md
@codecov

codecov Bot commented Jun 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.65%. Comparing base (977d34d) to head (8df7e92).
⚠️ Report is 21 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1759      +/-   ##
==========================================
+ Coverage   74.29%   76.65%   +2.36%     
==========================================
  Files         511      511              
  Lines       56356    56356              
==========================================
+ Hits        41868    43200    +1332     
+ Misses      14488    13156    -1332     
Flag Coverage Δ
examples 41.79% <ø> (-0.14%) ⬇️
gpu 57.91% <ø> (+7.68%) ⬆️
regression 14.70% <ø> (+0.06%) ⬆️

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.

Comment thread .agents/skills/ptq/references/unsupported-models.md Outdated
Comment thread .github/CODEOWNERS Outdated

@kevalmorabia97 kevalmorabia97 Jun 17, 2026

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.

Remove vlm_ptq codeowner entry

Suggested change

Comment thread .github/CODEOWNERS
/examples/llm_distill @NVIDIA/modelopt-torch-distill-codeowners
/examples/llm_eval @NVIDIA/modelopt-examples-llm_ptq-codeowners
/examples/llm_ptq @NVIDIA/modelopt-examples-llm_ptq-codeowners
/examples/hf_ptq @NVIDIA/modelopt-examples-llm_ptq-codeowners

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.

Should we use @NVIDIA/modelopt-torch-quantization-codeowners here?

from _test_utils.examples.run_command import MODELOPT_ROOT

_LLM_PTQ_DIR = MODELOPT_ROOT / "examples" / "llm_ptq"
_LLM_PTQ_DIR = MODELOPT_ROOT / "examples" / "hf_ptq"

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.

Suggested change
_LLM_PTQ_DIR = MODELOPT_ROOT / "examples" / "hf_ptq"
_HF_PTQ_DIR = MODELOPT_ROOT / "examples" / "hf_ptq"

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.

rename file to hf_ptq_example_utils.py

@kevalmorabia97 kevalmorabia97 Jun 17, 2026

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.

Rename function

Suggested change
def run_hf_ptq_command(*, model: str, quant: str, vlm: bool = False, **kwargs):

Comment thread README.md
Comment thread README.md Outdated
Comment on lines +133 to +134
| LLM Quantization | [View Support Matrix](./examples/hf_ptq/README.md#support-matrix) |
| VLM Quantization | [View Support Matrix](./examples/hf_ptq/README.md#hugging-face-supported-models) |

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.

Both point to the same table. Lets unify

Suggested change
| LLM Quantization | [View Support Matrix](./examples/hf_ptq/README.md#support-matrix) |
| VLM Quantization | [View Support Matrix](./examples/hf_ptq/README.md#hugging-face-supported-models) |
| LLM / VLM Quantization | [View Support Matrix](./examples/hf_ptq/README.md#support-matrix) |

- Fix broken docs link examples/hf_ptq/moe.md -> README.md (unsupported-models)
- Fix broken README anchors to existing hf_ptq/README.md headings
- Fix launcher script path common/hf_ptq/hf_ptq.sh -> common/hf/ptq.sh in SKILL.md
- Remove stale examples/vlm_ptq CODEOWNERS entry
- Unify README LLM/VLM support-matrix rows
- Rename test util: llm_ptq_example_utils.py -> hf_ptq_example_utils.py,
  _LLM_PTQ_DIR -> _HF_PTQ_DIR, run_llm_ptq_command -> run_hf_ptq_command

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Zhiyu Cheng <zhiyuc@nvidia.com>

@coderabbitai coderabbitai Bot 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.

Warning

CodeRabbit couldn't request changes on this pull request because it doesn't have sufficient GitHub permissions.

Please grant CodeRabbit Pull requests: Read and write permission and re-run the review.

👉 Steps to fix this

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@tests/_test_utils/examples/llm_ptq_utils.py`:
- Line 22: The file tests/_test_utils/examples/llm_ptq_utils.py has not been
renamed despite the PR's stated intention to rename the llm_ptq_utils module to
hf_ptq_utils. While the imports within the file have been updated to use the new
naming convention (such as run_hf_ptq_command), the physical file itself still
uses the old name. Rename the file from llm_ptq_utils.py to hf_ptq_utils.py to
complete the module refactoring and ensure consistency with the updated imports.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: e6bde70e-76ac-42bd-9fe0-bec3c6a84b60

📥 Commits

Reviewing files that changed from the base of the PR and between d182e62 and 8df7e92.

📒 Files selected for processing (12)
  • .agents/skills/ptq/SKILL.md
  • .agents/skills/ptq/references/unsupported-models.md
  • .github/CODEOWNERS
  • README.md
  • tests/_test_utils/examples/hf_ptq_example_utils.py
  • tests/_test_utils/examples/llm_ptq_utils.py
  • tests/_test_utils/examples/run_command.py
  • tests/examples/hf_ptq/test_cast_mxfp4_to_nvfp4.py
  • tests/examples/hf_ptq/test_example_utils.py
  • tests/examples/hf_ptq/test_vlm_ptq.py
  • tests/examples/llm_eval/test_llm_eval.py
  • tests/gpu/torch/quantization/test_gpt_oss_mxfp4_nvfp4_cast_cuda.py
💤 Files with no reviewable changes (1)
  • .github/CODEOWNERS
✅ Files skipped from review due to trivial changes (3)
  • tests/examples/hf_ptq/test_vlm_ptq.py
  • .agents/skills/ptq/references/unsupported-models.md
  • README.md
🚧 Files skipped from review as they are similar to previous changes (3)
  • tests/gpu/torch/quantization/test_gpt_oss_mxfp4_nvfp4_cast_cuda.py
  • .agents/skills/ptq/SKILL.md
  • tests/examples/hf_ptq/test_example_utils.py

import pytest
import torch
from _test_utils.examples.run_command import run_llm_ptq_command
from _test_utils.examples.run_command import run_hf_ptq_command

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.

📐 Maintainability & Code Quality | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify the actual filename and check for old module name references

# Check if the new filename exists
echo "=== Checking for hf_ptq_utils.py ==="
fd -t f 'hf_ptq_utils.py' tests/_test_utils/examples/

# Check if the old filename still exists
echo -e "\n=== Checking for llm_ptq_utils.py ==="
fd -t f 'llm_ptq_utils.py' tests/_test_utils/examples/

# Search for imports of the old module name
echo -e "\n=== Searching for imports of llm_ptq_utils ==="
rg -n 'from _test_utils.examples.llm_ptq_utils import' --type py

# Search for imports of the new module name
echo -e "\n=== Searching for imports of hf_ptq_utils ==="
rg -n 'from _test_utils.examples.hf_ptq_utils import' --type py

Repository: NVIDIA/Model-Optimizer

Length of output: 328


Rename module file from llm_ptq_utils.py to hf_ptq_utils.py to match the PR's stated module renaming.

The file tests/_test_utils/examples/llm_ptq_utils.py still uses its old name despite the PR summary stating that llm_ptq_utils should be renamed to hf_ptq_utils. While the imports within the file were updated (e.g., run_hf_ptq_command), the module file itself was not renamed. Rename the file to complete the module refactoring.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/_test_utils/examples/llm_ptq_utils.py` at line 22, The file
tests/_test_utils/examples/llm_ptq_utils.py has not been renamed despite the
PR's stated intention to rename the llm_ptq_utils module to hf_ptq_utils. While
the imports within the file have been updated to use the new naming convention
(such as run_hf_ptq_command), the physical file itself still uses the old name.
Rename the file from llm_ptq_utils.py to hf_ptq_utils.py to complete the module
refactoring and ensure consistency with the updated imports.

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