Skip to content

Conversation

@jirioc
Copy link
Collaborator

@jirioc jirioc commented Nov 24, 2025

Summary

The new neutron converter introduces extra output tensors. This requires changes in the backend. These changes are backward compatible, meaning that the PTE converted by the older versions can be run by the new NeutronBackend.cpp, but not vice versa.

Test plan

The unit tests have been adjusted to accommodate the new payload format.

cc @robert-kalmar @JakeStevens @digantdesai

@pytorch-bot
Copy link

pytorch-bot bot commented Nov 24, 2025

🔗 Helpful Links

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

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

❗ 2 Active SEVs

There are 2 currently active SEVs. If your PR is affected, please view them below:

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 Nov 24, 2025
@jirioc jirioc added ciflow/trunk 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 Nov 24, 2025
graph_outputs = sub_graph.OutputsAsNumpy()
payload_version = 0
node_outputs = neutron_node.OutputsAsNumpy()[:-1]
if len(graph_outputs) == len(node_outputs) - 2:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you please add a comment explaining the - 2?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I added a comment explaining all 3 extra tensors.

assert payload[6] == 0x0 # Map 0-th Neutron output to 0-th model output
assert all(byte == 0x0 for byte in payload[7:16]) # Aligned to 16 bytes
assert (
payload[7] == 0x0 or payload[7] == 0x1
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do you think it would be useful to use NeutronTargetSpec to determine the expected payload version for a stricter check?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The payload version is not dependent on Target, it depends on neutron converter version.

@jirioc jirioc force-pushed the feature-eiex-640-update-payload-version branch 3 times, most recently from 6d6d328 to 70deb5e Compare November 25, 2025 13:02
@jirioc jirioc force-pushed the feature-eiex-640-update-payload-version branch from 70deb5e to 31306d1 Compare November 25, 2025 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/trunk 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.

3 participants