Skip to content

Commit

Permalink
Use Apple perf workflow to validate the test spec (pytorch#5293)
Browse files Browse the repository at this point in the history
Summary:
This PR has 2 fixes:

* Use Apple perf workflow to validate the iOS test spec in the same way that we are doing for Android spec
* I also attempt to fix this concurrency deadlock when running the upload test spec workflow in trunk https://github.com/pytorch/executorch/actions/runs/10820832880.  This can only be tested once the PR lands though

Pull Request resolved: pytorch#5293

Reviewed By: shoumikhin

Differential Revision: D62539566

Pulled By: huydhn

fbshipit-source-id: fc9eb14b3ea235102d2a6e8a5c9f74e3fb9ad75a
  • Loading branch information
huydhn authored and facebook-github-bot committed Sep 12, 2024
1 parent 3ad2f16 commit 623b7b6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 15 deletions.
11 changes: 1 addition & 10 deletions .github/workflows/apple.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,6 @@ on:
- extension/apple/**
- extension/module/**
workflow_dispatch:
# TODO (huydhn): This is used to validate the test spec. Eventually, we need a proper
# perf benchmark workflow like android-perf. This can be cleaned up once that workflow
# is ready
workflow_call:
inputs:
test_spec:
description: The test spec to drive the test on AWS devices
required: false
type: string

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }}-${{ github.event_name == 'schedule' }}
Expand Down Expand Up @@ -116,7 +107,7 @@ jobs:
# Uploaded to S3 from the previous job
ios-ipa-archive: https://gha-artifacts.s3.amazonaws.com/${{ github.repository }}/${{ github.run_id }}/artifact/ExecuTorchDemo.ipa
ios-xctestrun-zip: https://gha-artifacts.s3.amazonaws.com/${{ github.repository }}/${{ github.run_id }}/artifact/ExecuTorchDemo.xctestrun.zip
test-spec: ${{ inputs.test_spec || 'https://ossci-ios.s3.amazonaws.com/executorch/default-ios-device-farm-appium-test-spec.yml' }}
test-spec: https://ossci-ios.s3.amazonaws.com/executorch/default-ios-device-farm-appium-test-spec.yml

build-frameworks-ios:
name: build-frameworks-ios
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/upload-android-test-specs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ on:
- extension/android/benchmark/android-llm-device-farm-test-spec.yml

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref_name }}-${{ github.ref_type == 'branch' && github.sha }}-${{ github.event_name == 'workflow_dispatch' }}-${{ github.event_name == 'schedule' }}
# NB: This concurency group needs to be different than the one used in android-perf, otherwise
# GH complains about concurrency deadlock
group: android-spec-${{ github.event.pull_request.number || github.ref_name }}-${{ github.ref_type == 'branch' && github.sha }}-${{ github.event_name == 'workflow_dispatch' }}-${{ github.event_name == 'schedule' }}
cancel-in-progress: true

jobs:
Expand Down
12 changes: 8 additions & 4 deletions .github/workflows/upload-apple-test-specs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ on:
- examples/demo-apps/apple_ios/default-ios-device-farm-appium-test-spec.yml

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref_name }}-${{ github.ref_type == 'branch' && github.sha }}-${{ github.event_name == 'workflow_dispatch' }}-${{ github.event_name == 'schedule' }}
# NB: This concurency group needs to be different than the one used in apple-perf, otherwise
# GH complains about concurrency deadlock
group: apple-spec-${{ github.event.pull_request.number || github.ref_name }}-${{ github.ref_type == 'branch' && github.sha }}-${{ github.event_name == 'workflow_dispatch' }}-${{ github.event_name == 'schedule' }}
cancel-in-progress: true

jobs:
Expand All @@ -32,16 +34,18 @@ jobs:
if-no-files-found: error
path: examples/demo-apps/apple_ios/default-ios-device-farm-appium-test-spec.yml

# TODO (huydhn): An example on how to validate the test spec using the iOS demo app, but we need a proper
# perf benchmark workflow like android-perf
validate-apple-test-spec:
needs: upload-apple-test-spec-for-validation
uses: ./.github/workflows/apple.yml
uses: ./.github/workflows/apple-perf.yml
secrets: inherit
permissions:
id-token: write
contents: read
with:
# Just use a small model here with a minimal amount of configuration to test the spec
models: stories110M
devices: apple_iphone_15
delegates: xnnpack
test_spec: https://gha-artifacts.s3.amazonaws.com/${{ github.repository }}/${{ github.run_id }}/artifact/default-ios-device-farm-appium-test-spec.yml

upload-apple-test-spec:
Expand Down

0 comments on commit 623b7b6

Please sign in to comment.