Skip to content

NXP backend: Enable adaptive_avg_pool2d with new Neutron flow.#19540

Open
MartinPavella wants to merge 1 commit into
pytorch:mainfrom
nxp-upstream:nxg01483/EIEX-863-add-adaptive_avg_pool2d-support-using-new-neutron-flow
Open

NXP backend: Enable adaptive_avg_pool2d with new Neutron flow.#19540
MartinPavella wants to merge 1 commit into
pytorch:mainfrom
nxp-upstream:nxg01483/EIEX-863-add-adaptive_avg_pool2d-support-using-new-neutron-flow

Conversation

@MartinPavella
Copy link
Copy Markdown
Collaborator

@MartinPavella MartinPavella commented May 13, 2026

Summary

This PR reflects the new Neutron requirements for the enablement of adaptive_avg_pool_2d in NXP backend,

Test plan

Unit tests provided.

cc @robert-kalmar @JakeStevens @digantdesai @rascani

@MartinPavella MartinPavella self-assigned this May 13, 2026
@MartinPavella MartinPavella 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 13, 2026
@pytorch-bot
Copy link
Copy Markdown

pytorch-bot Bot commented May 13, 2026

🔗 Helpful Links

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

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:

❌ 2 New Failures, 3 Unrelated Failures

As of commit 6a6b94c with merge base b04cc65 (image):

NEW FAILURES - The following jobs have failed:

FLAKY - The following job failed but was likely due to flakiness present on trunk:

BROKEN TRUNK - The following jobs failed but was 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 13, 2026
@MartinPavella
Copy link
Copy Markdown
Collaborator Author

@novak-vaclav as per usual, cannot add you as a reviewer but please feel free to have a look :)

@MartinPavella MartinPavella force-pushed the nxg01483/EIEX-863-add-adaptive_avg_pool2d-support-using-new-neutron-flow branch from 30aaa4e to 4fed4de Compare May 13, 2026 07:24
parameters_mapping: dict[str, Parameter],
custom_delegation_options: CustomDelegationOptions,
) -> bool:
if (
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 this check to is_supported_on_target, since it's not an IR's problem we did not determine node format yet.
It also makes more sense because _get_equivalent_avg_pool_parameters is also used in is_supported_on_target and the code concerning node formats would be in one place.

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.

The check is there to make sure our NodeFormatInference handles the operator as we expected. It is there to make sure that the principles on which EdgeProgramToIRConverter is built are obeyed. It has nothing to do with the RT700 platform and it's Neutron parameters. It is strictly related to conversion to the IR. Therefore it doesn't make sense for it to be in is_supported_on_target. I agree that including it in is_supported_in_IR is not ideal (though it's not a big stretch).

The PR which originally added the adaptive avgpool2d to our backend didn't update the format inference, so I added this check. I believe we should add it to all node converters of operators which require channels last format in NeutronIR.

Let's leave it as is in this PR. I have created a ticket to address this: https://jira.sw.nxp.com/browse/EIEX-913
I think I'll get on it soon.

Comment thread backends/nxp/tests/model_output_comparator.py
Comment thread backends/nxp/tests/ops_aliases.py
@novak-vaclav
Copy link
Copy Markdown
Contributor

Nice work! 👍 I have only a few points for improvement

@MartinPavella MartinPavella force-pushed the nxg01483/EIEX-863-add-adaptive_avg_pool2d-support-using-new-neutron-flow branch from 4fed4de to 6a6b94c Compare May 15, 2026 06:57
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