Skip to content

Commit 74a6aee

Browse files
committed
up
1 parent 1218e5a commit 74a6aee

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

examples/models/llama/source_transformation/quantize.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,12 @@ def quantize( # noqa C901
107107
print("quantized model:", model)
108108
return model
109109
elif qmode.startswith("torchao:8da"):
110+
# Check for required args
111+
if group_size is None:
112+
raise Exception(
113+
"For torchao:8daxw quantization, group size must be specified."
114+
)
115+
110116
pattern = r"torchao:8da(\d+)w"
111117
matches = re.findall(pattern, qmode)
112118
assert len(matches) == 1, f"Expected 1 match for pattern but got {len(matches)}"

0 commit comments

Comments
 (0)