Skip to content

Commit 629e7ca

Browse files
revert is_marlin_format check (#1316)
1 parent cd69d3e commit 629e7ca

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

gptqmodel/quantization/config.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333

3434
FORMAT_FIELD_CODE = "format"
3535
FORMAT_FIELD_JSON = "checkpoint_format"
36+
FORMAT_FIELD_COMPAT_MARLIN = "is_marlin_format"
3637
QUANT_METHOD_FIELD = "quant_method"
3738
PACK_DTYPE_FIELD = "pack_dtype"
3839
QUANT_CONFIG_FILENAME = "quantize_config.json"
@@ -184,6 +185,8 @@ class QuantizeConfig():
184185
# pending used field
185186
adapter: Optional[Union[Dict[str, Any], Lora]] = field(default=None)
186187

188+
is_marlin_format: bool = False
189+
187190
def __post_init__(self):
188191
fields_info = fields(self)
189192

@@ -351,6 +354,8 @@ def from_quant_config(cls, quantize_cfg, format: str = None):
351354
raise ValueError(f"QuantizeConfig: Unknown quantization method: `{val}`.")
352355
else:
353356
normalized[QUANT_METHOD_FIELD] = val
357+
elif key == FORMAT_FIELD_COMPAT_MARLIN and val:
358+
normalized[FORMAT_FIELD_CODE] = FORMAT.MARLIN
354359
elif key in field_names:
355360
normalized[key] = val
356361
else:

tests/test_quant_formats.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ def setUpClass(self):
4949

5050
@parameterized.expand(
5151
[
52-
# (QUANT_METHOD.GPTQ, BACKEND.AUTO, False, FORMAT.GPTQ, 8),
52+
(QUANT_METHOD.GPTQ, BACKEND.AUTO, False, FORMAT.GPTQ, 8),
5353
(QUANT_METHOD.GPTQ, BACKEND.EXLLAMA_V2, True, FORMAT.GPTQ_V2, 4),
54-
# (QUANT_METHOD.GPTQ, BACKEND.EXLLAMA_V2, False, FORMAT.GPTQ, 4),
54+
(QUANT_METHOD.GPTQ, BACKEND.EXLLAMA_V2, False, FORMAT.GPTQ, 4),
5555
]
5656
)
5757
def test_quantize(self, method: QUANT_METHOD, backend: BACKEND, sym: bool, format: FORMAT, bits: int):
@@ -115,12 +115,13 @@ def test_quantize(self, method: QUANT_METHOD, backend: BACKEND, sym: bool, forma
115115
if not sym and format == FORMAT.GPTQ or format == FORMAT.IPEX:
116116
return
117117

118-
# test compat: 1) with simple dict type
118+
# test compat: 1) with simple dict type 2) is_marlin_format
119119
compat_quantize_config = {
120120
"bits": bits,
121121
"group_size": 128,
122122
"sym": sym,
123123
"desc_act": False if format == FORMAT.MARLIN else True,
124+
"is_marlin_format": backend == BACKEND.MARLIN,
124125
}
125126

126127
model = GPTQModel.load(

0 commit comments

Comments
 (0)