Skip to content

[Deprecation] Replace deprecated function usage#2632

Open
kylesayrs wants to merge 4 commits intomainfrom
kylesayrs/remove-deprecated
Open

[Deprecation] Replace deprecated function usage#2632
kylesayrs wants to merge 4 commits intomainfrom
kylesayrs/remove-deprecated

Conversation

@kylesayrs
Copy link
Copy Markdown
Collaborator

No description provided.

Signed-off-by: Kyle Sayers <kylesayrs@gmail.com>
@github-actions
Copy link
Copy Markdown

👋 Hi! Thank you for contributing to llm-compressor. Please add the ready label when the PR is ready for review.

Note: This is required to complete the testing suite, please only add the label once the PR is code complete and local testing has been performed.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 20, 2026

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 1847b7e8-44f0-43c0-a962-ab3a33dcc7b8

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

Walkthrough

The PR refactors src/llmcompressor/modifiers/autoround/base.py to remove dependencies on compressed_tensors.utils helpers. It replaces delete_offload_parameter with delattr and register_offload_parameter with direct module.register_parameter calls, while adding explicit type annotations to _postprocess_qparams.

Changes

Cohort / File(s) Summary
Autoround utility refactoring
src/llmcompressor/modifiers/autoround/base.py
Removed compressed_tensors.utils helper imports. Replaced delete_offload_parameter() with delattr() in _preprocess_qparams. Updated _postprocess_qparams with explicit type annotations and replaced register_offload_parameter() with direct module.register_parameter() calls.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested labels

refactor, autoround

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ❓ Inconclusive No description was provided, making it impossible to evaluate relatedness to the changeset. Add a pull request description explaining the deprecation changes and rationale for removing the compressed_tensors.utils helpers.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: replacing deprecated function usage from compressed_tensors.utils helpers with direct implementation.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch kylesayrs/remove-deprecated

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@coderabbitai coderabbitai Bot added autoround For any PR / issue related to autoround support Refactor Code cleanup and/or improvements to existing features labels Apr 20, 2026
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/llmcompressor/modifiers/autoround/base.py`:
- Around line 409-411: The type annotation for the parameter
llmc_registered_qparams in _postprocess_qparams is incorrect: it's annotated as
dict[str, torch.Tensor] but the implementation accesses it as a nested mapping
(llmc_registered_qparams[name][qparam_name]); update the signature of
_postprocess_qparams to use a nested mapping type such as dict[str, dict[str,
torch.Tensor]] (or Mapping[str, Mapping[str, torch.Tensor]]) and adjust any
related type hints/usages in the surrounding code to match this nested structure
so static checkers and readers see the correct shape.
🪄 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: Pro

Run ID: 6292f65d-35df-41df-8739-85c41bd5e372

📥 Commits

Reviewing files that changed from the base of the PR and between 70a2dab and a41f572.

📒 Files selected for processing (1)
  • src/llmcompressor/modifiers/autoround/base.py

Comment thread src/llmcompressor/modifiers/autoround/base.py
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request refactors src/llmcompressor/modifiers/autoround/base.py by replacing deprecated offload utilities with standard PyTorch operations and adding type hints. Review feedback suggests using update_offload_parameter instead of module.register_parameter to maintain compatibility with offloaded models. Additionally, the type hint for llmc_registered_qparams should be corrected to reflect its nested dictionary structure.

Comment thread src/llmcompressor/modifiers/autoround/base.py
Comment thread src/llmcompressor/modifiers/autoround/base.py
Comment thread src/llmcompressor/modifiers/autoround/base.py
Comment thread src/llmcompressor/modifiers/autoround/base.py Outdated
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Signed-off-by: Kyle Sayers <kylesayrs@gmail.com>
@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented Apr 20, 2026

The quality checks have failed. Please run make style and make quality under
the root directory to adddress the lint failures. You will need to install the
dev optional install to get the required linting packages:
https://github.com/vllm-project/llm-compressor/blob/main/CONTRIBUTING.md

Copy link
Copy Markdown
Collaborator

@brian-dellabetta brian-dellabetta left a comment

Choose a reason for hiding this comment

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

good once make quality / make style are run

@mergify mergify Bot removed the quality-failed label Apr 20, 2026
@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented Apr 20, 2026

The quality checks have failed. Please run make style and make quality under
the root directory to adddress the lint failures. You will need to install the
dev optional install to get the required linting packages:
https://github.com/vllm-project/llm-compressor/blob/main/CONTRIBUTING.md

Signed-off-by: Kyle Sayers <kylesayrs@gmail.com>
@kylesayrs kylesayrs added the ready When a PR is ready for review label Apr 23, 2026
@mergify mergify Bot removed the quality-failed label Apr 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autoround For any PR / issue related to autoround support ready When a PR is ready for review Refactor Code cleanup and/or improvements to existing features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants