Skip to content

NXP backend: Add prelu support using new neutron flow#20427

Merged
roman-janik-nxp merged 3 commits into
pytorch:mainfrom
nxp-upstream:feature/nxg11066/EIEX-873-Add-prelu-support-using-new-Neutron-flow
Jul 14, 2026
Merged

NXP backend: Add prelu support using new neutron flow#20427
roman-janik-nxp merged 3 commits into
pytorch:mainfrom
nxp-upstream:feature/nxg11066/EIEX-873-Add-prelu-support-using-new-Neutron-flow

Conversation

@roman-janik-nxp

@roman-janik-nxp roman-janik-nxp commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

Summary

Add tests verifying correct support for prelu by the Neutron backend using the new Neutron MLIR flow

Test plan

Unit tests provided.

cc @robert-kalmar @JakeStevens @digantdesai @rascani

@roman-janik-nxp roman-janik-nxp 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 Jun 22, 2026
@pytorch-bot

pytorch-bot Bot commented Jun 22, 2026

Copy link
Copy Markdown

🔗 Helpful Links

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

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, 2 Pending

As of commit 79b54d7 with merge base abd2b54 (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 Jun 22, 2026
@linux-foundation-easycla

linux-foundation-easycla Bot commented Jun 22, 2026

Copy link
Copy Markdown

CLA Not Signed

@roman-janik-nxp

Copy link
Copy Markdown
Collaborator Author

@novak-vaclav

@roman-janik-nxp roman-janik-nxp force-pushed the feature/nxg11066/EIEX-873-Add-prelu-support-using-new-Neutron-flow branch from 19ab4f1 to 3bd49b7 Compare June 22, 2026 17:24
@novak-vaclav novak-vaclav requested a review from Copilot June 23, 2026 14:00

Copilot AI left a comment

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.

Pull request overview

Adds/expands PReLU delegation coverage for the NXP Neutron backend “new MLIR flow” by updating target-support checks (notably broadcast handling) and adding/refreshing unit tests and helper aliases/models.

Changes:

  • Introduces a new broadcast eligibility helper (inputs_satisfy_broadcast_condition) and switches Add/Mul/Sub/PReLU converters to use it.
  • Updates Neutron PReLU converter support rules and adds new test coverage (more ranks, conv+prelu, and num_parameters variant), including new op aliases/models.
  • Extends Add/Mul/Sub converter broadcast test parametrizations with an additional case.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
backends/nxp/tests/ops_aliases.py Adds new op aliases used by updated tests (e.g., Prelu, GtScalar, WhereSelf).
backends/nxp/tests/models.py Adds ConvPReLUModule test model to cover conv+prelu delegation.
backends/nxp/tests/ir/converter/node_converter/test_sub_tensor_converter.py Adds an extra broadcast test case.
backends/nxp/tests/ir/converter/node_converter/test_prelu_converter.py Reworks PReLU tests to the newer lower_run_compare harness and expands shape coverage.
backends/nxp/tests/ir/converter/node_converter/test_mul_tensor_converter.py Adds an extra broadcast test case.
backends/nxp/tests/ir/converter/node_converter/test_add_tensor_converter.py Adds an extra broadcast test case.
backends/nxp/backend/ir/converter/node_converters/ops_converters/sub_tensor_converter.py Uses the new broadcast eligibility helper.
backends/nxp/backend/ir/converter/node_converters/ops_converters/prelu_converter.py Updates target-support checks for PReLU in the new flow.
backends/nxp/backend/ir/converter/node_converters/ops_converters/mul_tensor_converter.py Uses the new broadcast eligibility helper.
backends/nxp/backend/ir/converter/node_converters/ops_converters/add_tensor_converter.py Uses the new broadcast eligibility helper.
backends/nxp/backend/ir/converter/node_converter.py Adds inputs_satisfy_broadcast_condition (element-count based).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@novak-vaclav novak-vaclav self-requested a review June 23, 2026 14:49
@roman-janik-nxp roman-janik-nxp force-pushed the feature/nxg11066/EIEX-873-Add-prelu-support-using-new-Neutron-flow branch from 3bd49b7 to e8e3457 Compare June 23, 2026 15:04

@novak-vaclav novak-vaclav left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

A few minor comments, otherwise LGTM. Good job 😄

Comment thread backends/nxp/tests/ir/converter/node_converter/test_prelu_converter.py Outdated
@roman-janik-nxp roman-janik-nxp force-pushed the feature/nxg11066/EIEX-873-Add-prelu-support-using-new-Neutron-flow branch from e8e3457 to bf7bbd2 Compare June 24, 2026 12:04

@novak-vaclav novak-vaclav left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM 👌

@roman-janik-nxp roman-janik-nxp force-pushed the feature/nxg11066/EIEX-873-Add-prelu-support-using-new-Neutron-flow branch from bf7bbd2 to bb3368c Compare June 25, 2026 09:54
@roman-janik-nxp roman-janik-nxp force-pushed the feature/nxg11066/EIEX-873-Add-prelu-support-using-new-Neutron-flow branch 2 times, most recently from c2578b5 to cf52386 Compare June 26, 2026 17:41
@roman-janik-nxp

Copy link
Copy Markdown
Collaborator Author

@MartinPavella I added conditional Transpose ops for the channels first format and num_parameters != 1 case. I don't think there should be any changes in NodeFormatInference as we discussed today. Please check again.

Comment thread backends/nxp/tests/ir/converter/node_converter/test_prelu_converter.py Outdated
@roman-janik-nxp roman-janik-nxp force-pushed the feature/nxg11066/EIEX-873-Add-prelu-support-using-new-Neutron-flow branch 2 times, most recently from 66904e6 to 33afb6a Compare June 30, 2026 11:13
@robert-kalmar robert-kalmar force-pushed the feature/nxg11066/EIEX-873-Add-prelu-support-using-new-Neutron-flow branch from 33afb6a to a79e40f Compare July 8, 2026 14:47
@roman-janik-nxp roman-janik-nxp force-pushed the feature/nxg11066/EIEX-873-Add-prelu-support-using-new-Neutron-flow branch 2 times, most recently from 5141289 to d245feb Compare July 10, 2026 09:43
Comment thread backends/nxp/tests/models.py
@roman-janik-nxp roman-janik-nxp force-pushed the feature/nxg11066/EIEX-873-Add-prelu-support-using-new-Neutron-flow branch from d245feb to 32f50fe Compare July 10, 2026 14:48
@roman-janik-nxp roman-janik-nxp force-pushed the feature/nxg11066/EIEX-873-Add-prelu-support-using-new-Neutron-flow branch from 32f50fe to 79b54d7 Compare July 13, 2026 15:59
@roman-janik-nxp roman-janik-nxp merged commit ae754e9 into pytorch:main Jul 14, 2026
181 of 183 checks passed
@roman-janik-nxp roman-janik-nxp deleted the feature/nxg11066/EIEX-873-Add-prelu-support-using-new-Neutron-flow branch July 14, 2026 09:06
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.

4 participants