diff --git a/.github/workflows/android-perf.yml b/.github/workflows/android-perf.yml index a75816ee896..06ee5a46fc1 100644 --- a/.github/workflows/android-perf.yml +++ b/.github/workflows/android-perf.yml @@ -140,6 +140,7 @@ jobs: submodules: 'true' timeout: 60 upload-artifact: android-models + upload-artifact-to-s3: true script: | # The generic Linux job chooses to use base env, not the one setup by the image echo "::group::Setting up dev environment" @@ -175,35 +176,6 @@ jobs: fi echo "::endgroup::" - # Upload models to S3. The artifacts are needed not only by the device farm but also TorchChat - upload-models: - needs: export-models - runs-on: linux.2xlarge - if: always() # Continue this job regardless of previous job outcome - steps: - - name: Download the models from GitHub - uses: actions/download-artifact@v3 - with: - # The name here needs to match the name of the upload-artifact parameter - name: android-models - path: ${{ runner.temp }}/artifacts/ - - - name: Verify the models - shell: bash - working-directory: ${{ runner.temp }}/artifacts/ - run: | - ls -lah ./ - - - name: Upload the models to S3 - 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: ignore - path: ${{ runner.temp }}/artifacts/ - build-llm-demo: name: build-llm-demo uses: pytorch/test-infra/.github/workflows/linux_job.yml@main @@ -215,6 +187,7 @@ jobs: ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }} timeout: 90 upload-artifact: android-apps + upload-artifact-to-s3: true script: | set -eux @@ -230,34 +203,6 @@ jobs: export ANDROID_ABIS="arm64-v8a" PYTHON_EXECUTABLE=python EXECUTORCH_BUILD_QNN=ON QNN_SDK_ROOT=/tmp/qnn/2.25.0.240728 bash build/build_android_llm_demo.sh ${ARTIFACTS_DIR_NAME} - # Upload artifacts to S3. The artifacts are needed not only by the device farm but also TorchChat - upload-android-apps: - needs: build-llm-demo - runs-on: linux.2xlarge - steps: - - name: Download the apps from GitHub - uses: actions/download-artifact@v3 - with: - # The name here needs to match the name of the upload-artifact parameter - name: android-apps - path: ${{ runner.temp }}/artifacts/ - - - name: Verify the apps - shell: bash - working-directory: ${{ runner.temp }}/artifacts/ - run: | - ls -lah ./ - - - name: Upload the apps to S3 - uses: seemethere/upload-artifact-s3@v5 - with: - s3-bucket: gha-artifacts - s3-prefix: | - ${{ github.repository }}/${{ github.run_id }}/artifact - retention-days: 14 - if-no-files-found: ignore - path: ${{ runner.temp }}/artifacts/ - # Let's see how expensive this job is, we might want to tone it down by running it periodically benchmark-on-device: permissions: @@ -266,8 +211,8 @@ jobs: uses: pytorch/test-infra/.github/workflows/mobile_job.yml@main needs: - set-parameters - - upload-models - - upload-android-apps + - build-llm-demo + - export-models strategy: matrix: model: ${{ fromJson(needs.set-parameters.outputs.models) }} @@ -285,9 +230,9 @@ jobs: # Unlike models there are limited numbers of build flavor for apps, and the model controls whether it should build with bpe/tiktoken tokenizer. # It's okay to build all possible apps with all possible flavors in job "build-llm-demo". However, in this job, once a model is given, there is only # one app+flavor that could load and run the model. - android-app-archive: https://gha-artifacts.s3.amazonaws.com/${{ github.repository }}/${{ github.run_id }}/artifact/minibench/app-debug.apk - android-test-archive: https://gha-artifacts.s3.amazonaws.com/${{ github.repository }}/${{ github.run_id }}/artifact/minibench/app-debug-androidTest.apk + android-app-archive: https://gha-artifacts.s3.amazonaws.com/${{ github.repository }}/${{ github.run_id }}/artifacts/minibench/app-debug.apk + android-test-archive: https://gha-artifacts.s3.amazonaws.com/${{ github.repository }}/${{ github.run_id }}/artifacts/minibench/app-debug-androidTest.apk # NB: Need to set the default spec here so that it works for periodic too test-spec: ${{ inputs.test_spec || 'https://ossci-android.s3.amazonaws.com/executorch/android-llm-device-farm-test-spec.yml' }} # 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 + extra-data: https://gha-artifacts.s3.amazonaws.com/${{ github.repository }}/${{ github.run_id }}/artifacts/${{ matrix.model }}_${{ matrix.delegate }}/model.zip diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index abafbc7fd36..54e9dbb7619 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -33,6 +33,7 @@ jobs: ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }} timeout: 90 upload-artifact: android-apps + upload-artifact-to-s3: true script: | set -eux @@ -45,38 +46,6 @@ jobs: # Build LLM Demo for Android bash build/build_android_llm_demo.sh ${ARTIFACTS_DIR_NAME} - # Upload artifacts to S3. The artifacts are needed not only by the device farm but also TorchChat - upload-artifacts: - needs: build-llm-demo - runs-on: linux.2xlarge - steps: - - name: Download the artifacts from GitHub - uses: actions/download-artifact@v3 - with: - # The name here needs to match the name of the upload-artifact parameter - name: android-apps - path: ${{ runner.temp }}/artifacts/ - - - name: Verify the artifacts - shell: bash - working-directory: ${{ runner.temp }}/artifacts/ - run: | - ls -lah ./ - - - name: Upload the artifacts to S3 - uses: seemethere/upload-artifact-s3@v5 - with: - s3-bucket: gha-artifacts - s3-prefix: | - ${{ github.repository }}/${{ github.run_id }}/artifact - # NOTE: Consume stale artifacts won't make sense for benchmarking as the goal is always to - # benchmark models as fresh as possible. I'm okay to keep the 14 retention-days for now - # for TorchChat until we have a periodic job can publish it more often. Ideally I want to - # reduce it to <= 2 day, meaning the benchmark job will run daily. - retention-days: 14 - if-no-files-found: ignore - path: ${{ runner.temp }}/artifacts/ - # Running Android emulator directly on the runner and not using Docker run-emulator: needs: build-llm-demo diff --git a/.github/workflows/apple-perf.yml b/.github/workflows/apple-perf.yml index 0fc095e4da3..6af807483bd 100644 --- a/.github/workflows/apple-perf.yml +++ b/.github/workflows/apple-perf.yml @@ -124,11 +124,13 @@ jobs: delegate: ${{ fromJson(needs.set-parameters.outputs.delegates) }} fail-fast: false with: - runner: macos-latest-xlarge + # NB: Need to use our AWS MacOS runner to upload large models to S3 + runner: macos-m1-stable python-version: '3.11' submodules: 'true' timeout: 60 upload-artifact: ios-models + upload-artifact-to-s3: true script: | set -eux @@ -176,34 +178,6 @@ jobs: fi echo "::endgroup::" - upload-models: - needs: export-models - runs-on: linux.2xlarge - if: always() # Continue this job regardless of previous job outcome - steps: - - name: Download the models from GitHub - uses: actions/download-artifact@v3 - with: - # The name here needs to match the name of the upload-artifact parameter - name: ios-models - path: ${{ runner.temp }}/artifacts/ - - - name: Verify the models - shell: bash - working-directory: ${{ runner.temp }}/artifacts/ - run: | - ls -lah ./ - - - name: Upload the models to S3 - 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: ignore - path: ${{ runner.temp }}/artifacts/ - build-benchmark-app: name: build-benchmark-app uses: pytorch/test-infra/.github/workflows/macos_job.yml@main @@ -297,7 +271,7 @@ jobs: with: s3-bucket: gha-artifacts s3-prefix: | - ${{ github.repository }}/${{ github.run_id }}/artifact + ${{ github.repository }}/${{ github.run_id }}/artifacts retention-days: 14 if-no-files-found: ignore path: ${{ runner.temp }}/artifacts/ @@ -306,7 +280,7 @@ jobs: needs: - set-parameters - upload-benchmark-app - - upload-models + - export-models permissions: id-token: write contents: read @@ -326,7 +300,7 @@ jobs: project-arn: arn:aws:devicefarm:us-west-2:308535385114:project:02a2cf0f-6d9b-45ee-ba1a-a086587469e6 device-pool-arn: ${{ matrix.device }} # Uploaded to S3 from the previous job - ios-ipa-archive: https://gha-artifacts.s3.amazonaws.com/${{ github.repository }}/${{ github.run_id }}/artifact/Benchmark.ipa - ios-xctestrun-zip: https://gha-artifacts.s3.amazonaws.com/${{ github.repository }}/${{ github.run_id }}/artifact/Benchmark.xctestrun.zip + ios-ipa-archive: https://gha-artifacts.s3.amazonaws.com/${{ github.repository }}/${{ github.run_id }}/artifacts/Benchmark.ipa + ios-xctestrun-zip: https://gha-artifacts.s3.amazonaws.com/${{ github.repository }}/${{ github.run_id }}/artifacts/Benchmark.xctestrun.zip test-spec: ${{ inputs.test_spec || 'https://ossci-ios.s3.amazonaws.com/executorch/default-ios-device-farm-appium-test-spec.yml' }} - extra-data: https://gha-artifacts.s3.amazonaws.com/${{ github.repository }}/${{ github.run_id }}/artifact/${{ matrix.model }}_${{ matrix.delegate }}/model.zip + extra-data: https://gha-artifacts.s3.amazonaws.com/${{ github.repository }}/${{ github.run_id }}/artifacts/${{ matrix.model }}_${{ matrix.delegate }}/model.zip diff --git a/.github/workflows/upload-android-test-specs.yml b/.github/workflows/upload-android-test-specs.yml index a4f8fb371b2..e9b1054080c 100644 --- a/.github/workflows/upload-android-test-specs.yml +++ b/.github/workflows/upload-android-test-specs.yml @@ -29,7 +29,7 @@ jobs: with: s3-bucket: gha-artifacts s3-prefix: | - ${{ github.repository }}/${{ github.run_id }}/artifact + ${{ github.repository }}/${{ github.run_id }}/artifacts retention-days: 1 if-no-files-found: error path: extension/android/benchmark/android-llm-device-farm-test-spec.yml @@ -45,7 +45,7 @@ jobs: models: stories110M devices: samsung_galaxy_s22 delegates: xnnpack - test_spec: https://gha-artifacts.s3.amazonaws.com/${{ github.repository }}/${{ github.run_id }}/artifact/android-llm-device-farm-test-spec.yml + test_spec: https://gha-artifacts.s3.amazonaws.com/${{ github.repository }}/${{ github.run_id }}/artifacts/android-llm-device-farm-test-spec.yml upload-android-test-spec: needs: validate-android-test-spec diff --git a/.github/workflows/upload-apple-test-specs.yml b/.github/workflows/upload-apple-test-specs.yml index 594fd5bf17b..06d20ef2beb 100644 --- a/.github/workflows/upload-apple-test-specs.yml +++ b/.github/workflows/upload-apple-test-specs.yml @@ -29,7 +29,7 @@ jobs: with: s3-bucket: gha-artifacts s3-prefix: | - ${{ github.repository }}/${{ github.run_id }}/artifact + ${{ github.repository }}/${{ github.run_id }}/artifacts retention-days: 1 if-no-files-found: error path: examples/demo-apps/apple_ios/default-ios-device-farm-appium-test-spec.yml @@ -46,7 +46,7 @@ jobs: 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 + test_spec: https://gha-artifacts.s3.amazonaws.com/${{ github.repository }}/${{ github.run_id }}/artifacts/default-ios-device-farm-appium-test-spec.yml upload-apple-test-spec: needs: validate-apple-test-spec