Conversation
Signed-off-by: Kyle Sayers <kylesayrs@gmail.com>
|
👋 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. |
Summary of ChangesHello, 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 undertakes a significant refactoring of the AWQ (Activation-aware Weight Quantization) modifier. The core logic and various helper functions previously residing within the Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe 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
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 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
|
|
The quality checks have failed. Please run |
There was a problem hiding this comment.
Code Review
This pull request introduces a significant and well-executed refactoring of the AWQModifier. The logic has been broken down into smaller, more manageable methods, and many helper functions have been extracted into a new src/llmcompressor/modifiers/awq/helpers.py file. This greatly improves the readability and maintainability of the code. My review includes a couple of suggestions for improvement in the new helper functions.
| leave=False, | ||
| ) | ||
| for grid_idx, use_duo_scaling in pbar: | ||
| ratio = grid_idx / n_grid |
There was a problem hiding this comment.
The grid search for the ratio α is stated in the AWQ paper to be in the range [0, 1]. The current implementation generates ratios from 0 up to (n_grid - 1) / n_grid, so it never reaches 1.0. This excludes a potentially optimal value from the search space. To cover the full range, you could adjust the ratio calculation to generate n_grid evenly spaced points between 0.0 and 1.0, inclusive.
| ratio = grid_idx / n_grid | |
| ratio = grid_idx / (n_grid - 1) if n_grid > 1 else 0.0 |
| raise Exception( | ||
| "No finite loss was found in best scalesgrid search. This typically " | ||
| "means NaN values are appearing in the forward pass of the parent " | ||
| "module. If you encounter this error, raise an issue at " | ||
| "https://github.com/vllm-project/llm-compressor/issues" | ||
| ) |
There was a problem hiding this comment.
There's a typo in the exception message. "scalesgrid" should be "scales grid". Fixing this will improve clarity for users who encounter this error.
| raise Exception( | |
| "No finite loss was found in best scalesgrid search. This typically " | |
| "means NaN values are appearing in the forward pass of the parent " | |
| "module. If you encounter this error, raise an issue at " | |
| "https://github.com/vllm-project/llm-compressor/issues" | |
| ) | |
| raise Exception( | |
| "No finite loss was found in best scales grid search. This typically " | |
| "means NaN values are appearing in the forward pass of the parent " | |
| "module. If you encounter this error, raise an issue at " | |
| "https://github.com/vllm-project/llm-compressor/issues" | |
| ) |
SUMMARY:
"please provide a brief summary"
TEST PLAN:
"please outline how the changes were tested"