Skip to content

Commit 480f073

Browse files
committed
add IntxUnpackedToInt8Tensor to safetensors
ghstack-source-id: 7f1fbe3 Pull Request resolved: #3065
1 parent ac7f8cd commit 480f073

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

test/prototype/safetensors/test_safetensors_support.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
from torchao.quantization.quant_api import (
2121
Float8DynamicActivationFloat8WeightConfig,
2222
Int4WeightOnlyConfig,
23+
Int8DynamicActivationIntxWeightConfig,
24+
IntxWeightOnlyConfig,
2325
)
2426
from torchao.utils import is_sm_at_least_89
2527

@@ -46,6 +48,8 @@ class TestSafeTensors(TestCase):
4648
(Int4WeightOnlyConfig(), False),
4749
(Int4WeightOnlyConfig(), True),
4850
(Int4WeightOnlyConfig(int4_packing_format="tile_packed_to_4d"), False),
51+
(IntxWeightOnlyConfig(), False),
52+
(Int8DynamicActivationIntxWeightConfig(), False),
4953
],
5054
)
5155
def test_safetensors(self, config, act_pre_scale=False):

torchao/prototype/safetensors/safetensors_utils.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
Float8Tensor,
1111
Int4Tensor,
1212
Int4TilePackedTo4dTensor,
13+
IntxUnpackedToInt8Tensor,
1314
)
1415
from torchao.quantization.quantize_.common import KernelPreference
1516
from torchao.quantization.quantize_.workflows import QuantizeTensorToFloat8Kwargs
@@ -18,6 +19,7 @@
1819
"Float8Tensor": Float8Tensor,
1920
"Int4Tensor": Int4Tensor,
2021
"Int4TilePackedTo4dTensor": Int4TilePackedTo4dTensor,
22+
"IntxUnpackedToInt8Tensor": IntxUnpackedToInt8Tensor,
2123
"Float8MMConfig": torchao.float8.inference.Float8MMConfig,
2224
"QuantizeTensorToFloat8Kwargs": QuantizeTensorToFloat8Kwargs,
2325
"PerRow": torchao.quantization.PerRow,
@@ -29,6 +31,7 @@
2931
"Float8Tensor",
3032
"Int4Tensor",
3133
"Int4TilePackedTo4dTensor",
34+
"IntxUnpackedToInt8Tensor",
3235
]
3336

3437
__all__ = [

0 commit comments

Comments
 (0)