Skip to content

Add nxp backend profiling support#19225

Merged
robert-kalmar merged 6 commits into
pytorch:mainfrom
nxp-upstream:feature/EIEX-752-executorch-profiling
Jun 23, 2026
Merged

Add nxp backend profiling support#19225
robert-kalmar merged 6 commits into
pytorch:mainfrom
nxp-upstream:feature/EIEX-752-executorch-profiling

Conversation

@irtrukhina

@irtrukhina irtrukhina commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

Summary

Add profiling support for the NXP backend.

Test plan

All CI tests passed including new test for the profiling feature.

cc @robert-kalmar @JakeStevens @digantdesai

@pytorch-bot

pytorch-bot Bot commented Apr 30, 2026

Copy link
Copy Markdown

🔗 Helpful Links

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

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:

⏳ 7 Pending, 1 Unrelated Failure

As of commit 6031ad9 with merge base 2b1ccd4 (image):

BROKEN TRUNK - The following job failed but were present on the merge base:

👉 Rebase onto the `viable/strict` branch to avoid these failures

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 Apr 30, 2026
@robert-kalmar robert-kalmar 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 4, 2026
Comment thread backends/nxp/backend/edge_program_converter.py Outdated
Comment thread backends/nxp/backend/neutron_converter_manager.py Outdated
Comment thread backends/nxp/backend/neutron_map.py Outdated
Comment thread backends/nxp/backend/neutron_map.py Outdated
Comment thread backends/nxp/backend/neutron_map.py Outdated
Comment thread backends/nxp/backend/neutron_map.py
Comment thread backends/nxp/tests/generic_tests/test_aot_example.py Outdated
Comment thread docs/source/backends/nxp/nxp-profiling.md Outdated
Comment thread docs/source/backends/nxp/nxp-profiling.md Outdated
Comment thread backends/nxp/tests/generic_tests/test_aot_example.py

@robert-kalmar robert-kalmar left a comment

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.

Review (Part 1/x)

Comment thread backends/nxp/backend/edge_program_converter.py Outdated
Comment thread backends/nxp/backend/neutron_converter_manager.py Outdated
Comment thread backends/nxp/backend/neutron_map.py Outdated
Comment thread backends/nxp/backend/neutron_map.py Outdated
Comment thread backends/nxp/tests/generic_tests/test_aot_example.py Outdated
Comment thread backends/nxp/tests/generic_tests/test_aot_example.py Outdated
Comment thread backends/nxp/nxp_backend.py Outdated
Comment thread docs/source/backends/nxp/nxp-profiling.md Outdated
Comment thread docs/source/backends/nxp/nxp-profiling.md Outdated
Comment thread docs/source/backends/nxp/nxp-profiling.md Outdated

@robert-kalmar robert-kalmar left a comment

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 fix the linting errors and look at our comments. For information how to run the lintrunner see https://github.com/pytorch/executorch/blob/main/CONTRIBUTING.md .

In short:

$ lintrunner init
$ lintrunner --merge-base-with <reference to last commit outside of your contribution>

Comment thread examples/nxp/analyzing_with_inspector.py Outdated
Comment thread examples/nxp/aot_neutron_compile.py Outdated
Comment thread examples/nxp/aot_neutron_compile.py Outdated
@robert-kalmar

Copy link
Copy Markdown
Collaborator

Internal CI build: https://bamboo3.sw.nxp.com/browse/MLTECE-EXIGH146

@irtrukhina irtrukhina force-pushed the feature/EIEX-752-executorch-profiling branch from 7a2d30c to f7c7896 Compare June 2, 2026 08:08
@linux-foundation-easycla

linux-foundation-easycla Bot commented Jun 2, 2026

Copy link
Copy Markdown

CLA Not Signed

@irtrukhina irtrukhina force-pushed the feature/EIEX-752-executorch-profiling branch 2 times, most recently from 9d924bb to 9a8a99b Compare June 2, 2026 19:28
@irtrukhina irtrukhina force-pushed the feature/EIEX-752-executorch-profiling branch from 9a8a99b to d45d32c Compare June 9, 2026 14:26
)
# Two graphs are expected in the input log: original and converted.
EXPECTED_GRAPHS = 2
# List of single-input nodes that shouldn't be mapped on the same TFLite node.

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 don't really understand which nodes is this list supposed to contain. What does the comment mean? Are there any single input nodes which shouldn't be in this list?
Also, is this list complete? Or will we ever need to add operators to it?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I created this list from the output of ./neutron-converter --show-kernel-kinds --target imxrt700. I selected all single-input kernels that can be executed in parallel with the same input.
As I understand, no additional kernels are expected for Neutron-C. If that is correct, this should be a complete list for Neutron-C.
The comment means that if two or more kernels from the list are mapped to the same TFLite node, this is incorrect. In such cases, we need to further analyze and filter the results to keep only one Neutron node that corresponds to the TFLite node name.

Comment thread backends/nxp/tests/generic_tests/test_profiling.py Outdated
Comment thread backends/nxp/tests/generic_tests/test_profiling.py
Comment thread backends/nxp/tests/generic_tests/test_profiling.py Outdated
Comment thread backends/nxp/tests/generic_tests/test_aot_example.py
Comment thread docs/source/backends/nxp/nxp-profiling.md
Comment thread backends/nxp/tests/generic_tests/test_aot_example.py Outdated
Comment thread backends/nxp/tests/generic_tests/test_aot_example.py Outdated
Comment thread backends/nxp/tests/generic_tests/test_aot_example.py Outdated
Comment thread examples/nxp/aot_neutron_compile.py Outdated
Comment thread backends/nxp/runtime/NeutronBackend.cpp Outdated
@irtrukhina irtrukhina force-pushed the feature/EIEX-752-executorch-profiling branch 4 times, most recently from ec062cc to 54cf6d4 Compare June 17, 2026 21:41
@irtrukhina irtrukhina force-pushed the feature/EIEX-752-executorch-profiling branch from 54cf6d4 to 804c3e2 Compare June 22, 2026 08:07
@irtrukhina

Copy link
Copy Markdown
Contributor Author

@robert-kalmar, can you please rerun the pending checks?

@irtrukhina

Copy link
Copy Markdown
Contributor Author

Again, a conflict? Sorry, I didn’t notice that. It was perfectly fine yesterday :(

@irtrukhina irtrukhina force-pushed the feature/EIEX-752-executorch-profiling branch from 804c3e2 to b14a37d Compare June 23, 2026 11:24
@robert-kalmar robert-kalmar merged commit 3169302 into pytorch:main Jun 23, 2026
190 of 192 checks passed
@robert-kalmar robert-kalmar deleted the feature/EIEX-752-executorch-profiling branch June 23, 2026 19:59
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.

3 participants