Skip to content

Comments

[ET-VK][qconv] Fix depthwise weight_sums sum dimension#17504

Merged
meta-codesync[bot] merged 3 commits intogh/SS-JIA/432/basefrom
gh/SS-JIA/432/head
Feb 20, 2026
Merged

[ET-VK][qconv] Fix depthwise weight_sums sum dimension#17504
meta-codesync[bot] merged 3 commits intogh/SS-JIA/432/basefrom
gh/SS-JIA/432/head

Conversation

@SS-JIA
Copy link
Contributor

@SS-JIA SS-JIA commented Feb 17, 2026

Stack from ghstack (oldest at bottom):

The weight_sums tensor stores per-output-channel sums of quantized weight values, used to apply activation zero point correction during integer accumulation. For depthwise convolutions, the weight tensor is reshaped to (H, W, OC), but the sum was unconditionally computed along dim=1 (the W dimension). This produced a tensor of shape (H, OC) instead of (OC,), causing incorrect zero point correction and corrupted depthwise conv output.

Fix by branching on is_depthwise_conv to sum over dims (0, 1) for the (H, W, OC) layout.

Differential Revision: D93511635

The weight_sums tensor stores per-output-channel sums of quantized weight values, used to apply activation zero point correction during integer accumulation. For depthwise convolutions, the weight tensor is reshaped to (H, W, OC), but the sum was unconditionally computed along dim=1 (the W dimension). This produced a tensor of shape (H, OC) instead of (OC,), causing incorrect zero point correction and corrupted depthwise conv output.

Fix by branching on is_depthwise_conv to sum over dims (0, 1) for the (H, W, OC) layout.

Differential Revision: [D93511635](https://our.internmc.facebook.com/intern/diff/D93511635/)

[ghstack-poisoned]
@pytorch-bot
Copy link

pytorch-bot bot commented Feb 17, 2026

🔗 Helpful Links

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

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

❌ 3 New Failures, 2 Unrelated Failures

As of commit 8bf97f2 with merge base 7b843e4 (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.

@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.

ssjia and others added 2 commits February 18, 2026 13:02
The weight_sums tensor stores per-output-channel sums of quantized weight values, used to apply activation zero point correction during integer accumulation. For depthwise convolutions, the weight tensor is reshaped to (H, W, OC), but the sum was unconditionally computed along dim=1 (the W dimension). This produced a tensor of shape (H, OC) instead of (OC,), causing incorrect zero point correction and corrupted depthwise conv output.

Fix by branching on is_depthwise_conv to sum over dims (0, 1) for the (H, W, OC) layout.

Differential Revision: [D93511635](https://our.internmc.facebook.com/intern/diff/D93511635/)

[ghstack-poisoned]
The weight_sums tensor stores per-output-channel sums of quantized weight values, used to apply activation zero point correction during integer accumulation. For depthwise convolutions, the weight tensor is reshaped to (H, W, OC), but the sum was unconditionally computed along dim=1 (the W dimension). This produced a tensor of shape (H, OC) instead of (OC,), causing incorrect zero point correction and corrupted depthwise conv output.

Fix by branching on is_depthwise_conv to sum over dims (0, 1) for the (H, W, OC) layout.

Differential Revision: [D93511635](https://our.internmc.facebook.com/intern/diff/D93511635/)

[ghstack-poisoned]
@meta-codesync meta-codesync bot merged commit 68230f4 into gh/SS-JIA/432/base Feb 20, 2026
178 of 185 checks passed
@meta-codesync meta-codesync bot deleted the gh/SS-JIA/432/head branch February 20, 2026 01:12
SS-JIA pushed a commit that referenced this pull request Feb 20, 2026
Pull Request resolved: #17504

The weight_sums tensor stores per-output-channel sums of quantized weight values, used to apply activation zero point correction during integer accumulation. For depthwise convolutions, the weight tensor is reshaped to (H, W, OC), but the sum was unconditionally computed along dim=1 (the W dimension). This produced a tensor of shape (H, OC) instead of (OC,), causing incorrect zero point correction and corrupted depthwise conv output.

Fix by branching on is_depthwise_conv to sum over dims (0, 1) for the (H, W, OC) layout.
ghstack-source-id: 342806069
@exported-using-ghexport

Differential Revision: [D93511635](https://our.internmc.facebook.com/intern/diff/D93511635/)
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 meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants