Skip to content

Commit 65a9917

Browse files
committed
Deprecate old QAT APIs
**Summary:** Deprecates QAT APIs that should no longer be used. Print helpful deprecation warning to help users migrate. **Test Plan:** ``` python test/quantization/test_qat.py -k test_qat_api_deprecation ``` Also manual testing: ``` 'IntXQuantizationAwareTrainingConfig' is deprecated and will be removed in a future release. Please use the following API instead: base_config = Int8DynamicActivationInt4WeightConfig(group_size=32) quantize_(model, QATConfig(base_config, step="prepare")) # train (not shown) quantize_(model, QATConfig(base_config, step="convert")) Alternatively, if you prefer to pass in fake quantization configs: activation_config = IntxFakeQuantizeConfig(torch.int8, "per_token", is_symmetric=False) weight_config = IntxFakeQuantizeConfig(torch.int4, group_size=32) qat_config = QATConfig( activation_config=activation_config, weight_config=weight_config, step="prepare", ) quantize_(model, qat_config) Please see #2630 for more details. IntXQuantizationAwareTrainingConfig(activation_config=None, weight_config=None) ``` ghstack-source-id: 4e209aa Pull Request resolved: #2641
1 parent e6b38bb commit 65a9917

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

docs/source/api_ref_qat.rst

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,13 @@ Custom QAT APIs
3535
linear.enable_linear_fake_quant
3636
linear.disable_linear_fake_quant
3737

38-
Legacy QAT APIs
38+
Legacy QAT Quantizers
3939
---------------------
4040

4141
.. autosummary::
4242
:toctree: generated/
4343
:nosignatures:
4444

45-
IntXQuantizationAwareTrainingConfig
46-
FromIntXQuantizationAwareTrainingConfig
4745
Int4WeightOnlyQATQuantizer
4846
linear.Int4WeightOnlyQATLinear
4947
Int8DynActInt4WeightQATQuantizer

torchao/quantization/qat/fake_quantize_config.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535

3636
from .utils import _log_deprecation_warning
3737

38+
from .utils import _log_deprecation_warning
39+
3840

3941
class FakeQuantizeConfigBase(abc.ABC):
4042
"""

0 commit comments

Comments
 (0)