@@ -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
@@ -150,6 +157,8 @@ runs:
150157 - name : Establish results branch, repo path, and workdir
151158 id : establish_outputs
152159 shell : bash
160+ env :
161+ CUSTOM_CR : ${{ inputs.custom_cr }}
153162 run : |
154163 # Establish results branch, repo path, and workdir
155164 #
@@ -164,6 +173,17 @@ runs:
164173
165174 BENCHMARK_RESULTS_REPO_PATH="$(realpath ./llvm-ci-perf-results)"
166175 echo "BENCHMARK_RESULTS_REPO_PATH=$BENCHMARK_RESULTS_REPO_PATH" >> $GITHUB_OUTPUT
176+
177+ CR_BUILD_REF=""
178+ if [ -n "${CUSTOM_CR}" ] && [[ "${CUSTOM_CR}" == PR_* ]]; then
179+ pr_no="$(echo "${CUSTOM_CR}" | sed 's/PR_//')"
180+ CR_BUILD_REF="refs/pull/$pr_no/head"
181+ echo "Using custom compute runtime ref: ${CR_BUILD_REF}"
182+ elif [ -n "${CUSTOM_CR}" ]; then
183+ CR_BUILD_REF="${CUSTOM_CR}"
184+ echo "Using custom compute runtime ref: ${CR_BUILD_REF}"
185+ fi
186+ echo "CR_BUILD_REF=${CR_BUILD_REF}" >> $GITHUB_OUTPUT
167187 - name : Checkout results repo
168188 uses : actions/checkout@v5
169189 with :
@@ -221,18 +241,10 @@ runs:
221241 shell : bash
222242 env :
223243 RUNNER_TAG : ${{ inputs.runner }}
244+ GITHUB_TOKEN : ${{ github.token }}
245+ CR_BUILD_REF : ${{ steps.establish_outputs.outputs.CR_BUILD_REF }}
224246 run : |
225247 # 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::"
236248 echo "::group::install_perf"
237249
238250 # Install perf in version matching the host kernel.
@@ -248,6 +260,38 @@ runs:
248260 sudo apt-get update
249261 sudo apt-get install -y linux-tools-$(uname -r)
250262
263+ echo "::endgroup::"
264+ echo "::group::install_igc"
265+
266+ # If a custom compute_runtime tag is provided and it points to a PR,
267+ # install latest IGC release from debs.
268+ echo "CR_BUILD_REF='${CR_BUILD_REF}'"
269+ if [[ "${CR_BUILD_REF}" != "" ]] && [[ "${CR_BUILD_REF}" == refs/pull/* ]]; then
270+ # Find latest IGC release, download debs, and install them
271+ curl --request GET \
272+ --url https://api.github.com/repos/intel/intel-graphics-compiler/releases/latest \
273+ --header "Authorization: Bearer ${GITHUB_TOKEN}" \
274+ --header "X-GitHub-Api-Version: 2022-11-28" > latest_igc_release.json
275+
276+ 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')
277+ 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')
278+ echo "IGC_CORE_DEB_URL=$IGC_CORE_DEB_URL"
279+ echo "IGC_CORE_DEVEL_DEB_URL=$IGC_CORE_DEVEL_DEB_URL"
280+
281+ mkdir neo_debs || true
282+ cd neo_debs
283+ wget -q "$IGC_CORE_DEB_URL"
284+ wget -q "$IGC_CORE_DEVEL_DEB_URL"
285+ sudo dpkg -i --force-all *.deb
286+ cd ..
287+ elif [[ "${CR_BUILD_REF}" == "" ]]; then
288+ # Cache the compute_runtime version from dependencies.json, but perform a
289+ # check with L0 version before using it: This value is not guaranteed to
290+ # accurately reflect the current compute_runtime version used, as the
291+ # docker images are built nightly.
292+ export COMPUTE_RUNTIME_TAG_CACHE="$(cat ./devops/dependencies.json | jq -r .linux.compute_runtime.github_tag)"
293+ fi
294+
251295 echo "::endgroup::"
252296 echo "::group::install_python_deps"
253297
@@ -272,6 +316,7 @@ runs:
272316 BENCH_WORKDIR : ${{ steps.establish_outputs.outputs.BENCH_WORKDIR }}
273317 BENCHMARK_RESULTS_REPO_PATH : ${{ steps.establish_outputs.outputs.BENCHMARK_RESULTS_REPO_PATH }}
274318 LLVM_BENCHMARKS_USE_GDB : ${{ inputs.gdb_mode }}
319+ CR_BUILD_REF : ${{ steps.establish_outputs.outputs.CR_BUILD_REF }}
275320 run : |
276321 # Build and run benchmarks
277322
@@ -298,6 +343,7 @@ runs:
298343 --timestamp-override "$SAVE_TIMESTAMP" \
299344 --detect-version sycl,compute_runtime \
300345 --produce-github-summary \
346+ $([[ "${CR_BUILD_REF}" != "" ]] && echo "--compute-runtime ${CR_BUILD_REF}" || echo '') \
301347 ${{ inputs.exit_on_failure == 'true' && '--exit-on-failure --iterations 1' || '' }}
302348 # TODO: add back: "--flamegraph inclusive" once works properly
303349
0 commit comments