@@ -43,6 +43,13 @@ inputs:
4343 runner :
4444 type : string
4545 required : True
46+ # It can be either a tag/branch/commit or a PR_<number>.
47+ # If the latter is given, latest IGC release will be installed from debs.
48+ # This assumes that the PR changes were based on the latest compute_runtime version.
49+ custom_cr :
50+ type : string
51+ required : False
52+ default : " "
4653
4754runs :
4855 # composite actions don't make use of 'name', so copy-paste steps' names as a comment in the first line of each step
@@ -164,6 +171,17 @@ runs:
164171
165172 BENCHMARK_RESULTS_REPO_PATH="$(realpath ./llvm-ci-perf-results)"
166173 echo "BENCHMARK_RESULTS_REPO_PATH=$BENCHMARK_RESULTS_REPO_PATH" >> $GITHUB_OUTPUT
174+
175+ CR_BUILD_REF=""
176+ if [ -n "${{ inputs.custom_cr }}" ] && [[ "${{ inputs.custom_cr }}" == PR_* ]]; then
177+ pr_no="$(echo "${{ inputs.custom_cr }}" | sed 's/PR_//')"
178+ CR_BUILD_REF="refs/pull/$pr_no/head"
179+ echo "Using custom compute runtime ref: ${CR_BUILD_REF}"
180+ elif [ -n "${{ inputs.custom_cr }}" ]; then
181+ CR_BUILD_REF="${{ inputs.custom_cr }}"
182+ echo "Using custom compute runtime ref: ${CR_BUILD_REF}"
183+ fi
184+ echo "CR_BUILD_REF=$CR_BUILD_REF" >> $GITHUB_OUTPUT
167185 - name : Checkout results repo
168186 uses : actions/checkout@v5
169187 with :
@@ -221,18 +239,10 @@ runs:
221239 shell : bash
222240 env :
223241 RUNNER_TAG : ${{ inputs.runner }}
242+ GITHUB_TOKEN : ${{ github.token }}
243+ CR_BUILD_REF : ${{ steps.establish_outputs.outputs.CR_BUILD_REF }}
224244 run : |
225245 # Install dependencies
226-
227- echo "::group::use_compute_runtime_tag_cache"
228-
229- # Cache the compute_runtime version from dependencies.json, but perform a
230- # check with L0 version before using it: This value is not guaranteed to
231- # accurately reflect the current compute_runtime version used, as the
232- # docker images are built nightly.
233- export COMPUTE_RUNTIME_TAG_CACHE="$(cat ./devops/dependencies.json | jq -r .linux.compute_runtime.github_tag)"
234-
235- echo "::endgroup::"
236246 echo "::group::install_perf"
237247
238248 # Install perf in version matching the host kernel.
@@ -248,6 +258,38 @@ runs:
248258 sudo apt-get update
249259 sudo apt-get install -y linux-tools-$(uname -r)
250260
261+ echo "::endgroup::"
262+ echo "::group::install_igc"
263+
264+ # If a custom compute_runtime tag is provided and it points to a PR,
265+ # install latest IGC release from debs.
266+ echo "CR_BUILD_REF='${CR_BUILD_REF}'"
267+ if [[ "${CR_BUILD_REF}" != "" ]] && [[ "${CR_BUILD_REF}" == refs/pull/* ]]; then
268+ # Find latest IGC release, download debs, and install them
269+ curl --request GET \
270+ --url https://api.github.com/repos/intel/intel-graphics-compiler/releases/latest \
271+ --header "Authorization: Bearer ${GITHUB_TOKEN}" \
272+ --header "X-GitHub-Api-Version: 2022-11-28" > latest_igc_release.json
273+
274+ IGC_CORE_DEB_URL=$(cat latest_igc_release.json | jq -r '.assets[] | select(.name | test("intel-igc-core-[0-9]+.*amd64.deb")) | .browser_download_url')
275+ IGC_CORE_DEVEL_DEB_URL=$(cat latest_igc_release.json | jq -r '.assets[] | select(.name | test("intel-igc-core-devel_[0-9]+.*amd64.deb")) | .browser_download_url')
276+ echo "IGC_CORE_DEB_URL=$IGC_CORE_DEB_URL"
277+ echo "IGC_CORE_DEVEL_DEB_URL=$IGC_CORE_DEVEL_DEB_URL"
278+
279+ mkdir neo_debs || true
280+ cd neo_debs
281+ wget -q "$IGC_CORE_DEB_URL"
282+ wget -q "$IGC_CORE_DEVEL_DEB_URL"
283+ sudo dpkg -i --force-all *.deb
284+ cd ..
285+ elif [[ "${CR_BUILD_REF}" == "" ]]; then
286+ # Cache the compute_runtime version from dependencies.json, but perform a
287+ # check with L0 version before using it: This value is not guaranteed to
288+ # accurately reflect the current compute_runtime version used, as the
289+ # docker images are built nightly.
290+ export COMPUTE_RUNTIME_TAG_CACHE="$(cat ./devops/dependencies.json | jq -r .linux.compute_runtime.github_tag)"
291+ fi
292+
251293 echo "::endgroup::"
252294 echo "::group::install_python_deps"
253295
@@ -272,6 +314,7 @@ runs:
272314 BENCH_WORKDIR : ${{ steps.establish_outputs.outputs.BENCH_WORKDIR }}
273315 BENCHMARK_RESULTS_REPO_PATH : ${{ steps.establish_outputs.outputs.BENCHMARK_RESULTS_REPO_PATH }}
274316 LLVM_BENCHMARKS_USE_GDB : ${{ inputs.gdb_mode }}
317+ CR_BUILD_REF : ${{ steps.establish_outputs.outputs.CR_BUILD_REF }}
275318 run : |
276319 # Build and run benchmarks
277320
@@ -298,6 +341,7 @@ runs:
298341 --timestamp-override "$SAVE_TIMESTAMP" \
299342 --detect-version sycl,compute_runtime \
300343 --produce-github-summary \
344+ ${{ env.CR_BUILD_REF != '' && format('--compute-runtime {0}', env.CR_BUILD_REF) || '' }} \
301345 ${{ inputs.exit_on_failure == 'true' && '--exit-on-failure --iterations 1' || '' }}
302346 # TODO: add back: "--flamegraph inclusive" once works properly
303347
0 commit comments