-
Notifications
You must be signed in to change notification settings - Fork 741
Adding a payload version to become compatible with new Neutron Converter #15959
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Adding a payload version to become compatible with new Neutron Converter #15959
Conversation
🔗 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 SEVsThere 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. |
| graph_outputs = sub_graph.OutputsAsNumpy() | ||
| payload_version = 0 | ||
| node_outputs = neutron_node.OutputsAsNumpy()[:-1] | ||
| if len(graph_outputs) == len(node_outputs) - 2: |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
6d6d328 to
70deb5e
Compare
70deb5e to
31306d1
Compare
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