|
34 | 34 | default: 'rolling'
|
35 | 35 | description: Driver lts/rolling
|
36 | 36 |
|
37 |
| -permissions: read-all |
| 37 | +permissions: write-all |
38 | 38 |
|
39 | 39 | jobs:
|
40 | 40 | op_benchmark_test:
|
41 | 41 | runs-on: ${{ inputs.runner }}
|
42 | 42 | timeout-minutes: 900
|
43 | 43 | env:
|
44 | 44 | GH_TOKEN: ${{ github.token }}
|
| 45 | + reference_issue: 1689 |
45 | 46 | NEOReadDebugKeys: ${{ inputs.driver == 'rolling' && '1' || '0' }}
|
46 | 47 | DisableScratchPages: ${{ inputs.driver == 'rolling' && '1' || '0' }}
|
47 | 48 | steps:
|
|
87 | 88 | export CMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}:${CONDA_PREFIX:-"$(dirname $(which conda))/../"}
|
88 | 89 | pip install -r requirements.txt
|
89 | 90 | pip install --force-reinstall ${{ github.workspace }}/torch*.whl
|
90 |
| - git clone https://github.com/pytorch/vision && cd vision && python setup.py install && cd .. |
91 | 91 | else
|
92 | 92 | pip install torch torchvision torchaudio --pre --index-url https://download.pytorch.org/whl/nightly/xpu
|
93 | 93 | TORCH_COMMIT_ID=$(python -c 'import torch; print(torch.version.git_version)')
|
@@ -123,30 +123,16 @@ jobs:
|
123 | 123 | bash ${{ github.workspace }}/.github/scripts/microbench_summary.sh ${{ github.workspace }}/op_benchmark ${{ github.workspace }}/op_benchmark/backward_op_summary.csv True
|
124 | 124 | - name: Download OP Baseline
|
125 | 125 | continue-on-error: true
|
| 126 | + id: reference_id |
126 | 127 | run: |
|
127 | 128 | source .github/scripts/env.sh ${{ inputs.pytorch }}
|
128 | 129 | source activate xpu_op_${ZE_AFFINITY_MASK}
|
129 |
| - sudo apt-get install -y jq |
130 |
| - gh api \ |
131 |
| - --method GET -F per_page=100 -F page=10 \ |
132 |
| - -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" \ |
133 |
| - /repos/${GITHUB_REPOSITORY:-"intel/torch-xpu-ops"}/actions/artifacts \ |
134 |
| - > ${GITHUB_WORKSPACE:-"/tmp"}/refer.json |
135 |
| - artifact_id="$(eval "jq -r \ |
136 |
| - '[.artifacts[] | \ |
137 |
| - select(.name|test(\"Inductor-XPU-OP-Benchmark-Data.*\")) | \ |
138 |
| - select(.workflow_run.head_branch|test(\"main\"))][0].id' \ |
139 |
| - ${GITHUB_WORKSPACE:-"/tmp"}/refer.json")" |
140 |
| - if [ "$artifact_id" -gt 1 ];then |
141 |
| - gh api \ |
142 |
| - -H "Accept: application/vnd.github+json" \ |
143 |
| - -H "X-GitHub-Api-Version: 2022-11-28" \ |
144 |
| - /repos/${GITHUB_REPOSITORY:-"intel/torch-xpu-ops"}/actions/artifacts/${artifact_id}/zip > reference.zip |
145 |
| - fi |
| 130 | + REFERENCE_RUN_ID="$(gh --repo ${GITHUB_REPOSITORY} issue view ${reference_issue} \ |
| 131 | + --json body -q .body |grep "Inductor-XPU-OP-Benchmark-Data" |sed 's/.*: *//')" |
| 132 | + gh --repo ${GITHUB_REPOSITORY} run download ${REFERENCE_RUN_ID} -p "Inductor-XPU-OP-Benchmark-Data-*" |
146 | 133 | rm -rf ${GITHUB_WORKSPACE:-"/tmp"}/reference
|
147 | 134 | mkdir ${GITHUB_WORKSPACE:-"/tmp"}/reference
|
148 |
| - mv reference.zip ${GITHUB_WORKSPACE:-"/tmp"}/reference |
149 |
| - unzip ${GITHUB_WORKSPACE:-"/tmp"}/reference/reference.zip -d ${GITHUB_WORKSPACE:-"/tmp"}/reference > /dev/null 2>&1 |
| 135 | + mv Inductor-XPU-OP-Benchmark-Data-*/* ${GITHUB_WORKSPACE:-"/tmp"}/reference |
150 | 136 |
|
151 | 137 | mkdir ${{ github.workspace }}/baseline
|
152 | 138 | if [[ -f "${GITHUB_WORKSPACE:-"/tmp"}/reference/new_baseline/baseline_forward_op_summary.csv" ]]; then
|
@@ -182,3 +168,9 @@ jobs:
|
182 | 168 | with:
|
183 | 169 | name: Inductor-XPU-OP-Benchmark-Data-${{ github.event.pull_request.number || github.sha }}
|
184 | 170 | path: ${{ github.workspace }}/op_benchmark
|
| 171 | + - name: Upload Reference Run ID |
| 172 | + if: ${{ env.run_type != 'on-demand' }} |
| 173 | + run: | |
| 174 | + gh --repo ${GITHUB_REPOSITORY} issue view ${reference_issue} --json body -q .body | \ |
| 175 | + sed "s/Inductor-XPU-OP-Benchmark-Data:.*/Inductor-XPU-OP-Benchmark-Data: ${GITHUB_RUN_ID}/" | sed '/^$/d' > new_body.txt |
| 176 | + gh --repo ${GITHUB_REPOSITORY} issue edit ${reference_issue} --body-file new_body.txt |
0 commit comments