Skip to content

Commit cd7975e

Browse files
authored
Rename Float8ActivationInt4WeightConfig to Float8DynamicActivationInt4WeightConfig (#2746)
Summary: This was a mistake, we need to align the name with other dynamic quant configs Test Plan: CI Reviewers: Subscribers: Tasks: Tags:
1 parent d08bbb0 commit cd7975e

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

docs/source/api_ref_quantization.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Inference APIs for quantize\_
2424
:nosignatures:
2525

2626
Int4WeightOnlyConfig
27-
Float8ActivationInt4WeightConfig
27+
Float8DynamicActivationInt4WeightConfig
2828
Float8DynamicActivationFloat8WeightConfig
2929
Float8WeightOnlyConfig
3030
Float8StaticActivationFloat8WeightConfig

test/quantization/quantize_/workflows/int4/test_int4_preshuffled_tensor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
)
1717

1818
from torchao.quantization import (
19-
Float8ActivationInt4WeightConfig,
19+
Float8DynamicActivationInt4WeightConfig,
2020
Int4WeightOnlyConfig,
2121
quantize_,
2222
)
@@ -33,7 +33,7 @@
3333
VERSION=2,
3434
)
3535

36-
FP8_ACT_CONFIG = Float8ActivationInt4WeightConfig(
36+
FP8_ACT_CONFIG = Float8DynamicActivationInt4WeightConfig(
3737
group_size=128,
3838
packing_format="preshuffled",
3939
)

torchao/quantization/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@
4444
from .quant_api import (
4545
CutlassInt4PackedLayout,
4646
FbgemmConfig,
47-
Float8ActivationInt4WeightConfig,
4847
Float8DynamicActivationFloat8SemiSparseWeightConfig,
4948
Float8DynamicActivationFloat8WeightConfig,
49+
Float8DynamicActivationInt4WeightConfig,
5050
Float8MMConfig,
5151
Float8StaticActivationFloat8WeightConfig,
5252
Float8WeightOnlyConfig,
@@ -143,7 +143,7 @@
143143
"Int8DynamicActivationInt8WeightConfig",
144144
"Int8DynamicActivationIntxWeightConfig",
145145
"Int4WeightOnlyConfig",
146-
"Float8ActivationInt4WeightConfig",
146+
"Float8DynamicActivationInt4WeightConfig",
147147
"Int8WeightOnlyConfig",
148148
"Float8WeightOnlyConfig",
149149
"Float8DynamicActivationFloat8WeightConfig",

torchao/quantization/quant_api.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1252,7 +1252,7 @@ def _int4_weight_only_transform(
12521252

12531253

12541254
@dataclass
1255-
class Float8ActivationInt4WeightConfig(AOBaseConfig):
1255+
class Float8DynamicActivationInt4WeightConfig(AOBaseConfig):
12561256
"""Configuration for apply float8 dynamic per row quantization and int4
12571257
per group weight quantization to linear
12581258
@@ -1265,9 +1265,9 @@ class Float8ActivationInt4WeightConfig(AOBaseConfig):
12651265
packing_format: PackingFormat = "preshuffled"
12661266

12671267

1268-
@register_quantize_module_handler(Float8ActivationInt4WeightConfig)
1269-
def _float8_activation_int4_weight_transform(
1270-
module: torch.nn.Module, config: Float8ActivationInt4WeightConfig
1268+
@register_quantize_module_handler(Float8DynamicActivationInt4WeightConfig)
1269+
def _float8_dynamic_activation_int4_weight_transform(
1270+
module: torch.nn.Module, config: Float8DynamicActivationInt4WeightConfig
12711271
) -> torch.nn.Module:
12721272
assert hasattr(module, "weight"), (
12731273
"applying int8 weight only quant requires module to have weight attribute"

0 commit comments

Comments
 (0)