Skip to content

Commit 7103a27

Browse files
authored
remove QuantizationScheme.default_scheme (#202)
Signed-off-by: Kyle Sayers <[email protected]>
1 parent 9010372 commit 7103a27

File tree

2 files changed

+2
-24
lines changed

2 files changed

+2
-24
lines changed

src/compressed_tensors/quantization/quant_scheme.py

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class QuantizationScheme(BaseModel):
3636
of modules should be quantized
3737
3838
:param targets: list of modules to apply the QuantizationArgs to, can be layer
39-
names, layer types or a regular expression
39+
names, layer types or a regular expression, typically ["Linear"]
4040
:param weights: quantization config for layer weights
4141
:param input_activations: quantization config for layer inputs
4242
:param output_activations: quantization config for layer outputs
@@ -47,28 +47,6 @@ class QuantizationScheme(BaseModel):
4747
input_activations: Optional[QuantizationArgs] = None
4848
output_activations: Optional[QuantizationArgs] = None
4949

50-
@classmethod
51-
def default_scheme(
52-
cls,
53-
targets: Optional[List[str]] = None,
54-
):
55-
56-
if targets is None:
57-
# default to quantizing all Linear layers
58-
targets = ["Linear"]
59-
60-
# by default, activations and weights are left unquantized
61-
weights = None
62-
input_activations = None
63-
output_activations = None
64-
65-
return cls(
66-
targets=targets,
67-
weights=weights,
68-
input_activations=input_activations,
69-
output_activations=output_activations,
70-
)
71-
7250

7351
"""
7452
Pre-Set Quantization Scheme Args

tests/test_quantization/test_quant_scheme.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def test_needs_targets():
5353

5454
def test_defaults():
5555
targets = ["Linear"]
56-
output = QuantizationScheme.default_scheme(targets=targets)
56+
output = QuantizationScheme(targets=targets)
5757
assert output.weights is None
5858
assert output.input_activations is None
5959
assert output.output_activations is None

0 commit comments

Comments
 (0)