File tree 1 file changed +5
-3
lines changed 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change
1
+ import warnings
1
2
from dataclasses import dataclass
2
3
from typing import Dict , Optional , Tuple
3
4
15
16
from torchao .dtypes .utils import Layout , is_device
16
17
from torchao .quantization .quant_primitives import quantize_affine
17
18
from torchao .utils import fill_defaults
18
- import warnings
19
19
20
20
aten = torch .ops .aten
21
21
@@ -81,7 +81,8 @@ def apply_gemlite_quant(
81
81
warnings .simplefilter ("once" , UserWarning )
82
82
warnings .warn (
83
83
"Gemlite only works for layers with in_features or out_features divisible by 128, "
84
- + "some layers have been skipped" , UserWarning
84
+ + "some layers have been skipped" ,
85
+ UserWarning ,
85
86
)
86
87
return weight
87
88
@@ -182,9 +183,10 @@ def from_plain(
182
183
exhaustive = False ,
183
184
use_cuda_graph = False ,
184
185
)
185
- if _layout .group_size == None and _layout .bit_width == 4 :
186
+ if _layout .group_size is None and _layout .bit_width == 4 :
186
187
from gemlite .core import GEMLITE_ACC_DTYPE
187
188
from gemlite .dtypes import DType
189
+
188
190
GEMLITE_ACC_DTYPE [DType .FP16 ] = DType .FP32
189
191
190
192
out_features , in_features = int_data .shape
You can’t perform that action at this time.
0 commit comments