Skip to content

Commit

Permalink
Add back mistakenly deleted QAT BC import test (#1417)
Browse files Browse the repository at this point in the history
Summary: The unused imports in this test were mistakenly deleted
in #1359. This commit adds
them back.

Test Plan:
python test/quantization/test_qat.py
  • Loading branch information
andrewor14 authored Dec 13, 2024
1 parent a555734 commit 46b8796
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions test/quantization/test_qat.py
Original file line number Diff line number Diff line change
Expand Up @@ -1108,6 +1108,53 @@ def test_qat_prototype_bc(self):
Just to make sure we can import all the old prototype paths.
We will remove this test in the near future when we actually break BC.
"""
from torchao.quantization.prototype.qat import ( # noqa: F401, F811, I001
disable_4w_fake_quant,
disable_8da4w_fake_quant,
enable_4w_fake_quant,
enable_8da4w_fake_quant,
ComposableQATQuantizer,
Int8DynActInt4WeightQATLinear,
Int4WeightOnlyEmbeddingQATQuantizer,
Int4WeightOnlyQATQuantizer,
Int8DynActInt4WeightQATQuantizer,
)
from torchao.quantization.prototype.qat._module_swap_api import ( # noqa: F401, F811
disable_4w_fake_quant_module_swap,
enable_4w_fake_quant_module_swap,
disable_8da4w_fake_quant_module_swap,
enable_8da4w_fake_quant_module_swap,
Int4WeightOnlyQATQuantizerModuleSwap,
Int8DynActInt4WeightQATQuantizerModuleSwap,
)
from torchao.quantization.prototype.qat.affine_fake_quantized_tensor import ( # noqa: F401, F811
AffineFakeQuantizedTensor,
to_affine_fake_quantized,
)
from torchao.quantization.prototype.qat.api import ( # noqa: F401, F811
ComposableQATQuantizer,
FakeQuantizeConfig,
)
from torchao.quantization.prototype.qat.embedding import ( # noqa: F401, F811
FakeQuantizedEmbedding,
Int4WeightOnlyEmbeddingQATQuantizer,
Int4WeightOnlyEmbedding,
Int4WeightOnlyQATEmbedding,
)
from torchao.quantization.prototype.qat.fake_quantizer import ( # noqa: F401, F811
FakeQuantizer,
)
from torchao.quantization.prototype.qat.linear import ( # noqa: F401, F811
disable_4w_fake_quant,
disable_8da4w_fake_quant,
enable_4w_fake_quant,
enable_8da4w_fake_quant,
FakeQuantizedLinear,
Int4WeightOnlyQATLinear,
Int4WeightOnlyQATQuantizer,
Int8DynActInt4WeightQATLinear,
Int8DynActInt4WeightQATQuantizer,
)


if __name__ == "__main__":
Expand Down

0 comments on commit 46b8796

Please sign in to comment.