File tree Expand file tree Collapse file tree 2 files changed +17
-10
lines changed
src/compressed_tensors/quantization Expand file tree Collapse file tree 2 files changed +17
-10
lines changed Original file line number Diff line number Diff line change @@ -57,15 +57,9 @@ def default_scheme(
57
57
# default to quantizing all Linear layers
58
58
targets = ["Linear" ]
59
59
60
- # default to 8 bit integer symmetric quantization
61
- # for weights
62
- weights = QuantizationArgs (num_bits = 8 , symmetric = True )
63
-
64
- # default to 8 bit integer asymmetric quantization
65
- input_activations = QuantizationArgs (num_bits = 8 , symmetric = True )
66
-
67
- # Do not quantize the output activations
68
- # by default
60
+ # by default, activations and weights are left unquantized
61
+ weights = None
62
+ input_activations = None
69
63
output_activations = None
70
64
71
65
return cls (
@@ -110,6 +104,7 @@ def is_preset_scheme(name: str) -> bool:
110
104
"""
111
105
return name .upper () in PRESET_SCHEMES
112
106
107
+
113
108
UNQUANTIZED = dict ()
114
109
115
110
# 8 bit integer weights and 8 bit activations quantization
Original file line number Diff line number Diff line change 13
13
# limitations under the License.
14
14
15
15
import pytest
16
- from compressed_tensors .quantization import QuantizationArgs , QuantizationScheme
16
+ from compressed_tensors .quantization import (
17
+ QuantizationArgs ,
18
+ QuantizationConfig ,
19
+ QuantizationScheme ,
20
+ )
17
21
from pydantic import ValidationError
18
22
19
23
@@ -49,3 +53,11 @@ def test_full_scheme():
49
53
def test_needs_targets ():
50
54
with pytest .raises (ValidationError ):
51
55
_ = QuantizationScheme ()
56
+
57
+
58
+ def test_defaults ():
59
+ targets = ["Linear" ]
60
+ output = QuantizationScheme .default_scheme (targets = targets )
61
+ assert output .weights is None
62
+ assert output .input_activations is None
63
+ assert output .output_activations is None
You can’t perform that action at this time.
0 commit comments