|
30 | 30 | description: The list of configs used the benchmark |
31 | 31 | required: false |
32 | 32 | type: string |
33 | | - test_spec: |
34 | | - description: The test spec to drive the test on AWS devices |
35 | | - required: false |
36 | | - type: string |
37 | 33 | workflow_call: |
38 | 34 | inputs: |
39 | 35 | models: |
|
60 | 56 | description: The list of configs used the benchmark |
61 | 57 | required: false |
62 | 58 | type: string |
63 | | - test_spec: |
64 | | - description: The test spec to drive the test on AWS devices |
65 | | - required: false |
66 | | - type: string |
67 | 59 |
|
68 | 60 | concurrency: |
69 | 61 | 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' }} |
@@ -125,6 +117,32 @@ jobs: |
125 | 117 | echo "devices=$(echo "$MAPPED_ARNS_JSON" | jq -c .)" >> $GITHUB_OUTPUT |
126 | 118 | echo "delegates=$(echo $DELEGATES | jq -Rc 'split(",")')" >> $GITHUB_OUTPUT |
127 | 119 |
|
| 120 | + - name: Prepare the spec |
| 121 | + shell: bash |
| 122 | + working-directory: extension/benchmark/android/benchmark |
| 123 | + run: | |
| 124 | + set -eux |
| 125 | +
|
| 126 | + # The model will be exported in the next step to this S3 path |
| 127 | + MODEL_PATH="s3://gha-artifacts/${{ github.repository }}/${{ github.run_id }}/artifacts/${{ matrix.model }}_${{ matrix.delegate }}/model.zip" |
| 128 | + # We could write a script to properly use jinja here, but there is only one variable, |
| 129 | + # so let's just sed it |
| 130 | + sed -i -e 's,{{ model_path }},'"${MODEL_PATH}"',g' android-llm-device-farm-test-spec.yml.j2 |
| 131 | + cp android-llm-device-farm-test-spec.yml.j2 android-llm-device-farm-test-spec.yml |
| 132 | +
|
| 133 | + # Just print the test spec for debugging |
| 134 | + cat android-llm-device-farm-test-spec.yml |
| 135 | +
|
| 136 | + - name: Upload the spec |
| 137 | + uses: seemethere/upload-artifact-s3@v5 |
| 138 | + with: |
| 139 | + s3-bucket: gha-artifacts |
| 140 | + s3-prefix: | |
| 141 | + ${{ github.repository }}/${{ github.run_id }}/artifacts/${{ matrix.model }}_${{ matrix.delegate }} |
| 142 | + retention-days: 1 |
| 143 | + if-no-files-found: error |
| 144 | + path: extension/benchmark/android/benchmark/android-llm-device-farm-test-spec.yml |
| 145 | + |
128 | 146 | export-models: |
129 | 147 | name: export-models |
130 | 148 | uses: pytorch/test-infra/.github/workflows/linux_job.yml@main |
@@ -231,10 +249,7 @@ jobs: |
231 | 249 | device-pool-arn: ${{ matrix.device }} |
232 | 250 | android-app-archive: https://gha-artifacts.s3.amazonaws.com/${{ github.repository }}/${{ github.run_id }}/artifacts/minibench/app-debug.apk |
233 | 251 | android-test-archive: https://gha-artifacts.s3.amazonaws.com/${{ github.repository }}/${{ github.run_id }}/artifacts/minibench/app-debug-androidTest.apk |
234 | | - # NB: Need to set the default spec here so that it works for periodic too |
235 | | - test-spec: ${{ inputs.test_spec || 'https://ossci-android.s3.amazonaws.com/executorch/android-llm-device-farm-test-spec.yml' }} |
236 | | - # Uploaded to S3 from the previous job |
237 | | - extra-data: https://gha-artifacts.s3.amazonaws.com/${{ github.repository }}/${{ github.run_id }}/artifacts/${{ matrix.model }}_${{ matrix.delegate }}/model.zip |
| 252 | + test-spec: ${{ https://gha-artifacts.s3.amazonaws.com/${{ github.repository }}/${{ github.run_id }}/artifacts/${{ matrix.model }}_${{ matrix.delegate }}/android-llm-device-farm-test-spec.yml }} |
238 | 253 |
|
239 | 254 | upload-benchmark-results: |
240 | 255 | needs: |
|
0 commit comments