Skip to content

Commit

Permalink
[Awq] Add peft support for AWQ (huggingface#28987)
Browse files Browse the repository at this point in the history
* add peft support for AWQ

* Update src/transformers/quantizers/quantizer_awq.py

Co-authored-by: amyeroberts <22614925+amyeroberts@users.noreply.github.com>

* fix

---------

Co-authored-by: amyeroberts <22614925+amyeroberts@users.noreply.github.com>
  • Loading branch information
younesbelkada and amyeroberts authored Feb 19, 2024
1 parent ce4fff0 commit 864c8e6
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/transformers/quantizers/quantizer_awq.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import importlib.metadata
from typing import TYPE_CHECKING

from packaging import version

from .base import HfQuantizer


Expand Down Expand Up @@ -105,6 +108,6 @@ def is_serializable(self):

@property
def is_trainable(self):
# AWQ does not support neither QAT (Quantization Aware Training or PEFT yet.)
# TODO: if this is supported in the future, do a version check here.
return False
# AWQ supports PEFT fine-tuning from version 0.2.0
MIN_AWQ_VERSION_FOR_PEFT = "0.2.0"
return version.parse(importlib.metadata.version("autoawq")) >= version.parse(MIN_AWQ_VERSION_FOR_PEFT)

0 comments on commit 864c8e6

Please sign in to comment.