From de3393b725d4e02ed4f58ece0fa28c732bc9057b Mon Sep 17 00:00:00 2001 From: Vrajang Parikh Date: Fri, 18 Aug 2023 15:09:29 -0700 Subject: [PATCH] Update macOS and iOS custom build documentation for training (#17223) ### Description Add instructions for macOS build and training pods Preview: https://vraspar.github.io/onnxruntime/docs/build/training.html, https://vraspar.github.io/onnxruntime/docs/build/custom.html#ios --------- Co-authored-by: Edward Chen <18449977+edgchen1@users.noreply.github.com> Co-authored-by: Baiju Meswani --- docs/build/custom.md | 14 ++++++++++++++ docs/build/training.md | 8 ++++++++ 2 files changed, 22 insertions(+) diff --git a/docs/build/custom.md b/docs/build/custom.md index dab7e1c909..93e1c1bfa2 100644 --- a/docs/build/custom.md +++ b/docs/build/custom.md @@ -186,6 +186,20 @@ To produce pods for an iOS build, use the [build_and_assemble_ios_pods.py](https The reduced set of ops in the custom build is specified with the file provided to the `--include_ops_by_config` option. See the current op config used by the pre-built mobile package at [tools/ci_build/github/android/mobile_package.required_operators.config](https://github.com/microsoft/onnxruntime/blob/main/tools/ci_build/github/android/mobile_package.required_operators.config) (Android and iOS pre-built mobile packages share the same config file). You can use this file directly. + The default package does not include the training APIs. To create a training package, add `--enable_training_apis` in the build options file provided to `--build-settings-file` and add the `--variant Training` option when calling `build_and_assemble_ios_pods.py`. + + For example: + + ```bash + # /path/to/build_settings.json is a file that includes the `--enable_training_apis` option + + python3 tools/ci_build/github/apple/build_and_assemble_ios_pods.py \ + --staging-dir /path/to/staging/dir \ + --include-ops-by-config /path/to/ops.config \ + --build-settings-file /path/to/build_settings.json \ + --variant Training + ``` + 3. Use the local pods. For example, update the Podfile to use the local onnxruntime-mobile-objc pod instead of the released one: diff --git a/docs/build/training.md b/docs/build/training.md index 49f35aac78..1840a35941 100644 --- a/docs/build/training.md +++ b/docs/build/training.md @@ -41,6 +41,14 @@ redirect_from: /docs/how-to/build/training Refer to the [Android build instructions](./android.md) and add the ```--enable_training_apis``` build flag. + d. For MacOS + + Refer to the [macOS inference build instructions](./inferencing.md) and add the `--enable_training_apis` build flag. + + e. For iOS + + Refer to the [iOS build instructions](./ios.md) and add the ```--enable_training_apis``` build flag. + > **Note** > > - To build the C# bindings, add the ```--build_nuget``` flag to the build command above.