Skip to content

NXP backend: Enable Sub Tensor with new Neutron flow#19588

Open
roman-janik-nxp wants to merge 1 commit into
pytorch:mainfrom
nxp-upstream:feature/nxg11066/EIEX-878-Add-`sub`-support-using-new-Neutron-flow
Open

NXP backend: Enable Sub Tensor with new Neutron flow#19588
roman-janik-nxp wants to merge 1 commit into
pytorch:mainfrom
nxp-upstream:feature/nxg11066/EIEX-878-Add-`sub`-support-using-new-Neutron-flow

Conversation

@roman-janik-nxp
Copy link
Copy Markdown
Collaborator

@roman-janik-nxp roman-janik-nxp commented May 14, 2026

Summary

Add tests verifying correct support for sub.tensor 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 May 14, 2026
@pytorch-bot
Copy link
Copy Markdown

pytorch-bot Bot commented May 14, 2026

🔗 Helpful Links

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

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:

❌ 3 New Failures

As of commit c91b4b8 with merge base 5b89d23 (image):

NEW FAILURES - The following jobs have 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 May 14, 2026
@@ -1,26 +1,40 @@
# Copyright 2025 NXP
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.

Nit: 2026



class TestSubTensorNewNeutronFlow:
@pytest.mark.skip("AIR-14602: incorrect results")
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.

The AIR-14602 refers to the Add operator. Are you sure this is correct?



class TestSubTensorNewNeutronFlow:
@pytest.mark.skip("AIR-14602: incorrect results")
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.

I think using @pytest.mark.xfail(strict=True) would be better here, as once Neutron is updated and the bug is fixed. we will be alerted and will update the test.
With skip it's possible that we will forget about it.

This applies to other tests too, not just this one.

[
pytest.param((6, 8), id="2D."),
pytest.param((1, 4, 8), id="3D."),
pytest.param((1, 4, 8, 8), id="4D."),
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.

Please don't use multiples of 8 in the shapes, to make sure there is no num_macs related restriction.
This applies to all tests, not just this one.

pytest.param((1, 4, 8, 8), id="4D."),
],
)
def test__basic_nsys_inference(self, x_input_shape, mocker):
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.

Please separate out the passing and failing cases (I assume at least some cases produce correct outputs. If not, please try to find some :D). Right now everything is skipped. It's desirable to have at least some passing tests.

id="2 inputs 3D.",
),
pytest.param(
[ModelInputSpec((4,)), ModelInputSpec((4, 4))], id="2 inputs 2D+3D."
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.

The id seems incorrect. Looks like 1D - 2D to me.

)
assert graph_contains_any_of_ops(delegated_ep.graph, [SubTensor])

@pytest.mark.skip("AIR-14602: incorrect results")
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.

Would it be possible to find a working example so we can have a passing test?

),
],
)
def test__w_conv_unsupported(self, input_spec):
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.

Please also add a test for the supported channels first broadcasting case.

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