@@ -121,27 +121,38 @@ jobs:
121
121
bash ${{ github.workspace }}/.github/scripts/microbench_summary.sh ${{ github.workspace }}/op_benchmark ${{ github.workspace }}/op_benchmark/forward_op_summary.csv
122
122
# Summary backward op time
123
123
bash ${{ github.workspace }}/.github/scripts/microbench_summary.sh ${{ github.workspace }}/op_benchmark ${{ github.workspace }}/op_benchmark/backward_op_summary.csv True
124
- - name : Upload Inductor XPU OP benchmark Log
125
- if : always()
126
- uses : actions/upload-artifact@v4
127
- with :
128
- name : Inductor-XPU-OP-Benchmark-Data-${{ github.event.pull_request.number || github.sha }}
129
- path : ${{ github.workspace }}/op_benchmark
130
124
- name : Download OP Baseline
131
125
continue-on-error : true
132
126
run : |
133
- # Download forward baseline
134
- curl -L "https://api.github.com/repos/${GITHUB_REPOSITORY:-"intel/torch-xpu-ops"}/new_baseline/baseline_forward_op_summary.csv?ref=gh-pages" \
135
- -H "Accept: application/vnd.github.raw" \
136
- -o baseline_forward_op_summary.csv
137
-
138
- # Download backward baseline
139
- curl -L "https://api.github.com/repos/${GITHUB_REPOSITORY:-"intel/torch-xpu-ops"}/new_baseline/baseline_backward_op_summary.csv?ref=gh-pages" \
140
- -H "Accept: application/vnd.github.raw" \
141
- -o baseline_backward_op_summary.csv
127
+ gh api \
128
+ --method GET -F per_page=100 -F page=10 \
129
+ -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" \
130
+ /repos/${GITHUB_REPOSITORY:-"intel/torch-xpu-ops"}/actions/artifacts \
131
+ > ${GITHUB_WORKSPACE:-"/tmp"}/refer.json
132
+ artifact_id="$(eval "jq -r \
133
+ '[.artifacts[] | \
134
+ select(.name|test(\"Inductor-XPU-OP-Benchmark-Data.*\")) | \
135
+ select(.workflow_run.head_branch|test(\"main\"))][0].id' \
136
+ ${GITHUB_WORKSPACE:-"/tmp"}/refer.json")"
137
+ if [ "$artifact_id" -gt 1 ];then
138
+ gh api \
139
+ -H "Accept: application/vnd.github+json" \
140
+ -H "X-GitHub-Api-Version: 2022-11-28" \
141
+ /repos/${GITHUB_REPOSITORY:-"intel/torch-xpu-ops"}/actions/artifacts/${artifact_id}/zip > reference.zip
142
+ fi
143
+ rm -rf ${GITHUB_WORKSPACE:-"/tmp"}/reference
144
+ mkdir ${GITHUB_WORKSPACE:-"/tmp"}/reference
145
+ mv reference.zip ${GITHUB_WORKSPACE:-"/tmp"}/reference
146
+ unzip ${GITHUB_WORKSPACE:-"/tmp"}/reference/reference.zip -d ${GITHUB_WORKSPACE:-"/tmp"}/reference > /dev/null 2>&1
142
147
143
148
mkdir ${{ github.workspace }}/baseline
144
- cp baseline*.csv ${{ github.workspace }}/baseline
149
+ if [ -f "${GITHUB_WORKSPACE:-"/tmp"}/reference/new_baseline/baseline_forward_op_summary.csv" ]; then
150
+ cp ${GITHUB_WORKSPACE:-"/tmp"}/reference/new_baseline/baseline_forward_op_summary.csv ${{ github.workspace }}/baseline
151
+ cp ${GITHUB_WORKSPACE:-"/tmp"}/reference/new_baseline/baseline_backward_op_summary.csv ${{ github.workspace }}/baseline
152
+ else
153
+ cp ${GITHUB_WORKSPACE:-"/tmp"}/reference/forward_op_summary.csv ${{ github.workspace }}/baseline/baseline_forward_op_summary.csv
154
+ cp ${GITHUB_WORKSPACE:-"/tmp"}/reference/backward_op_summary.csv ${{ github.workspace }}/baseline/baseline_backward_op_summary.csv
155
+ fi
145
156
- name : Check OP Baseline
146
157
run : |
147
158
forward_exists=$([ -f "baseline/baseline_forward_op_summary.csv" ] && echo "true" || echo "false")
@@ -155,6 +166,7 @@ jobs:
155
166
mkdir ${{ github.workspace }}/new_baseline
156
167
cp ${{ github.workspace }}/op_benchmark/forward_op_summary.csv ${{ github.workspace }}/new_baseline/baseline_forward_op_summary.csv
157
168
cp ${{ github.workspace }}/op_benchmark/backward_op_summary.csv ${{ github.workspace }}/new_baseline/baseline_backward_op_summary.csv
169
+ cp -r ${{ github.workspace }}/new_baseline ${{ github.workspace }}/op_benchmark
158
170
echo "Initial the Baseline Data"
159
171
- name : Check the OP Regression
160
172
if : steps.check-baseline.outputs.both_exist == 'true'
@@ -176,11 +188,10 @@ jobs:
176
188
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
177
189
# Update backward op
178
190
python ${{ github.workspace }}/.github/scripts/op_calculate_best_perf.py --xpu ${{ github.workspace }}/op_benchmark/backward_op_summary.csv --baseline ${{ github.workspace }}/new_baseline/baseline_backward_op_summary.csv -r
179
- - name : Deploy Baseline to gh-pages
191
+ cp -r ${{ github.workspace }}/new_baseline ${{ github.workspace }}/op_benchmark
192
+ - name : Upload Inductor XPU OP benchmark Log
180
193
if : always()
181
- uses : peaceiris/ actions-gh-pages@v3
194
+ uses : actions/upload-artifact@v4
182
195
with :
183
- github_token : ${{ secrets.GITHUB_TOKEN }}
184
- publish_dir : ./new_baseline
185
- publish_branch : gh-pages
186
- force_orphan : true
196
+ name : Inductor-XPU-OP-Benchmark-Data-${{ github.event.pull_request.number || github.sha }}
197
+ path : ${{ github.workspace }}/op_benchmark
0 commit comments