Skip to content

[Reland] Remove torchao.quantization.prototype #1975

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 0 additions & 56 deletions test/quantization/test_qat.py
Original file line number Diff line number Diff line change
Expand Up @@ -1133,62 +1133,6 @@ def embedding_forward_4w(x: torch.Tensor, weight: torch.Tensor) -> torch.Tensor:
baseline_out = embedding_forward_4w(x2, fq_embedding.weight)
torch.testing.assert_close(baseline_out, fq_out, atol=0, rtol=0)

@unittest.skipIf(
not TORCH_VERSION_AT_LEAST_2_4, "skipping when torch version is 2.4 or lower"
)
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,
)

@unittest.skipIf(
not TORCH_VERSION_AT_LEAST_2_4, "skipping when torch version is 2.4 or lower"
)
Expand Down
Empty file.
3 changes: 0 additions & 3 deletions torchao/quantization/prototype/qat/README.md

This file was deleted.

25 changes: 0 additions & 25 deletions torchao/quantization/prototype/qat/__init__.py

This file was deleted.

30 changes: 0 additions & 30 deletions torchao/quantization/prototype/qat/_module_swap_api.py

This file was deleted.

This file was deleted.

9 changes: 0 additions & 9 deletions torchao/quantization/prototype/qat/api.py

This file was deleted.

13 changes: 0 additions & 13 deletions torchao/quantization/prototype/qat/embedding.py

This file was deleted.

7 changes: 0 additions & 7 deletions torchao/quantization/prototype/qat/fake_quantizer.py

This file was deleted.

23 changes: 0 additions & 23 deletions torchao/quantization/prototype/qat/linear.py

This file was deleted.

Loading