|  | 
| 92 | 92 |     to_weight_tensor_with_linear_activation_quantization_metadata, | 
| 93 | 93 | ) | 
| 94 | 94 | from torchao.utils import ( | 
|  | 95 | +    _ConfigDeprecationWrapper, | 
| 95 | 96 |     _is_fbgemm_genai_gpu_available, | 
| 96 | 97 |     is_MI300, | 
| 97 | 98 |     is_sm_at_least_89, | 
| @@ -639,7 +640,9 @@ def __post_init__(self): | 
| 639 | 640 | 
 | 
| 640 | 641 | 
 | 
| 641 | 642 | # for BC | 
| 642 |  | -int8_dynamic_activation_int4_weight = Int8DynamicActivationInt4WeightConfig | 
|  | 643 | +int8_dynamic_activation_int4_weight = _ConfigDeprecationWrapper( | 
|  | 644 | +    "int8_dynamic_activation_int4_weight", Int8DynamicActivationInt4WeightConfig | 
|  | 645 | +) | 
| 643 | 646 | 
 | 
| 644 | 647 | 
 | 
| 645 | 648 | @register_quantize_module_handler(Int8DynamicActivationInt4WeightConfig) | 
| @@ -957,7 +960,9 @@ def __post_init__(self): | 
| 957 | 960 | 
 | 
| 958 | 961 | 
 | 
| 959 | 962 | # for bc | 
| 960 |  | -int4_dynamic_activation_int4_weight = Int4DynamicActivationInt4WeightConfig | 
|  | 963 | +int4_dynamic_activation_int4_weight = _ConfigDeprecationWrapper( | 
|  | 964 | +    "int4_dynamic_activation_int4_weight", Int4DynamicActivationInt4WeightConfig | 
|  | 965 | +) | 
| 961 | 966 | 
 | 
| 962 | 967 | 
 | 
| 963 | 968 | @register_quantize_module_handler(Int4DynamicActivationInt4WeightConfig) | 
| @@ -1018,7 +1023,9 @@ def __post_init__(self): | 
| 1018 | 1023 | 
 | 
| 1019 | 1024 | 
 | 
| 1020 | 1025 | # for BC | 
| 1021 |  | -gemlite_uintx_weight_only = GemliteUIntXWeightOnlyConfig | 
|  | 1026 | +gemlite_uintx_weight_only = _ConfigDeprecationWrapper( | 
|  | 1027 | +    "gemlite_uintx_weight_only", GemliteUIntXWeightOnlyConfig | 
|  | 1028 | +) | 
| 1022 | 1029 | 
 | 
| 1023 | 1030 | 
 | 
| 1024 | 1031 | @register_quantize_module_handler(GemliteUIntXWeightOnlyConfig) | 
| @@ -1100,7 +1107,7 @@ def __post_init__(self): | 
| 1100 | 1107 | 
 | 
| 1101 | 1108 | # for BC | 
| 1102 | 1109 | # TODO maybe change other callsites | 
| 1103 |  | -int4_weight_only = Int4WeightOnlyConfig | 
|  | 1110 | +int4_weight_only = _ConfigDeprecationWrapper("int4_weight_only", Int4WeightOnlyConfig) | 
| 1104 | 1111 | 
 | 
| 1105 | 1112 | 
 | 
| 1106 | 1113 | def _int4_weight_only_quantize_tensor(weight, config): | 
| @@ -1310,7 +1317,7 @@ def __post_init__(self): | 
| 1310 | 1317 | 
 | 
| 1311 | 1318 | 
 | 
| 1312 | 1319 | # for BC | 
| 1313 |  | -int8_weight_only = Int8WeightOnlyConfig | 
|  | 1320 | +int8_weight_only = _ConfigDeprecationWrapper("int8_weight_only", Int8WeightOnlyConfig) | 
| 1314 | 1321 | 
 | 
| 1315 | 1322 | 
 | 
| 1316 | 1323 | def _int8_weight_only_quantize_tensor(weight, config): | 
| @@ -1471,7 +1478,9 @@ def __post_init__(self): | 
| 1471 | 1478 | 
 | 
| 1472 | 1479 | 
 | 
| 1473 | 1480 | # for BC | 
| 1474 |  | -int8_dynamic_activation_int8_weight = Int8DynamicActivationInt8WeightConfig | 
|  | 1481 | +int8_dynamic_activation_int8_weight = _ConfigDeprecationWrapper( | 
|  | 1482 | +    "int8_dynamic_activation_int8_weight", Int8DynamicActivationInt8WeightConfig | 
|  | 1483 | +) | 
| 1475 | 1484 | 
 | 
| 1476 | 1485 | 
 | 
| 1477 | 1486 | def _int8_dynamic_activation_int8_weight_quantize_tensor(weight, config): | 
| @@ -1580,7 +1589,9 @@ def __post_init__(self): | 
| 1580 | 1589 | 
 | 
| 1581 | 1590 | 
 | 
| 1582 | 1591 | # for BC | 
| 1583 |  | -float8_weight_only = Float8WeightOnlyConfig | 
|  | 1592 | +float8_weight_only = _ConfigDeprecationWrapper( | 
|  | 1593 | +    "float8_weight_only", Float8WeightOnlyConfig | 
|  | 1594 | +) | 
| 1584 | 1595 | 
 | 
| 1585 | 1596 | 
 | 
| 1586 | 1597 | def _float8_weight_only_quant_tensor(weight, config): | 
| @@ -1738,7 +1749,9 @@ def __post_init__(self): | 
| 1738 | 1749 | 
 | 
| 1739 | 1750 | 
 | 
| 1740 | 1751 | # for bc | 
| 1741 |  | -float8_dynamic_activation_float8_weight = Float8DynamicActivationFloat8WeightConfig | 
|  | 1752 | +float8_dynamic_activation_float8_weight = _ConfigDeprecationWrapper( | 
|  | 1753 | +    "float8_dynamic_activation_float8_weight", Float8DynamicActivationFloat8WeightConfig | 
|  | 1754 | +) | 
| 1742 | 1755 | 
 | 
| 1743 | 1756 | 
 | 
| 1744 | 1757 | def _float8_dynamic_activation_float8_weight_quantize_tensor(weight, config): | 
| @@ -1911,7 +1924,9 @@ def __post_init__(self): | 
| 1911 | 1924 | 
 | 
| 1912 | 1925 | 
 | 
| 1913 | 1926 | # for bc | 
| 1914 |  | -float8_static_activation_float8_weight = Float8StaticActivationFloat8WeightConfig | 
|  | 1927 | +float8_static_activation_float8_weight = _ConfigDeprecationWrapper( | 
|  | 1928 | +    "float8_static_activation_float8_weight", Float8StaticActivationFloat8WeightConfig | 
|  | 1929 | +) | 
| 1915 | 1930 | 
 | 
| 1916 | 1931 | 
 | 
| 1917 | 1932 | @register_quantize_module_handler(Float8StaticActivationFloat8WeightConfig) | 
| @@ -1994,7 +2009,9 @@ def __post_init__(self): | 
| 1994 | 2009 | 
 | 
| 1995 | 2010 | 
 | 
| 1996 | 2011 | # for BC | 
| 1997 |  | -uintx_weight_only = UIntXWeightOnlyConfig | 
|  | 2012 | +uintx_weight_only = _ConfigDeprecationWrapper( | 
|  | 2013 | +    "uintx_weight_only", UIntXWeightOnlyConfig | 
|  | 2014 | +) | 
| 1998 | 2015 | 
 | 
| 1999 | 2016 | 
 | 
| 2000 | 2017 | @register_quantize_module_handler(UIntXWeightOnlyConfig) | 
| @@ -2234,7 +2251,7 @@ def __post_init__(self): | 
| 2234 | 2251 | 
 | 
| 2235 | 2252 | 
 | 
| 2236 | 2253 | # for BC | 
| 2237 |  | -fpx_weight_only = FPXWeightOnlyConfig | 
|  | 2254 | +fpx_weight_only = _ConfigDeprecationWrapper("fpx_weight_only", FPXWeightOnlyConfig) | 
| 2238 | 2255 | 
 | 
| 2239 | 2256 | 
 | 
| 2240 | 2257 | @register_quantize_module_handler(FPXWeightOnlyConfig) | 
|  | 
0 commit comments