Add MPS delegate (#754)
Summary: This PR adds MPS Delegate support for ExecuTorch: To use the MPS delegate, follow the following steps: * (AOT) Generate an MPSGraph lowered module ``` python3 -m examples.apple.mps.scripts.mps_example --model_name="mv2" --bundled ``` * (RUNTIME) Once the model binary file is generated, use the mps_executor_runner to run the model: ```bash # Build the mps_executor_runner rm -rf cmake-out && mkdir cmake-out && cd cmake-out && cmake -DEXECUTORCH_BUILD_MPS=1 -DBUCK2=/tmp/buck2 —trace .. && cmake --build . && cd .. # Run the bundled program ./cmake-out/examples/apple/mps/mps_executor_runner --model_path mv2_mps_bundled.pte --bundled_program ``` To see more verbose logging on the runtime, you can enable set -DCMAKE_BUILD_TYPE=Debug while building the runner. An example tutorial can be found under examples/apple/mps/README.md. iOS instructions to run using the MPSDelegate have been updated in examples/demo-apps/apple_ios/README.md Note that the mps_executor_runner can be used with any testcase from test_mps.py and is not limited to examples.apple.mps.scripts.mps_example. For example ``` python3 -m unittest backends.apple.mps.test.test_mps --verbose -k test_mps_backend_cumsum ``` Fix MPS delegate through simulator. Pull Request resolved: https://github.com/pytorch/executorch/pull/754 Reviewed By: iseeyuan, guangy10 Differential Revision: D50110623 Pulled By: kimishpatel fbshipit-source-id: 800a1d90776206dfac82fba8d9d2a0b83daf8c31
K
kulinseth committed
ed16f66753a82aad6af2d886f2794b107b7d9f51
Parent: 102ec0a
Committed by Facebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
on 10/11/2023, 10:22:09 PM