Skip to content

Commit f3771a8

Browse files
committed
fix
1 parent 10deb16 commit f3771a8

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

src/diffusers/quantizers/torchao/torchao_quantizer.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -35,28 +35,28 @@
3535
import torch
3636
import torch.nn as nn
3737

38+
SUPPORTED_TORCH_DTYPES_FOR_QUANTIZATION = (
39+
# At the moment, only int8 is supported for integer quantization dtypes.
40+
# In Torch 2.6, int1-int7 will be introduced, so this can be visited in the future
41+
# to support more quantization methods, such as intx_weight_only.
42+
torch.int8,
43+
torch.float8_e4m3fn,
44+
torch.float8_e5m2,
45+
torch.uint1,
46+
torch.uint2,
47+
torch.uint3,
48+
torch.uint4,
49+
torch.uint5,
50+
torch.uint6,
51+
torch.uint7,
52+
)
53+
3854
if is_torchao_available():
3955
from torchao.quantization import quantize_
4056

4157

4258
logger = logging.get_logger(__name__)
4359

44-
SUPPORTED_TORCH_DTYPES_FOR_QUANTIZATION = (
45-
# At the moment, only int8 is supported for integer quantization dtypes.
46-
# In Torch 2.6, int1-int7 will be introduced, so this can be visited in the future
47-
# to support more quantization methods, such as intx_weight_only.
48-
torch.int8,
49-
torch.float8_e4m3fn,
50-
torch.float8_e5m2,
51-
torch.uint1,
52-
torch.uint2,
53-
torch.uint3,
54-
torch.uint4,
55-
torch.uint5,
56-
torch.uint6,
57-
torch.uint7,
58-
)
59-
6060

6161
def _quantization_type(weight):
6262
from torchao.dtypes import AffineQuantizedTensor

0 commit comments

Comments
 (0)