From 1937f56c1e483834d456ff07df5b89b2978ac581 Mon Sep 17 00:00:00 2001 From: Paulius Velesko Date: Wed, 15 Apr 2026 14:10:42 +0300 Subject: [PATCH 01/14] ci: add chipStar presubmit on self-hosted Intel Arc runner Adds 4-job GitHub Actions matrix (LLVM 22 native/translator x release/debug) running on [self-hosted, Linux, X64]. Driver script scripts/ci_unit_tests.sh mirrors chipStar's unit_tests.sh shape: loads llvm/22.0- + HIP/chipStar/ci-llvm22-- modules, configures with BUILD_TEST=ON, runs ctest -L chip-spv-gpu. .ci/exclude.txt seeds known-failing tests with links to upstream issues (IGC#403, pre-existing chipStar kernel-lookup bug). Removes AMD's ROCm-targeted .gitlab-ci.yml (538 lines) which cannot run in CHIP-SPV infra. --- .ci/exclude.txt | 15 + .github/workflows/presubmit.yml | 88 ++++++ .gitlab-ci.yml | 538 -------------------------------- scripts/ci_unit_tests.sh | 102 ++++++ 4 files changed, 205 insertions(+), 538 deletions(-) create mode 100644 .ci/exclude.txt create mode 100644 .github/workflows/presubmit.yml delete mode 100644 .gitlab-ci.yml create mode 100755 scripts/ci_unit_tests.sh diff --git a/.ci/exclude.txt b/.ci/exclude.txt new file mode 100644 index 000000000..03515c5d4 --- /dev/null +++ b/.ci/exclude.txt @@ -0,0 +1,15 @@ +# CTest regex patterns (one per line) for tests excluded from CI. +# Blank lines and '#' comments are ignored. Every entry should link to an +# upstream issue — fix the test, don't register failures indefinitely. +# +# Source: /space/pvelesko/2026.04.14-lib-fixes/bug-summary.md (2026-04-14 sweep). + +# Pre-existing chipStar kernel-name lookup failure (not a rocPRIM bug). +# Tracked in bug-summary.md §1 "test_device_reduce_by_key — unchanged — +# pre-existing unrelated kernel-name lookup failure". +rocprim\.device_reduce_by_key + +# IGC bug #403 (SIMD32 finalizer silently drops kernels after register-pressure +# retry). Upstream: https://github.com/intel/intel-graphics-compiler/issues/403 +# Mitigation: CHIP_L0_FORCE_SIMD16 or wait for IGC fix. +rocprim\.device_run_length_encode diff --git a/.github/workflows/presubmit.yml b/.github/workflows/presubmit.yml new file mode 100644 index 000000000..126da2f45 --- /dev/null +++ b/.github/workflows/presubmit.yml @@ -0,0 +1,88 @@ +name: Presubmit (chipStar / Intel) + +on: + pull_request: + paths-ignore: "docs/**" + push: + branches: [main] + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + unit-tests-llvm-22-native-release: + runs-on: [self-hosted, Linux, X64] + env: + CHIP_MODULE_CACHE_DIR: "" + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha }} + fetch-depth: 1 + - name: Build and test + run: ./scripts/ci_unit_tests.sh release llvm-22 --variant=native + shell: bash + - uses: actions/upload-artifact@v4 + if: failure() + with: + name: ctest-logs-llvm-22-native-release + path: build/Testing/**/LastTest*.log + if-no-files-found: ignore + + unit-tests-llvm-22-native-debug: + runs-on: [self-hosted, Linux, X64] + env: + CHIP_MODULE_CACHE_DIR: "" + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha }} + fetch-depth: 1 + - name: Build and test + run: ./scripts/ci_unit_tests.sh debug llvm-22 --variant=native + shell: bash + - uses: actions/upload-artifact@v4 + if: failure() + with: + name: ctest-logs-llvm-22-native-debug + path: build/Testing/**/LastTest*.log + if-no-files-found: ignore + + unit-tests-llvm-22-translator-release: + runs-on: [self-hosted, Linux, X64] + env: + CHIP_MODULE_CACHE_DIR: "" + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha }} + fetch-depth: 1 + - name: Build and test + run: ./scripts/ci_unit_tests.sh release llvm-22 --variant=translator + shell: bash + - uses: actions/upload-artifact@v4 + if: failure() + with: + name: ctest-logs-llvm-22-translator-release + path: build/Testing/**/LastTest*.log + if-no-files-found: ignore + + unit-tests-llvm-22-translator-debug: + runs-on: [self-hosted, Linux, X64] + env: + CHIP_MODULE_CACHE_DIR: "" + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha }} + fetch-depth: 1 + - name: Build and test + run: ./scripts/ci_unit_tests.sh debug llvm-22 --variant=translator + shell: bash + - uses: actions/upload-artifact@v4 + if: failure() + with: + name: ctest-logs-llvm-22-translator-debug + path: build/Testing/**/LastTest*.log + if-no-files-found: ignore diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index 87a9c19b8..000000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,538 +0,0 @@ -# MIT License -# -# Copyright (c) 2017-2023 Advanced Micro Devices, Inc. All rights reserved. -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - -include: - - project: 'amd/ci-templates' - ref: main - file: - - /defaults.yaml - - /deps-cmake.yaml - - /deps-rocm.yaml - - /deps-vcpkg.yaml - - /gpus-rocm.yaml - - /rules.yaml - -stages: - - lint - - autotune - - build - - test - - benchmark - -variables: - PACKAGE_DIR: $BUILD_DIR/package - AUTOTUNE_CONFIG_DIR: ${CI_PROJECT_DIR}/autotune_config - -clang-format: - extends: - - .deps:rocm - stage: lint - needs: [] - tags: - - rocm-build - variables: - CLANG_FORMAT: "/opt/rocm/llvm/bin/clang-format" - GIT_CLANG_FORMAT: "/opt/rocm/llvm/bin/git-clang-format" - rules: - - if: '$CI_PIPELINE_SOURCE == "merge_request_event"' - script: - - cd $CI_PROJECT_DIR - - git config --global --add safe.directory $CI_PROJECT_DIR - - scripts/code-format/check-format.sh $CI_MERGE_REQUEST_DIFF_BASE_SHA --binary "$CLANG_FORMAT" - -.cmake-minimum-vcpkg: - extends: - - .deps:rocm - - .deps:cmake-minimum - - .deps:vcpkg - before_script: - - !reference [".deps:rocm", before_script] - - !reference [".deps:cmake-minimum", before_script] - - !reference [".deps:vcpkg", before_script] - - $VCPKG_DIR/vcpkg install - gtest - benchmark - -.cmake-minimum-apt: - extends: - - .deps:rocm - - .deps:cmake-minimum - before_script: - - !reference [".deps:rocm", before_script] - - !reference [".deps:cmake-minimum", before_script] - - $SUDO_CMD apt-get install -y -qq - libgtest-dev - libbenchmark-dev - -.build:vcpkg-apt: - stage: build - tags: - - rocm-build - extends: - - .gpus:rocm-gpus - - .rules:build -# Missing -Werror and other diagnostic flags due to rocm-terminal sporting an old googletest APT package (Ubuntu 18.04). -# Here we're only testing the consumption logic, and we want to avoid new errors breaking logic testing - script: - - cmake - -G Ninja - -D CMAKE_CXX_COMPILER="$AMDCLANG" - -D CMAKE_BUILD_TYPE=Release - "$(if [ -n "$VCPKG_DIR" ]; then echo "-DCMAKE_TOOLCHAIN_FILE=$VCPKG_DIR/scripts/buildsystems/vcpkg.cmake"; fi)" - -D BUILD_TEST=ON - -D BUILD_EXAMPLE=ON - -D BUILD_BENCHMARK=ON - -D GPU_TARGETS=$GPU_TARGETS - -D AMDGPU_TEST_TARGETS=$GPU_TARGETS - -S $CI_PROJECT_DIR - -B $BUILD_DIR - - cmake - --build $BUILD_DIR - --target test_basic - -build:cmake-minimum-vcpkg: - stage: build - needs: [] - extends: - - .cmake-minimum-vcpkg - - .build:vcpkg-apt - -build:cmake-minimum-apt: - stage: build - needs: [] - extends: - - .cmake-minimum-apt - - .build:vcpkg-apt - -.cmake-latest: - extends: - - .deps:rocm - - .deps:cmake-latest - before_script: - - !reference [".deps:rocm", before_script] - - !reference [".deps:cmake-latest", before_script] - -.cmake-minimum: - extends: - - .deps:rocm - - .deps:cmake-minimum - before_script: - - !reference [".deps:rocm", before_script] - - !reference [".deps:cmake-minimum", before_script] - -.build:common: - stage: build - tags: - - rocm-build - extends: - - .gpus:rocm-gpus - - .rules:build - script: - - mkdir -p $BUILD_DIR - - cd $BUILD_DIR - - cmake - -G Ninja - -D CMAKE_CXX_COMPILER="$AMDCLANG" - -D CMAKE_CXX_FLAGS="-Wall -Wextra -Werror" - -D CMAKE_BUILD_TYPE=Release - -D BUILD_TEST=ON - -D BUILD_EXAMPLE=ON - -D BUILD_BENCHMARK=OFF - -D GPU_TARGETS=$GPU_TARGETS - -D AMDGPU_TEST_TARGETS=$GPU_TARGETS - -S $CI_PROJECT_DIR - -B $BUILD_DIR - - cmake --build $BUILD_DIR - artifacts: - paths: - - $BUILD_DIR/test/test_* - - $BUILD_DIR/test/rocprim/test_* - - $BUILD_DIR/test/CTestTestfile.cmake - - $BUILD_DIR/test/rocprim/CTestTestfile.cmake - - $BUILD_DIR/gtest/ - - $BUILD_DIR/CMakeCache.txt - - $BUILD_DIR/.ninja_log - - $BUILD_DIR/CTestTestfile.cmake - expire_in: 2 weeks - -build:cmake-latest: - stage: build - needs: [] - extends: - - .cmake-latest - - .build:common - -build:cmake-minimum: - stage: build - needs: [] - extends: - - .cmake-minimum - - .build:common - -build:package: - stage: build - needs: [] - tags: - - rocm-build - extends: - - .cmake-minimum - - .gpus:rocm-gpus - - .rules:build - script: - - mkdir -p $PACKAGE_DIR - - cmake - -G Ninja - -D CMAKE_CXX_COMPILER="$AMDCLANG" - -D CMAKE_BUILD_TYPE=Release - -B $PACKAGE_DIR - -S $CI_PROJECT_DIR - - cd $PACKAGE_DIR - - cpack -G "DEB;ZIP" - artifacts: - paths: - - $PACKAGE_DIR/rocprim*.deb - - $PACKAGE_DIR/rocprim*.zip - expire_in: 2 weeks - -build:benchmark: - stage: build - needs: - - job: "autotune:generate-config" - optional: true - tags: - - rocm-build - extends: - - .cmake-minimum - - .gpus:rocm-gpus - - .rules:build - script: -# If we have a custom config created by autotune:create-config - - "[ -d ${AUTOTUNE_CONFIG_DIR} ] && cp -r -f ${AUTOTUNE_CONFIG_DIR}/* ${CI_PROJECT_DIR}/" - - mkdir -p $BUILD_DIR - - cd $BUILD_DIR - - cmake - -B $BUILD_DIR - -S $CI_PROJECT_DIR - -G Ninja - -D CMAKE_CXX_COMPILER="$AMDCLANG" - -D CMAKE_BUILD_TYPE=Release - -D BUILD_TEST=OFF - -D BUILD_EXAMPLE=OFF - -D BUILD_BENCHMARK=ON - -D GPU_TARGETS=$GPU_TARGETS - - cmake --build . - artifacts: - paths: - - $BUILD_DIR/benchmark/* - - $BUILD_DIR/.ninja_log - - $BUILD_DIR/deps/googlebenchmark/ - expire_in: 2 weeks - -autotune:build: - stage: autotune - needs: [] - tags: - - rocm-build - extends: - - .cmake-minimum - - .gpus:rocm-gpus - - .rules:manual - variables: - BENCHMARK_TARGETS: benchmark_config_tuning - script: - - mkdir -p $BUILD_DIR - - cd $BUILD_DIR - - 'printf "Building benchmark targets: %s\n" "$BENCHMARK_TARGETS"' - - cmake - -B $BUILD_DIR - -S $CI_PROJECT_DIR - -G Ninja - -D CMAKE_CXX_COMPILER="$AMDCLANG" - -D CMAKE_BUILD_TYPE=Release - -D BUILD_TEST=OFF - -D BUILD_EXAMPLE=OFF - -D BUILD_BENCHMARK=ON - -D BENCHMARK_CONFIG_TUNING=ON - -D GPU_TARGETS=$GPU_TARGETS - - cmake --build . --target $BENCHMARK_TARGETS - - 'rm -rf $BUILD_DIR/benchmark/benchmark*.parallel' - artifacts: - paths: - - $BUILD_DIR/benchmark/benchmark* - - $BUILD_DIR/.ninja_log - - $BUILD_DIR/deps/googlebenchmark/ - expire_in: 1 week - -test: - stage: test - extends: - - .cmake-minimum - - .rules:test - - .gpus:rocm - needs: - - build:cmake-minimum - script: - - cd $BUILD_DIR - - cmake - -D CMAKE_PREFIX_PATH=/opt/rocm - -P $CI_PROJECT_DIR/cmake/GenerateResourceSpec.cmake - - cat ./resources.json - - ctest - --output-on-failure - --repeat-until-fail 2 - --tests-regex "hip|$GPU_TARGET" - --resource-spec-file ./resources.json - --parallel $PARALLEL_JOBS - -.test-package: - script: - - cmake - -G Ninja - -D CMAKE_CXX_COMPILER="$AMDCLANG" - -D CMAKE_BUILD_TYPE=Release - -D GPU_TARGETS=$GPU_TARGETS - -S "$CI_PROJECT_DIR/test/extra" - -B "$CI_PROJECT_DIR/package_test" - - cmake --build "$CI_PROJECT_DIR/package_test" - - "$CI_PROJECT_DIR/package_test/test_rocprim_package" - - cd "$CI_PROJECT_DIR/package_test" - - ctest --output-on-failure --repeat-until-fail 2 - -test:install: - stage: test - needs: [] - tags: - - rocm - extends: - - .cmake-minimum - - .rules:test - - .gpus:rocm-gpus - script: - - cmake - -G Ninja - -D CMAKE_CXX_COMPILER="$AMDCLANG" - -D CMAKE_BUILD_TYPE=Release - -B build - -S $CI_PROJECT_DIR - - $SUDO_CMD cmake --build build --target install - - !reference [.test-package, script] - -test:deb: - stage: test - needs: - - build:package - tags: - - rocm - extends: - - .cmake-minimum - - .rules:test - - .gpus:rocm-gpus - script: - - $SUDO_CMD dpkg -i $PACKAGE_DIR/rocprim*.deb - - !reference [.test-package, script] - -test:docs: - stage: test - extends: .rules:test - image: sphinxdoc/sphinx-latexpdf:latest - needs: [] - before_script: - - apt-get update -qq - - apt-get install -y -qq doxygen - - pip3 install --user -r $CI_PROJECT_DIR/docs/requirements.txt - script: - - cd docs - - make - artifacts: - paths: - - $CI_PROJECT_DIR/docs/_build - - $CI_PROJECT_DIR/docs/docBin - expire_in: 1 week - -.benchmark-base: - stage: benchmark - extends: - - .rules:benchmark - variables: - BENCHMARK_RESULT_DIR: ${CI_PROJECT_DIR}/benchmark_results - BENCHMARK_RESULT_CACHE_DIR: ${BENCHMARK_RESULT_DIR}_cache - -benchmark: - needs: - - build:benchmark - extends: - - .cmake-minimum - - .gpus:rocm - - .benchmark-base - variables: - BENCHMARK_FILENAME_REGEX: ^benchmark - BENCHMARK_ALGORITHM_REGEX: "benchmark_device_merge_sort_block_sort" - script: - - 'printf "CI Variables used in benchmarks:\nBENCHMARK_RESULT_DIR: %s\nBENCHMARK_FILENAME_REGEX: %s\nBENCHMARK_ALGORITHM_REGEX: %s \n" "$BENCHMARK_RESULT_DIR" "$BENCHMARK_FILENAME_REGEX" "$BENCHMARK_ALGORITHM_REGEX"' - - cd "${CI_PROJECT_DIR}" - - mkdir -p "${BENCHMARK_RESULT_DIR}" - - python3 - .gitlab/run_benchmarks.py - --benchmark_dir "${BUILD_DIR}/benchmark" - --benchmark_gpu_architecture "${GPU_TARGET}" - --benchmark_output_dir "${BENCHMARK_RESULT_DIR}" - --benchmark_filename_regex "${BENCHMARK_FILENAME_REGEX}" - --benchmark_filter_regex "${BENCHMARK_ALGORITHM_REGEX}" - artifacts: - paths: - - ${BENCHMARK_RESULT_DIR} - expire_in: 1 week - -benchmark:cache-or-report: - needs: - - benchmark - extends: - - .benchmark-base - tags: - - single-cache - cache: - key: benchmark-cache - paths: - - ${BENCHMARK_RESULT_CACHE_DIR} - script: - # If on MR branch, generate report, else cache results - - > - if [ ! -z "${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME}" ]; then - if [ ! -d "${BENCHMARK_RESULT_CACHE_DIR}" ]; then - echo 'ERROR: Cache directory does not exist' - exit 1 - elif [ ! -d "${BENCHMARK_RESULT_DIR}" ]; then - echo 'ERROR: Benchmark results directory does not exist' - exit 1 - else - echo 'INFO: Files in cache (reference benchmarks):' - ls -al ${BENCHMARK_RESULT_CACHE_DIR} - echo 'INFO: Generating report...' - python3 .gitlab/generate_report.py --old ${BENCHMARK_RESULT_CACHE_DIR} --new ${BENCHMARK_RESULT_DIR} - fi - elif [ "${CI_COMMIT_BRANCH}" == "${CI_DEFAULT_BRANCH}" ]; then - echo 'INFO: Caching benchmark results...' - mkdir -p ${BENCHMARK_RESULT_CACHE_DIR} - cp -R ${BENCHMARK_RESULT_DIR}/*.json ${BENCHMARK_RESULT_CACHE_DIR} - else - echo 'ERROR: Neither on a merge-request branch or the default branch' - exit 1 - fi - - -.autotune-base: - stage: autotune - extends: - - .rules:manual - variables: - AUTOTUNE_RESULT_DIR: ${CI_PROJECT_DIR}/autotune_results - -autotune:execute-tuning: - needs: - - autotune:build - extends: - - .autotune-base - - .cmake-minimum - - .gpus:rocm - variables: - AUTOTUNE_FILENAME_REGEX: ^benchmark - AUTOTUNE_ALGORITHM_REGEX: "" - timeout: 8h - artifacts: - paths: - - ${AUTOTUNE_RESULT_DIR}/*.json - script: - - 'printf "CI Variables used in benchmarks:\nAUTOTUNE_RESULT_DIR: %s\nAUTOTUNE_FILENAME_REGEX: %s\nAUTOTUNE_ALGORITHM_REGEX: %s \n" "$AUTOTUNE_RESULT_DIR" "$AUTOTUNE_FILENAME_REGEX" "$AUTOTUNE_ALGORITHM_REGEX"' - - cd "${CI_PROJECT_DIR}" - - mkdir -p "${AUTOTUNE_RESULT_DIR}" - - python3 - .gitlab/run_benchmarks.py - --benchmark_dir "${BUILD_DIR}/benchmark" - --benchmark_gpu_architecture "${GPU_TARGET}" - --benchmark_output_dir "${AUTOTUNE_RESULT_DIR}" - --benchmark_filename_regex "${AUTOTUNE_FILENAME_REGEX}" - --benchmark_filter_regex "${AUTOTUNE_ALGORITHM_REGEX}" - -autotune:generate-config: - image: python:3.10.5-buster - needs: - - job: "autotune:execute-tuning" - optional: true - extends: - - .rules:manual - - .autotune-base - variables: - AUTOTUNE_CONFIG_REPO_PATH: /rocprim/include/rocprim/device/detail/config - AUTOTUNE_RESULT_CACHE_DIR: ${AUTOTUNE_RESULT_DIR}_cache - tags: - - single-cache - cache: - key: autotune-cache - paths: - - autotune_results_cache/ - script: - # Set cache dir variables depending on if this is a MR or not - - > - if [ ! -z "${CI_MERGE_REQUEST_TARGET_BRANCH_NAME}" ]; then - AUTOTUNE_RESULT_CACHE_BRANCH_DIR="${AUTOTUNE_RESULT_CACHE_DIR}/${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME}" - AUTOTUNE_RESULT_CACHE_TARGET_BRANCH_DIR="${AUTOTUNE_RESULT_CACHE_DIR}/${CI_MERGE_REQUEST_TARGET_BRANCH_NAME}" - else - AUTOTUNE_RESULT_CACHE_BRANCH_DIR="${AUTOTUNE_RESULT_CACHE_DIR}/${CI_COMMIT_BRANCH}" - fi - # If the global cache dir does not exist, create it - - mkdir -p $AUTOTUNE_RESULT_CACHE_DIR - # If there are fresh results in the artifacts, cache them in the branch cache - # If there are no fresh results, check branch cache - # If there are no branch cache results, check TARGET branch cache - # If there are TARGET branch cache results, cache them in the branch cache - - > - if [ -d "$AUTOTUNE_RESULT_DIR" ]; then - mkdir -p $AUTOTUNE_RESULT_CACHE_BRANCH_DIR - cp -R -u ${AUTOTUNE_RESULT_DIR}/*.json ${AUTOTUNE_RESULT_CACHE_BRANCH_DIR} - elif [ -d "$AUTOTUNE_RESULT_CACHE_BRANCH_DIR" ]; then - mkdir -p $AUTOTUNE_RESULT_DIR - cp -R -u ${AUTOTUNE_RESULT_CACHE_BRANCH_DIR}/*.json ${AUTOTUNE_RESULT_DIR} - elif [ -d "$AUTOTUNE_RESULT_CACHE_TARGET_BRANCH_DIR" ]; then - mkdir -p $AUTOTUNE_RESULT_DIR - cp -R -u ${AUTOTUNE_RESULT_CACHE_TARGET_BRANCH_DIR}/*.json ${AUTOTUNE_RESULT_DIR} - mkdir -p $AUTOTUNE_RESULT_CACHE_BRANCH_DIR - cp -R -u ${AUTOTUNE_RESULT_DIR}/*.json ${AUTOTUNE_RESULT_CACHE_BRANCH_DIR} - else - echo 'ERROR: No autotune results found in previous artifacts, the branch cache or the target branch cache...' - exit 1 - fi - # List the final .json files to use for config generation - - ls -al ${AUTOTUNE_RESULT_DIR} - - cd "${CI_PROJECT_DIR}" - - python3 -m pip install jinja2 - - mkdir -p ${AUTOTUNE_CONFIG_DIR}${AUTOTUNE_CONFIG_REPO_PATH} - - python3 - scripts/autotune/create_optimization.py - --benchmark_files ${AUTOTUNE_RESULT_DIR}/*.json - --out_basedir "${AUTOTUNE_CONFIG_DIR}${AUTOTUNE_CONFIG_REPO_PATH}" - artifacts: - paths: - - ${AUTOTUNE_CONFIG_DIR} - -scheduled-check-changes: - stage: autotune - extends: .rules:scheduled-check-changes diff --git a/scripts/ci_unit_tests.sh b/scripts/ci_unit_tests.sh new file mode 100755 index 000000000..19a12dc13 --- /dev/null +++ b/scripts/ci_unit_tests.sh @@ -0,0 +1,102 @@ +#!/bin/bash +# Presubmit CI script for CHIP-SPV/rocPRIM fork. +# Mirrors the shape of chipStar's scripts/unit_tests.sh. Runs on the +# [self-hosted, Linux, X64] runner against a pre-installed chipStar module. +# +# Usage: ci_unit_tests.sh llvm-22 --variant= +# +# Required modules on the runner: +# llvm/22.0- +# HIP/chipStar/ci-llvm22-- (chipStar install matching +# the LLVM variant+build type) +# oneapi/2025.0.4, level-zero/dgpu +# +# Runner admins: point the HIP/chipStar/ci-llvm22-* modules at a chipStar +# install built from a recent main; the rocPRIM CI will rebuild rocPRIM +# against it on every PR. + +set -e + +if [ "$#" -lt 3 ]; then + echo "Usage: $0 llvm-22 --variant=" + exit 1 +fi + +build_type_lc="$1" +llvm_arg="$2" +variant_arg="$3" + +case "$build_type_lc" in + debug|release) ;; + *) echo "Error: first arg must be 'debug' or 'release'"; exit 1;; +esac + +if [ "$llvm_arg" != "llvm-22" ]; then + echo "Error: only llvm-22 is supported"; exit 1 +fi + +case "$variant_arg" in + --variant=native|--variant=translator) ;; + *) echo "Error: third arg must be --variant=native or --variant=translator"; exit 1;; +esac + +variant="${variant_arg#--variant=}" +build_type=$(echo "$build_type_lc" | tr '[:lower:]' '[:upper:]') + +echo "build_type = $build_type" +echo "variant = $variant" + +# Source environment modules. +if [ -f "$HOME/.local/init/bash" ]; then + export MODULESHOME=$HOME/.local + source "$MODULESHOME/init/bash" +elif [ -f /etc/profile.d/lmod.sh ]; then + source /etc/profile.d/lmod.sh &> /dev/null +else + source /etc/profile.d/modules.sh &> /dev/null +fi + +module use ~/modulefiles +module load oneapi/2025.0.4 +module load "llvm/22.0-${variant}" +module load "HIP/chipStar/ci-llvm22-${variant}-${build_type_lc}" +module load level-zero/dgpu +module list + +unset CHIP_PLATFORM +unset CHIP_DEVICE +export CHIP_LOGLEVEL=err +export CHIP_MODULE_CACHE_DIR="" +rm -rf ~/.cache/chipStar + +hipcc_bin="$(which hipcc)" +echo "hipcc = $hipcc_bin" + +rm -rf build +mkdir build +cd build + +cmake .. \ + -DCMAKE_CXX_COMPILER="$hipcc_bin" \ + -DCMAKE_BUILD_TYPE="$build_type" \ + -DBUILD_TEST=ON \ + -DBUILD_BENCHMARK=OFF \ + -DAMDGPU_TEST_TARGETS="" + +# rocPRIM translation units are heavy; cap parallelism. +nproc_capped=$(( $(nproc) < 8 ? $(nproc) : 8 )) +cmake --build . -j "$nproc_capped" + +exclude_regex="" +if [ -f ../.ci/exclude.txt ]; then + # Strip comments/blank lines, join with '|'. + exclude_regex=$(grep -Ev '^\s*(#|$)' ../.ci/exclude.txt | paste -sd '|' -) +fi + +ctest_args=(--output-on-failure --timeout 300 -L chip-spv-gpu) +if [ -n "$exclude_regex" ]; then + ctest_args+=(-E "$exclude_regex") +fi + +echo "ctest ${ctest_args[*]}" +ctest "${ctest_args[@]}" From 9475ca380fda312466c37aa417a95681edf8e319 Mon Sep 17 00:00:00 2001 From: Paulius Velesko Date: Wed, 15 Apr 2026 14:12:31 +0300 Subject: [PATCH 02/14] ci: reduce matrix to native-release until other chipStar installs exist Only llvm22-native-release chipStar install/module is available on the runner (see /space/pvelesko/install/HIP-llvm22-retest/). The other three matrix variants will fail with 'Unable to locate modulefile'. Reduce the matrix to the working variant; the other three are commented as TODO until matching installs are built. --- .github/workflows/presubmit.yml | 61 +++------------------------------ 1 file changed, 5 insertions(+), 56 deletions(-) diff --git a/.github/workflows/presubmit.yml b/.github/workflows/presubmit.yml index 126da2f45..2e9be0b0d 100644 --- a/.github/workflows/presubmit.yml +++ b/.github/workflows/presubmit.yml @@ -30,59 +30,8 @@ jobs: path: build/Testing/**/LastTest*.log if-no-files-found: ignore - unit-tests-llvm-22-native-debug: - runs-on: [self-hosted, Linux, X64] - env: - CHIP_MODULE_CACHE_DIR: "" - steps: - - uses: actions/checkout@v4 - with: - ref: ${{ github.event.pull_request.head.sha }} - fetch-depth: 1 - - name: Build and test - run: ./scripts/ci_unit_tests.sh debug llvm-22 --variant=native - shell: bash - - uses: actions/upload-artifact@v4 - if: failure() - with: - name: ctest-logs-llvm-22-native-debug - path: build/Testing/**/LastTest*.log - if-no-files-found: ignore - - unit-tests-llvm-22-translator-release: - runs-on: [self-hosted, Linux, X64] - env: - CHIP_MODULE_CACHE_DIR: "" - steps: - - uses: actions/checkout@v4 - with: - ref: ${{ github.event.pull_request.head.sha }} - fetch-depth: 1 - - name: Build and test - run: ./scripts/ci_unit_tests.sh release llvm-22 --variant=translator - shell: bash - - uses: actions/upload-artifact@v4 - if: failure() - with: - name: ctest-logs-llvm-22-translator-release - path: build/Testing/**/LastTest*.log - if-no-files-found: ignore - - unit-tests-llvm-22-translator-debug: - runs-on: [self-hosted, Linux, X64] - env: - CHIP_MODULE_CACHE_DIR: "" - steps: - - uses: actions/checkout@v4 - with: - ref: ${{ github.event.pull_request.head.sha }} - fetch-depth: 1 - - name: Build and test - run: ./scripts/ci_unit_tests.sh debug llvm-22 --variant=translator - shell: bash - - uses: actions/upload-artifact@v4 - if: failure() - with: - name: ctest-logs-llvm-22-translator-debug - path: build/Testing/**/LastTest*.log - if-no-files-found: ignore + # TODO: enable the other three variants once the runner has matching + # chipStar installs and modules: + # HIP/chipStar/ci-llvm22-native-debug + # HIP/chipStar/ci-llvm22-translator-release + # HIP/chipStar/ci-llvm22-translator-debug From 2945e2e535ad9a01df487de75f12e0ffbeaf1731 Mon Sep 17 00:00:00 2001 From: Paulius Velesko Date: Wed, 15 Apr 2026 14:20:32 +0300 Subject: [PATCH 03/14] ci: load existing HIP-llvm22-retest/chipStar/2026.04.14 module Previous commit invented HIP/chipStar/ci-llvm22-- module names that don't exist on the runner. The real module for the LLVM22-native chipStar install is HIP-llvm22-retest/chipStar/2026.04.14 (parallel modulepath subtree, not under HIP/). --- scripts/ci_unit_tests.sh | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/scripts/ci_unit_tests.sh b/scripts/ci_unit_tests.sh index 19a12dc13..b4002e976 100755 --- a/scripts/ci_unit_tests.sh +++ b/scripts/ci_unit_tests.sh @@ -6,14 +6,9 @@ # Usage: ci_unit_tests.sh llvm-22 --variant= # # Required modules on the runner: -# llvm/22.0- -# HIP/chipStar/ci-llvm22-- (chipStar install matching -# the LLVM variant+build type) +# llvm/22.0-native (currently hard-coded; translator/debug variants pending) +# HIP-llvm22-retest/chipStar/2026.04.14 # oneapi/2025.0.4, level-zero/dgpu -# -# Runner admins: point the HIP/chipStar/ci-llvm22-* modules at a chipStar -# install built from a recent main; the rocPRIM CI will rebuild rocPRIM -# against it on every PR. set -e @@ -59,7 +54,7 @@ fi module use ~/modulefiles module load oneapi/2025.0.4 module load "llvm/22.0-${variant}" -module load "HIP/chipStar/ci-llvm22-${variant}-${build_type_lc}" +module load HIP-llvm22-retest/chipStar/2026.04.14 module load level-zero/dgpu module list From 15e7e4de65abbbcd0e7a882cca08d9b3ba3c8586 Mon Sep 17 00:00:00 2001 From: Paulius Velesko Date: Wed, 15 Apr 2026 14:22:30 +0300 Subject: [PATCH 04/14] ci: inline build+test in workflow, drop scripts/ci_unit_tests.sh The script only wrapped a few module loads + cmake + ctest. Inlining removes indirection and keeps CI self-contained in one file. --- .github/workflows/presubmit.yml | 38 ++++++++++--- scripts/ci_unit_tests.sh | 97 --------------------------------- 2 files changed, 31 insertions(+), 104 deletions(-) delete mode 100755 scripts/ci_unit_tests.sh diff --git a/.github/workflows/presubmit.yml b/.github/workflows/presubmit.yml index 2e9be0b0d..2d2c6dc50 100644 --- a/.github/workflows/presubmit.yml +++ b/.github/workflows/presubmit.yml @@ -21,17 +21,41 @@ jobs: ref: ${{ github.event.pull_request.head.sha }} fetch-depth: 1 - name: Build and test - run: ./scripts/ci_unit_tests.sh release llvm-22 --variant=native shell: bash + run: | + set -e + if [ -f "$HOME/.local/init/bash" ]; then + export MODULESHOME=$HOME/.local + source "$MODULESHOME/init/bash" + elif [ -f /etc/profile.d/lmod.sh ]; then + source /etc/profile.d/lmod.sh + else + source /etc/profile.d/modules.sh + fi + module use ~/modulefiles + module load oneapi/2025.0.4 + module load llvm/22.0-native + module load HIP-llvm22-retest/chipStar/2026.04.14 + module load level-zero/dgpu + module list + rm -rf ~/.cache/chipStar build + cmake -S . -B build \ + -DCMAKE_CXX_COMPILER="$(which hipcc)" \ + -DCMAKE_BUILD_TYPE=Release \ + -DBUILD_TEST=ON \ + -DBUILD_BENCHMARK=OFF \ + -DAMDGPU_TEST_TARGETS="" + cmake --build build -j 8 + exclude=$(grep -Ev '^\s*(#|$)' .ci/exclude.txt | paste -sd '|' -) + cd build + if [ -n "$exclude" ]; then + ctest --output-on-failure --timeout 300 -L chip-spv-gpu -E "$exclude" + else + ctest --output-on-failure --timeout 300 -L chip-spv-gpu + fi - uses: actions/upload-artifact@v4 if: failure() with: name: ctest-logs-llvm-22-native-release path: build/Testing/**/LastTest*.log if-no-files-found: ignore - - # TODO: enable the other three variants once the runner has matching - # chipStar installs and modules: - # HIP/chipStar/ci-llvm22-native-debug - # HIP/chipStar/ci-llvm22-translator-release - # HIP/chipStar/ci-llvm22-translator-debug diff --git a/scripts/ci_unit_tests.sh b/scripts/ci_unit_tests.sh deleted file mode 100755 index b4002e976..000000000 --- a/scripts/ci_unit_tests.sh +++ /dev/null @@ -1,97 +0,0 @@ -#!/bin/bash -# Presubmit CI script for CHIP-SPV/rocPRIM fork. -# Mirrors the shape of chipStar's scripts/unit_tests.sh. Runs on the -# [self-hosted, Linux, X64] runner against a pre-installed chipStar module. -# -# Usage: ci_unit_tests.sh llvm-22 --variant= -# -# Required modules on the runner: -# llvm/22.0-native (currently hard-coded; translator/debug variants pending) -# HIP-llvm22-retest/chipStar/2026.04.14 -# oneapi/2025.0.4, level-zero/dgpu - -set -e - -if [ "$#" -lt 3 ]; then - echo "Usage: $0 llvm-22 --variant=" - exit 1 -fi - -build_type_lc="$1" -llvm_arg="$2" -variant_arg="$3" - -case "$build_type_lc" in - debug|release) ;; - *) echo "Error: first arg must be 'debug' or 'release'"; exit 1;; -esac - -if [ "$llvm_arg" != "llvm-22" ]; then - echo "Error: only llvm-22 is supported"; exit 1 -fi - -case "$variant_arg" in - --variant=native|--variant=translator) ;; - *) echo "Error: third arg must be --variant=native or --variant=translator"; exit 1;; -esac - -variant="${variant_arg#--variant=}" -build_type=$(echo "$build_type_lc" | tr '[:lower:]' '[:upper:]') - -echo "build_type = $build_type" -echo "variant = $variant" - -# Source environment modules. -if [ -f "$HOME/.local/init/bash" ]; then - export MODULESHOME=$HOME/.local - source "$MODULESHOME/init/bash" -elif [ -f /etc/profile.d/lmod.sh ]; then - source /etc/profile.d/lmod.sh &> /dev/null -else - source /etc/profile.d/modules.sh &> /dev/null -fi - -module use ~/modulefiles -module load oneapi/2025.0.4 -module load "llvm/22.0-${variant}" -module load HIP-llvm22-retest/chipStar/2026.04.14 -module load level-zero/dgpu -module list - -unset CHIP_PLATFORM -unset CHIP_DEVICE -export CHIP_LOGLEVEL=err -export CHIP_MODULE_CACHE_DIR="" -rm -rf ~/.cache/chipStar - -hipcc_bin="$(which hipcc)" -echo "hipcc = $hipcc_bin" - -rm -rf build -mkdir build -cd build - -cmake .. \ - -DCMAKE_CXX_COMPILER="$hipcc_bin" \ - -DCMAKE_BUILD_TYPE="$build_type" \ - -DBUILD_TEST=ON \ - -DBUILD_BENCHMARK=OFF \ - -DAMDGPU_TEST_TARGETS="" - -# rocPRIM translation units are heavy; cap parallelism. -nproc_capped=$(( $(nproc) < 8 ? $(nproc) : 8 )) -cmake --build . -j "$nproc_capped" - -exclude_regex="" -if [ -f ../.ci/exclude.txt ]; then - # Strip comments/blank lines, join with '|'. - exclude_regex=$(grep -Ev '^\s*(#|$)' ../.ci/exclude.txt | paste -sd '|' -) -fi - -ctest_args=(--output-on-failure --timeout 300 -L chip-spv-gpu) -if [ -n "$exclude_regex" ]; then - ctest_args+=(-E "$exclude_regex") -fi - -echo "ctest ${ctest_args[*]}" -ctest "${ctest_args[@]}" From 8c279d58d8eddad0618fe25a32107375d11bfd33 Mon Sep 17 00:00:00 2001 From: Paulius Velesko Date: Wed, 15 Apr 2026 14:24:54 +0300 Subject: [PATCH 05/14] ci: use absolute modulepath (runner $HOME may not be /space/pvelesko) module use ~/modulefiles resolves to the runner process's $HOME which isn't guaranteed to be /space/pvelesko. Use absolute path for portability. --- .github/workflows/presubmit.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/presubmit.yml b/.github/workflows/presubmit.yml index 2d2c6dc50..47d40415f 100644 --- a/.github/workflows/presubmit.yml +++ b/.github/workflows/presubmit.yml @@ -32,7 +32,7 @@ jobs: else source /etc/profile.d/modules.sh fi - module use ~/modulefiles + module use /space/pvelesko/modulefiles module load oneapi/2025.0.4 module load llvm/22.0-native module load HIP-llvm22-retest/chipStar/2026.04.14 From 025d2b742cb75d7cc0083a22408ea4fc533a959f Mon Sep 17 00:00:00 2001 From: Paulius Velesko Date: Wed, 15 Apr 2026 14:26:08 +0300 Subject: [PATCH 06/14] ci: debug module lookup failure (temp) --- .github/workflows/presubmit.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/presubmit.yml b/.github/workflows/presubmit.yml index 47d40415f..b7b046805 100644 --- a/.github/workflows/presubmit.yml +++ b/.github/workflows/presubmit.yml @@ -33,6 +33,14 @@ jobs: source /etc/profile.d/modules.sh fi module use /space/pvelesko/modulefiles + echo "=== which module command / type ===" + type module || true + echo "=== modulefile listing ===" + ls -la /space/pvelesko/modulefiles/HIP-llvm22-retest/chipStar/ || true + echo "=== module avail HIP-llvm22 ===" + module avail HIP-llvm22 2>&1 || true + echo "=== module avail (full) ===" + module avail 2>&1 | grep -i chipstar || true module load oneapi/2025.0.4 module load llvm/22.0-native module load HIP-llvm22-retest/chipStar/2026.04.14 From 64a38af586098bc909d01c212061e03e31db9c34 Mon Sep 17 00:00:00 2001 From: Paulius Velesko Date: Wed, 15 Apr 2026 14:30:52 +0300 Subject: [PATCH 07/14] ci: drop debug output, use HIP/chipStar/main on meatloaf runner --- .github/workflows/presubmit.yml | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/.github/workflows/presubmit.yml b/.github/workflows/presubmit.yml index b7b046805..6739a84c6 100644 --- a/.github/workflows/presubmit.yml +++ b/.github/workflows/presubmit.yml @@ -33,17 +33,9 @@ jobs: source /etc/profile.d/modules.sh fi module use /space/pvelesko/modulefiles - echo "=== which module command / type ===" - type module || true - echo "=== modulefile listing ===" - ls -la /space/pvelesko/modulefiles/HIP-llvm22-retest/chipStar/ || true - echo "=== module avail HIP-llvm22 ===" - module avail HIP-llvm22 2>&1 || true - echo "=== module avail (full) ===" - module avail 2>&1 | grep -i chipstar || true module load oneapi/2025.0.4 module load llvm/22.0-native - module load HIP-llvm22-retest/chipStar/2026.04.14 + module load HIP/chipStar/main module load level-zero/dgpu module list rm -rf ~/.cache/chipStar build From a5a4409a39ec8136f768ee25f6e3e2fe79b91553 Mon Sep 17 00:00:00 2001 From: Paulius Velesko Date: Wed, 15 Apr 2026 14:50:59 +0300 Subject: [PATCH 08/14] ci: retrigger after chipStar/main rebuild with llvm/22.0-native From bd733c82ae0f5777f734ee9729a3de69907745d0 Mon Sep 17 00:00:00 2001 From: Paulius Velesko Date: Wed, 15 Apr 2026 15:08:28 +0300 Subject: [PATCH 09/14] ci: add salami + pastrami jobs; exclude fp16 tests pending PR #3 --- .ci/exclude.txt | 6 ++ .github/workflows/presubmit.yml | 98 ++++++++++++++++++++++++++++----- 2 files changed, 91 insertions(+), 13 deletions(-) diff --git a/.ci/exclude.txt b/.ci/exclude.txt index 03515c5d4..d418edcb9 100644 --- a/.ci/exclude.txt +++ b/.ci/exclude.txt @@ -13,3 +13,9 @@ rocprim\.device_reduce_by_key # retry). Upstream: https://github.com/intel/intel-graphics-compiler/issues/403 # Mitigation: CHIP_L0_FORCE_SIMD16 or wait for IGC fix. rocprim\.device_run_length_encode + +# IGC bug #402 (fp16 subgroup-shuffle narrowing miscompile). +# Upstream: https://github.com/intel/intel-graphics-compiler/issues/402 +# Fix pending in PR [CHIP-SPV/rocPRIM#3]; remove these two lines when #3 merges. +rocprim\.warp_reduce +rocprim\.warp_scan diff --git a/.github/workflows/presubmit.yml b/.github/workflows/presubmit.yml index 6739a84c6..947f702ad 100644 --- a/.github/workflows/presubmit.yml +++ b/.github/workflows/presubmit.yml @@ -1,4 +1,4 @@ -name: Presubmit (chipStar / Intel) +name: Presubmit on: pull_request: @@ -11,7 +11,7 @@ concurrency: cancel-in-progress: true jobs: - unit-tests-llvm-22-native-release: + meatloaf-x64-intel: runs-on: [self-hosted, Linux, X64] env: CHIP_MODULE_CACHE_DIR: "" @@ -20,7 +20,7 @@ jobs: with: ref: ${{ github.event.pull_request.head.sha }} fetch-depth: 1 - - name: Build and test + - name: Build and test (chip-spv-gpu) shell: bash run: | set -e @@ -33,29 +33,101 @@ jobs: source /etc/profile.d/modules.sh fi module use /space/pvelesko/modulefiles - module load oneapi/2025.0.4 - module load llvm/22.0-native - module load HIP/chipStar/main - module load level-zero/dgpu + module load oneapi/2025.0.4 llvm/22.0-native HIP/chipStar/main level-zero/dgpu module list rm -rf ~/.cache/chipStar build cmake -S . -B build \ -DCMAKE_CXX_COMPILER="$(which hipcc)" \ -DCMAKE_BUILD_TYPE=Release \ - -DBUILD_TEST=ON \ - -DBUILD_BENCHMARK=OFF \ + -DBUILD_TEST=ON -DBUILD_BENCHMARK=OFF \ -DAMDGPU_TEST_TARGETS="" cmake --build build -j 8 exclude=$(grep -Ev '^\s*(#|$)' .ci/exclude.txt | paste -sd '|' -) cd build - if [ -n "$exclude" ]; then - ctest --output-on-failure --timeout 300 -L chip-spv-gpu -E "$exclude" + ctest --output-on-failure --timeout 300 -L chip-spv-gpu ${exclude:+-E "$exclude"} + - uses: actions/upload-artifact@v4 + if: failure() + with: + name: ctest-logs-meatloaf + path: build/Testing/**/LastTest*.log + if-no-files-found: ignore + + salami-arm64: + runs-on: [self-hosted, Linux, ARM64] + env: + CHIP_MODULE_CACHE_DIR: "" + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha }} + fetch-depth: 1 + - name: Build and test (chip-spv-cpu) + shell: bash + run: | + set -e + if [ -f "$HOME/.local/init/bash" ]; then + export MODULESHOME=$HOME/.local + source "$MODULESHOME/init/bash" + elif [ -f /etc/profile.d/lmod.sh ]; then + source /etc/profile.d/lmod.sh else - ctest --output-on-failure --timeout 300 -L chip-spv-gpu + source /etc/profile.d/modules.sh + fi + module use ~/modulefiles + module load llvm/22.0-native HIP/chipStar/main + module list + rm -rf ~/.cache/chipStar build + cmake -S . -B build \ + -DCMAKE_CXX_COMPILER="$(which hipcc)" \ + -DCMAKE_BUILD_TYPE=Release \ + -DBUILD_TEST=ON -DBUILD_BENCHMARK=OFF \ + -DAMDGPU_TEST_TARGETS="" + cmake --build build -j 4 + exclude=$(grep -Ev '^\s*(#|$)' .ci/exclude.txt | paste -sd '|' -) + cd build + ctest --output-on-failure --timeout 300 -L chip-spv-cpu ${exclude:+-E "$exclude"} + - uses: actions/upload-artifact@v4 + if: failure() + with: + name: ctest-logs-salami + path: build/Testing/**/LastTest*.log + if-no-files-found: ignore + + pastrami-macos: + runs-on: [self-hosted, ARM64, MacOS] + env: + CHIP_MODULE_CACHE_DIR: "" + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha }} + fetch-depth: 1 + - name: Build and test (chip-spv-cpu) + shell: bash + run: | + set -e + if [ -f "$HOME/.local/init/bash" ]; then + export MODULESHOME=$HOME/.local + source "$MODULESHOME/init/bash" + elif [ -f /etc/profile.d/lmod.sh ]; then + source /etc/profile.d/lmod.sh fi + module use ~/modulefiles + module load llvm/22.0-native HIP/chipStar/main + module list + rm -rf ~/.cache/chipStar build + cmake -S . -B build \ + -DCMAKE_CXX_COMPILER="$(which hipcc)" \ + -DCMAKE_BUILD_TYPE=Release \ + -DBUILD_TEST=ON -DBUILD_BENCHMARK=OFF \ + -DAMDGPU_TEST_TARGETS="" + cmake --build build -j 4 + exclude=$(grep -Ev '^\s*(#|$)' .ci/exclude.txt | paste -sd '|' -) + cd build + ctest --output-on-failure --timeout 300 -L chip-spv-cpu ${exclude:+-E "$exclude"} - uses: actions/upload-artifact@v4 if: failure() with: - name: ctest-logs-llvm-22-native-release + name: ctest-logs-pastrami path: build/Testing/**/LastTest*.log if-no-files-found: ignore From eca21a822be09326471ec8bbf4c59e9139dd98a1 Mon Sep 17 00:00:00 2001 From: Paulius Velesko Date: Wed, 15 Apr 2026 16:02:35 +0300 Subject: [PATCH 10/14] ci: comment out salami; fix pastrami module init for homebrew --- .github/workflows/presubmit.yml | 76 +++++++++++++-------------------- 1 file changed, 29 insertions(+), 47 deletions(-) diff --git a/.github/workflows/presubmit.yml b/.github/workflows/presubmit.yml index 947f702ad..8a65b4757 100644 --- a/.github/workflows/presubmit.yml +++ b/.github/workflows/presubmit.yml @@ -52,46 +52,33 @@ jobs: path: build/Testing/**/LastTest*.log if-no-files-found: ignore - salami-arm64: - runs-on: [self-hosted, Linux, ARM64] - env: - CHIP_MODULE_CACHE_DIR: "" - steps: - - uses: actions/checkout@v4 - with: - ref: ${{ github.event.pull_request.head.sha }} - fetch-depth: 1 - - name: Build and test (chip-spv-cpu) - shell: bash - run: | - set -e - if [ -f "$HOME/.local/init/bash" ]; then - export MODULESHOME=$HOME/.local - source "$MODULESHOME/init/bash" - elif [ -f /etc/profile.d/lmod.sh ]; then - source /etc/profile.d/lmod.sh - else - source /etc/profile.d/modules.sh - fi - module use ~/modulefiles - module load llvm/22.0-native HIP/chipStar/main - module list - rm -rf ~/.cache/chipStar build - cmake -S . -B build \ - -DCMAKE_CXX_COMPILER="$(which hipcc)" \ - -DCMAKE_BUILD_TYPE=Release \ - -DBUILD_TEST=ON -DBUILD_BENCHMARK=OFF \ - -DAMDGPU_TEST_TARGETS="" - cmake --build build -j 4 - exclude=$(grep -Ev '^\s*(#|$)' .ci/exclude.txt | paste -sd '|' -) - cd build - ctest --output-on-failure --timeout 300 -L chip-spv-cpu ${exclude:+-E "$exclude"} - - uses: actions/upload-artifact@v4 - if: failure() - with: - name: ctest-logs-salami - path: build/Testing/**/LastTest*.log - if-no-files-found: ignore + # TODO: enable once salami has llvm/22.0-native + HIP/chipStar/main installed + # (LLVM 22 build is in progress 2026-04-15 — expect ~10h on ARM). + # salami-arm64: + # runs-on: [self-hosted, Linux, ARM64] + # env: + # CHIP_MODULE_CACHE_DIR: "" + # steps: + # - uses: actions/checkout@v4 + # with: + # ref: ${{ github.event.pull_request.head.sha }} + # fetch-depth: 1 + # - name: Build and test (chip-spv-cpu) + # shell: bash + # run: | + # set -e + # source /etc/profile.d/modules.sh + # module use ~/modulefiles + # module load llvm/22.0-native HIP/chipStar/main + # rm -rf ~/.cache/chipStar build + # cmake -S . -B build \ + # -DCMAKE_CXX_COMPILER="$(which hipcc)" \ + # -DCMAKE_BUILD_TYPE=Release \ + # -DBUILD_TEST=ON -DBUILD_BENCHMARK=OFF -DAMDGPU_TEST_TARGETS="" + # cmake --build build -j 2 + # exclude=$(grep -Ev '^\s*(#|$)' .ci/exclude.txt | paste -sd '|' -) + # cd build + # ctest --output-on-failure --timeout 300 -L chip-spv-cpu ${exclude:+-E "$exclude"} pastrami-macos: runs-on: [self-hosted, ARM64, MacOS] @@ -106,14 +93,9 @@ jobs: shell: bash run: | set -e - if [ -f "$HOME/.local/init/bash" ]; then - export MODULESHOME=$HOME/.local - source "$MODULESHOME/init/bash" - elif [ -f /etc/profile.d/lmod.sh ]; then - source /etc/profile.d/lmod.sh - fi + source /opt/homebrew/Cellar/modules/5.6.0/init/bash module use ~/modulefiles - module load llvm/22.0-native HIP/chipStar/main + module load llvm/22.0-native pocl HIP/chipStar/main module list rm -rf ~/.cache/chipStar build cmake -S . -B build \ From 40dd3d3b56a19587c9b9f8d06e0cbc3a98e55d6c Mon Sep 17 00:00:00 2001 From: Paulius Velesko Date: Wed, 15 Apr 2026 16:19:55 +0300 Subject: [PATCH 11/14] ci: pass CMAKE_POLICY_VERSION_MINIMUM=3.5 (pastrami cmake 4.x gtest fetch) --- .github/workflows/presubmit.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/presubmit.yml b/.github/workflows/presubmit.yml index 8a65b4757..032c2ea5b 100644 --- a/.github/workflows/presubmit.yml +++ b/.github/workflows/presubmit.yml @@ -40,7 +40,8 @@ jobs: -DCMAKE_CXX_COMPILER="$(which hipcc)" \ -DCMAKE_BUILD_TYPE=Release \ -DBUILD_TEST=ON -DBUILD_BENCHMARK=OFF \ - -DAMDGPU_TEST_TARGETS="" + -DAMDGPU_TEST_TARGETS="" \ + -DCMAKE_POLICY_VERSION_MINIMUM=3.5 cmake --build build -j 8 exclude=$(grep -Ev '^\s*(#|$)' .ci/exclude.txt | paste -sd '|' -) cd build @@ -102,7 +103,8 @@ jobs: -DCMAKE_CXX_COMPILER="$(which hipcc)" \ -DCMAKE_BUILD_TYPE=Release \ -DBUILD_TEST=ON -DBUILD_BENCHMARK=OFF \ - -DAMDGPU_TEST_TARGETS="" + -DAMDGPU_TEST_TARGETS="" \ + -DCMAKE_POLICY_VERSION_MINIMUM=3.5 cmake --build build -j 4 exclude=$(grep -Ev '^\s*(#|$)' .ci/exclude.txt | paste -sd '|' -) cd build From fadd3af6540e1de02acf94d650b4520e7d6ebf45 Mon Sep 17 00:00:00 2001 From: Paulius Velesko Date: Wed, 15 Apr 2026 16:31:58 +0300 Subject: [PATCH 12/14] ci: exclude rocprim.block_shuffle (fp16/bf16 PoCL-CPU failures) --- .ci/exclude.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.ci/exclude.txt b/.ci/exclude.txt index d418edcb9..c658dcb78 100644 --- a/.ci/exclude.txt +++ b/.ci/exclude.txt @@ -19,3 +19,8 @@ rocprim\.device_run_length_encode # Fix pending in PR [CHIP-SPV/rocPRIM#3]; remove these two lines when #3 merges. rocprim\.warp_reduce rocprim\.warp_scan + +# fp16/bf16 block_shuffle failures on PoCL CPU (pastrami). Related to the same +# sub-int warp_shuffle roundtrip addressed by PR [CHIP-SPV/rocPRIM#3]; remove +# once the fp16 fix lands and is verified on CPU. +rocprim\.block_shuffle From ea03b0c27541c0fb28aabb2a3b7f55146d445664 Mon Sep 17 00:00:00 2001 From: Paulius Velesko Date: Thu, 16 Apr 2026 08:09:01 +0300 Subject: [PATCH 13/14] ci: enable salami-arm64 job (llvm22 + chipStar/main now installed) --- .github/workflows/presubmit.yml | 66 +++++++++++++++++++-------------- 1 file changed, 39 insertions(+), 27 deletions(-) diff --git a/.github/workflows/presubmit.yml b/.github/workflows/presubmit.yml index 032c2ea5b..bc865258c 100644 --- a/.github/workflows/presubmit.yml +++ b/.github/workflows/presubmit.yml @@ -53,33 +53,45 @@ jobs: path: build/Testing/**/LastTest*.log if-no-files-found: ignore - # TODO: enable once salami has llvm/22.0-native + HIP/chipStar/main installed - # (LLVM 22 build is in progress 2026-04-15 — expect ~10h on ARM). - # salami-arm64: - # runs-on: [self-hosted, Linux, ARM64] - # env: - # CHIP_MODULE_CACHE_DIR: "" - # steps: - # - uses: actions/checkout@v4 - # with: - # ref: ${{ github.event.pull_request.head.sha }} - # fetch-depth: 1 - # - name: Build and test (chip-spv-cpu) - # shell: bash - # run: | - # set -e - # source /etc/profile.d/modules.sh - # module use ~/modulefiles - # module load llvm/22.0-native HIP/chipStar/main - # rm -rf ~/.cache/chipStar build - # cmake -S . -B build \ - # -DCMAKE_CXX_COMPILER="$(which hipcc)" \ - # -DCMAKE_BUILD_TYPE=Release \ - # -DBUILD_TEST=ON -DBUILD_BENCHMARK=OFF -DAMDGPU_TEST_TARGETS="" - # cmake --build build -j 2 - # exclude=$(grep -Ev '^\s*(#|$)' .ci/exclude.txt | paste -sd '|' -) - # cd build - # ctest --output-on-failure --timeout 300 -L chip-spv-cpu ${exclude:+-E "$exclude"} + salami-arm64: + runs-on: [self-hosted, Linux, ARM64] + env: + CHIP_MODULE_CACHE_DIR: "" + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha }} + fetch-depth: 1 + - name: Build and test (chip-spv-cpu) + shell: bash + run: | + set -e + if [ -f "$HOME/.local/init/bash" ]; then + export MODULESHOME=$HOME/.local + source "$MODULESHOME/init/bash" + else + source /etc/profile.d/modules.sh + fi + module use ~/modulefiles + module load llvm/22.0-native HIP/chipStar/main + module list + rm -rf ~/.cache/chipStar build + cmake -S . -B build \ + -DCMAKE_CXX_COMPILER="$(which hipcc)" \ + -DCMAKE_BUILD_TYPE=Release \ + -DBUILD_TEST=ON -DBUILD_BENCHMARK=OFF \ + -DAMDGPU_TEST_TARGETS="" \ + -DCMAKE_POLICY_VERSION_MINIMUM=3.5 + cmake --build build -j 2 + exclude=$(grep -Ev '^\s*(#|$)' .ci/exclude.txt | paste -sd '|' -) + cd build + ctest --output-on-failure --timeout 300 -L chip-spv-cpu ${exclude:+-E "$exclude"} + - uses: actions/upload-artifact@v4 + if: failure() + with: + name: ctest-logs-salami + path: build/Testing/**/LastTest*.log + if-no-files-found: ignore pastrami-macos: runs-on: [self-hosted, ARM64, MacOS] From a4321132e6102f8b757ebb082236af6f6984e19a Mon Sep 17 00:00:00 2001 From: Paulius Velesko Date: Thu, 16 Apr 2026 10:05:04 +0300 Subject: [PATCH 14/14] ci: exclude tests requiring fp64/SubgroupDispatch (salami Mali GPU) --- .ci/exclude.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.ci/exclude.txt b/.ci/exclude.txt index c658dcb78..abe9971b9 100644 --- a/.ci/exclude.txt +++ b/.ci/exclude.txt @@ -24,3 +24,9 @@ rocprim\.warp_scan # sub-int warp_shuffle roundtrip addressed by PR [CHIP-SPV/rocPRIM#3]; remove # once the fp16 fix lands and is verified on CPU. rocprim\.block_shuffle + +# Mali GPU (salami) lacks fp64 + SubgroupDispatch SPIR-V capabilities. +# These tests require hardware features the ARM Mali doesn't expose. +rocprim\.thread_algos +rocprim\.intrinsics +rocprim\.warp_load