[AWQ] Fix _accumulate_mean bug, move AWQ activation averaging off CPU, and improve logging#2161
Conversation
|
👋 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 @ZewenShen-Cohere, 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 focuses on enhancing the robustness, performance, and observability of the AWQ (Activation-aware Weight Quantization) calibration process. It addresses a critical bug in the mean accumulation logic, optimizes activation averaging to leverage GPU resources more effectively, and introduces comprehensive logging capabilities to provide better insights into the calibration grid search and its outcomes. 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. 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
|
There was a problem hiding this comment.
Code Review
This pull request introduces several valuable improvements to the AWQ modifier. It correctly fixes a bug in _accumulate_mean that caused incorrect output on its first run. Moving the activation averaging computation off the CPU is a significant performance enhancement, especially for large models. The addition of more informative logging, including a progress bar and JSON output for error metrics, greatly improves the usability and observability of the AWQ calibration process. The code is well-structured, but I have a couple of suggestions to enhance robustness and simplify the implementation.
brian-dellabetta
left a comment
There was a problem hiding this comment.
Thanks for creating this! The fixes look good, I just have a few questions on the logging part, hopefully we can streamline some more of it
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Signed-off-by: ZewenShen-Cohere <zewen.shen@cohere.com>
|
Thank you for the revision @brian-dellabetta. I've switched to use the logger. |
|
Can you address the quality issues? You can do this by running these steps in the root dir: pip install -e .[dev] |
Done |
HDCharles
left a comment
There was a problem hiding this comment.
looks good, see comments
brian-dellabetta
left a comment
There was a problem hiding this comment.
Things look great! Thanks for catching the accumulate bug. One comment on the tqdm logging
Signed-off-by: ZewenShen-Cohere <zewen.shen@cohere.com>
brian-dellabetta
left a comment
There was a problem hiding this comment.
Thanks @ZewenShen-Cohere !
|
@ZewenShen-Cohere do you mind fixing the quality issue, by running the command in your rootdir? |
|
@dsikka Done! |
…, and improve logging (vllm-project#2161) This PR addresses the following issues: 1. _accumulate_mean produces incorrect output on its first run. 2. cache_smooth_activations_hook previously performed the averaging computation on the CPU. When both the hidden dimension and sequence length are large, this makes AWQ calibration CPU-bound. The slowdown is especially severe when multiple AWQ quantization jobs run concurrently. 3. Added more informative logging to the AWQ calibration grid search, including per-mapping JSON logs. This PR is a subset of vllm-project#2158 --------- Signed-off-by: ZewenShen-Cohere <zewen.shen@cohere.com> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Co-authored-by: Dipika Sikka <dipikasikka1@gmail.com> Signed-off-by: jwpark33 <pjw9703@gmail.com>
This PR addresses the following issues:
_accumulate_mean produces incorrect output on its first run.
cache_smooth_activations_hook previously performed the averaging computation on the CPU. When both the hidden dimension and sequence length are large, this makes AWQ calibration CPU-bound. The slowdown is especially severe when multiple AWQ quantization jobs run concurrently.
Added more informative logging to the AWQ calibration grid search, including per-mapping JSON logs.
This PR is a subset of #2158