Skip to content

Consolidating executor runners in CMake - xnnpack #11239

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 5 commits into from
Jun 3, 2025

Conversation

BujSet
Copy link
Contributor

@BujSet BujSet commented May 29, 2025

Summary

Continuing the process of consolidating the executor runners to top level CMakeLists.txt file. Completing this process for the xnnpack backend in the cmake build flow.

Partially Fixes #<10819> : #10819.

Test plan

Successfully ran the commands in the building from source guide. Updated the github actions to not use the generic executor_runner and remove the invocation for the backend-specific xnn_executor_runner. Also ran the following formatinng and lint checks:

cmake-format -i backends/xnnpack/CMakeLists.txt

cmake-lint backends/xnnpack/CMakeLists.txt

Includes updates to documentation and tutorials (flows from examples and tutorials were verify to ensure build functionality).

Note: the buck flow side of things was unmodified, and support for that flow remains for a future change.

Copy link

pytorch-bot bot commented May 29, 2025

🔗 Helpful Links

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

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

✅ You can merge normally! (1 Unrelated Failure)

As of commit dfa240b with merge base 879eee0 (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.

@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 May 29, 2025
@BujSet
Copy link
Contributor Author

BujSet commented May 29, 2025

@pytorchbot label "release notes: none"

@pytorch-bot pytorch-bot bot added the release notes: none Do not include this in the release notes label May 29, 2025
@BujSet BujSet marked this pull request as ready for review May 29, 2025 23:17
@BujSet BujSet force-pushed the consolidating_executor_runners branch from 47fc752 to a902ddd Compare May 30, 2025 17:07
@BujSet BujSet marked this pull request as draft May 30, 2025 17:08
@BujSet BujSet force-pushed the consolidating_executor_runners branch from a902ddd to d54a72f Compare May 30, 2025 17:55
@BujSet BujSet changed the title Consolidating executor runners in CMake - openvino Consolidating executor runners in CMake - xnnpack May 30, 2025
@BujSet BujSet force-pushed the consolidating_executor_runners branch from a6239bc to 55944a2 Compare May 30, 2025 18:02
@BujSet BujSet marked this pull request as ready for review May 30, 2025 18:02
@@ -153,7 +132,6 @@ endif()

install(
TARGETS xnnpack_backend
DESTINATION lib
Copy link
Contributor

Choose a reason for hiding this comment

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

Why change this?

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 ran cmake-lint on this file, and it reported [E1122] Duplicate keyword argument DESTINATION because this variable is overridden two lines below to what I believe is the correct destination. It's the same error and fix as in the formatting PR-L496.

if [[ ! -f ${CMAKE_OUTPUT_DIR}/backends/xnnpack/xnn_executor_runner ]]; then
build_cmake_xnn_executor_runner
if [[ ! -f ${CMAKE_OUTPUT_DIR}/executor_runner ]]; then
build_cmake_executor_runner
Copy link
Contributor

Choose a reason for hiding this comment

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

You will have to make sure EXECUTORCH_BUILD_XNNPACK is ON, right? Maybe let build_cmake_executor_runner take a backend string and turn the option on accordingly? This can be extended to other backends.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds good, will try this out.

@@ -150,10 +137,10 @@ test_model_with_xnnpack() {
if [[ "${BUILD_TOOL}" == "buck2" ]]; then
buck2 run //examples/xnnpack:xnn_executor_runner -- --model_path "${OUTPUT_MODEL_PATH}"
Copy link
Contributor

Choose a reason for hiding this comment

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

Also after this PR the internal (BUCK) behavior is different than CMake. I think it's fine for now but maybe add a TODO here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added in a comment for it.

@BujSet BujSet force-pushed the consolidating_executor_runners branch from 55944a2 to 8b44d68 Compare May 30, 2025 18:42
@BujSet BujSet force-pushed the consolidating_executor_runners branch 5 times, most recently from 73dd149 to c389f68 Compare June 2, 2025 21:55
@BujSet BujSet marked this pull request as draft June 3, 2025 03:09
@BujSet BujSet self-assigned this Jun 3, 2025
@BujSet BujSet force-pushed the consolidating_executor_runners branch from c389f68 to 042c357 Compare June 3, 2025 03:11
@BujSet BujSet marked this pull request as ready for review June 3, 2025 05:05
@BujSet BujSet requested a review from digantdesai as a code owner June 3, 2025 05:05
BujSet added 5 commits June 2, 2025 22:05
Continuing the process of consolidating the executor runners to top
level CMakeLists.txt file. Completing this process for the xnnpack
backend. Change also updates the CI tests to not use the generic
executor_runner and removes the specific xnn_executor_runner.
Note, this change only affects the cmake build process. Similar changes
will be necessary for the buck build flow.
@BujSet BujSet force-pushed the consolidating_executor_runners branch from eea93eb to dfa240b Compare June 3, 2025 05:05
@BujSet BujSet merged commit 5ef38d3 into pytorch:main Jun 3, 2025
532 of 540 checks passed
@BujSet BujSet deleted the consolidating_executor_runners branch June 19, 2025 00:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ciflow/binaries ciflow/trunk CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. release notes: none Do not include this in the release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants