Skip to content

NXP backend: Add support for depthwise and separable convolution. #11215

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

robert-kalmar
Copy link
Collaborator

@robert-kalmar robert-kalmar commented May 29, 2025

Summary

Adding depthwise convolution support for the NXP backend

Test plan

Functionality tested by python unit tests:

pytest -c /dev/null/ backend/nxp/tests

cc @digantdesai @JakeStevens , @Pop-korn

Copy link

pytorch-bot bot commented May 29, 2025

🔗 Helpful Links

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

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

❌ 3 New Failures

As of commit 07f79c2 with merge base 77f16dc (image):

NEW FAILURES - The following jobs have failed:

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 May 29, 2025
@robert-kalmar
Copy link
Collaborator Author

@pytorchbot label "module: nxp" "release notes: nxp"

@pytorch-bot pytorch-bot bot added module: nxp Issues related to NXP Neutron NPU delegation and code under backends/nxp/ release notes: nxp Changes to the NXP Neutron backend delegate labels May 29, 2025
@@ -204,3 +210,328 @@ def test_conv2d_quant_conversion(mocker, model: torch.nn.Module, input_shape):
input_data=input_data,
atol=1.0,
)


@pytest.mark.parametrize("stride", [1, 2])
Copy link
Contributor

Choose a reason for hiding this comment

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

I thought we decided to not use pytest features in new tests :P

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sorry for misunderstanding. I thought we are OK using pytest temporarily for the those tests, we already have in our development tree.

The latest (in our development tree) uses the unittest instead of pytest - nxp-upstream@63fd43f#diff-d103a8083dbc6da9184c269a015199baa963f734cdd8cb2f29336e6954f01cb8R7

assert len(nodes) == 11
assert (
nodes[7].target.__name__ == "aten.convolution.default"
) # Convolution not delegated.
Copy link
Contributor

Choose a reason for hiding this comment

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

Love these tests.

@digantdesai
Copy link
Contributor

Just skimmed, let me take a close look in a day or so, esp _convert_2d_conv. Thanks

The `group` attribute of the `aten.convolution` has an effect on how the weights are used in the computation of the convolution. To properly utilize Neutron, the convolution is sometimes converted to `DepthwiseConv2D`.
@robert-kalmar robert-kalmar force-pushed the upstream/main-nxp/depthwise-convolution branch from 8e64288 to cb91593 Compare June 10, 2025 11:09
@robert-kalmar
Copy link
Collaborator Author

@JacobSzwejbka
Copy link
Contributor

digant is out for a while I will try to find another person to review these

@robert-kalmar robert-kalmar marked this pull request as draft June 18, 2025 12:11
@robert-kalmar
Copy link
Collaborator Author

Converting to draft unless the NXP Backend CI is back (#11756)

@JakeStevens
Copy link
Contributor

digant is out for a while I will try to find another person to review these

I am back, I can review this coming week.

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. module: nxp Issues related to NXP Neutron NPU delegation and code under backends/nxp/ release notes: nxp Changes to the NXP Neutron backend delegate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants