Skip to content
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

Refactor CadenceQuantizer #7540

Merged
merged 1 commit into from
Jan 9, 2025
Merged

Refactor CadenceQuantizer #7540

merged 1 commit into from
Jan 9, 2025

Conversation

mcremon-meta
Copy link
Contributor

Summary:
The current class structure is hard to cleanly extend. This diff:

  • Makes CadenceQuantizer a base class
  • Creates a CadenceDefaultQuantizer that is exactly the same as the previous CadenceQuantizer class
  • Removes the qconfig from the CadenceQuantizer, since it really belongs to the CadenceAtenQuantizer (it is defined per op)
  • Makes both the default qconfig and the default quantizer list module level variables

Using this structure will make it much cleaner to add new quantizers in the future.

Differential Revision: D67645196

Copy link

pytorch-bot bot commented Jan 7, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/7540

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit a8dc686 with merge base 1bac885 (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jan 7, 2025
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D67645196

mcremon-meta added a commit that referenced this pull request Jan 7, 2025
Summary:

The current class structure is hard to cleanly extend. This diff:
- Makes `CadenceQuantizer` a base class
- Creates a `CadenceDefaultQuantizer` that is exactly the same as the previous `CadenceQuantizer` class
- Removes the qconfig from the `CadenceQuantizer`, since it really belongs to the `CadenceAtenQuantizer` (it is defined per op)
- Makes both the default qconfig and the default quantizer list module level variables

Using this structure will make it much cleaner to add new quantizers in the future.

Differential Revision: D67645196
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D67645196

mcremon-meta added a commit that referenced this pull request Jan 7, 2025
Summary:

The current class structure is hard to cleanly extend. This diff:
- Makes `CadenceQuantizer` a base class
- Creates a `CadenceDefaultQuantizer` that is exactly the same as the previous `CadenceQuantizer` class
- Removes the qconfig from the `CadenceQuantizer`, since it really belongs to the `CadenceAtenQuantizer` (it is defined per op)
- Makes both the default qconfig and the default quantizer list module level variables

Using this structure will make it much cleaner to add new quantizers in the future.

Differential Revision: D67645196
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D67645196

act_qspec,
act_qspec,
wgt_qspec,
None,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need None as a default?

backends/cadence/aot/quantizer/quantizer.py Outdated Show resolved Hide resolved
Summary:

The current class structure is hard to cleanly extend. This diff:
- Makes `CadenceQuantizer` a base class
- Creates a `CadenceDefaultQuantizer` that is exactly the same as the previous `CadenceQuantizer` class
- Removes the qconfig from the `CadenceQuantizer`, since it really belongs to the `CadenceAtenQuantizer` (it is defined per op)
- Makes both the default qconfig and the default quantizer list module level variables

Using this structure will make it much cleaner to add new quantizers in the future.

Reviewed By: zonglinpeng

Differential Revision: D67645196
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D67645196

@facebook-github-bot facebook-github-bot merged commit b16271c into main Jan 9, 2025
43 of 46 checks passed
@facebook-github-bot facebook-github-bot deleted the export-D67645196 branch January 9, 2025 10:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported topic: not user facing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants