Skip to content

Conversation

manuelcandales
Copy link
Contributor

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-poisoned]
Copy link

pytorch-bot bot commented Oct 10, 2025

🔗 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 Job

As of commit 74cbeef with merge base 6e0c9f6 (image):

CANCELLED JOB - The following job was cancelled. Please retry:

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

manuelcandales added a commit that referenced this pull request Oct 10, 2025
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
@manuelcandales manuelcandales requested review from mergennachin and removed request for cccclai, kirklandsign and shoumikhin October 10, 2025 21:02
@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 Oct 10, 2025
[ghstack-poisoned]
manuelcandales added a commit that referenced this pull request Oct 10, 2025
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
[ghstack-poisoned]
manuelcandales added a commit that referenced this pull request Oct 11, 2025
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)

Copy link
Contributor

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)
Copy link
Contributor

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?

Comment on lines +131 to +135
// 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");

Copy link
Contributor

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?

[ghstack-poisoned]
manuelcandales added a commit that referenced this pull request Oct 13, 2025
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
[ghstack-poisoned]
manuelcandales added a commit that referenced this pull request Oct 13, 2025
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
@manuelcandales manuelcandales added the release notes: none Do not include this in the release notes label Oct 13, 2025
[ghstack-poisoned]
manuelcandales added a commit that referenced this pull request Oct 13, 2025
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
[ghstack-poisoned]
manuelcandales added a commit that referenced this pull request Oct 13, 2025
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
[ghstack-poisoned]
manuelcandales added a commit that referenced this pull request Oct 13, 2025
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
[ghstack-poisoned]
manuelcandales added a commit that referenced this pull request Oct 13, 2025
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
[ghstack-poisoned]
manuelcandales added a commit that referenced this pull request Oct 15, 2025
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
[ghstack-poisoned]
manuelcandales added a commit that referenced this pull request Oct 15, 2025
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
[ghstack-poisoned]
manuelcandales added a commit that referenced this pull request Oct 15, 2025
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
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. release notes: none Do not include this in the release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants