Skip to content

Include custom_ops and XNNPACK in executor_runner if built #9248

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

Merged
merged 7 commits into from
Mar 17, 2025

Conversation

swolchok
Copy link
Contributor

Somebody (@larryliu0820?) pointed out that there's no particular
reason to require a separate xnn_executor_runner target, and indeed we
already put several other optimized things in here if they're built.

[ghstack-poisoned]
@swolchok
Copy link
Contributor Author

swolchok commented Mar 13, 2025

Copy link

pytorch-bot bot commented Mar 13, 2025

🔗 Helpful Links

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

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

✅ No Failures

As of commit 46ae720 with merge base 82f3381 (image):
💚 Looks good so far! There are no failures yet. 💚

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

swolchok added a commit that referenced this pull request Mar 13, 2025
Somebody (larryliu0820?) pointed out that there's no particular
reason to require a separate xnn_executor_runner target, and indeed we
already put several other optimized things in here if they're built.

ghstack-source-id: 1938f3c
ghstack-comment-id: 2722889450
Pull Request resolved: #9248
@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 Mar 13, 2025
@swolchok
Copy link
Contributor Author

hm, apparently the linux runners have an old CMake, but I thought install_requirements.sh installed latest cmake via pip...

[ghstack-poisoned]
@swolchok swolchok requested a review from mcr229 as a code owner March 14, 2025 16:28
swolchok added a commit that referenced this pull request Mar 14, 2025
Somebody (larryliu0820?) pointed out that there's no particular
reason to require a separate xnn_executor_runner target, and indeed we
already put several other optimized things in here if they're built.

ghstack-source-id: e408855
ghstack-comment-id: 2722889450
Pull Request resolved: #9248
[ghstack-poisoned]
swolchok added a commit that referenced this pull request Mar 14, 2025
Somebody (larryliu0820?) pointed out that there's no particular
reason to require a separate xnn_executor_runner target, and indeed we
already put several other optimized things in here if they're built.

ghstack-source-id: 293c52a
ghstack-comment-id: 2722889450
Pull Request resolved: #9248
@swolchok
Copy link
Contributor Author

I have a local patch for llama-runner-qnn-linux trunk job. to avoid excessive CI usage, I will wait for the other trunk jobs to come back and if they are green, I will just add the patch and merge right away.

[ghstack-poisoned]
swolchok added a commit that referenced this pull request Mar 14, 2025
Somebody (larryliu0820?) pointed out that there's no particular
reason to require a separate xnn_executor_runner target, and indeed we
already put several other optimized things in here if they're built.

ghstack-source-id: 5f7a181
ghstack-comment-id: 2722889450
Pull Request resolved: #9248
@swolchok
Copy link
Contributor Author

merge right away.

whoops, thought this was reviewed but it's not. should be good to go

swolchok added a commit that referenced this pull request Mar 14, 2025
Attempt to add a Buck target that's analogous to the CMake build's executor_runner -- has all CPU ops that you need etc. The base executor_runner target is commented as intentionally having minimal deps, hence the separate target.

This is sort of a companion to #9248, except that that PR is for CMake only and this PR is for Buck only.

Differential Revision: [D71220489](https://our.internmc.facebook.com/intern/diff/D71220489/)

[ghstack-poisoned]
swolchok added a commit that referenced this pull request Mar 14, 2025
Attempt to add a Buck target that's analogous to the CMake build's executor_runner -- has all CPU ops that you need etc. The base executor_runner target is commented as intentionally having minimal deps, hence the separate target.

This is sort of a companion to #9248, except that that PR is for CMake only and this PR is for Buck only.

Differential Revision: [D71220489](https://our.internmc.facebook.com/intern/diff/D71220489/)

[ghstack-poisoned]
swolchok added a commit that referenced this pull request Mar 14, 2025
Attempt to add a Buck target that's analogous to the CMake build's executor_runner -- has all CPU ops that you need etc. The base executor_runner target is commented as intentionally having minimal deps, hence the separate target.

This is sort of a companion to #9248, except that that PR is for CMake only and this PR is for Buck only.

Differential Revision: [D71220489](https://our.internmc.facebook.com/intern/diff/D71220489/)

[ghstack-poisoned]
swolchok added a commit that referenced this pull request Mar 14, 2025
Attempt to add a Buck target that's analogous to the CMake build's executor_runner -- has all CPU ops that you need etc. The base executor_runner target is commented as intentionally having minimal deps, hence the separate target.

This is sort of a companion to #9248, except that that PR is for CMake only and this PR is for Buck only.

Differential Revision: [D71220489](https://our.internmc.facebook.com/intern/diff/D71220489/)

[ghstack-poisoned]
swolchok added a commit that referenced this pull request Mar 14, 2025
It is redundant with executor_runner after #9248 .

Differential Revision: [D71159265](https://our.internmc.facebook.com/intern/diff/D71159265/)

[ghstack-poisoned]
@swolchok
Copy link
Contributor Author

swolchok commented Mar 14, 2025

hmm, 3 test-models-macos jobs timed out, but they're all succeeding quickly on main. rerunning.

swolchok added a commit that referenced this pull request Mar 14, 2025
It is redundant with executor_runner after #9248 .

Differential Revision: [D71159265](https://our.internmc.facebook.com/intern/diff/D71159265/)

[ghstack-poisoned]
swolchok added a commit that referenced this pull request Mar 14, 2025
Pull Request resolved: #9292

It is redundant with executor_runner after #9248 .

Differential Revision: [D71159265](https://our.internmc.facebook.com/intern/diff/D71159265/)
ghstack-source-id: 271912198
@swolchok
Copy link
Contributor Author

noting that CI is green. rebasing and merging

[ghstack-poisoned]
swolchok added a commit that referenced this pull request Mar 17, 2025
Somebody (larryliu0820?) pointed out that there's no particular
reason to require a separate xnn_executor_runner target, and indeed we
already put several other optimized things in here if they're built.

ghstack-source-id: 5f741f1
ghstack-comment-id: 2722889450
Pull Request resolved: #9248
[ghstack-poisoned]
[ghstack-poisoned]
@swolchok swolchok changed the base branch from main to gh/swolchok/371/head March 17, 2025 15:37
@swolchok swolchok mentioned this pull request Mar 17, 2025
swolchok added a commit that referenced this pull request Mar 17, 2025
Somebody (larryliu0820?) pointed out that there's no particular
reason to require a separate xnn_executor_runner target, and indeed we
already put several other optimized things in here if they're built.

ghstack-source-id: 9b3104b
ghstack-comment-id: 2722889450
Pull Request resolved: #9248
Base automatically changed from gh/swolchok/371/head to main March 17, 2025 15:46
@swolchok swolchok merged commit 0653b8f into main Mar 17, 2025
162 checks passed
@swolchok swolchok deleted the gh/swolchok/361/head branch March 17, 2025 17:04
@@ -118,7 +118,7 @@ include(cmake/Dependencies.cmake)
list(TRANSFORM _xnnpack_backend__srcs PREPEND "${EXECUTORCH_ROOT}/")
add_library(xnnpack_backend STATIC ${_xnnpack_backend__srcs})
target_link_libraries(
xnnpack_backend PUBLIC ${xnnpack_third_party} executorch_core xnnpack_schema
xnnpack_backend PUBLIC ${xnnpack_third_party} executorch_core xnnpack_schema extension_threadpool
Copy link
Contributor

Choose a reason for hiding this comment

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

@swolchok just checking, does it have any implications on build_apple_frameworks.sh's backend_xnnpack framework? Specifically, the fact kernels_custom already links against extension_threadpool. Can we run into duplicated symbols when both are linked with an app? All iOS CI tests that could have flagged were red by the time this change merged due to some previous changes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think we should be requiring everyone who makes a change to the CMake dependency graph to think about build_apple_frameworks.sh. We should look into using CMake's built-in support for building Apple frameworks instead if possible.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can we run into duplicated symbols when both are linked with an app?

I don't know, but I would expect to see red CI jobs in that case.

Copy link
Contributor

Choose a reason for hiding this comment

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

Each framework is sorta a higher level abstraction and consists of several CMake artifacts built according to the rules in build_apple_frameworks.sh. Apps can link them selectively, which may reveal missing or duplicate symbols. To catch such issues, we rely on demo and benchmark apps running tests as part of CI. However, both are currently failing due to unrelated prior changes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

if I'm not mistaken, the build_apple_frameworks job for this diff successfully compiled and linked the demo app and it's failing in tests.

Copy link
Contributor

Choose a reason for hiding this comment

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

That’s correct - it means the frameworks were linked as instructed. Now, the app tests will determine whether the frameworks contain all the required symbols, are missing any, or have duplicates. These tests don’t run on every PR but only on specific path changes and in CI (last I heard, Mac runners were costly to run every time). Since the CI is already failing for them, I’m proactively checking if there are any other potentially relevant changes we should investigate once those issues are resolved.

swolchok added a commit that referenced this pull request Mar 17, 2025
It is redundant with executor_runner after #9248 .

Differential Revision: [D71159265](https://our.internmc.facebook.com/intern/diff/D71159265/)

[ghstack-poisoned]
swolchok added a commit that referenced this pull request Mar 17, 2025
Pull Request resolved: #9292

It is redundant with executor_runner after #9248 .
ghstack-source-id: 272251778

Differential Revision: [D71159265](https://our.internmc.facebook.com/intern/diff/D71159265/)
swolchok added a commit that referenced this pull request Mar 17, 2025
It is redundant with executor_runner after #9248 .

Differential Revision: [D71159265](https://our.internmc.facebook.com/intern/diff/D71159265/)

[ghstack-poisoned]
swolchok added a commit that referenced this pull request Mar 17, 2025
…tor_runner:executor_runner_opt"

Attempt to add a Buck target that's analogous to the CMake build's executor_runner -- has all CPU ops that you need etc. The base executor_runner target is commented as intentionally having minimal deps, hence the separate target.

This is sort of a companion to #9248, except that that PR is for CMake only and this PR is for Buck only.

Differential Revision: [D71220489](https://our.internmc.facebook.com/intern/diff/D71220489/)

[ghstack-poisoned]
swolchok added a commit that referenced this pull request Mar 17, 2025
…tor_runner_opt"

Attempt to add a Buck target that's analogous to the CMake build's executor_runner -- has all CPU ops that you need etc. The base executor_runner target is commented as intentionally having minimal deps, hence the separate target.

This is sort of a companion to #9248, except that that PR is for CMake only and this PR is for Buck only.

Differential Revision: [D71220489](https://our.internmc.facebook.com/intern/diff/D71220489/)

[ghstack-poisoned]
@huydhn huydhn mentioned this pull request Mar 20, 2025
huydhn added a commit that referenced this pull request Mar 21, 2025
This is the minimum version `cmake_minimum_required(VERSION 3.24)` set
by #9248. Android jobs are
failing
https://github.com/pytorch/executorch/actions/runs/13959323278/job/39077616882#step:15:753
after #9248 lands
oscarandersson8218 pushed a commit to oscarandersson8218/executorch that referenced this pull request Mar 21, 2025
This is the minimum version `cmake_minimum_required(VERSION 3.24)` set
by pytorch#9248. Android jobs are
failing
https://github.com/pytorch/executorch/actions/runs/13959323278/job/39077616882#step:15:753
after pytorch#9248 lands
swolchok added a commit that referenced this pull request Mar 21, 2025
Pull Request resolved: #9291

Attempt to add a Buck target that's analogous to the CMake build's executor_runner -- has all CPU ops that you need etc. The base executor_runner target is commented as intentionally having minimal deps, hence the separate target.

This is sort of a companion to #9248, except that that PR is for CMake only and this PR is for Buck only.
ghstack-source-id: 273335947
@exported-using-ghexport

Differential Revision: [D71220489](https://our.internmc.facebook.com/intern/diff/D71220489/)
swolchok added a commit that referenced this pull request Mar 21, 2025
…tor_runner:executor_runner_opt"

Attempt to add a Buck target that's analogous to the CMake build's executor_runner -- has all CPU ops that you need etc. The base executor_runner target is commented as intentionally having minimal deps, hence the separate target.

This is sort of a companion to #9248, except that that PR is for CMake only and this PR is for Buck only.

Differential Revision: [D71220489](https://our.internmc.facebook.com/intern/diff/D71220489/)

[ghstack-poisoned]
swolchok added a commit that referenced this pull request Mar 21, 2025
…tor_runner_opt"

Attempt to add a Buck target that's analogous to the CMake build's executor_runner -- has all CPU ops that you need etc. The base executor_runner target is commented as intentionally having minimal deps, hence the separate target.

This is sort of a companion to #9248, except that that PR is for CMake only and this PR is for Buck only.

Differential Revision: [D71220489](https://our.internmc.facebook.com/intern/diff/D71220489/)

[ghstack-poisoned]
swolchok added a commit that referenced this pull request Mar 21, 2025
…opt (#9291)

Attempt to add a Buck target that's analogous to the CMake build's
executor_runner -- has all CPU ops that you need etc. The base
executor_runner target is commented as intentionally having minimal
deps, hence the separate target.

This is sort of a companion to
#9248, except that that PR is
for CMake only and this PR is for Buck only.
DannyYuyang-quic pushed a commit to CodeLinaro/executorch that referenced this pull request Apr 2, 2025
)

Somebody (@larryliu0820?) pointed out that there's no particular
reason to require a separate xnn_executor_runner target, and indeed we
already put several other optimized things in here if they're built.
DannyYuyang-quic pushed a commit to CodeLinaro/executorch that referenced this pull request Apr 2, 2025
This is the minimum version `cmake_minimum_required(VERSION 3.24)` set
by pytorch#9248. Android jobs are
failing
https://github.com/pytorch/executorch/actions/runs/13959323278/job/39077616882#step:15:753
after pytorch#9248 lands
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. topic: not user facing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants