[examples][awq] Update AWQ examples to stacked recipe pattern#2461
[examples][awq] Update AWQ examples to stacked recipe pattern#2461dzhengAP wants to merge 1 commit intovllm-project:mainfrom
Conversation
…zationModifier/GPTQModifier) Relates to vllm-project#2327
|
👋 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 refactors the AWQ (Activation-aware Weight Quantization) examples and documentation to align with a new, explicit stacked recipe pattern. The core change clarifies that 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
|
There was a problem hiding this comment.
Code Review
This pull request updates the AWQ examples to use the canonical stacked recipe pattern, clarifying that AWQModifier is a pre-pass combined with a quantization modifier. The llama_example.py and new llama_gptq_example.py provide clear references, and the README.md is more informative. A security audit found no high-severity vulnerabilities; the use of trust_remote_code=True is noted but poses no immediate risk due to the hardcoded, reputable model ID. Minor suggestions were made to improve consistency between the README examples and the actual example files.
|
|
||
| ```python | ||
| recipe = [ | ||
| AWQModifier(ignore=["lm_head"], scheme="W4A16_ASYM", targets=["Linear"]), |
There was a problem hiding this comment.
The AWQModifier in this example recipe is missing the duo_scaling="both" argument, which is present in the corresponding llama_example.py file. For consistency and to showcase a more complete example, it would be beneficial to include it here.
| AWQModifier(ignore=["lm_head"], scheme="W4A16_ASYM", targets=["Linear"]), | |
| AWQModifier(ignore=["lm_head"], scheme="W4A16_ASYM", targets=["Linear"], duo_scaling="both"), |
|
|
||
| ```python | ||
| recipe = [ | ||
| AWQModifier(ignore=["lm_head"], scheme="W4A16_ASYM", targets=["Linear"]), |
There was a problem hiding this comment.
Similar to the previous example, the AWQModifier here is missing the duo_scaling="both" argument which is present in llama_gptq_example.py. Adding it would improve consistency between the documentation and the example code.
| AWQModifier(ignore=["lm_head"], scheme="W4A16_ASYM", targets=["Linear"]), | |
| AWQModifier(ignore=["lm_head"], scheme="W4A16_ASYM", targets=["Linear"], duo_scaling="both"), |
|
I thought there was still a lot of work needed to enable this stacked flow since AWQ does quantization by default. if thats the case can you mark this as dependent on those PRs? |
Yeah, added Depends on #2327. This PR is intended as the example/doc update that follows the restructuring work. |
|
Examples should not be modified until the AWQ refactor lands. I'm assuming we will want to update the examples as part of that PR, rather than splitting it out into 2. A community user is looking into the refactor |
Summary
Updates AWQ examples and README to use the canonical stacked recipe pattern per #2327.
Depends on: #2327 (AWQModifier restructuring to decouple smoothing from quantization)
AWQModifieris a smoothing pre-pass (likeSmoothQuantModifier). The correct usage is:Changes
llama_example.py: updated to explicit[AWQModifier, QuantizationModifier]stackllama_gptq_example.py: new example showing[AWQModifier, GPTQModifier]README.md: documents both stacking patternsRelated
Part of #2327