Skip to content

Commit 61e5d4c

Browse files
Riandyfacebook-github-bot
authored andcommitted
Improve iOS demo app readme (#5453)
Summary: Pull Request resolved: #5453 - Add instructions on how to clear package dependencies cache Reviewed By: shoumikhin Differential Revision: D62909056 fbshipit-source-id: ce5f595c9eebd51a7322209d562c98ff6c4c1c43
1 parent f5f54b8 commit 61e5d4c

File tree

3 files changed

+61
-7
lines changed

3 files changed

+61
-7
lines changed

examples/demo-apps/apple_ios/LLaMA/README.md

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,41 @@ First it’s important to note that currently ExecuTorch provides support across
3333
## How to Use the App
3434
This section will provide the main steps to use the app, along with a code snippet of the ExecuTorch API.
3535

36-
```{note}
36+
### Swift Package Manager
37+
3738
ExecuTorch runtime is distributed as a Swift package providing some .xcframework as prebuilt binary targets.
3839
Xcode will download and cache the package on the first run, which will take some time.
40+
41+
Note: If you're running into any issues related to package dependencies, quit Xcode entirely, delete the whole executorch repo, clean the caches by running the command below in terminal and clone the repo again.
42+
43+
```rm -rf \
44+
~/Library/org.swift.swiftpm \
45+
~/Library/Caches/org.swift.swiftpm \
46+
~/Library/Caches/com.apple.dt.Xcode \
47+
~/Library/Developer/Xcode/DerivedData
3948
```
4049

50+
Link your binary with the ExecuTorch runtime and any backends or kernels used by the exported ML model. It is recommended to link the core runtime to the components that use ExecuTorch directly, and link kernels and backends against the main app target.
51+
52+
Note: To access logs, link against the Debug build of the ExecuTorch runtime, i.e., the executorch_debug framework. For optimal performance, always link against the Release version of the deliverables (those without the _debug suffix), which have all logging overhead removed.
53+
54+
For more details integrating and Running ExecuTorch on Apple Platforms, checkout this [link](https://pytorch.org/executorch/main/apple-runtime.html).
55+
56+
### XCode
4157
* Open XCode and select "Open an existing project" to open `examples/demo-apps/apple_ios/LLama`.
42-
* Ensure that the ExecuTorch package dependencies are installed correctly.
58+
* Ensure that the ExecuTorch package dependencies are installed correctly, then select which ExecuTorch framework should link against which target.
59+
60+
<p align="center">
61+
<img src="docs/screenshots/ios_demo_app_swift_pm.png" alt="iOS LLaMA App Swift PM" width="600">
62+
</p>
63+
64+
<p align="center">
65+
<img src="docs/screenshots/ios_demo_app_choosing_package.png" alt="iOS LLaMA App Choosing package" width="600">
66+
</p>
67+
4368
* Run the app. This builds and launches the app on the phone.
4469
* In app UI pick a model and tokenizer to use, type a prompt and tap the arrow buton
4570

46-
4771
## Copy the model to Simulator
4872

4973
* Drag&drop the model and tokenizer files onto the Simulator window and save them somewhere inside the iLLaMA folder.

examples/demo-apps/apple_ios/LLaMA/docs/delegates/mps_README.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ Install dependencies
3939
## Prepare Models
4040
In this demo app, we support text-only inference with Llama 3.1, Llama 3, and Llama 2 models.
4141

42-
Install the required packages
42+
Install the required packages to export the model
4343

4444
```
45-
executorch/examples/models/llama2/install_requirements.sh
45+
sh examples/models/llama2/install_requirements.sh
4646
```
4747

4848
Export the model
@@ -78,6 +78,21 @@ The prebuilt ExecuTorch runtime, backend, and kernels are available as a Swift P
7878
### Xcode
7979
Open the project in Xcode.In Xcode, go to `File > Add Package Dependencies`. Paste the URL of the ExecuTorch repo into the search bar and select it. Make sure to change the branch name to the desired ExecuTorch version, e.g., “0.3.0”, or just use the “latest” branch name for the latest stable build.
8080

81+
Note: If you're running into any issues related to package dependencies, quit Xcode entirely, delete the whole executorch repo, clean the caches by running the command below in terminal and clone the repo again.
82+
83+
```rm -rf \
84+
~/Library/org.swift.swiftpm \
85+
~/Library/Caches/org.swift.swiftpm \
86+
~/Library/Caches/com.apple.dt.Xcode \
87+
~/Library/Developer/Xcode/DerivedData
88+
```
89+
90+
Link your binary with the ExecuTorch runtime and any backends or kernels used by the exported ML model. It is recommended to link the core runtime to the components that use ExecuTorch directly, and link kernels and backends against the main app target.
91+
92+
Note: To access logs, link against the Debug build of the ExecuTorch runtime, i.e., the executorch_debug framework. For optimal performance, always link against the Release version of the deliverables (those without the _debug suffix), which have all logging overhead removed.
93+
94+
For more details integrating and Running ExecuTorch on Apple Platforms, checkout this [link](https://pytorch.org/executorch/main/apple-runtime.html).
95+
8196
<p align="center">
8297
<img src="../screenshots/ios_demo_app_swift_pm.png" alt="iOS LLaMA App Swift PM" width="600">
8398
</p>

examples/demo-apps/apple_ios/LLaMA/docs/delegates/xnnpack_README.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ Install dependencies
3939
## Prepare Models
4040
In this demo app, we support text-only inference with up-to-date Llama models.
4141

42-
Install the required packages
42+
Install the required packages to export the model
4343

4444
```
45-
executorch/examples/models/llama2/install_requirements.sh
45+
sh examples/models/llama2/install_requirements.sh
4646
```
4747

4848
Export the model
@@ -78,6 +78,21 @@ The prebuilt ExecuTorch runtime, backend, and kernels are available as a Swift P
7878
### Xcode
7979
Open the project in Xcode.In Xcode, go to `File > Add Package Dependencies`. Paste the URL of the ExecuTorch repo into the search bar and select it. Make sure to change the branch name to the desired ExecuTorch version, e.g., “0.3.0”, or just use the “latest” branch name for the latest stable build.
8080

81+
Note: If you're running into any issues related to package dependencies, quit Xcode entirely, delete the whole executorch repo, clean the caches by running the command below in terminal and clone the repo again.
82+
83+
```rm -rf \
84+
~/Library/org.swift.swiftpm \
85+
~/Library/Caches/org.swift.swiftpm \
86+
~/Library/Caches/com.apple.dt.Xcode \
87+
~/Library/Developer/Xcode/DerivedData
88+
```
89+
90+
Link your binary with the ExecuTorch runtime and any backends or kernels used by the exported ML model. It is recommended to link the core runtime to the components that use ExecuTorch directly, and link kernels and backends against the main app target.
91+
92+
Note: To access logs, link against the Debug build of the ExecuTorch runtime, i.e., the executorch_debug framework. For optimal performance, always link against the Release version of the deliverables (those without the _debug suffix), which have all logging overhead removed.
93+
94+
For more details integrating and Running ExecuTorch on Apple Platforms, checkout this [link](https://pytorch.org/executorch/main/apple-runtime.html).
95+
8196
<p align="center">
8297
<img src="../screenshots/ios_demo_app_swift_pm.png" alt="iOS LLaMA App Swift PM" width="600">
8398
</p>

0 commit comments

Comments
 (0)