-
Notifications
You must be signed in to change notification settings - Fork 686
Add Metal backend build system and runtime integration #15024
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: gh/manuelcandales/143/head
Are you sure you want to change the base?
Add Metal backend build system and runtime integration #15024
Conversation
Stack from ghstack (oldest at bottom): |
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/15024
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 Cancelled JobAs of commit 74cbeef with merge base 6e0c9f6 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
Build system changes: - Add EXECUTORCH_BUILD_METAL build option in default.cmake - Fix AOTI linker flags for Apple platforms (use -export_dynamic) - Extend AOTI build support to Metal backend - Register Metal backend and configure Metal framework linkage - Add PyTorch AOTI headers and OpenMP library detection with rpath Runtime implementation: - Add main Metal backend runtime providing entry point for AOTI-compiled model execution on Metal devices This commit ties together all Metal backend components and enables building the complete backend. ghstack-source-id: 32be451 ghstack-comment-id: 3392300655 Pull-Request: #15024
Build system changes: - Add EXECUTORCH_BUILD_METAL build option in default.cmake - Fix AOTI linker flags for Apple platforms (use -export_dynamic) - Extend AOTI build support to Metal backend - Register Metal backend and configure Metal framework linkage - Add PyTorch AOTI headers and OpenMP library detection with rpath Runtime implementation: - Add main Metal backend runtime providing entry point for AOTI-compiled model execution on Metal devices This commit ties together all Metal backend components and enables building the complete backend. ghstack-source-id: dd5866f ghstack-comment-id: 3392300655 Pull-Request: #15024
Build system changes: - Add EXECUTORCH_BUILD_METAL build option in default.cmake - Fix AOTI linker flags for Apple platforms (use -export_dynamic) - Extend AOTI build support to Metal backend - Register Metal backend and configure Metal framework linkage - Add PyTorch AOTI headers and OpenMP library detection with rpath Runtime implementation: - Add main Metal backend runtime providing entry point for AOTI-compiled model execution on Metal devices This commit ties together all Metal backend components and enables building the complete backend. ghstack-source-id: cde20a4 ghstack-comment-id: 3392300655 Pull-Request: #15024
# It should also be cmake-lint clean. | ||
# | ||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON) | ||
|
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.
cmake_minimum_required(VERSION 3.29)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
if(NOT APPLE)
message(FATAL_ERROR "Metal backend requires macOS")
endif()
${METALPERFORMANCESHADERSGRAPH_LIBRARY} | ||
) | ||
|
||
target_compile_options(metal_backend PUBLIC -fexceptions -frtti -fPIC) |
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.
Let's remove -frtti
and -fexceptions
because on desktop, we actually want those, no?
// Generate dynamic temporary file path | ||
filesystem::path temp_dir = filesystem::temp_directory_path(); | ||
filesystem::path so_path = | ||
temp_dir / (so_blob_key + to_string(getpid()) + ".so"); | ||
|
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 we need to delete these temp files?
Build system changes: - Add EXECUTORCH_BUILD_METAL build option in default.cmake - Fix AOTI linker flags for Apple platforms (use -export_dynamic) - Extend AOTI build support to Metal backend - Register Metal backend and configure Metal framework linkage - Add PyTorch AOTI headers and OpenMP library detection with rpath Runtime implementation: - Add main Metal backend runtime providing entry point for AOTI-compiled model execution on Metal devices This commit ties together all Metal backend components and enables building the complete backend. ghstack-source-id: ee5a382 ghstack-comment-id: 3392300655 Pull-Request: #15024
Build system changes: - Add EXECUTORCH_BUILD_METAL build option in default.cmake - Fix AOTI linker flags for Apple platforms (use -export_dynamic) - Extend AOTI build support to Metal backend - Register Metal backend and configure Metal framework linkage - Add PyTorch AOTI headers and OpenMP library detection with rpath Runtime implementation: - Add main Metal backend runtime providing entry point for AOTI-compiled model execution on Metal devices This commit ties together all Metal backend components and enables building the complete backend. ghstack-source-id: 6cec8c4 ghstack-comment-id: 3392300655 Pull-Request: #15024
Build system changes: - Add EXECUTORCH_BUILD_METAL build option in default.cmake - Fix AOTI linker flags for Apple platforms (use -export_dynamic) - Extend AOTI build support to Metal backend - Register Metal backend and configure Metal framework linkage - Add PyTorch AOTI headers and OpenMP library detection with rpath Runtime implementation: - Add main Metal backend runtime providing entry point for AOTI-compiled model execution on Metal devices This commit ties together all Metal backend components and enables building the complete backend. ghstack-source-id: 47506f2 ghstack-comment-id: 3392300655 Pull-Request: #15024
Build system changes: - Add EXECUTORCH_BUILD_METAL build option in default.cmake - Fix AOTI linker flags for Apple platforms (use -export_dynamic) - Extend AOTI build support to Metal backend - Register Metal backend and configure Metal framework linkage - Add PyTorch AOTI headers and OpenMP library detection with rpath Runtime implementation: - Add main Metal backend runtime providing entry point for AOTI-compiled model execution on Metal devices This commit ties together all Metal backend components and enables building the complete backend. ghstack-source-id: d669c96 ghstack-comment-id: 3392300655 Pull-Request: #15024
Build system changes: - Add EXECUTORCH_BUILD_METAL build option in default.cmake - Fix AOTI linker flags for Apple platforms (use -export_dynamic) - Extend AOTI build support to Metal backend - Register Metal backend and configure Metal framework linkage - Add PyTorch AOTI headers and OpenMP library detection with rpath Runtime implementation: - Add main Metal backend runtime providing entry point for AOTI-compiled model execution on Metal devices This commit ties together all Metal backend components and enables building the complete backend. ghstack-source-id: 0c66dd8 ghstack-comment-id: 3392300655 Pull-Request: #15024
Build system changes: - Add EXECUTORCH_BUILD_METAL build option in default.cmake - Fix AOTI linker flags for Apple platforms (use -export_dynamic) - Extend AOTI build support to Metal backend - Register Metal backend and configure Metal framework linkage - Add PyTorch AOTI headers and OpenMP library detection with rpath Runtime implementation: - Add main Metal backend runtime providing entry point for AOTI-compiled model execution on Metal devices This commit ties together all Metal backend components and enables building the complete backend. ghstack-source-id: 4051027 ghstack-comment-id: 3392300655 Pull-Request: #15024
Build system changes: - Add EXECUTORCH_BUILD_METAL build option in default.cmake - Fix AOTI linker flags for Apple platforms (use -export_dynamic) - Extend AOTI build support to Metal backend - Register Metal backend and configure Metal framework linkage - Add PyTorch AOTI headers and OpenMP library detection with rpath Runtime implementation: - Add main Metal backend runtime providing entry point for AOTI-compiled model execution on Metal devices This commit ties together all Metal backend components and enables building the complete backend. ghstack-source-id: 989b781 ghstack-comment-id: 3392300655 Pull-Request: #15024
Build system changes: - Add EXECUTORCH_BUILD_METAL build option in default.cmake - Fix AOTI linker flags for Apple platforms (use -export_dynamic) - Extend AOTI build support to Metal backend - Register Metal backend and configure Metal framework linkage - Add PyTorch AOTI headers and OpenMP library detection with rpath Runtime implementation: - Add main Metal backend runtime providing entry point for AOTI-compiled model execution on Metal devices This commit ties together all Metal backend components and enables building the complete backend. ghstack-source-id: 086b734 ghstack-comment-id: 3392300655 Pull-Request: #15024
Build system changes: - Add EXECUTORCH_BUILD_METAL build option in default.cmake - Fix AOTI linker flags for Apple platforms (use -export_dynamic) - Extend AOTI build support to Metal backend - Register Metal backend and configure Metal framework linkage - Add PyTorch AOTI headers and OpenMP library detection with rpath Runtime implementation: - Add main Metal backend runtime providing entry point for AOTI-compiled model execution on Metal devices This commit ties together all Metal backend components and enables building the complete backend. ghstack-source-id: b9c5537 ghstack-comment-id: 3392300655 Pull-Request: #15024
Build system changes:
Runtime implementation:
model execution on Metal devices
This commit ties together all Metal backend components and enables
building the complete backend.