-
Notifications
You must be signed in to change notification settings - Fork 607
Upload Android test spec to ossci-android #4676
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
cb437da
13b144f
a0384fa
64bf7e7
3b4d24d
b7ef68f
2d4802a
998cc22
0c7be0e
d9f5f9e
67cccde
b549895
5dfedea
acc6482
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,13 +30,47 @@ on: | |
description: The list of configs used the benchmark | ||
required: false | ||
type: string | ||
test_spec: | ||
description: The test spec to drive the test on AWS devices | ||
required: false | ||
type: string | ||
default: https://ossci-android.s3.amazonaws.com/executorch/android-llm-device-farm-test-spec.yml | ||
workflow_call: | ||
inputs: | ||
models: | ||
description: Models to be benchmarked | ||
required: false | ||
type: string | ||
default: stories110M | ||
devices: | ||
description: Target devices to run benchmark | ||
required: false | ||
type: string | ||
default: samsung_galaxy_s2x | ||
delegates: | ||
description: Backend delegates | ||
required: false | ||
type: string | ||
default: xnnpack | ||
threadpool: | ||
description: Run with threadpool? | ||
required: false | ||
type: boolean | ||
default: false | ||
benchmark_configs: | ||
description: The list of configs used the benchmark | ||
required: false | ||
type: string | ||
test_spec: | ||
description: The test spec to drive the test on AWS devices | ||
required: false | ||
type: string | ||
default: https://ossci-android.s3.amazonaws.com/executorch/android-llm-device-farm-test-spec.yml | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If the prefix is common for all, let's only put the file name There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, this is not a common prefix here though. For PR testing, it needs to stay as an artifact available only to the PR, i.e. https://gha-artifacts.s3.amazonaws.com/pytorch/executorch/10361242176/artifact/android-llm-device-farm-test-spec.yml. On the other hand, once validation is done and the spec file is committed, it will be uploaded to the source of truth at https://ossci-android.s3.amazonaws.com/executorch/android-llm-device-farm-test-spec.yml There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @huydhn, fyi, we start seeing the failures due to empty test spec https://hud.pytorch.org/hud/pytorch/executorch/main/1?per_page=50&name_filter=android-perf%20%2F%20benchmark There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let me take a look There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
||
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' }} | ||
cancel-in-progress: true | ||
|
||
permissions: read-all | ||
huydhn marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
jobs: | ||
set-parameters: | ||
runs-on: linux.2xlarge | ||
|
@@ -234,6 +268,6 @@ jobs: | |
# TODO: Hard code llm_demo_bpe for now in this job. | ||
android-app-archive: https://gha-artifacts.s3.amazonaws.com/${{ github.repository }}/${{ github.run_id }}/artifact/llm_demo_bpe/app-debug.apk | ||
android-test-archive: https://gha-artifacts.s3.amazonaws.com/${{ github.repository }}/${{ github.run_id }}/artifact/llm_demo_bpe/app-debug-androidTest.apk | ||
test-spec: https://ossci-assets.s3.amazonaws.com/android-llm-device-farm-test-spec.yml | ||
test-spec: ${{ inputs.test_spec }} | ||
# Uploaded to S3 from the previous job | ||
extra-data: https://gha-artifacts.s3.amazonaws.com/${{ github.repository }}/${{ github.run_id }}/artifact/${{ matrix.model }}_${{ matrix.delegate }}/model.zip |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
name: Upload AWS Device Farm test specs | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- .github/workflows/upload-test-specs.yml | ||
- examples/demo-apps/android/LlamaDemo/android-llm-device-farm-test-spec.yml | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- .github/workflows/upload-test-specs.yml | ||
- examples/demo-apps/android/LlamaDemo/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' }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
upload-android-test-spec-for-validation: | ||
runs-on: linux.2xlarge | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Upload the spec as a GitHub artifact for validation | ||
uses: seemethere/upload-artifact-s3@v5 | ||
with: | ||
s3-bucket: gha-artifacts | ||
s3-prefix: | | ||
${{ github.repository }}/${{ github.run_id }}/artifact | ||
retention-days: 1 | ||
if-no-files-found: error | ||
path: examples/demo-apps/android/LlamaDemo/android-llm-device-farm-test-spec.yml | ||
|
||
validate-android-test-spec: | ||
needs: upload-android-test-spec-for-validation | ||
uses: ./.github/workflows/android-perf.yml | ||
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 | ||
huydhn marked this conversation as resolved.
Show resolved
Hide resolved
|
||
devices: samsung_galaxy_s2x | ||
delegates: xnnpack | ||
test_spec: https://gha-artifacts.s3.amazonaws.com/${{ github.repository }}/${{ github.run_id }}/artifact/android-llm-device-farm-test-spec.yml | ||
|
||
upload-android-test-spec: | ||
needs: validate-android-test-spec | ||
runs-on: ubuntu-22.04 | ||
timeout-minutes: 15 | ||
permissions: | ||
id-token: write | ||
contents: read | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.11' | ||
cache: pip | ||
|
||
- name: configure aws credentials | ||
uses: aws-actions/configure-aws-credentials@v1.7.0 | ||
with: | ||
role-to-assume: arn:aws:iam::308535385114:role/gha_executorch_upload-frameworks-android | ||
aws-region: us-east-1 | ||
|
||
- name: Only push to S3 when running the workflow manually from main branch | ||
if: ${{ github.ref == 'refs/heads/main' }} | ||
shell: bash | ||
run: | | ||
set -eux | ||
echo "UPLOAD_ON_MAIN=1" >> "${GITHUB_ENV}" | ||
|
||
- name: Upload the spec to S3 ossci-android bucket | ||
shell: bash | ||
working-directory: examples/demo-apps/android/LlamaDemo/ | ||
env: | ||
SPEC_FILE: android-llm-device-farm-test-spec.yml | ||
run: | | ||
set -eux | ||
|
||
pip install awscli==1.32.18 | ||
|
||
AWS_CMD="aws s3 cp --dryrun" | ||
if [[ "${UPLOAD_ON_MAIN:-0}" == "1" ]]; then | ||
AWS_CMD="aws s3 cp" | ||
fi | ||
|
||
shasum -a 256 "${SPEC_FILE}" | ||
${AWS_CMD} "${SPEC_FILE}" s3://ossci-android/executorch/ --acl public-read |
Uh oh!
There was an error while loading. Please reload this page.