Skip to content

Conversation

zhanglei1172
Copy link

SUMMARY:
"Fix AWQ modifier to support per-channel quantization configuration"

TEST PLAN:
"Previously, AWQ modifier defaulted to using group quantization's group_size configuration, which caused errors when per-channel quantization configuration was passed in."

Copy link

👋 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.

Copy link
Contributor

Summary of Changes

Hello @zhanglei1172, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses a critical issue in the AWQ modifier where it previously failed to support per-channel quantization configurations. The changes ensure that the system properly recognizes and adapts its behavior when per-channel quantization is intended, specifically by adjusting how _group_size is interpreted and by conditionally applying group-specific weight smoothing operations. This fix allows for more flexible and robust quantization strategies within the framework.

Highlights

  • Per-channel Quantization Support: The AWQ modifier now correctly handles per-channel quantization configurations by explicitly setting _group_size to -1 when no group size is specified, indicating a per-channel setup.
  • Conditional Weight Smoothing: The weight smoothing logic within the _apply_smoothing method has been updated to only execute when a positive _group_size is defined. This prevents errors when per-channel quantization is active, as group-based operations are not applicable in such cases.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
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 addresses an issue in the AWQ modifier where the group size was not correctly handled when per-channel quantization was used. The changes ensure that the group size is set to -1 when it's None, and a conditional statement is added to apply smoothing only when the group size is greater than 0. This resolves errors that occurred when per-channel quantization configurations were passed in. The review focuses on the correctness and maintainability of the changes.

@zhanglei1172 zhanglei1172 force-pushed the lz_dev branch 3 times, most recently from e0acb35 to 0a6c04e Compare October 17, 2025 11:40
Copy link
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.

Thanks for the contribution, but I don't think this will work correctly as is. See change request.

Have you been able to run AWQ with channel-wise quant on this branch and seen improvement over simple round-to-nearest channel-wise quant?

@dsikka dsikka added the awq For any issue / PR related to AWQ support label Oct 17, 2025
zhanglei1172 and others added 2 commits October 18, 2025 03:21
Signed-off-by: LeiZhang <[email protected]>
Co-authored-by: Brian Dellabetta <[email protected]>
Signed-off-by: LeiZhang <[email protected]>
@zhanglei1172 zhanglei1172 changed the title Lz dev AWQ per-channel fix Oct 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awq For any issue / PR related to AWQ support

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants