Skip to content

Commit

Permalink
add test_asym_gptq_v1.py (#740)
Browse files Browse the repository at this point in the history
* add test_asym_gptq_v1.py

* add base score
  • Loading branch information
CSY-ModelCloud authored Dec 4, 2024
1 parent 9c3296f commit b11d112
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/models/model_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ class ModelTest(unittest.TestCase):
DELETE_QUANTIZED_MODEL = True

# quant config
QUANT_FORMAT = FORMAT.GPTQ
DESC_ACT = True
SYM = True

def generate(self, model, tokenizer, prompt=None):
if prompt is None:
Expand Down Expand Up @@ -83,8 +85,9 @@ def quantModel(self, model_id_or_path, trust_remote_code=False, torch_dtype="aut
quantize_config = QuantizeConfig(
bits=4,
group_size=128,
format=FORMAT.GPTQ,
format=self.QUANT_FORMAT,
desc_act=self.DESC_ACT,
sym=self.SYM,
)
model = GPTQModel.load(
model_id_or_path,
Expand Down
19 changes: 19 additions & 0 deletions tests/test_asym_gptq_v1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# -- do not touch
import os

os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID"
# -- end do not touch
from gptqmodel.quantization import FORMAT # noqa: E402

from models.model_test import ModelTest # noqa: E402


class Test(ModelTest):
NATIVE_MODEL_ID = "/monster/data/model/Llama-3.2-1B-Instruct" # "meta-llama/Llama-3.2-1B-Instruct"
QUANT_FORMAT = FORMAT.GPTQ
SYM = False
NATIVE_ARC_CHALLENGE_ACC = 0.2747
NATIVE_ARC_CHALLENGE_ACC_NORM = 0.2935

def test(self):
self.quant_lm_eval()

0 comments on commit b11d112

Please sign in to comment.