Skip to content

[FIX] qqq with eora #1415

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

Merged
merged 2 commits into from
Mar 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gptqmodel/adapter/adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def remove(cls, path):
class Adapter():
def __init__(self, rank: int = None, path: str = None):
self.rank = rank # rank may be zero, when loading, and rank will be re-populated by loading saved LoraConfig file
self.path = path.lower().strip() if isinstance(path, str) else path
self.path = path.strip() if isinstance(path, str) else path

def validate_path(self, local=False):
if not self.path or not isinstance(self.path, str):
Expand Down
2 changes: 1 addition & 1 deletion gptqmodel/nn_modules/qlinear/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ def post_init(self):
if self.adapter is not None:
self.adapter.post_init(
weight_key=self.name,
device=self.qweight.device,
device=next(self.parameters()).device,
lora_A=getattr(self, "lora_A", None),
lora_B=getattr(self, "lora_B", None))

Expand Down
2 changes: 1 addition & 1 deletion gptqmodel/utils/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ def convert_gptq_v2_to_v1_format(
for _, submodule in model.named_modules():
# sym=False has underflow probability of ~<=13% during testing. No underflow possible for sym=True.
if isinstance(submodule, qlinear_kernel):
convert_gptq_v2_to_v1_format_module(module=submodule, cfg=cfg)
convert_gptq_v2_to_v1_format_module(module=submodule, quantize_config=quantize_config)

return model

Expand Down
14 changes: 13 additions & 1 deletion tests/test_quant_and_eora.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
# -- do not touch
import os

from parameterized import parameterized

from gptqmodel.quantization import QUANT_METHOD, FORMAT

os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID"
# -- end do not touch

Expand Down Expand Up @@ -45,7 +49,13 @@ class Test(ModelTest):
def setUpClass(cls):
pass

def test_quant_and_eora(self):
@parameterized.expand(
[
# (QUANT_METHOD.GPTQ, FORMAT.GPTQ),
(QUANT_METHOD.QQQ, FORMAT.QQQ),
]
)
def test_quant_and_eora(self, quant_method: QUANT_METHOD, format: FORMAT):
bits = 4
group_size = 128
desc_act = True
Expand Down Expand Up @@ -91,6 +101,8 @@ def test_quant_and_eora(self):
group_size=group_size,
desc_act=desc_act, # bitblas only supports DESC_ACT=False
adapter=eora,
format=format,
quant_method=quant_method,
)

model = GPTQModel.load(
Expand Down