66 str_name :
77 required : true
88 type : string
9- unit :
9+ preset :
1010 required : true
1111 type : string
1212 pr_no :
3030 required : false
3131 type : string
3232 default : ' '
33- upload_report :
34- required : false
35- type : boolean
36- default : false
3733 compute_runtime_commit :
3834 required : false
3935 type : string
4036 default : ' '
4137
4238permissions :
43- contents : read
39+ contents : write
4440 pull-requests : write
4541
4642jobs :
5147 adapter : [
5248 {str_name: "${{ inputs.str_name }}",
5349 sycl_config : " ${{ inputs.sycl_config_params }}" ,
54- unit : " ${{ inputs.unit }}"
5550 }
5651 ]
5752 build_type : [Release]
6055 runs-on : " ${{ inputs.str_name }}_PERF"
6156
6257 steps :
63- - name : Cleanup self-hosted workspace
64- if : always()
65- run : |
66- ls -la ./
67- rm -rf ./* || true
68-
6958 - name : Add comment to PR
7059 uses : actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
7160 if : ${{ always() && inputs.pr_no != 0 }}
@@ -84,25 +73,28 @@ jobs:
8473 body: body
8574 })
8675
87- - name : Checkout UR
76+ - name : Checkout benchmark scripts
8877 uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
8978 with :
90- path : ur-repo
79+ repository : intel/llvm
80+ ref : unify-benchmark-ci
81+ path : sc
82+ sparse-checkout : |
83+ devops/scripts/benchmarks
9184
92- - name : Install pip packages
93- run : |
94- pip install --force-reinstall -r ${{github.workspace}}/ur-repo/third_party/benchmark_requirements.txt
95-
96- # We need to fetch special ref for proper PR's merge commit. Note, this ref may be absent if the PR is already merged.
97- - name : Fetch PR's merge commit
98- if : ${{ inputs.pr_no != 0 }}
99- working-directory : ${{github.workspace}}/ur-repo
100- env :
101- PR_NO : ${{ inputs.pr_no }}
85+ - name : Checkout results branch
86+ uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
87+ with :
88+ ref : benchmark-results
89+ path : results-repo
90+
91+ - name : Create virtual environment
92+ run : python -m venv .venv
93+
94+ - name : Activate virtual environment and install pip packages
10295 run : |
103- git fetch -- https://github.com/${{github.repository}} +refs/pull/${PR_NO}/*:refs/remotes/origin/pr/${PR_NO}/*
104- git checkout origin/pr/${PR_NO}/merge
105- git rev-parse origin/pr/${PR_NO}/merge
96+ source .venv/bin/activate
97+ pip install -r sc/devops/scripts/benchmarks/requirements.txt
10698
10799 - name : Checkout SYCL
108100 uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
@@ -135,8 +127,6 @@ jobs:
135127 --ci-defaults ${{matrix.adapter.sycl_config}}
136128 --cmake-opt="-DLLVM_INSTALL_UTILS=ON"
137129 --cmake-opt="-DSYCL_PI_TESTS=OFF"
138- --cmake-opt="-DSYCL_UR_USE_FETCH_CONTENT=OFF"
139- --cmake-opt="-DSYCL_UR_SOURCE_DIR=${{github.workspace}}/ur-repo/"
140130 --cmake-opt=-DCMAKE_C_COMPILER_LAUNCHER=ccache
141131 --cmake-opt=-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
142132
@@ -146,7 +136,7 @@ jobs:
146136 - name : Configure UR
147137 run : >
148138 cmake -DCMAKE_BUILD_TYPE=Release
149- -S${{github.workspace}}/ur -repo
139+ -S${{github.workspace}}/sycl -repo/unified-runtime
150140 -B${{github.workspace}}/ur_build
151141 -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/ur_install
152142 -DUR_BUILD_TESTS=OFF
@@ -160,35 +150,6 @@ jobs:
160150 - name : Install UR
161151 run : cmake --install ${{github.workspace}}/ur_build
162152
163- - name : Checkout UMF
164- uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
165- with :
166- repository : oneapi-src/unified-memory-framework
167- ref : main
168- path : umf-repo
169- fetch-depth : 1
170- fetch-tags : false
171-
172- - name : Configure UMF
173- run : >
174- cmake -DCMAKE_BUILD_TYPE=Release
175- -S${{github.workspace}}/umf-repo
176- -B${{github.workspace}}/umf_build
177- -DUMF_BUILD_BENCHMARKS=ON
178- -DUMF_BUILD_SHARED_LIBRARY=ON
179- -DUMF_BUILD_BENCHMARKS_MT=ON
180- -DUMF_BUILD_TESTS=OFF
181- -DUMF_FORMAT_CODE_STYLE=OFF
182- -DUMF_DEVELOPER_MODE=OFF
183- -DUMF_BUILD_LEVEL_ZERO_PROVIDER=ON
184- -DUMF_BUILD_CUDA_PROVIDER=ON
185- -DUMF_BUILD_LIBUMF_POOL_DISJOINT=ON
186- -DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
187- -DUMF_BUILD_EXAMPLES=OFF
188-
189- - name : Build UMF
190- run : cmake --build ${{github.workspace}}/umf_build -j $(nproc)
191-
192153 - name : Compute core range
193154 run : |
194155 # Compute the core range for the first NUMA node; second node is for UMF jobs.
@@ -208,25 +169,25 @@ jobs:
208169 echo "ZE_AFFINITY_MASK=$ZE_AFFINITY_MASK" >> $GITHUB_ENV
209170
210171 - name : Run benchmarks
211- working-directory : ${{ github.workspace }}/ur-repo/
212172 id : benchmarks
213173 run : >
214- taskset -c ${{ env.CORES }} ${{ github.workspace }}/ur-repo/scripts/benchmarks/main.py
215- ~/bench_workdir
174+ source .venv/bin/activate &&
175+ taskset -c ${{ env.CORES }} ./sc/devops/scripts/benchmarks/main.py
176+ ~/ur_bench_workdir
216177 --sycl ${{ github.workspace }}/sycl_build
217178 --ur ${{ github.workspace }}/ur_install
218- --umf ${{ github.workspace }}/umf_build
219179 --adapter ${{ matrix.adapter.str_name }}
220180 --compute-runtime ${{ inputs.compute_runtime_commit }}
221181 --build-igc
222- --compare baseline
223- ${{ inputs.upload_report && '--output-html' || '' }}
224- ${{ inputs.pr_no != 0 && '--output-markdown' || '' }}
182+ --output-html remote
183+ --results-dir ${{ github.workspace }}/results-repo
184+ --output-markdown
185+ --preset ${{ inputs.preset }}
225186 ${{ inputs.bench_script_params }}
226187
227188 - name : Print benchmark results
228189 run : |
229- cat ${{ github.workspace }}/ur-repo /benchmark_results.md || true
190+ cat ${{ github.workspace }}/sc/devops/scripts/benchmarks /benchmark_results.md || true
230191
231192 - name : Add comment to PR
232193 uses : actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
@@ -236,7 +197,7 @@ jobs:
236197 let markdown = ""
237198 try {
238199 const fs = require('fs');
239- markdown = fs.readFileSync('ur-repo /benchmark_results.md', 'utf8');
200+ markdown = fs.readFileSync('sc/devops/scripts/benchmarks /benchmark_results.md', 'utf8');
240201 } catch(err) {
241202 }
242203
@@ -255,14 +216,41 @@ jobs:
255216 body: body
256217 })
257218
258- - name : Upload HTML report
259- if : ${{ always() && inputs.upload_report }}
260- uses : actions/cache/save@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
261- with :
262- path : ur-repo/benchmark_results.html
263- key : benchmark-results-${{ matrix.adapter.str_name }}-${{ github.run_id }}
219+ - name : Commit data.json and results directory
220+ working-directory : results-repo
221+ run : |
222+ git config --global user.name "GitHub Actions Bot"
223+ git config --global user.email "[email protected] " 224+
225+ for attempt in {1..5}; do
226+ echo "Attempt $attempt to push changes"
227+
228+ rm -f data.json
229+ cp ${{ github.workspace }}/sc/devops/scripts/benchmarks/html/data.json .
230+
231+ git add data.json results/
232+ git commit -m "Add benchmark results and data.json"
233+
234+ results_file=$(git diff HEAD~1 --name-only -- results/ | head -n 1)
235+
236+ if git push origin benchmark-results; then
237+ echo "Push succeeded"
238+ break
239+ fi
240+
241+ echo "Push failed, retrying..."
242+
243+ if [ -n "$results_file" ]; then
244+ mv $results_file ${{ github.workspace }}/temp_$(basename $results_file)
245+
246+ git reset --hard origin/benchmark-results
247+ git pull origin benchmark-results
248+
249+ new_file="results/$(basename "$results_file")"
250+ mv ${{ github.workspace }}/temp_$(basename $results_file) $new_file
251+ fi
252+
253+ echo "Regenerating data.json"
254+ (cd ${{ github.workspace }} && ${{ github.workspace }}/sc/devops/scripts/benchmarks/main.py ~/ur_bench_workdir --dry-run --results-dir ${{ github.workspace }}/results-repo --output-html remote)
264255
265- - name : Get information about platform
266- if : ${{ always() }}
267- working-directory : ${{ github.workspace }}/ur-repo/
268- run : .github/scripts/get_system_info.sh
256+ done
0 commit comments