Skip to content

NXP backend: Enable Amax with new Neutron flow#20628

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

NXP backend: Enable Amax with new Neutron flow#20628
roman-janik-nxp wants to merge 1 commit into
pytorch:mainfrom
nxp-upstream:feature/nxg11066/EIEX-890-Add-amax-support-using-new-Neutron-flow

Conversation

@roman-janik-nxp

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

Copy link
Copy Markdown
Collaborator

Summary

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

Test plan

Unit tests provided.

cc @robert-kalmar

@roman-janik-nxp roman-janik-nxp added the release notes: nxp Changes to the NXP Neutron backend delegate label Jun 30, 2026
@pytorch-bot

pytorch-bot Bot commented Jun 30, 2026

Copy link
Copy Markdown

🔗 Helpful Links

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

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

⏳ No Failures, 1 Pending

As of commit 910e187 with merge base 3bd4748 (image):
💚 Looks good so far! There are no failures yet. 💚

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 30, 2026
@linux-foundation-easycla

linux-foundation-easycla Bot commented Jun 30, 2026

Copy link
Copy Markdown

CLA Not Signed

@roman-janik-nxp roman-janik-nxp added the module: nxp Issues related to NXP Neutron NPU delegation and code under backends/nxp/ label Jun 30, 2026
@roman-janik-nxp roman-janik-nxp changed the title NXP backend: Enable amin with new Neutron flow NXP backend: Enable Amax with new Neutron flow Jun 30, 2026
@roman-janik-nxp roman-janik-nxp force-pushed the feature/nxg11066/EIEX-890-Add-amax-support-using-new-Neutron-flow branch from 3fa4f11 to dab563d Compare July 1, 2026 14:41
@roman-janik-nxp roman-janik-nxp force-pushed the feature/nxg11066/EIEX-890-Add-amax-support-using-new-Neutron-flow branch from dab563d to 910e187 Compare July 2, 2026 13:04
# Just 1 test case to verify correct handling of the `dim`.
# Most cases fall into the single bit error case, and since this test uses 2 operators, the error accumulates
# and the final error is larger. We cannot with 100% certainty say that the error is only caused by the single
# bit errors and not related to the format. That's why only this 1 case with no errors is used.

@novak-vaclav novak-vaclav Jul 2, 2026

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.

It may happen that there is a two-bit error, however it is not a good idea to selectively only include test cases that pass.
I'd recommend allowing two bit error or not using remove_quant_io_ops=True in this test.


class AmaxModule(torch.nn.Module):
def __init__(
self, dim: int | torch.Size | list[int] | tuple[int, ...], keepdim: bool

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: According to the documentation, dim can only be int, tuple of ints, and can be None. keepdim can be None. This is also true for MaxPoolAmaxModule.
I think it would be better to add two test cases that use the implicit value of dim and keepdim.

self._assert_neutron_ir_model_has_ops(
model_builder_finish_spy,
expected_ops=[
Transpose,

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: in the comment above, you say no Transpose ops are added. Please clarify the comment if you meant to say "no Transpose ops are added after MaxPool2D".

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