Skip to content

Commit

Permalink
Handle illegal character in benchmark configs filename (#7461)
Browse files Browse the repository at this point in the history
* Handle illegal character in benchmark configs filename

* Only change the filename

* Save benchmark config filename as GH output

* Typo

* Also update the spec
  • Loading branch information
huydhn authored Dec 31, 2024
1 parent d3e58b0 commit 9a884a8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/android-perf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ jobs:
- uses: actions/checkout@v3

- name: Prepare the spec
id: prepare
shell: bash
env:
BENCHMARK_CONFIG: ${{ toJSON(matrix) }}
Expand All @@ -111,7 +112,7 @@ jobs:
# so let's just sed it
sed -i -e 's,{{ model_path }},'"${MODEL_PATH}"',g' android-llm-device-farm-test-spec.yml.j2
BENCHMARK_CONFIG_ID="${{ matrix.model }}_${{ matrix.config }}"
BENCHMARK_CONFIG_ID=$(echo "${{ matrix.model }}_${{ matrix.config }}" | sed -e 's/[^A-Za-z0-9._-]/_/g')
# The config for this benchmark runs, we save it in the test spec so that it can be fetched
# later by the upload script
sed -i -e 's,{{ benchmark_config_id }},'"${BENCHMARK_CONFIG_ID}"',g' android-llm-device-farm-test-spec.yml.j2
Expand All @@ -122,6 +123,7 @@ jobs:
# Save the benchmark configs so that we can use it later in the dashboard
echo "${BENCHMARK_CONFIG}" > "${BENCHMARK_CONFIG_ID}.json"
echo "benchmark-config-id=${BENCHMARK_CONFIG_ID}" >> $GITHUB_OUTPUT
- name: Upload the spec
uses: seemethere/upload-artifact-s3@v5
Expand All @@ -141,7 +143,7 @@ jobs:
${{ github.repository }}/${{ github.run_id }}/artifacts/benchmark-configs/
retention-days: 1
if-no-files-found: error
path: extension/benchmark/android/benchmark/${{ matrix.model }}_${{ matrix.config }}.json
path: extension/benchmark/android/benchmark/${{ steps.prepare.outputs.benchmark-config-id }}.json

export-models:
name: export-models
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/apple-perf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ jobs:
- uses: actions/checkout@v3

- name: Prepare the spec
id: prepare
shell: bash
env:
BENCHMARK_CONFIG: ${{ toJSON(matrix) }}
Expand All @@ -113,7 +114,7 @@ jobs:
# so let's just sed it
sed -i -e 's,{{ model_path }},'"${MODEL_PATH}"',g' default-ios-device-farm-appium-test-spec.yml.j2
BENCHMARK_CONFIG_ID="${{ matrix.model }}_${{ matrix.config }}"
BENCHMARK_CONFIG_ID=$(echo "${{ matrix.model }}_${{ matrix.config }}" | sed -e 's/[^A-Za-z0-9._-]/_/g')
# The config for this benchmark runs, we save it in the test spec so that it can be fetched
# later by the upload script
sed -i -e 's,{{ benchmark_config_id }},'"${BENCHMARK_CONFIG_ID}"',g' default-ios-device-farm-appium-test-spec.yml.j2
Expand All @@ -124,6 +125,7 @@ jobs:
# Save the benchmark configs so that we can use it later in the dashboard
echo "${BENCHMARK_CONFIG}" > "${BENCHMARK_CONFIG_ID}.json"
echo "benchmark-config-id=${BENCHMARK_CONFIG_ID}" >> $GITHUB_OUTPUT
- name: Upload the spec
uses: seemethere/upload-artifact-s3@v5
Expand All @@ -143,7 +145,7 @@ jobs:
${{ github.repository }}/${{ github.run_id }}/artifacts/benchmark-configs/
retention-days: 1
if-no-files-found: error
path: extension/benchmark/apple/Benchmark/${{ matrix.model }}_${{ matrix.config }}.json
path: extension/benchmark/apple/Benchmark/${{ steps.prepare.outputs.benchmark-config-id }}.json

export-models:
name: export-models
Expand Down

0 comments on commit 9a884a8

Please sign in to comment.