Skip to content

Commit 325e86c

Browse files
committed
ruff
1 parent 967e35a commit 325e86c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

torchao/dtypes/uintx/gemlite_layout.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import warnings
12
from dataclasses import dataclass
23
from typing import Dict, Optional, Tuple
34

@@ -15,7 +16,6 @@
1516
from torchao.dtypes.utils import Layout, is_device
1617
from torchao.quantization.quant_primitives import quantize_affine
1718
from torchao.utils import fill_defaults
18-
import warnings
1919

2020
aten = torch.ops.aten
2121

@@ -81,7 +81,8 @@ def apply_gemlite_quant(
8181
warnings.simplefilter("once", UserWarning)
8282
warnings.warn(
8383
"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,
8586
)
8687
return weight
8788

@@ -182,9 +183,10 @@ def from_plain(
182183
exhaustive=False,
183184
use_cuda_graph=False,
184185
)
185-
if _layout.group_size == None and _layout.bit_width == 4:
186+
if _layout.group_size is None and _layout.bit_width == 4:
186187
from gemlite.core import GEMLITE_ACC_DTYPE
187188
from gemlite.dtypes import DType
189+
188190
GEMLITE_ACC_DTYPE[DType.FP16] = DType.FP32
189191

190192
out_features, in_features = int_data.shape

0 commit comments

Comments
 (0)