|
13 | 13 | - install_requirements.sh |
14 | 14 | - backends/apple/** |
15 | 15 | - build/build_apple_frameworks.sh |
| 16 | + - build/build_apple_llm_demo.sh |
16 | 17 | - build/create_frameworks.sh |
17 | 18 | - build/test_ios_ci.sh |
18 | 19 | - examples/demo-apps/apple_ios/** |
@@ -215,3 +216,70 @@ jobs: |
215 | 216 | shasum -a 256 "${FILENAME}" |
216 | 217 | ${AWS_CMD} "${FILENAME}" s3://ossci-ios/executorch/ --acl public-read |
217 | 218 | done |
| 219 | +
|
| 220 | + build-benchmark-app: |
| 221 | + name: build-benchmark-app |
| 222 | + uses: pytorch/test-infra/.github/workflows/macos_job.yml@main |
| 223 | + secrets: inherit |
| 224 | + with: |
| 225 | + runner: macos-latest-xlarge |
| 226 | + python-version: '3.11' |
| 227 | + submodules: 'true' |
| 228 | + ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }} |
| 229 | + upload-artifact: ios-apps |
| 230 | + secrets-env: BUILD_CERTIFICATE_BASE64 EXECUTORCH_BENCHMARK_BUILD_PROVISION_PROFILE_BASE64 KEYCHAIN_PASSWORD |
| 231 | + timeout: 90 |
| 232 | + script: | |
| 233 | + set -eux |
| 234 | +
|
| 235 | + echo "::group::Setting up CI environment" |
| 236 | + .ci/scripts/setup-conda.sh |
| 237 | +
|
| 238 | + BUILD_TOOL=cmake |
| 239 | + # Setup MacOS dependencies as there is no Docker support on MacOS atm |
| 240 | + GITHUB_RUNNER=1 PYTHON_EXECUTABLE=python ${CONDA_RUN} --no-capture-output \ |
| 241 | + .ci/scripts/setup-macos.sh "${BUILD_TOOL}" |
| 242 | + export ARTIFACTS_DIR_NAME=artifacts-to-be-uploaded |
| 243 | +
|
| 244 | + # Setup Apple certificate for iOS development |
| 245 | + BUILD_PROVISION_PROFILE_BASE64="${SECRET_EXECUTORCH_BENCHMARK_BUILD_PROVISION_PROFILE_BASE64}" \ |
| 246 | + BUILD_CERTIFICATE_BASE64="${SECRET_BUILD_CERTIFICATE_BASE64}" \ |
| 247 | + KEYCHAIN_PASSWORD="${SECRET_KEYCHAIN_PASSWORD}" \ |
| 248 | + .ci/scripts/setup-ios.sh |
| 249 | +
|
| 250 | + # Install CoreML Backend Requirements |
| 251 | + PYTHON_EXECUTABLE=python ${CONDA_RUN} --no-capture-output \ |
| 252 | + backends/apple/coreml/scripts/install_requirements.sh |
| 253 | +
|
| 254 | + # Install MPS Backend Requirements |
| 255 | + PYTHON_EXECUTABLE=python ${CONDA_RUN} --no-capture-output \ |
| 256 | + backends/apple/mps/install_requirements.sh |
| 257 | + echo "::endgroup::" |
| 258 | +
|
| 259 | + echo "::group::Build ExecuTorch iOS frameworks" |
| 260 | + FRAMEWORKS=( |
| 261 | + "executorch" |
| 262 | + "backend_coreml" |
| 263 | + "backend_mps" |
| 264 | + "backend_xnnpack" |
| 265 | + "kernels_custom" |
| 266 | + "kernels_optimized" |
| 267 | + "kernels_portable" |
| 268 | + "kernels_quantized" |
| 269 | + ) |
| 270 | +
|
| 271 | + # Build Release iOS Frameworks |
| 272 | + PYTHON_EXECUTABLE=python ${CONDA_RUN} --no-capture-output \ |
| 273 | + build/build_apple_frameworks.sh --coreml --custom --mps --optimized --portable --quantized --xnnpack |
| 274 | +
|
| 275 | + mkdir -p extension/apple/Benchmark/Frameworks |
| 276 | + for FRAMEWORK in "${FRAMEWORKS[@]}"; do ( |
| 277 | + cp -r "cmake-out/${FRAMEWORK}.xcframework" extension/apple/Benchmark/Frameworks/ |
| 278 | + ) done |
| 279 | + echo "::endgroup::" |
| 280 | +
|
| 281 | + echo "::group::Build ExecuTorch benchmark app" |
| 282 | + mkdir -p extension/apple/Benchmark/Models |
| 283 | + ${CONDA_RUN} --no-capture-output \ |
| 284 | + build/build_apple_llm_demo.sh ${ARTIFACTS_DIR_NAME} |
| 285 | + echo "::endgroup::" |
0 commit comments