Skip to content

Conversation

@GregoryComer
Copy link
Member

Summary

I believe I prematurely merged #11775 and messed up the ghstack. There is no PR for #11731. .github/scripts/propose_ghstack_orig_pr.py is erroring out with a validation error (422?) so I'm attempting to manually create the PR to fix this.

@diff-train-skip-merge

Test plan

CI

mcr229 added 2 commits June 17, 2025 11:16
…ups==1

Pull Request resolved: #11730

Supporting Quantized Transposed Convs with Groups being 1.

Previously, There was some added support for Quantized Transposed Convolutions but only when the channel axis is 1 and when the groups is 1. The current Quantizer didn't support this because it only allows quantizaing along the zero dim, which is generally the output channels. However for TransposedConvs, the dimension of the weights are:
```
[in_channels, out_channels/groups, h, w]
```

Since we want to keep quantization along the output channels, we now need to quantize along axis = 1.

The reason we require groups to be one is because XNNPACK takes in filters of the dimension:
```
[out_channels, H, W, in_channels/groups]
```

Since we are quantizing along the output channels, in pytorch we expect to have out_channels/groups scales, but in xnnpack we have out_channels scales! Realistically we would need to support this with some affine quantization, where we provide a scale for every group, every out_channel. However for now, we just ensure the constraint where groups == 1.
ghstack-source-id: 291033630
@exported-using-ghexport

Differential Revision: [D76631781](https://our.internmc.facebook.com/intern/diff/D76631781/)
…groups ==1

Pull Request resolved: #11731

Here we support dynamically quantized Deconvolutions.

There is some refactoring of the previous diff, but in general, we just remove the constraint in the Dynamism check that the convolution isn't transposed. For the same reasons as before, this only supports channel_axis = 1 and groups = 1.
ghstack-source-id: 291033632
@exported-using-ghexport

Differential Revision: [D76638904](https://our.internmc.facebook.com/intern/diff/D76638904/)
@pytorch-bot
Copy link

pytorch-bot bot commented Jun 23, 2025

🔗 Helpful Links

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

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

❌ 4 New Failures, 3 Unrelated Failures

As of commit 6481220 with merge base 057558f (image):

NEW FAILURES - The following jobs have failed:

FLAKY - The following jobs failed but were likely due to flakiness present on trunk:

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 Jun 23, 2025
@github-actions
Copy link

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

Copy link
Contributor

@digantdesai digantdesai left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for the test clean up.

if (
# skip if transposed conv has more than 1 group
skip = skip or (is_conv_transpose and num_groups != 1)
print(f"{skip} conv transpose and num_groups")
Copy link
Contributor

Choose a reason for hiding this comment

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

remove

self._test(
PerChannelConvTranspose2d(
3 * groups, 5 * groups, groups, ch_axis
), # ch_axis=0
Copy link
Contributor

Choose a reason for hiding this comment

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

what's this comment?


if is_conv_transpose:
# transposed convs per output channel quantization
weight_qspec = change_quantization_config(weight_qspec, ch_axis=1)
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we support group > 1 here in the quant flow? I know we are checking above but just curious. If yes, we can move this before the group check, if not then add an assert to avoid future issues when we allow groups > 1 for transposed_conv.

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants