Skip to content

Conversation

@DrJessop
Copy link
Contributor

Summary:
Unfortunately, we are in a state where conv2d can run either 1d or 2d convs, and the padding/stride/dilation logic is pretty bad.

Essentially, if we have a conv1d, we can produce a conv2d where stride becomes [1, value_provided] in the fusion_pass (see get_conv_args). That is why in ops_registrations, we have been indexing at 1. However, if we somehow construct a conv2d_nchw/nchw without going through that fusion_pass, this canonicalization is not done.

Ideally, we have conv1d implementations where these arguments are scalars, not lists. But, this is a larger effort, since even the C++ kernels follow this convoluted logic.

Temporary fix here is to index at -1, and we'll have to come back to cleaning up conv kernels.

Differential Revision: D87943382

@pytorch-bot
Copy link

pytorch-bot bot commented Nov 26, 2025

🔗 Helpful Links

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

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

❗ 1 Active SEVs

There are 1 currently active SEVs. If your PR is affected, please view them below:

❌ 1 New Failure

As of commit f578636 with merge base 12d17ef (image):

NEW FAILURE - The following job has failed:

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

@meta-cla meta-cla 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 Nov 26, 2025
@meta-codesync
Copy link

meta-codesync bot commented Nov 26, 2025

@DrJessop has exported this pull request. If you are a Meta employee, you can view the originating Diff in D87943382.

Summary:

Unfortunately, we are in a state where conv2d can run either 1d or 2d convs, and the padding/stride/dilation logic is pretty bad.

Essentially, if we have a conv1d, we can produce a conv2d where stride becomes [1, value_provided] in the fusion_pass (see get_conv_args). That is why in ops_registrations, we have been indexing at 1. However, if we somehow construct a conv2d_nchw/nchw without going through that fusion_pass, this canonicalization is not done.

Ideally, we have conv1d implementations where these arguments are scalars, not lists. But, this is a larger effort, since even the C++ kernels follow this convoluted logic.

Temporary fix here is to index at -1, and we'll have to come back to cleaning up conv kernels.

Reviewed By: hsharma35

Differential Revision: D87943382
@github-actions
Copy link

github-actions bot commented Dec 1, 2025

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.

@meta-codesync meta-codesync bot merged commit 0a94ecf into pytorch:main Dec 2, 2025
143 of 144 checks passed
AdrianLundell pushed a commit to AdrianLundell/executorch that referenced this pull request Dec 2, 2025
Differential Revision: D87943382

Pull Request resolved: pytorch#15995
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