@@ -101,20 +101,30 @@ jobs:
101
101
102
102
- name : Prepare the spec
103
103
shell : bash
104
+ env :
105
+ BENCHMARK_CONFIG : ${{ toJSON(matrix) }}
104
106
working-directory : extension/benchmark/apple/Benchmark
105
107
run : |
106
108
set -eux
107
109
108
- echo "DEBUG: ${{ matrix.model }}"
109
110
# The model will be exported in the next step to this S3 path
110
111
MODEL_PATH="https://gha-artifacts.s3.amazonaws.com/${{ github.repository }}/${{ github.run_id }}/artifacts/${{ matrix.model }}_${{ matrix.config }}/model.zip"
111
112
# We could write a script to properly use jinja here, but there is only one variable,
112
113
# so let's just sed it
113
114
sed -i -e 's,{{ model_path }},'"${MODEL_PATH}"',g' default-ios-device-farm-appium-test-spec.yml.j2
115
+
116
+ BENCHMARK_CONFIG_ID="${{ matrix.model }}_${{ matrix.config }}"
117
+ # The config for this benchmark runs, we save it in the test spec so that it can be fetched
118
+ # later by the upload script
119
+ sed -i -e 's,{{ benchmark_config_id }},'"${BENCHMARK_CONFIG_ID}"',g' default-ios-device-farm-appium-test-spec.yml.j2
120
+
114
121
cp default-ios-device-farm-appium-test-spec.yml.j2 default-ios-device-farm-appium-test-spec.yml
115
122
# Just print the test spec for debugging
116
123
cat default-ios-device-farm-appium-test-spec.yml
117
124
125
+ # Save the benchmark configs so that we can use it later in the dashboard
126
+ echo "${BENCHMARK_CONFIG}" > "${BENCHMARK_CONFIG_ID}.json"
127
+
118
128
- name : Upload the spec
119
129
uses : seemethere/upload-artifact-s3@v5
120
130
with :
@@ -125,6 +135,16 @@ jobs:
125
135
if-no-files-found : error
126
136
path : extension/benchmark/apple/Benchmark/default-ios-device-farm-appium-test-spec.yml
127
137
138
+ - name : Update the benchmark configs
139
+ uses : seemethere/upload-artifact-s3@v5
140
+ with :
141
+ s3-bucket : gha-artifacts
142
+ s3-prefix : |
143
+ ${{ github.repository }}/${{ github.run_id }}/artifacts/benchmark-configs/
144
+ retention-days : 1
145
+ if-no-files-found : error
146
+ path : extension/benchmark/apple/Benchmark/${{ matrix.model }}_${{ matrix.config }}.json
147
+
128
148
export-models :
129
149
name : export-models
130
150
uses : pytorch/test-infra/.github/workflows/macos_job.yml@main
@@ -481,6 +501,18 @@ jobs:
481
501
482
502
ls -lah artifacts
483
503
504
+ - name : Download the list of benchmark configs from S3
505
+ env :
506
+ BENCHMARK_CONFIGS_DIR : s3://gha-artifacts/${{ github.repository }}/${{ github.run_id }}/artifacts/benchmark-configs/
507
+ shell : bash
508
+ run : |
509
+ set -eux
510
+ mkdir -p benchmark-configs
511
+ pushd benchmark-configs
512
+ ${CONDA_RUN} aws s3 sync "${BENCHMARK_CONFIGS_DIR}" .
513
+ popd
514
+ ls -lah benchmark-configs
515
+
484
516
- name : Extract the benchmark results JSON
485
517
shell : bash
486
518
run : |
@@ -498,7 +530,8 @@ jobs:
498
530
--head-branch ${{ github.head_ref || github.ref_name }} \
499
531
--workflow-name "${{ github.workflow }}" \
500
532
--workflow-run-id ${{ github.run_id }} \
501
- --workflow-run-attempt ${{ github.run_attempt }}
533
+ --workflow-run-attempt ${{ github.run_attempt }} \
534
+ --benchmark-configs benchmark-configs
502
535
done
503
536
504
537
for SCHEMA in v2 v3; do
0 commit comments