Skip to content

Commit b424431

Browse files
authored
[CI][benchmarks][Liger-Kernel] Fixed issues with dependencies and runtime (#3660)
Closes #3650 Currently need to solve: - [x] When one of benchmarks fail, CI stops, so no artefacts available
1 parent d61d915 commit b424431

File tree

3 files changed

+32
-16
lines changed

3 files changed

+32
-16
lines changed

.github/workflows/third-party-benchmarks.yml

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
name: Third party benchmarks
2-
run-name: ${{ inputs.run_name }}
32

43
on:
54
workflow_dispatch:
@@ -12,10 +11,6 @@ on:
1211
description: Tag for benchmark results
1312
type: string
1413
default: "test"
15-
run_name:
16-
description: Run name
17-
type: string
18-
default: "Triton benchmarks"
1914
use_pyenv_python:
2015
description: Use Python built with pyenv
2116
type: boolean
@@ -24,12 +19,6 @@ on:
2419
# About midnight PST (UTC-8)
2520
- cron: "5 10 * * *"
2621

27-
28-
# Cancels in-progress PR runs when the PR is updated. Manual runs are never cancelled.
29-
concurrency:
30-
group: ${{ github.workflow }}-${{ github.event_name == 'workflow_dispatch' && github.run_id || github.event.pull_request.number || github.ref }}
31-
cancel-in-progress: true
32-
3322
permissions: read-all
3423

3524
env:
@@ -92,7 +81,7 @@ jobs:
9281
- name: Install benchmark dependencies
9382
id: install
9483
run: |
95-
pip install transformers pandas
84+
pip install transformers pandas pytest
9685
9786
- name: Create reports dir
9887
run: |
@@ -109,10 +98,15 @@ jobs:
10998
git clone https://github.com/linkedin/Liger-Kernel
11099
pip install -e Liger-Kernel
111100
112-
bash ./run_benchmarks.sh
101+
# To remember return code, but still copy results
102+
RET_CODE=0
103+
bash ./run_benchmarks.sh || RET_CODE=$?
113104
114105
cp Liger-Kernel/benchmark/data/all_benchmark_data.csv $REPORTS/liger-raw.csv
115-
python transform.py $REPORTS/liger-raw.csv $REPORTS/liger-report.csv
106+
python transform.py $REPORTS/liger-raw.csv $REPORTS/liger-report.csv --tag $TAG
107+
108+
# Return the captured return code at the end
109+
exit "$RET_CODE"
116110
117111
- name: Upload benchmark reports
118112
if: ${{ steps.install.outcome == 'success' && !cancelled() }}

benchmarks/third_party/liger_kernels/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ https://github.com/linkedin/Liger-Kernel/tree/main
66

77
We run benchmarks for Liger Kernels in CI, the process is
88
1. Run individual benchmarks.
9-
2. Convert results from Liger-Lernels format into our format.
9+
2. Convert results from Liger-Kernels format into our format.
1010
3. Upload file with results as an artefact for further processing.

benchmarks/third_party/liger_kernels/run_benchmarks.sh

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,28 @@
22

33
set -euo pipefail
44

5+
6+
# Array to keep track of failed benchmarks
7+
FAILED_BENCHMARKS=()
8+
59
for file in Liger-Kernel/benchmark/scripts/benchmark_*; do
6-
python "$file"
10+
if python "$file"; then
11+
echo "Benchmark ran successfully: $file"
12+
else
13+
echo "Error: Benchmark failed for $file."
14+
FAILED_BENCHMARKS+=("$file")
15+
fi
716
done
17+
18+
# Print failed benchmarks
19+
if [ ${#FAILED_BENCHMARKS[@]} -ne 0 ]; then
20+
echo "The following benchmarks failed:"
21+
for failed_bench in "${FAILED_BENCHMARKS[@]}"; do
22+
echo "$failed_bench"
23+
done
24+
exit 1
25+
else
26+
echo "All benchmarks completed successfully."
27+
fi
28+
29+
exit 0

0 commit comments

Comments
 (0)