Skip to content

Conversation

jirioc
Copy link
Collaborator

@jirioc jirioc commented Jul 28, 2025

Summary

The NXP backend is now robust against the swapping the order of inputs/outputs in the model converter.

Release notes: NXP

Test plan

test_neutron_backend.py tests this feature

cc @digantdesai @JakeStevens @robert-kalmar

Copy link

pytorch-bot bot commented Jul 28, 2025

🔗 Helpful Links

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

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

As of commit 3c5e971 with merge base 4197fc1 (image):

NEW FAILURES - The following jobs have failed:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@facebook-github-bot facebook-github-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 Jul 28, 2025
@StrycekSimon StrycekSimon force-pushed the upstream/main-nxp/EIEX-400-upstream-robustness-against-input-output-swapping branch from 299fc73 to 03abf61 Compare July 28, 2025 12:21
@jirioc
Copy link
Collaborator Author

jirioc commented Jul 28, 2025

@pytorchbot label "release notes: nxp"

@pytorch-bot pytorch-bot bot added the release notes: nxp Changes to the NXP Neutron backend delegate label Jul 28, 2025
@JakeStevens
Copy link
Contributor

NXP build failing

@StrycekSimon
Copy link
Collaborator

Thanks, I noticed it earlier but I was already out of office. I will fix it.

@StrycekSimon StrycekSimon force-pushed the upstream/main-nxp/EIEX-400-upstream-robustness-against-input-output-swapping branch from 03abf61 to d0eb3c4 Compare July 31, 2025 09:06
@robert-kalmar robert-kalmar added the module: nxp Issues related to NXP Neutron NPU delegation and code under backends/nxp/ label Aug 1, 2025
Copy link
Collaborator

@robert-kalmar robert-kalmar left a comment

Choose a reason for hiding this comment

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

Looks good to me. The CI failures seems irrelevant to the changes in this PR.
Rebased to main to have more up to date test results.

assert (
len(outputs) < 256
len(neutron_artifacts.input_indices) < 256
), "Models with more than 255 inputs are not supported."
Copy link
Collaborator

Choose a reason for hiding this comment

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

NIT: This is actually a valid case, not a "programming error". We just use 8bit field to encode input indices. Consider using ValueError instead of assert.

len(outputs) < 256
len(neutron_artifacts.input_indices) < 256
), "Models with more than 255 inputs are not supported."
assert (
Copy link
Collaborator

Choose a reason for hiding this comment

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

NIT: This is actually a valid case, not a "programming error". We just use 8bit field to encode input indices. Consider using ValueError instead of assert.

@robert-kalmar robert-kalmar force-pushed the upstream/main-nxp/EIEX-400-upstream-robustness-against-input-output-swapping branch from d0eb3c4 to 3c5e971 Compare August 1, 2025 09:12
#define OUTPUT_TENSOR_FORMAT_LEN_POS 1
#define INPUT_TENSOR_FORMAT_ARRAY_ADDR(base) (base + 2 * ITEM_SIZE)
#define INPUT_ARGS_LEN_POS 2
#define INPUT_TENSOR_FORMAT_ARRAY_ADDR(base) (base + 3 * ITEM_SIZE)
Copy link
Contributor

Choose a reason for hiding this comment

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

This is ok for now but in the future consider FC/BC issues when updating serialization formats.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We hope that the format is now general enough to cover the future scenarios.

Copy link
Contributor

Choose a reason for hiding this comment

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

Says like a true developer, until a second before breaking BC :-p

@robert-kalmar robert-kalmar merged commit 0248897 into pytorch:main Aug 4, 2025
100 of 102 checks passed
@robert-kalmar robert-kalmar deleted the upstream/main-nxp/EIEX-400-upstream-robustness-against-input-output-swapping branch August 4, 2025 08:08
agrima1304 pushed a commit to agrima1304/executorch that referenced this pull request Aug 26, 2025
…orch#12890)

### Summary
The NXP backend is now robust against the swapping the order of
inputs/outputs in the model converter.

Release notes: NXP

### Test plan
test_neutron_backend.py tests this feature
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.

6 participants