Skip to content

Commit

Permalink
check marlin/bitblas dependencies in base model
Browse files Browse the repository at this point in the history
  • Loading branch information
mobicham committed Jul 16, 2024
1 parent e57104f commit 96a5cc1
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions hqq/models/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,21 @@
from ..core.quantize import HQQLinear
from ..core.peft import PeftUtils, _HQQ_LORA_CLASSES
from ..backends.torchao import HQQLinearTorchWeightOnlynt4
from ..backends.marlin import MarlinLinear

_HQQ_BACKEND_CLASSES = [HQQLinearTorchWeightOnlynt4, MarlinLinear]
_HQQ_BACKEND_CLASSES = [HQQLinearTorchWeightOnlynt4]

try:
from ..backends.bitblas import HQQLinearBitBlas
_HQQ_BACKEND_CLASSES.append(HQQLinearBitBlas)
except Exception:
pass

try:
from ..backends.marlin import MarlinLinear
_HQQ_BACKEND_CLASSES.append(MarlinLinear)
except Exception:
pass


# Defined what is qualified as "linear layer"
_QUANT_LAYERS = [nn.Linear, HQQLinear] + _HQQ_LORA_CLASSES + _HQQ_BACKEND_CLASSES
Expand Down

0 comments on commit 96a5cc1

Please sign in to comment.