Skip to content

NXP backend: Test max_pool2d with new Neutron flow.#19272

Open
MartinPavella wants to merge 2 commits intopytorch:mainfrom
nxp-upstream:nxg01483/EIEX-868-add-max_pool2d-support-using-new-neutron-flow
Open

NXP backend: Test max_pool2d with new Neutron flow.#19272
MartinPavella wants to merge 2 commits intopytorch:mainfrom
nxp-upstream:nxg01483/EIEX-868-add-max_pool2d-support-using-new-neutron-flow

Conversation

@MartinPavella
Copy link
Copy Markdown
Collaborator

@MartinPavella MartinPavella commented May 3, 2026

Summary

Reflect the requirements of the new Neutron MLIR flow for the max_pool2d operator in NXP backend.

Test plan

Unit tests provided.

cc @robert-kalmar @JakeStevens @digantdesai

@MartinPavella MartinPavella self-assigned this May 3, 2026
@MartinPavella MartinPavella added the module: nxp Issues related to NXP Neutron NPU delegation and code under backends/nxp/ label May 3, 2026
@MartinPavella MartinPavella added the release notes: nxp Changes to the NXP Neutron backend delegate label May 3, 2026
@pytorch-bot
Copy link
Copy Markdown

pytorch-bot Bot commented May 3, 2026

🔗 Helpful Links

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

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:

✅ You can merge normally! (2 Unrelated Failures)

As of commit 7096412 with merge base 48a8d58 (image):

BROKEN TRUNK - The following jobs failed but were present on the merge base:

👉 Rebase onto the `viable/strict` branch to avoid these failures

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 May 3, 2026
@MartinPavella
Copy link
Copy Markdown
Collaborator Author

@novak-vaclav I am not able to add you as a reviewer, but feel free to have a look.

@MartinPavella

This comment was marked as resolved.


class TestMaxPool2DNewNeutronFlow:
# noinspection PyMethodMayBeStatic
def assert_delegated(self, model, input_shape):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I would move these methods to a separate file so they can be used in other tests as well. When I start implementing new neutron flow tests, I would have to copy this into my test suite and that seems unnecessary.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

These functions are not universal. This one checks for 1 delegated node and no non-delegated nodes. For example MaxPool1D tests have it different.
I guess we could implement some generic methods like this, but let's not do it in this PR.

def test__basic_nsys_inference__view_not_delegated(self):
input_shape = (2, 4, 6) # The old flow limited the batch size to 1.
model = MaxPool1DModule()
graph_verifier = BaseGraphVerifier(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I would add checking for the maxpool_2d node explicitly. Is it possible to tell if the delegated node was originally maxpool_2d?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Not with the BaseGraphVerifier. If there is only 1 node in the model (like in this case), there is no doubt it is the MaxPool. But I like the idea of a more strict GraphVerifier. I have created a task for it: https://jira.sw.nxp.com/browse/EIEX-902

Comment thread backends/nxp/tests/ir/converter/node_converter/test_max_pool_2d_converter.py Outdated
@MartinPavella MartinPavella force-pushed the nxg01483/EIEX-868-add-max_pool2d-support-using-new-neutron-flow branch from a3f359a to 7096412 Compare May 5, 2026 14:20
@MartinPavella MartinPavella requested a review from novak-vaclav May 5, 2026 14:20
Copy link
Copy Markdown
Contributor

@novak-vaclav novak-vaclav left a comment

Choose a reason for hiding this comment

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

LGTM. Good work 👍

(for some reason I don't see the "Resolve comment" in the Github GUI and resolving the comments in the diff view throws "Failed to resolve thread" 🤷)

Image

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.

2 participants