Files
pytorch/test/test_ao_sparsity.py
Charles David Hernandez 02e30a09f7 [ao][sparsity] make sparsity and PTQ compose (#74845)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/74845

This PR adds support for quantization flow to detect
parametrized modules and match them using their original module types.
This mainly involved using the new type_before_parametrizations function rather than
type to check for module mathcing

Test Plan:
python test/test_ao_sparsity.py TestComposability

Imported from OSS

Reviewed By: jerryzh168

Differential Revision: D35240274

fbshipit-source-id: 7294d89c9c2e069e51d8b9bafa45c15f92bed124
(cherry picked from commit ed5cdb7b636c42e040d1b4a67b6b94604d06e1ff)
2022-04-05 03:35:41 +00:00

28 lines
835 B
Python

# -*- coding: utf-8 -*-
# Owner(s): ["module: unknown"]
from torch.testing._internal.common_utils import run_tests
# Kernels
from ao.sparsity.test_kernels import TestQuantizedSparseKernels # noqa: F401
from ao.sparsity.test_kernels import TestQuantizedSparseLayers # noqa: F401
# Parametrizations
from ao.sparsity.test_parametrization import TestFakeSparsity # noqa: F401
# Sparsifier
from ao.sparsity.test_sparsifier import TestBaseSparsifier # noqa: F401
from ao.sparsity.test_sparsifier import TestWeightNormSparsifier # noqa: F401
# Pruner
from ao.sparsity.test_pruner import TestBasePruner # noqa: F401
# Scheduler
from ao.sparsity.test_scheduler import TestScheduler # noqa: F401
# Composability
from ao.sparsity.test_composability import TestComposability # noqa: F401
if __name__ == '__main__':
run_tests()