Add test for hipGraphAddDependencies multi-pair iteration (#556) #4289
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: pocl-cpu | |
| on: | |
| push: | |
| paths-ignore: "docs/**" | |
| pull_request: | |
| paths-ignore: "docs/**" | |
| jobs: | |
| pre_job: | |
| runs-on: ubuntu-22.04 | |
| outputs: | |
| should_skip: ${{ steps.skip_check.outputs.should_skip }} | |
| steps: | |
| - id: skip_check | |
| uses: fkirc/skip-duplicate-actions@master | |
| with: | |
| concurrent_skipping: 'same_content' | |
| skip_after_successful_duplicate: 'true' | |
| paths_ignore: '["docs/**"]' | |
| do_not_skip: '["pull_request"]' | |
| spirv-tools: | |
| needs: pre_job | |
| if: ${{ needs.pre_job.outputs.should_skip != 'true' }} | |
| name: Build and cache spirv-tools | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - uses: actions/cache@v3 | |
| id: spirv-tools | |
| env: | |
| cache-name: cache-spirv-tools | |
| with: | |
| path: ~/opt/SPIRV-Tools/v2023.2 | |
| key: ${{ runner.os }}-build-${{ env.cache-name }} | |
| - run: sudo apt update; sudo apt install -y gcc cmake python3 spirv-tools | |
| if: steps.spirv-tools.outputs.cache-hit != 'true' | |
| - uses: actions/checkout@v3 | |
| with: | |
| repository: KhronosGroup/SPIRV-Tools | |
| ref: v2023.2 | |
| path: SPIRV-Tools | |
| fetch-depth: 0 | |
| if: steps.spirv-tools.outputs.cache-hit != 'true' | |
| - run: python3 utils/git-sync-deps | |
| working-directory: SPIRV-Tools/ | |
| if: steps.spirv-tools.outputs.cache-hit != 'true' | |
| - run: mkdir -p SPIRV-Tools/build | |
| if: steps.spirv-tools.outputs.cache-hit != 'true' | |
| - run: cmake .. -DCMAKE_INSTALL_PREFIX=$HOME/opt/SPIRV-Tools/v2023.2 -DSPIRV_SKIP_TESTS=ON -DCMAKE_INSTALL_LIBDIR=lib -DSPIRV_TOOLS_INSTALL_HEADERS=ON -DSPIRV_TOOLS_BUILD_STATIC=ON | |
| working-directory: SPIRV-Tools/build | |
| if: steps.spirv-tools.outputs.cache-hit != 'true' | |
| - run: cmake --build . --parallel 4 | |
| working-directory: SPIRV-Tools/build | |
| if: steps.spirv-tools.outputs.cache-hit != 'true' | |
| - run: cmake --install . | |
| working-directory: SPIRV-Tools/build | |
| if: steps.spirv-tools.outputs.cache-hit != 'true' | |
| llvm: | |
| needs: [pre_job, spirv-tools] | |
| if: ${{ needs.pre_job.outputs.should_skip != 'true' }} | |
| name: Build and cache llvm-${{ matrix.llvm-version }} | |
| runs-on: ubuntu-22.04 | |
| strategy: | |
| matrix: | |
| llvm-version: [19] | |
| fail-fast: false | |
| steps: | |
| - uses: actions/checkout@v3 | |
| with: | |
| submodules: true | |
| - name: Free up disk space | |
| run: | | |
| sudo rm -rf /usr/share/dotnet | |
| sudo rm -rf /usr/local/lib/android | |
| sudo rm -rf /opt/ghc | |
| sudo rm -rf /opt/hostedtoolcache/CodeQL | |
| sudo docker image prune --all --force | |
| df -h | |
| - uses: actions/cache@v3 | |
| id: spirv-tools | |
| env: | |
| cache-name: cache-spirv-tools | |
| with: | |
| path: ~/opt/SPIRV-Tools/v2023.2 | |
| key: ${{ runner.os }}-build-${{ env.cache-name }} | |
| fail-on-cache-miss: true | |
| - name: Set cache key | |
| id: set-cache-key | |
| run: | | |
| echo "cache-key=${{ runner.os }}-build-cache-llvm-${{ matrix.llvm-version }}-release-${{ matrix.llvm-version }}.x-dynamic" >> $GITHUB_OUTPUT | |
| - uses: actions/cache@v3 | |
| id: llvm | |
| with: | |
| path: ~/opt/llvm/${{ matrix.llvm-version }} | |
| key: ${{ steps.set-cache-key.outputs.cache-key }} | |
| - name: Install dependencies | |
| if: steps.llvm.outputs.cache-hit != 'true' | |
| run: sudo apt update; sudo apt install -y gcc cmake git python3 patch | |
| - name: Configure LLVM with configure_llvm.sh | |
| if: steps.llvm.outputs.cache-hit != 'true' | |
| run: | | |
| chmod +x scripts/configure_llvm.sh | |
| ./scripts/configure_llvm.sh --version ${{ matrix.llvm-version }} --install-dir $HOME/opt/llvm/${{ matrix.llvm-version }} --link-type dynamic | |
| - name: Build LLVM | |
| if: steps.llvm.outputs.cache-hit != 'true' | |
| run: cmake --build . --parallel 4 | |
| working-directory: llvm-project/llvm/build_${{ matrix.llvm-version }} | |
| - name: Clean object files before install | |
| if: steps.llvm.outputs.cache-hit != 'true' | |
| run: find . -name "*.o" -delete | |
| working-directory: llvm-project/llvm/build_${{ matrix.llvm-version }} | |
| - name: Install LLVM | |
| if: steps.llvm.outputs.cache-hit != 'true' | |
| run: cmake --install . | |
| working-directory: llvm-project/llvm/build_${{ matrix.llvm-version }} | |
| pocl: | |
| needs: [pre_job, llvm, spirv-tools] | |
| if: ${{ needs.pre_job.outputs.should_skip != 'true' }} | |
| name: Build and cache pocl ${{ matrix.pocl-version }} (llvm-${{ matrix.llvm-version }}) | |
| runs-on: ubuntu-22.04 | |
| strategy: | |
| matrix: | |
| include: | |
| - pocl-version: "7.1" | |
| llvm-version: 19 | |
| fail-fast: false | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - id: get-shas | |
| uses: ./.github/actions/get-shas | |
| with: | |
| pocl-version: ${{ matrix.pocl-version }} | |
| llvm-version: ${{ matrix.llvm-version }} | |
| - uses: actions/cache@v3 | |
| id: pocl | |
| env: | |
| cache-name: cache-pocl-${{ matrix.pocl-version }}-llvm-${{ matrix.llvm-version }} | |
| with: | |
| path: ~/opt/pocl/${{ matrix.pocl-version }}-${{ matrix.llvm-version }} | |
| key: ${{ steps.get-shas.outputs.pocl-cache-key }} | |
| - name: Check PoCL Key | |
| run: echo ${{ steps.get-shas.outputs.pocl-cache-key }} | |
| - uses: actions/cache@v3 | |
| id: spirv-tools | |
| env: | |
| cache-name: cache-spirv-tools | |
| with: | |
| path: ~/opt/SPIRV-Tools/v2023.2 | |
| key: ${{ runner.os }}-build-${{ env.cache-name }} | |
| fail-on-cache-miss: true | |
| if: steps.pocl.outputs.cache-hit != 'true' | |
| - uses: actions/cache@v3 | |
| id: llvm | |
| env: | |
| cache-name: cache-llvm-${{ matrix.llvm-version }} | |
| with: | |
| path: ~/opt/llvm/${{ matrix.llvm-version }} | |
| key: ${{ runner.os }}-build-cache-llvm-${{ matrix.llvm-version }}-release-${{ matrix.llvm-version }}.x-dynamic | |
| fail-on-cache-miss: true | |
| if: steps.pocl.outputs.cache-hit != 'true' | |
| - run: sudo add-apt-repository ppa:ocl-icd/ppa; sudo apt update | |
| if: steps.pocl.outputs.cache-hit != 'true' | |
| - run: sudo apt install -y python3-dev libpython3-dev build-essential cmake git pkg-config make ninja-build ocl-icd-libopencl1 ocl-icd-dev ocl-icd-opencl-dev libhwloc-dev zlib1g zlib1g-dev clinfo dialog apt-utils libxml2-dev spirv-tools spirv-headers | |
| if: steps.pocl.outputs.cache-hit != 'true' | |
| - uses: actions/checkout@v3 | |
| with: | |
| repository: pocl/pocl | |
| ref: ${{ steps.get-shas.outputs.pocl-sha }} | |
| path: pocl | |
| if: steps.pocl.outputs.cache-hit != 'true' | |
| - run: mkdir -p pocl/build | |
| if: steps.pocl.outputs.cache-hit != 'true' | |
| - name: Configure PoCL | |
| if: steps.pocl.outputs.cache-hit != 'true' | |
| run: cmake .. -DCMAKE_INSTALL_PREFIX=$HOME/opt/pocl/${{ matrix.pocl-version }}-${{ matrix.llvm-version }} -DCMAKE_BUILD_TYPE=Release -DWITH_LLVM_CONFIG=$HOME/opt/llvm/${{ matrix.llvm-version }}/bin/llvm-config -DENABLE_TESTS=OFF -DENABLE_EXAMPLES=OFF -DSTATIC_LLVM=OFF -DKERNELLIB_HOST_CPU_VARIANTS=distro | |
| working-directory: pocl/build | |
| - run: cmake --build . --parallel $(nproc) | |
| working-directory: pocl/build | |
| if: steps.pocl.outputs.cache-hit != 'true' | |
| - run: cmake --install . | |
| working-directory: pocl/build | |
| if: steps.pocl.outputs.cache-hit != 'true' | |
| - name: Check PoCL Installation | |
| run: ls $HOME/opt/pocl/${{ matrix.pocl-version }}-${{ matrix.llvm-version }}/etc/OpenCL/vendors/ | |
| chipstar: | |
| needs: [pre_job, llvm, spirv-tools, pocl] | |
| if: ${{ needs.pre_job.outputs.should_skip != 'true' }} | |
| name: Build and test chipStar on ${{ matrix.backend }}${{ matrix.pocl-version && format(' {0}', matrix.pocl-version) || '' }} (llvm-${{ matrix.llvm-version }}) | |
| runs-on: ubuntu-22.04 | |
| env: | |
| CHIP_MODULE_CACHE_DIR: "" | |
| EXCLUDE: ${{ matrix.backend == 'intel' && '"`cat ./test_lists/OPENCL_POCL.txt`|`cat ./test_lists/ALL.txt`"' || format('"`cat ./test_lists/OPENCL_POCL.txt`|`cat ./test_lists/ALL.txt`{0}"', matrix.extra_exclude || '') }} | |
| strategy: | |
| matrix: | |
| include: | |
| # PoCL backend with specific version combinations | |
| - backend: pocl | |
| pocl-version: "7.1" | |
| llvm-version: 19 | |
| extra_exclude: "" | |
| fail-fast: false | |
| steps: | |
| - name: Install spirv-tools & headers | |
| run: sudo apt install -y spirv-tools spirv-headers | |
| - name: Set OPENCL_ENV for intel | |
| if: matrix.backend == 'intel' | |
| run: echo "OPENCL_ENV=LD_LIBRARY_PATH=$(dirname $(find /opt/intel -name libsvml.so)):$(dirname $(find /opt/intel/oneapi/tbb -name libtbb.so* -print -quit)):$LD_LIBRARY_PATH OCL_ICD_FILENAMES=$(cat /etc/OpenCL/vendors/intel64.icd) CHIP_DEVICE_TYPE=cpu POCL_KERNEL_CACHE=0" >> $GITHUB_ENV | |
| - name: Set OPENCL_ENV for pocl | |
| if: matrix.backend == 'pocl' | |
| run: echo "OPENCL_ENV=OPENCL_VENDOR_PATH=$HOME/opt/pocl/${{ matrix.pocl-version }}-${{ matrix.llvm-version }}/etc/OpenCL/vendors/ LD_LIBRARY_PATH=$HOME/opt/llvm/${{ matrix.llvm-version }}/lib:\$LD_LIBRARY_PATH CHIP_DEVICE_TYPE=pocl POCL_KERNEL_CACHE=0" >> $GITHUB_ENV | |
| - uses: actions/checkout@v3 | |
| with: | |
| submodules: true | |
| - uses: actions/cache@v3 | |
| id: spirv-tools | |
| env: | |
| cache-name: cache-spirv-tools | |
| with: | |
| path: ~/opt/SPIRV-Tools/v2023.2 | |
| key: ${{ runner.os }}-build-${{ env.cache-name }} | |
| fail-on-cache-miss: true | |
| - id: get-shas | |
| uses: ./.github/actions/get-shas | |
| with: | |
| pocl-version: ${{ matrix.pocl-version }} | |
| llvm-version: ${{ matrix.llvm-version }} | |
| - uses: actions/cache@v3 | |
| id: llvm | |
| env: | |
| cache-name: cache-llvm-${{ matrix.llvm-version }} | |
| with: | |
| path: ~/opt/llvm/${{ matrix.llvm-version }} | |
| key: ${{ runner.os }}-build-cache-llvm-${{ matrix.llvm-version }}-release-${{ matrix.llvm-version }}.x-dynamic | |
| fail-on-cache-miss: true | |
| - uses: actions/cache@v3 | |
| id: pocl | |
| env: | |
| cache-name: cache-pocl-${{ matrix.pocl-version }}-llvm-${{ matrix.llvm-version }} | |
| with: | |
| path: ~/opt/pocl/${{ matrix.pocl-version }}-${{ matrix.llvm-version }} | |
| key: ${{ steps.get-shas.outputs.pocl-cache-key }} | |
| fail-on-cache-miss: true | |
| - name: Check PoCL Installation | |
| run: ls $HOME/opt/pocl/${{ matrix.pocl-version }}-${{ matrix.llvm-version }} | |
| if: ${{ matrix.backend == 'pocl' }} | |
| - run: wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | gpg --dearmor | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null | |
| if: ${{ matrix.backend == 'intel' }} | |
| - run: echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list | |
| if: ${{ matrix.backend == 'intel' }} | |
| - run: sudo add-apt-repository ppa:ocl-icd/ppa | |
| if: ${{ matrix.backend == 'pocl' || matrix.backend == 'intel' }} | |
| - run: sudo apt update | |
| - run: sudo apt install -y python3-dev libpython3-dev build-essential cmake git pkg-config make ninja-build libhwloc-dev zlib1g zlib1g-dev clinfo dialog apt-utils libxml2-dev ${{ matrix.backend == 'intel' && 'intel-oneapi-compiler-dpcpp-cpp intel-oneapi-runtime-opencl ocl-icd-opencl-dev' || 'ocl-icd-libopencl1 ocl-icd-dev ocl-icd-opencl-dev' }} | |
| - name: Verify PoCL is available | |
| if: matrix.backend == 'pocl' | |
| run: | | |
| echo "Checking PoCL installation..." | |
| ls -la $HOME/opt/pocl/${{ matrix.pocl-version }}-${{ matrix.llvm-version }}/etc/OpenCL/vendors/ || { echo "ERROR: PoCL vendors directory not found!"; exit 1; } | |
| cat $HOME/opt/pocl/${{ matrix.pocl-version }}-${{ matrix.llvm-version }}/etc/OpenCL/vendors/*.icd || { echo "ERROR: No ICD files found!"; exit 1; } | |
| echo "Running clinfo to verify PoCL..." | |
| ${{ env.OPENCL_ENV }} clinfo | head -50 | |
| ${{ env.OPENCL_ENV }} clinfo | grep -i "Portable Computing Language" || { echo "ERROR: PoCL platform not found in clinfo!"; exit 1; } | |
| echo "PoCL verification passed!" | |
| - run: ${{ env.OPENCL_ENV }} clinfo | |
| if: matrix.backend == 'intel' | |
| - run: mkdir -p build | |
| - name: CMake | |
| run: ${{ env.OPENCL_ENV }} cmake .. -DLLVM_CONFIG_BIN=$HOME/opt/llvm/${{ matrix.llvm-version }}/bin/llvm-config -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=$HOME/opt/SPIRV-Tools/v2023.2 -DCHIP_BUILD_SAMPLES=ON -DCHIP_BUILD_TESTS=ON | |
| working-directory: build | |
| - name: Build | |
| run: ${{ env.OPENCL_ENV }} cmake --build . --parallel 4 | |
| working-directory: build | |
| - name: Build Tests | |
| run: ${{ env.OPENCL_ENV }} cmake --build . --parallel 4 --target build_tests | |
| working-directory: build | |
| - name: Test OpenCL | |
| run: ${{ env.OPENCL_ENV }} ctest --timeout 180 --output-on-failure -E ${{ env.EXCLUDE }} | |
| working-directory: build | |
| - uses: actions/upload-artifact@v4 | |
| if: failure() | |
| with: | |
| name: build-and-check-${{ matrix.backend }}-pocl-${{ matrix.pocl-version }}-llvm-${{ matrix.llvm-version }} | |
| path: build/Testing/Temporary/LastTest.log |