Skip to content

Commit e79c6c0

Browse files
fix quant scheme errors
Signed-off-by: Brian Dellabetta <[email protected]>
1 parent b88221b commit e79c6c0

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

tests/llmcompressor/pytorch/utils/test_sparse.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import pytest
22
import torch
3-
from compressed_tensors.quantization import QuantizationArgs, QuantizationScheme
3+
from compressed_tensors.quantization import QuantizationArgs, QuantizationScheme, QuantizationStrategy, QuantizationType
44
from torch.nn import Linear, Module, ReLU
55

66
from llmcompressor.pytorch.utils import ModuleSparsificationInfo
@@ -14,14 +14,16 @@ def __init__(self):
1414
self.relu = ReLU()
1515

1616
self.fc1.quantization_scheme = QuantizationScheme(
17-
targets=["model.fc1"],
18-
weights=QuantizationArgs(
19-
precision=8,
20-
granularity="per_tensor",
21-
algorithm="gptq",
22-
blocksize=128,
23-
),
24-
)
17+
targets=["Linear"],
18+
weights=QuantizationArgs(
19+
num_bits=4,
20+
type=QuantizationType.INT,
21+
group_size=128,
22+
strategy=QuantizationStrategy.GROUP,
23+
symmetric=True,
24+
dynamic=False,
25+
)
26+
)
2527

2628

2729
def test_module_quantization_info():

0 commit comments

Comments
 (0)