Skip to content

Commit

Permalink
Fix executor_runner_mps and mpsdelegate linking with pybind (#3222) (#…
Browse files Browse the repository at this point in the history
…3248)

Summary:
Summary of changes:
- fixes mps_executor_runner build - previously it would fail to build previously due to incorrect linking with portable ops
- fixes `mpsdelegate` linking with `pybind` lib
- added tests to check correctness directly through pybind
- added a helper file (`bench_utils.py`) to help measure models forward pass between PyTorch MPS and ExecuTorch MPS

Testing (will run both AOT and runtime if MPS was built with pybind):
- `./install_requirements.sh --pybind mps`
- invoke a single unit test: `python3 -m unittest backends.apple.mps.test.test_mps_indexing_ops -v -k test_mps_indexing_get_1`.
- invoke all tests from a file: `python3 -m unittest backends.apple.mps.test.test_mps_indexing_ops -v`

cc cccclai , shoumikhin

Pull Request resolved: #3222

Reviewed By: shoumikhin

Differential Revision: D56447888

Pulled By: cccclai

fbshipit-source-id: 5cbbcbf8df34f29e23a1854df72f764337a9df76
(cherry picked from commit 6c30eea)

Co-authored-by: Denis Vieriu <dvieriu@apple.com>
  • Loading branch information
pytorchbot and DenisVieriu97 authored Apr 23, 2024
1 parent ba6e318 commit b045b3c
Show file tree
Hide file tree
Showing 9 changed files with 1,011 additions and 308 deletions.
3 changes: 3 additions & 0 deletions backends/apple/mps/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ target_link_libraries(mpsdelegate
${MPS_GRAPG_FRAMEWORK}
)

target_link_options_shared_lib(mpsdelegate)
target_compile_options(mpsdelegate PUBLIC ${_common_compile_options})

install(
TARGETS mpsdelegate
DESTINATION lib
Expand Down
Loading

0 comments on commit b045b3c

Please sign in to comment.