-
Notifications
You must be signed in to change notification settings - Fork 26.3k
[ao][sparsity] make sparsity compose with PTQ convert #74846
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
Conversation
Summary: making sure it works for PTQ even if squash_mask isn't applied Test Plan: Reviewers: Subscribers: Tasks: Tags: [ghstack-poisoned]
🔗 Helpful links
💊 CI failures summary and remediationsAs of commit 78ab3d0 (more details on the Dr. CI page):
🕵️♀️ 1 failure not recognized by patterns:The following CI failures may be due to changes from the PR
This comment was automatically generated by Dr. CI (expand for details).Please report bugs/suggestions to the (internal) Dr. CI Users group. |
Summary: making sure it works for PTQ even if squash_mask isn't applied Test Plan: Reviewers: Subscribers: Tasks: Tags: [ghstack-poisoned]
Summary: This PR primarily allows the PTQ convert function to work with parametrized modules. Given that the parametrized weight is what is used by default in convert, as long as sparsifier.step() has already been called, the converted model will use the sparisified weights. There is currently no way to handle things if sparsifier.step() has not been called. Test Plan: python test/test_ao_sparsity.py TestComposability Reviewers: Subscribers: Tasks: Tags: [ghstack-poisoned]
Summary: This PR primarily allows the PTQ convert function to work with parametrized modules. Given that the parametrized weight is what is used by default in convert, as long as sparsifier.step() has already been called, the converted model will use the sparisified weights. There is currently no way to handle things if sparsifier.step() has not been called. Test Plan: python test/test_ao_sparsity.py TestComposability Reviewers: Subscribers: Tasks: Tags: [ghstack-poisoned]
Summary: This PR primarily allows the PTQ convert function to work with parametrized modules. Given that the parametrized weight is what is used by default in convert, as long as sparsifier.step() has already been called, the converted model will use the sparisified weights. There is currently no way to handle things if sparsifier.step() has not been called. Test Plan: python test/test_ao_sparsity.py TestComposability Reviewers: Subscribers: Tasks: Tags: [ghstack-poisoned]
Summary: This PR primarily allows the PTQ convert function to work with parametrized modules. Given that the parametrized weight is what is used by default in convert, as long as sparsifier.step() has already been called, the converted model will use the sparisified weights. There is currently no way to handle things if sparsifier.step() has not been called. Test Plan: python test/test_ao_sparsity.py TestComposability Reviewers: Subscribers: Tasks: Tags: [ghstack-poisoned]
Summary: This PR primarily allows the PTQ convert function to work with parametrized modules. Given that the parametrized weight is what is used by default in convert, as long as sparsifier.step() has already been called, the converted model will use the sparisified weights. There is currently no way to handle things if sparsifier.step() has not been called. Test Plan: python test/test_ao_sparsity.py TestComposability Reviewers: Subscribers: Tasks: Tags: [ghstack-poisoned]
Summary: This PR primarily allows the PTQ convert function to work with parametrized modules. Given that the parametrized weight is what is used by default in convert, as long as sparsifier.step() has already been called, the converted model will use the sparisified weights. There is currently no way to handle things if sparsifier.step() has not been called. Test Plan: python test/test_ao_sparsity.py TestComposability Reviewers: Subscribers: Tasks: Tags: [ghstack-poisoned]
Summary: This PR primarily allows the PTQ convert function to work with parametrized modules. Given that the parametrized weight is what is used by default in convert, as long as sparsifier.step() has already been called, the converted model will use the sparisified weights. There is currently no way to handle things if sparsifier.step() has not been called. Lastly, added the is_leaf_or_only_parametrized function because parametrized modules no longer look like leaves due to the parametrizations module attached to them Test Plan: python test/test_ao_sparsity.py TestComposability Reviewers: Subscribers: Tasks: Tags: [ghstack-poisoned]
Summary: This PR primarily allows the PTQ convert function to work with parametrized modules. Given that the parametrized weight is what is used by default in convert, as long as sparsifier.step() has already been called, the converted model will use the sparisified weights. There is currently no way to handle things if sparsifier.step() has not been called. Lastly, added the is_leaf_or_only_parametrized function because parametrized modules no longer look like leaves due to the parametrizations module attached to them Test Plan: python test/test_ao_sparsity.py TestComposability Reviewers: Subscribers: Tasks: Tags: [ghstack-poisoned]
|
@HDCharles has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
torch/nn/quantized/modules/linear.py
Outdated
| from torch.nn.utils.fusion import fuse_linear_bn_weights | ||
| from typing import Optional | ||
|
|
||
| from torch.nn.utils.parametrize import is_parametrized |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: fix lint
Summary: This PR primarily allows the PTQ convert function to work with parametrized modules. Given that the parametrized weight is what is used by default in convert, as long as sparsifier.step() has already been called, the converted model will use the sparisified weights. There is currently no way to handle things if sparsifier.step() has not been called. Lastly, added the has_no_children_ignoring_parametrizations function because parametrized modules no longer look like leaves due to the parametrizations module attached to them Test Plan: python test/test_ao_sparsity.py TestComposability Reviewers: Subscribers: Tasks: Tags: Differential Revision: [D35240275](https://our.internmc.facebook.com/intern/diff/D35240275) [ghstack-poisoned]
|
@HDCharles has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
Summary: This PR primarily allows the PTQ convert function to work with parametrized modules. Given that the parametrized weight is what is used by default in convert, as long as sparsifier.step() has already been called, the converted model will use the sparisified weights. There is currently no way to handle things if sparsifier.step() has not been called. Lastly, added the has_no_children_ignoring_parametrizations function because parametrized modules no longer look like leaves due to the parametrizations module attached to them Test Plan: python test/test_ao_sparsity.py TestComposability Reviewers: Subscribers: Tasks: Tags: Differential Revision: [D35240275](https://our.internmc.facebook.com/intern/diff/D35240275) [ghstack-poisoned]
|
@HDCharles has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
Summary: This PR primarily allows the PTQ convert function to work with parametrized modules. Given that the parametrized weight is what is used by default in convert, as long as sparsifier.step() has already been called, the converted model will use the sparisified weights. There is currently no way to handle things if sparsifier.step() has not been called. Lastly, added the has_no_children_ignoring_parametrizations function because parametrized modules no longer look like leaves due to the parametrizations module attached to them Test Plan: python test/test_ao_sparsity.py TestComposability Reviewers: Subscribers: Tasks: Tags: Differential Revision: [D35240275](https://our.internmc.facebook.com/intern/diff/D35240275) [ghstack-poisoned]
|
@HDCharles has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
| self.assertTrue(isinstance(mod[5], torch.nn.quantized.Linear)) | ||
| self.assertEqual(mod(torch.randn(1, 4, 4, 4)).shape, torch.Size([1, 4, 4, 4])) | ||
|
|
||
| def test_convert_without_squash_mask(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: same more this, I feel these tests are a bit complicated so we should have more comments on the context, also for future tests in this file as well
Summary: This PR primarily allows the PTQ convert function to work with parametrized modules. Given that the parametrized weight is what is used by default in convert, as long as sparsifier.step() has already been called, the converted model will use the sparisified weights. There is currently no way to handle things if sparsifier.step() has not been called. Lastly, added the has_no_children_ignoring_parametrizations function because parametrized modules no longer look like leaves due to the parametrizations module attached to them Test Plan: python test/test_ao_sparsity.py TestComposability Reviewers: Subscribers: Tasks: Tags: Differential Revision: [D35240275](https://our.internmc.facebook.com/intern/diff/D35240275) [ghstack-poisoned]
|
@HDCharles has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
Summary: This PR primarily allows the PTQ convert function to work with parametrized modules. Given that the parametrized weight is what is used by default in convert, as long as sparsifier.step() has already been called, the converted model will use the sparisified weights. There is currently no way to handle things if sparsifier.step() has not been called. Lastly, added the has_no_children_ignoring_parametrizations function because parametrized modules no longer look like leaves due to the parametrizations module attached to them Test Plan: python test/test_ao_sparsity.py TestComposability Reviewers: Subscribers: Tasks: Tags: Differential Revision: [D35240275](https://our.internmc.facebook.com/intern/diff/D35240275) [ghstack-poisoned]
|
@HDCharles has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
1 similar comment
|
@HDCharles has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
Summary: This PR primarily allows the PTQ convert function to work with parametrized modules. Given that the parametrized weight is what is used by default in convert, as long as sparsifier.step() has already been called, the converted model will use the sparisified weights. There is currently no way to handle things if sparsifier.step() has not been called. Lastly, added the has_no_children_ignoring_parametrizations function because parametrized modules no longer look like leaves due to the parametrizations module attached to them Test Plan: python test/test_ao_sparsity.py TestComposability Reviewers: Subscribers: Tasks: Tags: Differential Revision: [D35240275](https://our.internmc.facebook.com/intern/diff/D35240275) [ghstack-poisoned]
|
@HDCharles has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
Summary: This PR primarily allows the PTQ convert function to work with parametrized modules. Given that the parametrized weight is what is used by default in convert, as long as sparsifier.step() has already been called, the converted model will use the sparisified weights. There is currently no way to handle things if sparsifier.step() has not been called. Lastly, added the has_no_children_ignoring_parametrizations function because parametrized modules no longer look like leaves due to the parametrizations module attached to them Test Plan: python test/test_ao_sparsity.py TestComposability Reviewers: Subscribers: Tasks: Tags: Differential Revision: [D35240275](https://our.internmc.facebook.com/intern/diff/D35240275) [ghstack-poisoned]
|
@HDCharles has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
Summary: Pull Request resolved: #74846 This PR primarily allows the PTQ convert function to work with parametrized modules. Given that the parametrized weight is what is used by default in convert, as long as sparsifier.step() has already been called, the converted model will use the sparisified weights. There is currently no way to handle things if sparsifier.step() has not been called. Lastly, added the is_leaf_or_only_parametrized function because parametrized modules no longer look like leaves due to the parametrizations module attached to them Test Plan: python test/test_ao_sparsity.py TestComposability Imported from OSS Reviewed By: vkuzo Differential Revision: D35240275 fbshipit-source-id: 48529f2a83edfe6d8a2d2dff8ca3d08a3fb0d553
|
Hey @HDCharles. |
Summary: This PR primarily allows the PTQ convert function to work with parametrized modules. Given that the parametrized weight is what is used by default in convert, as long as sparsifier.step() has already been called, the converted model will use the sparisified weights. There is currently no way to handle things if sparsifier.step() has not been called. Lastly, added the has_no_children_ignoring_parametrizations function because parametrized modules no longer look like leaves due to the parametrizations module attached to them Test Plan: python test/test_ao_sparsity.py TestComposability Reviewers: Subscribers: Tasks: Tags: ghstack-source-id: ce30add Pull Request resolved: pytorch/pytorch#74846
Stack from ghstack (oldest at bottom):
Summary: This PR primarily allows the PTQ convert function to work with
parametrized modules. Given that the parametrized weight is what is used
by default in convert, as long as sparsifier.step() has already been
called, the converted model will use the sparisified weights. There is
currently no way to handle things if sparsifier.step() has not been
called. Lastly, added the has_no_children_ignoring_parametrizations function because
parametrized modules no longer look like leaves due to the
parametrizations module attached to them
Test Plan: python test/test_ao_sparsity.py TestComposability
Reviewers:
Subscribers:
Tasks:
Tags:
Differential Revision: D35240275