Adds AWQ (Activation-aware Weight Quantization) support.#205
Merged
copybara-service[bot] merged 1 commit intomainfrom Feb 4, 2026
Merged
Adds AWQ (Activation-aware Weight Quantization) support.#205copybara-service[bot] merged 1 commit intomainfrom
copybara-service[bot] merged 1 commit intomainfrom
Conversation
e62f814 to
7009dc7
Compare
This CL implements AWQ to improve quantization accuracy by identifying salient weight channels based on activation magnitudes and applying per-channel scaling. Key changes: - `AwqCalibrationProvider`: Added provider to collect activation statistics (act_scale) by intercepting `dot_general` and `einsum`. - Inherits from the new `StatsCalibrationProvider` to share interception logic with GPTQ. - `AwqRule`: Added rule to enable AWQ configuration. - `quantize_params`: Implemented AWQ scale search (grid search) and application. - Stores quantized weights wrapped in `WithAwqScale` alongside per-channel scales. - `WithAwqScale`: storage for localized AWQ scales alongside quantized data. - `AwqInferenceProvider`: Added inference support that handles `WithAwqScale` inputs, performing on-the-fly dequantization and scale compensation during `dot_general` and `einsum` operations. - `StatsCalibrationProvider`: Refactored common interception logic (for `dot_general`/`einsum`) from GPTQ into a shared base class in calibration.py. PiperOrigin-RevId: 865178716
7009dc7 to
f7101de
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds AWQ (Activation-aware Weight Quantization) support.
This CL implements AWQ to improve quantization accuracy by identifying salient weight channels based on activation magnitudes and applying per-channel scaling.
Key changes:
AwqCalibrationProvider: Added provider to collect activation statistics (act_scale) by interceptingdot_generalandeinsum.StatsCalibrationProviderto share interception logic with GPTQ.AwqRule: Added rule to enable AWQ configuration.quantize_params: Implemented AWQ scale search (grid search) and application.WithAwqScalealongside per-channel scales.WithAwqScale: storage for localized AWQ scales alongside quantized data.AwqInferenceProvider: Added inference support that handlesWithAwqScaleinputs, performing on-the-fly dequantization and scale compensation duringdot_generalandeinsumoperations.StatsCalibrationProvider: Refactored common interception logic (fordot_general/einsum) from GPTQ into a shared base class in calibration.py.