Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add auto-gptq integration #175

Draft
wants to merge 16 commits into
base: main
Choose a base branch
from
Draft
167 changes: 0 additions & 167 deletions models/custom_autotune.py

This file was deleted.

17 changes: 14 additions & 3 deletions models/modeling_moss.py
Original file line number Diff line number Diff line change
Expand Up @@ -733,6 +733,17 @@ def _reorder_cache(
)

def quantize(self, wbits, groupsize):
from .quantization import quantize_with_gptq
return quantize_with_gptq(self, wbits, groupsize)

from auto_gptq.modeling._utils import make_quant, find_layers
try:
import triton
use_triton = True
except ImportError:
use_triton = False

layers = find_layers(self)
for name in ["lm_head"]:
if name in layers:
del layers[name]
make_quant(self, layers, wbits, groupsize, use_triton=use_triton)

return self
Loading