pytorch
25ee5257 - [ao][sparsity] comsability for sparsity and QAT convert

Commit
3 years ago
[ao][sparsity] comsability for sparsity and QAT convert Summary: The primary issue for enabling sparsity to work with QAT convert (unlike normal quantization convert) is that when the parametrized module undergoes the QAT convert, the parametrizations need to be maintained. If the parametrizations don't get transfered during the convert, the sparsifier would lose its connection to the model. In practice this was handled using the transfer_parametrizations_and_params function to move the weight and bias and any associated paramerizations to the new module. This PR also adds tests for transfer_parametrizations_and_params and type_before_parametrizations to test_nn.py and also added comments to the test code for composability. Test Plan: python test/test_ao_sparsity.py TestComposability python test/test_nn.py TestNN Reviewers: Subscribers: Tasks: Tags: Pull Request resolved: https://github.com/pytorch/pytorch/pull/74848 Approved by: https://github.com/vkuzo, https://github.com/Lezcano
Author
Committer
Parents
Loading