Skip to content

Commit 3a723b6

Browse files
enhance the baseline download workflow
1 parent d840e72 commit 3a723b6

File tree

1 file changed

+16
-9
lines changed

1 file changed

+16
-9
lines changed

.github/workflows/_linux_op_benchmark.yml

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -152,18 +152,25 @@ jobs:
152152
run: |
153153
REFERENCE_RUN_ID="$(gh --repo ${GITHUB_REPOSITORY} issue view ${reference_issue} \
154154
--json body -q .body |grep "Inductor-XPU-OP-Benchmark-Data" |sed 's/.*: *//')"
155-
gh --repo ${GITHUB_REPOSITORY} run download ${REFERENCE_RUN_ID} -p "Inductor-XPU-OP-Benchmark-Data-*"
156155
rm -rf ${{ github.workspace }}/reference
157156
mkdir -p ${{ github.workspace }}/reference
158-
mv -f Inductor-XPU-OP-Benchmark-Data-*-Updated/* ${{ github.workspace }}/reference
159-
160157
mkdir -p ${{ github.workspace }}/baseline
161-
if [[ -f "${{ github.workspace }}/reference/new_baseline/baseline_forward_op_summary.csv" ]]; then
162-
cp ${{ github.workspace }}/reference/new_baseline/baseline_forward_op_summary.csv ${{ github.workspace }}/baseline
163-
cp ${{ github.workspace }}/reference/new_baseline/baseline_backward_op_summary.csv ${{ github.workspace }}/baseline
158+
if [[ -n "${REFERENCE_RUN_ID}" ]]; then
159+
echo "Using reference run ID: ${REFERENCE_RUN_ID}"
160+
gh --repo ${GITHUB_REPOSITORY} run download ${REFERENCE_RUN_ID} -p "Inductor-XPU-OP-Benchmark-Data-*"
161+
mv -f Inductor-XPU-OP-Benchmark-Data-*-Updated/* ${{ github.workspace }}/reference
162+
163+
if [[ -f "${{ github.workspace }}/reference/new_baseline/baseline_forward_op_summary.csv" ]]; then
164+
cp ${{ github.workspace }}/reference/new_baseline/baseline_forward_op_summary.csv ${{ github.workspace }}/baseline
165+
cp ${{ github.workspace }}/reference/new_baseline/baseline_backward_op_summary.csv ${{ github.workspace }}/baseline
166+
else
167+
cp ${{ github.workspace }}/reference/forward_op_summary.csv ${{ github.workspace }}/baseline/baseline_forward_op_summary.csv
168+
cp ${{ github.workspace }}/reference/backward_op_summary.csv ${{ github.workspace }}/baseline/baseline_backward_op_summary.csv
169+
fi
164170
else
165-
cp ${{ github.workspace }}/reference/forward_op_summary.csv ${{ github.workspace }}/baseline/baseline_forward_op_summary.csv
166-
cp ${{ github.workspace }}/reference/backward_op_summary.csv ${{ github.workspace }}/baseline/baseline_backward_op_summary.csv
171+
echo "No reference run ID found, using local op_benchmark as baseline"
172+
cp ${{ github.workspace }}/op_benchmark/forward_op_summary.csv ${{ github.workspace }}/baseline/baseline_forward_op_summary.csv
173+
cp ${{ github.workspace }}/op_benchmark/backward_op_summary.csv ${{ github.workspace }}/baseline/baseline_backward_op_summary.csv
167174
fi
168175
- name: Check the OP Regression
169176
run: |
@@ -175,7 +182,7 @@ jobs:
175182
- name: Update OP Baseline
176183
run: |
177184
pip install tabulate pandas
178-
mkdir ${{ github.workspace }}/new_baseline
185+
mkdir -p ${{ github.workspace }}/new_baseline
179186
cp ${{ github.workspace }}/baseline/baseline*.csv ${{ github.workspace }}/new_baseline
180187
# Update forward op
181188
python ${{ github.workspace }}/.github/scripts/op_calculate_best_perf.py --xpu ${{ github.workspace }}/op_benchmark/forward_op_summary.csv --baseline ${{ github.workspace }}/new_baseline/baseline_forward_op_summary.csv -r

0 commit comments

Comments
 (0)