From 7f5fe465671664f09bc58500949974564beb36d6 Mon Sep 17 00:00:00 2001 From: sbalint98 Date: Tue, 26 Apr 2022 01:28:57 +0200 Subject: [PATCH 01/17] Initial CI for hipSYCL --- .github/workflows/linux.yml | 82 +++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 .github/workflows/linux.yml diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml new file mode 100644 index 000000000..ef9a9c617 --- /dev/null +++ b/.github/workflows/linux.yml @@ -0,0 +1,82 @@ +name: Linux build and test + +on: [push, pull_request] + +jobs: + test-clang-based: + name: clang ${{ matrix.clang_version }}, ${{ matrix.os }}, CUDA ${{matrix.cuda}} + runs-on: ${{ matrix.os }} + strategy: + matrix: + clang_version: [13] + rocm_version: ['5.1.1'] + os: [ubuntu-20.04, ubuntu-18.04] + cuda: [11.0] + steps: + - uses: actions/checkout@v2 + with: + submodules: 'recursive' + - name: install CUDA 11.0 + if: matrix.cuda == 11.0 + run: | + mkdir -p /opt/hipSYCL/cuda + wget -q -O cuda.sh http://developer.download.nvidia.com/compute/cuda/11.0.2/local_installers/cuda_11.0.2_450.51.05_linux.run + sudo sh ./cuda.sh --override --silent --toolkit --no-man-page --no-drm --no-opengl-libs --installpath=/opt/hipSYCL/cuda || true + echo "CUDA Version 11.0.0" | sudo tee /opt/hipSYCL/cuda/version.txt + - name: install ROCm + run: | + sudo apt install libnuma-dev cmake unzip + wget -q -O - https://repo.radeon.com/rocm/rocm.gpg.key | sudo apt-key add - + echo 'deb [arch=amd64] https://repo.radeon.com/rocm/apt/${{matrix.rocm_version}} xenial main' | sudo tee /etc/apt/sources.list.d/rocm.list + sudo apt update + sudo apt install rocm-dev + - name: install LLVM + run: | + wget https://apt.llvm.org/llvm.sh + chmod +x llvm.sh + sudo ./llvm.sh ${{matrix.clang_version}} + sudo apt install libclang-${{matrix.clang_version}}-dev clang-tools-${{matrix.clang_version}} libomp-${{matrix.clang_version}}-dev + - name: install boost (from source) + if: matrix.os == 'ubuntu-18.04' + run: | + wget -q https://boostorg.jfrog.io/artifactory/main/release/1.70.0/source/boost_1_70_0.zip + unzip boost_1_70_0.zip + cd boost_1_70_0 + ./bootstrap.sh --prefix=/usr + sudo ./b2 link=static,shared install -j$(nproc) || true + cd .. + - name: install boost (from apt) + if: matrix.os == 'ubuntu-20.04' + run: | + sudo apt install libboost-all-dev + - name: build hipSYCL + run: | + git clone https://github.com/illuhad/hipSYCL.git + cd hipSYCL + mkdir build && cd build + cmake -DCMAKE_CXX_COMPILER=/usr/bin/clang++-${{matrix.clang_version}} -DCLANG_EXECUTABLE_PATH=/usr/bin/clang++-${{matrix.clang_version}} -DLLVM_DIR=/usr/lib/llvm-${{matrix.clang_version}}/cmake -DWITH_CUDA_BACKEND=ON -DWITH_ROCM_BACKEND=ON -DWITH_LEVEL_ZERO_BACKEND=ON -DCMAKE_INSTALL_PREFIX=`pwd`/install -DCUDA_TOOLKIT_ROOT_DIR=/opt/hipSYCL/cuda -DROCM_PATH=/opt/rocm .. + make -j2 install + cp /opt/hipSYCL/cuda/lib64/stubs/libcuda.so `pwd`/install/lib/libcuda.so + cp /opt/hipSYCL/cuda/lib64/stubs/libcuda.so `pwd`/install/lib/libcuda.so.1 + - name: build CPU tests + run: | + mkdir /home/runner/work/hipSYCL/hipSYCL/build/tests-cpu + cd /home/runner/work/hipSYCL/hipSYCL/build/tests-cpu + cmake -DHIPSYCL_TARGETS="omp" -DhipSYCL_DIR=/home/runner/work/hipSYCL/hipSYCL/build/install/lib/cmake/hipSYCL /home/runner/work/hipSYCL/hipSYCL/tests + make -j2 + - name: build CUDA tests + run: | + mkdir /home/runner/work/hipSYCL/hipSYCL/build/tests-cuda + cd /home/runner/work/hipSYCL/hipSYCL/build/tests-cuda + cmake -DHIPSYCL_TARGETS="cuda:sm_60" -DhipSYCL_DIR=/home/runner/work/hipSYCL/hipSYCL/build/install/lib/cmake/hipSYCL /home/runner/work/hipSYCL/hipSYCL/tests + make -j2 + - name: build ROCm tests + run: | + mkdir /home/runner/work/hipSYCL/hipSYCL/build/tests-rocm + cd /home/runner/work/hipSYCL/hipSYCL/build/tests-rocm + cmake -DHIPSYCL_PLATFORM=rocm -DHIPSYCL_GPU_ARCH=gfx906 -DhipSYCL_DIR=/home/runner/work/hipSYCL/hipSYCL/build/install/lib/cmake/hipSYCL /home/runner/work/hipSYCL/hipSYCL/tests + make -j2 + - name: run CPU tests + run: | + cd /home/runner/work/hipSYCL/hipSYCL/build/tests-cpu + LD_LIBRARY_PATH=/home/runner/work/hipSYCL/hipSYCL/build/install/lib ./sycl_tests From 111e5fb797956e466eb0496c920ebbc313eafe28 Mon Sep 17 00:00:00 2001 From: sbalint98 Date: Tue, 26 Apr 2022 01:34:20 +0200 Subject: [PATCH 02/17] only test bionic --- .github/workflows/linux.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index ef9a9c617..3a76cdf05 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -9,8 +9,8 @@ jobs: strategy: matrix: clang_version: [13] - rocm_version: ['5.1.1'] - os: [ubuntu-20.04, ubuntu-18.04] + rocm_version: ['5.1.0'] + os: [ubuntu-20.04] cuda: [11.0] steps: - uses: actions/checkout@v2 From 8dfca221ac185bc055be593670e5d5eaa36bc153 Mon Sep 17 00:00:00 2001 From: sbalint98 Date: Tue, 26 Apr 2022 01:42:21 +0200 Subject: [PATCH 03/17] use the bionic repo --- .github/workflows/linux.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 3a76cdf05..b67576db4 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -27,7 +27,7 @@ jobs: run: | sudo apt install libnuma-dev cmake unzip wget -q -O - https://repo.radeon.com/rocm/rocm.gpg.key | sudo apt-key add - - echo 'deb [arch=amd64] https://repo.radeon.com/rocm/apt/${{matrix.rocm_version}} xenial main' | sudo tee /etc/apt/sources.list.d/rocm.list + echo 'deb [arch=amd64] https://repo.radeon.com/rocm/apt/${{matrix.rocm_version}} bionic main' | sudo tee /etc/apt/sources.list.d/rocm.list sudo apt update sudo apt install rocm-dev - name: install LLVM From 103ffb689f6c44557a78375b99950ea11c05e023 Mon Sep 17 00:00:00 2001 From: Balint Soproni Date: Sun, 15 May 2022 12:10:32 +0200 Subject: [PATCH 04/17] Use rocm 5.1.1 --- .github/workflows/linux.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index b67576db4..b3158edc5 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -9,13 +9,20 @@ jobs: strategy: matrix: clang_version: [13] - rocm_version: ['5.1.0'] + rocm_version: ['5.1.1'] os: [ubuntu-20.04] cuda: [11.0] steps: - uses: actions/checkout@v2 with: submodules: 'recursive' + - name: install ROCm + run: | + sudo apt install libnuma-dev cmake unzip + wget -q -O - https://repo.radeon.com/rocm/rocm.gpg.key | sudo apt-key add - + echo 'deb [arch=amd64] https://repo.radeon.com/rocm/apt/${{matrix.rocm_version}}/ ubuntu main' | sudo tee /etc/apt/sources.list.d/rocm.list + sudo apt update + sudo apt install rocm-dev - name: install CUDA 11.0 if: matrix.cuda == 11.0 run: | @@ -23,13 +30,6 @@ jobs: wget -q -O cuda.sh http://developer.download.nvidia.com/compute/cuda/11.0.2/local_installers/cuda_11.0.2_450.51.05_linux.run sudo sh ./cuda.sh --override --silent --toolkit --no-man-page --no-drm --no-opengl-libs --installpath=/opt/hipSYCL/cuda || true echo "CUDA Version 11.0.0" | sudo tee /opt/hipSYCL/cuda/version.txt - - name: install ROCm - run: | - sudo apt install libnuma-dev cmake unzip - wget -q -O - https://repo.radeon.com/rocm/rocm.gpg.key | sudo apt-key add - - echo 'deb [arch=amd64] https://repo.radeon.com/rocm/apt/${{matrix.rocm_version}} bionic main' | sudo tee /etc/apt/sources.list.d/rocm.list - sudo apt update - sudo apt install rocm-dev - name: install LLVM run: | wget https://apt.llvm.org/llvm.sh From dc045a58db50bf36f38017b060c371ff336745be Mon Sep 17 00:00:00 2001 From: Balint Soproni Date: Sun, 15 May 2022 12:34:26 +0200 Subject: [PATCH 05/17] WIP --- .github/workflows/linux.yml | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index b3158edc5..2bb57e65d 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -5,7 +5,7 @@ on: [push, pull_request] jobs: test-clang-based: name: clang ${{ matrix.clang_version }}, ${{ matrix.os }}, CUDA ${{matrix.cuda}} - runs-on: ${{ matrix.os }} + runs-on: ubuntu-20.04 strategy: matrix: clang_version: [13] @@ -54,7 +54,7 @@ jobs: git clone https://github.com/illuhad/hipSYCL.git cd hipSYCL mkdir build && cd build - cmake -DCMAKE_CXX_COMPILER=/usr/bin/clang++-${{matrix.clang_version}} -DCLANG_EXECUTABLE_PATH=/usr/bin/clang++-${{matrix.clang_version}} -DLLVM_DIR=/usr/lib/llvm-${{matrix.clang_version}}/cmake -DWITH_CUDA_BACKEND=ON -DWITH_ROCM_BACKEND=ON -DWITH_LEVEL_ZERO_BACKEND=ON -DCMAKE_INSTALL_PREFIX=`pwd`/install -DCUDA_TOOLKIT_ROOT_DIR=/opt/hipSYCL/cuda -DROCM_PATH=/opt/rocm .. + cmake -DCMAKE_CXX_COMPILER=/usr/bin/clang++-${{matrix.clang_version}} -DCLANG_EXECUTABLE_PATH=/usr/bin/clang++-${{matrix.clang_version}} -DLLVM_DIR=/usr/lib/llvm-${{matrix.clang_version}}/cmake -DWITH_CUDA_BACKEND=ON -DWITH_ROCM_BACKEND=ON -DWITH_LEVEL_ZERO_BACKEND=OFF -DCMAKE_INSTALL_PREFIX=`pwd`/install -DCUDA_TOOLKIT_ROOT_DIR=/opt/hipSYCL/cuda -DROCM_PATH=/opt/rocm .. make -j2 install cp /opt/hipSYCL/cuda/lib64/stubs/libcuda.so `pwd`/install/lib/libcuda.so cp /opt/hipSYCL/cuda/lib64/stubs/libcuda.so `pwd`/install/lib/libcuda.so.1 @@ -80,3 +80,32 @@ jobs: run: | cd /home/runner/work/hipSYCL/hipSYCL/build/tests-cpu LD_LIBRARY_PATH=/home/runner/work/hipSYCL/hipSYCL/build/install/lib ./sycl_tests + + test-dpcpp-based: + name: Test dpcpp based compilation + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + with: + submodules: 'recursive' + - name: Install dpcpp + run: | + wget https://registrationcenter-download.intel.com/akdlm/irc_nas/18236/l_BaseKit_p_2021.4.0.3422.sh + bash l_BaseKit_p_2021.4.0.3422.sh \ + -a --action install \ + -s --eula accept \ + --components=\ + intel.oneapi.lin.tbb.devel:\ + intel.oneapi.lin.dpcpp-cpp-compiler:\ + intel.oneapi.lin.mkl.devel \ + --install-dir /opt/intel/ \ + --download-dir /opt/intel/dw/ \ + --download-cache /opt/intel/dw/ \ + --package-path /opt/intel/intel + + - name: Clone oneMKL + run: | + git clone https://github.com/oneapi-src/oneMKL.git + + + From e22260d0d79022543bdd6d5eb1f388ef121d0afa Mon Sep 17 00:00:00 2001 From: Nils Friess Date: Mon, 4 Jul 2022 15:39:06 +0200 Subject: [PATCH 06/17] Update github CI workflow file to test compilation of oneMKL with hipSYCL on Ubuntu 18.04 and 20.04 Squashed commit of the following: commit 5ee7dd15541555e11ec0277daf5954548703e3b8 Author: Nils Friess Date: Thu Jun 30 11:44:57 2022 +0200 Also test on Ubuntu 18.04 (requires installing boost from source) commit 4cfe3aa5d8fc0935bd936457f60b7af55f908677 Author: Nils Friess Date: Thu Jun 23 22:49:30 2022 +0200 Renamed workflow file commit 911b977b26454e42dfafd75bb739f040ede39b0d Author: Nils Friess Date: Thu Jun 23 22:22:39 2022 +0200 Run also on pull requests commit 18670fa00d8aa610d3a82203e98fa14b5eb32572 Author: Nils Friess Date: Thu Jun 23 22:08:56 2022 +0200 Revert "Also test on Ubuntu 22.04 LTS" This reverts commit 1912951991ffc9649d1c5966bcdcee3737260907. ROCm currently cannot be installed on 22.04. commit 1912951991ffc9649d1c5966bcdcee3737260907 Author: Nils Friess Date: Thu Jun 23 22:02:05 2022 +0200 Also test on Ubuntu 22.04 LTS commit 2aca44b6e8319af8f2cde7387d95481e64df9eb6 Author: Nils Friess Date: Thu Jun 23 22:01:41 2022 +0200 Format and remove unused flags etc. commit c976018a4471f888c8428f762a2fefa00b59bd43 Author: Nils Friess Date: Tue Jun 21 11:13:31 2022 +0200 Fix typo in CMake command commit 716a3ff7458ea359d410c0b5a458120d5a28c949 Author: Nils Friess Date: Tue Jun 21 11:04:53 2022 +0200 Update apt sources before installing boost commit 78c0b743dc06a79c6ca08bf72247ef2438a35162 Author: Nils Friess Date: Tue Jun 21 10:51:38 2022 +0200 Remove commands to install tbb and mkl since they are not necessary commit c3b1abd4be47571210ba14ad6078b27857df599b Author: Nils Friess Date: Mon Jun 20 14:25:29 2022 +0200 Run cmake install as sudo commit 7f4ddbdd99dc7e1b1a5d6382127cfb80af1ff14d Author: Nils Friess Date: Mon Jun 20 14:15:49 2022 +0200 Add path to lapack in cmake command commit 33d23a513eea8820367fdf3cf2b6a1f76be1f8f1 Author: Nils Friess Date: Mon Jun 20 14:12:42 2022 +0200 Install LAPACK from source commit f87e0403daf2316cc0ccc7a72e5f33d5f4be50fa Author: Nils Friess Date: Mon Jun 20 13:53:46 2022 +0200 Add command to build oneMKL commit 159db623cfa00fc23c710ed28e9e0fae073f3d35 Author: Nils Friess Date: Mon Jun 20 13:53:18 2022 +0200 Fix typo in cmake flag commit 4d50f8b4315e86ee5d2bbf64b4c1e09d6ca4d836 Author: Nils Friess Date: Sun Jun 19 13:58:20 2022 +0200 Add command to install CBLAS (for simplicity we install libatlas) commit 3527cd8497ecf7631c7bebed56f2cc864a8c0d72 Author: Nils Friess Date: Sun Jun 19 13:43:03 2022 +0200 Add command to install cblas commit 4a6906c7774774ca60ee2f2f1378dab623527e1f Author: Nils Friess Date: Sun Jun 19 13:28:53 2022 +0200 Add path to cmake config of hsa-runtime64 as env variable commit f6f62a9e73803d8aa588fdeb4d0707432fcbb9d5 Author: Nils Friess Date: Sun Jun 19 13:15:35 2022 +0200 Add path to amd_comgr cmake config as env variable commit 6fd04a0b068a20672794dc154e473e8a823d3c58 Author: Nils Friess Date: Sun Jun 19 12:52:27 2022 +0200 Add path to cmake config for AMDDeviceLibs as env variable commit d9fc104311a5103c9fc923929cfd8af75e4df708 Author: Nils Friess Date: Sun Jun 19 12:41:25 2022 +0200 Add path to hip cmake config as environment variable commit 51253682ef53dc9d702ddb41fb1a3bbdd71e1003 Author: Nils Friess Date: Sun Jun 19 12:32:52 2022 +0200 Install rocblas together with rocm commit 483bdc6955601c1434b0e9b0bc0f0759d8becff9 Author: Nils Friess Date: Sun Jun 19 12:23:05 2022 +0200 Add rocblas_DIR to cmake command commit fa58d4b059ced816ea4f6f5fa3ef69b173f8b178 Author: Nils Friess Date: Sun Jun 19 12:13:32 2022 +0200 Add rocBLAS CMake config path as environment variable commit 52065e92048cff5690c82a103c06e3c2dd5df157 Author: Nils Friess Date: Sun Jun 19 11:00:08 2022 +0200 Fix hipSYCL build paths commit bd79ccfe5d60c44248ed5f7418ffa8ccc7cda590 Author: Nils Friess Date: Sun Jun 19 10:45:27 2022 +0200 Add commands for building oneMKL commit 4b44a683f07158cced1decc09ad00db0c0b58d9c Merge: be11ced 6b95323 Author: Nils Friess Date: Wed Jun 8 23:26:20 2022 +0200 Merge branch 'github-ci-test' of github.com:nilsfriess/oneMKL into github-ci-test commit be11cedeef7f5bd97f49208bda7289f43ab2e0a5 Author: Nils Friess Date: Wed Jun 8 23:23:11 2022 +0200 Add hipsycl build (including setup for CUDA and ROCm) commit 6b953239c97117a5041801319479491fb18878c7 Author: Nils Friess Date: Wed Jun 8 23:20:41 2022 +0200 Remove sudo and add hipsycl build commit 8378aba8affaee6a42a96c79ac29cc95639165bb Author: Nils Friess Date: Wed Jun 8 23:03:34 2022 +0200 Add github workflow test file --- .github/workflows/linux.yml | 127 +++++++++++++++--------------------- 1 file changed, 54 insertions(+), 73 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 2bb57e65d..f4d485787 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -1,17 +1,16 @@ -name: Linux build and test +name: Build tests with hipSYCL on: [push, pull_request] jobs: - test-clang-based: - name: clang ${{ matrix.clang_version }}, ${{ matrix.os }}, CUDA ${{matrix.cuda}} - runs-on: ubuntu-20.04 + test-with-hipsycl: + name: Run tests with hipSYCL strategy: matrix: clang_version: [13] rocm_version: ['5.1.1'] - os: [ubuntu-20.04] - cuda: [11.0] + os: [ubuntu-20.04, ubuntu-18.04] + runs-on: ${{matrix.os}} steps: - uses: actions/checkout@v2 with: @@ -22,90 +21,72 @@ jobs: wget -q -O - https://repo.radeon.com/rocm/rocm.gpg.key | sudo apt-key add - echo 'deb [arch=amd64] https://repo.radeon.com/rocm/apt/${{matrix.rocm_version}}/ ubuntu main' | sudo tee /etc/apt/sources.list.d/rocm.list sudo apt update - sudo apt install rocm-dev - - name: install CUDA 11.0 - if: matrix.cuda == 11.0 - run: | - mkdir -p /opt/hipSYCL/cuda - wget -q -O cuda.sh http://developer.download.nvidia.com/compute/cuda/11.0.2/local_installers/cuda_11.0.2_450.51.05_linux.run - sudo sh ./cuda.sh --override --silent --toolkit --no-man-page --no-drm --no-opengl-libs --installpath=/opt/hipSYCL/cuda || true - echo "CUDA Version 11.0.0" | sudo tee /opt/hipSYCL/cuda/version.txt + sudo apt install rocm-dev rocblas - name: install LLVM run: | wget https://apt.llvm.org/llvm.sh chmod +x llvm.sh sudo ./llvm.sh ${{matrix.clang_version}} sudo apt install libclang-${{matrix.clang_version}}-dev clang-tools-${{matrix.clang_version}} libomp-${{matrix.clang_version}}-dev - - name: install boost (from source) + - name: install boost from apt + if: matrix.os == 'ubuntu-20.04' + run: | + sudo apt update + sudo apt install libboost-all-dev + - name: install boost from source if: matrix.os == 'ubuntu-18.04' run: | + cd wget -q https://boostorg.jfrog.io/artifactory/main/release/1.70.0/source/boost_1_70_0.zip unzip boost_1_70_0.zip cd boost_1_70_0 ./bootstrap.sh --prefix=/usr - sudo ./b2 link=static,shared install -j$(nproc) || true - cd .. - - name: install boost (from apt) - if: matrix.os == 'ubuntu-20.04' - run: | - sudo apt install libboost-all-dev + ./b2 + sudo ./b2 install -j4 - name: build hipSYCL run: | + cd git clone https://github.com/illuhad/hipSYCL.git cd hipSYCL mkdir build && cd build - cmake -DCMAKE_CXX_COMPILER=/usr/bin/clang++-${{matrix.clang_version}} -DCLANG_EXECUTABLE_PATH=/usr/bin/clang++-${{matrix.clang_version}} -DLLVM_DIR=/usr/lib/llvm-${{matrix.clang_version}}/cmake -DWITH_CUDA_BACKEND=ON -DWITH_ROCM_BACKEND=ON -DWITH_LEVEL_ZERO_BACKEND=OFF -DCMAKE_INSTALL_PREFIX=`pwd`/install -DCUDA_TOOLKIT_ROOT_DIR=/opt/hipSYCL/cuda -DROCM_PATH=/opt/rocm .. - make -j2 install - cp /opt/hipSYCL/cuda/lib64/stubs/libcuda.so `pwd`/install/lib/libcuda.so - cp /opt/hipSYCL/cuda/lib64/stubs/libcuda.so `pwd`/install/lib/libcuda.so.1 - - name: build CPU tests - run: | - mkdir /home/runner/work/hipSYCL/hipSYCL/build/tests-cpu - cd /home/runner/work/hipSYCL/hipSYCL/build/tests-cpu - cmake -DHIPSYCL_TARGETS="omp" -DhipSYCL_DIR=/home/runner/work/hipSYCL/hipSYCL/build/install/lib/cmake/hipSYCL /home/runner/work/hipSYCL/hipSYCL/tests - make -j2 - - name: build CUDA tests - run: | - mkdir /home/runner/work/hipSYCL/hipSYCL/build/tests-cuda - cd /home/runner/work/hipSYCL/hipSYCL/build/tests-cuda - cmake -DHIPSYCL_TARGETS="cuda:sm_60" -DhipSYCL_DIR=/home/runner/work/hipSYCL/hipSYCL/build/install/lib/cmake/hipSYCL /home/runner/work/hipSYCL/hipSYCL/tests - make -j2 - - name: build ROCm tests - run: | - mkdir /home/runner/work/hipSYCL/hipSYCL/build/tests-rocm - cd /home/runner/work/hipSYCL/hipSYCL/build/tests-rocm - cmake -DHIPSYCL_PLATFORM=rocm -DHIPSYCL_GPU_ARCH=gfx906 -DhipSYCL_DIR=/home/runner/work/hipSYCL/hipSYCL/build/install/lib/cmake/hipSYCL /home/runner/work/hipSYCL/hipSYCL/tests - make -j2 - - name: run CPU tests + cmake -DCMAKE_CXX_COMPILER=/usr/bin/clang++-${{matrix.clang_version}} \ + -DCLANG_EXECUTABLE_PATH=/usr/bin/clang++-${{matrix.clang_version}} \ + -DLLVM_DIR=/usr/lib/llvm-${{matrix.clang_version}}/cmake \ + -DWITH_CUDA_BACKEND=OFF \ + -DWITH_ROCM_BACKEND=ON \ + -DWITH_LEVEL_ZERO_BACKEND=OFF \ + -DCMAKE_INSTALL_PREFIX=/opt/hipSYCL \ + -DROCM_PATH=/opt/rocm-${{matrix.rocm_version}} .. + make -j4 install + - name: install LAPACK (for CBLAS) run: | - cd /home/runner/work/hipSYCL/hipSYCL/build/tests-cpu - LD_LIBRARY_PATH=/home/runner/work/hipSYCL/hipSYCL/build/install/lib ./sycl_tests - - test-dpcpp-based: - name: Test dpcpp based compilation - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v2 - with: - submodules: 'recursive' - - name: Install dpcpp - run: | - wget https://registrationcenter-download.intel.com/akdlm/irc_nas/18236/l_BaseKit_p_2021.4.0.3422.sh - bash l_BaseKit_p_2021.4.0.3422.sh \ - -a --action install \ - -s --eula accept \ - --components=\ - intel.oneapi.lin.tbb.devel:\ - intel.oneapi.lin.dpcpp-cpp-compiler:\ - intel.oneapi.lin.mkl.devel \ - --install-dir /opt/intel/ \ - --download-dir /opt/intel/dw/ \ - --download-cache /opt/intel/dw/ \ - --package-path /opt/intel/intel - - - name: Clone oneMKL + cd + git clone https://github.com/Reference-LAPACK/lapack.git + cd lapack + mkdir build && cd build + cmake -DCMAKE_INSTALL_LIBDIR=/opt/lapack -DBUILD_SHARED_LIBS=ON -DCBLAS=ON .. + sudo cmake --build . -j --target install + - name: clone and build oneMKL + env: + rocblas_DIR: /opt/rocm-${{matrix.rocm_version}}/lib/cmake/rocblas/ + hip_DIR: /opt/rocm-${{matrix.rocm_version}}/lib/cmake/hip/ + AMDDeviceLibs_DIR: /opt/rocm-${{matrix.rocm_version}}/lib/cmake/AMDDeviceLibs/ + amd_comgr_DIR: /opt/rocm-${{matrix.rocm_version}}/lib/cmake/amd_comgr/ + hsa-runtime64_DIR: /opt/rocm-${{matrix.rocm_version}}/lib/cmake/hsa-runtime64/ run: | + cd git clone https://github.com/oneapi-src/oneMKL.git - - - + cd oneMKL + mkdir build + cd build + cmake -DENABLE_CUBLAS_BACKEND=False \ + -DENABLE_MKLGPU_BACKEND=False \ + -DENABLE_MKLCPU_BACKEND=False \ + -DENABLE_NETLIB_BACKEND=False \ + -DENABLE_ROCBLAS_BACKEND=True \ + -DTARGET_DOMAINS=blas \ + -DHIPSYCL_TARGETS=omp\;hip:gfx906 \ + -DONEMKL_SYCL_IMPLEMENTATION=hipSYCL \ + -DREF_BLAS_ROOT=/opt/lapack/ .. + make -j8 + From a233732a083bcb0d2412d2037ee55219a0953b83 Mon Sep 17 00:00:00 2001 From: Sanchi Vaishnavi Date: Wed, 16 Nov 2022 16:01:49 +0000 Subject: [PATCH 07/17] Include Cuda backend. Tested on Ubuntu 20.04 ctest segfaults at ImatcopyBatchStrideTests --- .github/workflows/linux.yml | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index f4d485787..4e1568576 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -43,6 +43,11 @@ jobs: ./bootstrap.sh --prefix=/usr ./b2 sudo ./b2 install -j4 + - name: install CUDA + run: | + cd + wget https://developer.download.nvidia.com/compute/cuda/11.8.0/local_installers/cuda_11.8.0_520.61.05_linux.run + sudo sh cuda_11.8.0_520.61.05_linux.run --override --silent --toolkit - name: build hipSYCL run: | cd @@ -52,8 +57,8 @@ jobs: cmake -DCMAKE_CXX_COMPILER=/usr/bin/clang++-${{matrix.clang_version}} \ -DCLANG_EXECUTABLE_PATH=/usr/bin/clang++-${{matrix.clang_version}} \ -DLLVM_DIR=/usr/lib/llvm-${{matrix.clang_version}}/cmake \ - -DWITH_CUDA_BACKEND=OFF \ - -DWITH_ROCM_BACKEND=ON \ + -DWITH_CUDA_BACKEND=ON \ + -DWITH_ROCM_BACKEND=OFF \ -DWITH_LEVEL_ZERO_BACKEND=OFF \ -DCMAKE_INSTALL_PREFIX=/opt/hipSYCL \ -DROCM_PATH=/opt/rocm-${{matrix.rocm_version}} .. @@ -66,7 +71,7 @@ jobs: mkdir build && cd build cmake -DCMAKE_INSTALL_LIBDIR=/opt/lapack -DBUILD_SHARED_LIBS=ON -DCBLAS=ON .. sudo cmake --build . -j --target install - - name: clone and build oneMKL +- name: clone and build oneMKL env: rocblas_DIR: /opt/rocm-${{matrix.rocm_version}}/lib/cmake/rocblas/ hip_DIR: /opt/rocm-${{matrix.rocm_version}}/lib/cmake/hip/ @@ -79,11 +84,14 @@ jobs: cd oneMKL mkdir build cd build - cmake -DENABLE_CUBLAS_BACKEND=False \ + cmake -DCUDA_CUDA_LIBRARY=/usr/local/cuda-11.6/lib64/stubs/libcuda.so \ + -DENABLE_CUBLAS_BACKEND=True \ + -DENABLE_CURAND_BACKEND=False \ + -DENABLE_CUSOLVER_BACKEND=False \ -DENABLE_MKLGPU_BACKEND=False \ -DENABLE_MKLCPU_BACKEND=False \ -DENABLE_NETLIB_BACKEND=False \ - -DENABLE_ROCBLAS_BACKEND=True \ + -DENABLE_ROCBLAS_BACKEND=False \ -DTARGET_DOMAINS=blas \ -DHIPSYCL_TARGETS=omp\;hip:gfx906 \ -DONEMKL_SYCL_IMPLEMENTATION=hipSYCL \ From 3e91bff2952f885a9f63e30d431dfd49dde206d7 Mon Sep 17 00:00:00 2001 From: Sanchi Vaishnavi Date: Wed, 16 Nov 2022 16:30:44 +0000 Subject: [PATCH 08/17] convert tabs to spaces --- .github/workflows/linux.yml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 4e1568576..31d0add19 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -45,9 +45,9 @@ jobs: sudo ./b2 install -j4 - name: install CUDA run: | - cd - wget https://developer.download.nvidia.com/compute/cuda/11.8.0/local_installers/cuda_11.8.0_520.61.05_linux.run - sudo sh cuda_11.8.0_520.61.05_linux.run --override --silent --toolkit + cd + wget https://developer.download.nvidia.com/compute/cuda/11.8.0/local_installers/cuda_11.8.0_520.61.05_linux.run + sudo sh cuda_11.8.0_520.61.05_linux.run --override --silent --toolkit - name: build hipSYCL run: | cd @@ -85,9 +85,9 @@ jobs: mkdir build cd build cmake -DCUDA_CUDA_LIBRARY=/usr/local/cuda-11.6/lib64/stubs/libcuda.so \ - -DENABLE_CUBLAS_BACKEND=True \ - -DENABLE_CURAND_BACKEND=False \ - -DENABLE_CUSOLVER_BACKEND=False \ + -DENABLE_CUBLAS_BACKEND=True \ + -DENABLE_CURAND_BACKEND=False \ + -DENABLE_CUSOLVER_BACKEND=False \ -DENABLE_MKLGPU_BACKEND=False \ -DENABLE_MKLCPU_BACKEND=False \ -DENABLE_NETLIB_BACKEND=False \ @@ -97,4 +97,3 @@ jobs: -DONEMKL_SYCL_IMPLEMENTATION=hipSYCL \ -DREF_BLAS_ROOT=/opt/lapack/ .. make -j8 - From 29a73058486590d902552c1d58398b4ff518e84b Mon Sep 17 00:00:00 2001 From: Sanchi Vaishnavi Date: Wed, 16 Nov 2022 16:33:36 +0000 Subject: [PATCH 09/17] resolve a typo --- .github/workflows/linux.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 31d0add19..d5be3261b 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -70,7 +70,7 @@ jobs: cd lapack mkdir build && cd build cmake -DCMAKE_INSTALL_LIBDIR=/opt/lapack -DBUILD_SHARED_LIBS=ON -DCBLAS=ON .. - sudo cmake --build . -j --target install + sudo cmake --build . -j4 --target install - name: clone and build oneMKL env: rocblas_DIR: /opt/rocm-${{matrix.rocm_version}}/lib/cmake/rocblas/ From 559b3d712445a679cd2bdb09f4a5ca7a4dc54d58 Mon Sep 17 00:00:00 2001 From: Sanchi Vaishnavi Date: Wed, 16 Nov 2022 16:39:30 +0000 Subject: [PATCH 10/17] lapack change cmd for install --- .github/workflows/linux.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index d5be3261b..a6e97975e 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -70,7 +70,7 @@ jobs: cd lapack mkdir build && cd build cmake -DCMAKE_INSTALL_LIBDIR=/opt/lapack -DBUILD_SHARED_LIBS=ON -DCBLAS=ON .. - sudo cmake --build . -j4 --target install + sudo make -j4 install - name: clone and build oneMKL env: rocblas_DIR: /opt/rocm-${{matrix.rocm_version}}/lib/cmake/rocblas/ From 4b6a945d2f5747895d6ec34af5464a899a723c32 Mon Sep 17 00:00:00 2001 From: Sanchi Vaishnavi Date: Wed, 16 Nov 2022 16:52:34 +0000 Subject: [PATCH 11/17] fix indentation --- .github/workflows/linux.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index a6e97975e..a8c8d8fcb 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -70,8 +70,8 @@ jobs: cd lapack mkdir build && cd build cmake -DCMAKE_INSTALL_LIBDIR=/opt/lapack -DBUILD_SHARED_LIBS=ON -DCBLAS=ON .. - sudo make -j4 install -- name: clone and build oneMKL + make -j4 install + - name: clone and build oneMKL env: rocblas_DIR: /opt/rocm-${{matrix.rocm_version}}/lib/cmake/rocblas/ hip_DIR: /opt/rocm-${{matrix.rocm_version}}/lib/cmake/hip/ From e272d66070efd11e46833d813550ea1d8be0a271 Mon Sep 17 00:00:00 2001 From: Sanchi Vaishnavi Date: Thu, 17 Nov 2022 14:19:19 +0100 Subject: [PATCH 12/17] change to cmake build for lapack --- .github/workflows/linux.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index a8c8d8fcb..63c07bc9c 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -70,7 +70,7 @@ jobs: cd lapack mkdir build && cd build cmake -DCMAKE_INSTALL_LIBDIR=/opt/lapack -DBUILD_SHARED_LIBS=ON -DCBLAS=ON .. - make -j4 install + sudo cmake --build . -j --target install - name: clone and build oneMKL env: rocblas_DIR: /opt/rocm-${{matrix.rocm_version}}/lib/cmake/rocblas/ From 43c023d4507d643877e293bed954293d29d58e05 Mon Sep 17 00:00:00 2001 From: Sanchi Vaishnavi Date: Tue, 22 Nov 2022 15:27:08 +0000 Subject: [PATCH 13/17] fix typo in cuda version --- .github/workflows/linux.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 63c07bc9c..139384cd1 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -84,7 +84,7 @@ jobs: cd oneMKL mkdir build cd build - cmake -DCUDA_CUDA_LIBRARY=/usr/local/cuda-11.6/lib64/stubs/libcuda.so \ + cmake -DCUDA_CUDA_LIBRARY=/usr/local/cuda-11.8/lib64/stubs/libcuda.so \ -DENABLE_CUBLAS_BACKEND=True \ -DENABLE_CURAND_BACKEND=False \ -DENABLE_CUSOLVER_BACKEND=False \ From 3888d38532e066827a80d7c9839e4af1c032858c Mon Sep 17 00:00:00 2001 From: Sanchi Vaishnavi Date: Wed, 23 Nov 2022 17:53:16 +0100 Subject: [PATCH 14/17] downgrade cuda version to 11.6 --- .github/workflows/linux.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 139384cd1..c1ab2f1a1 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -45,9 +45,15 @@ jobs: sudo ./b2 install -j4 - name: install CUDA run: | - cd - wget https://developer.download.nvidia.com/compute/cuda/11.8.0/local_installers/cuda_11.8.0_520.61.05_linux.run - sudo sh cuda_11.8.0_520.61.05_linux.run --override --silent --toolkit + cd + wget https://developer.download.nvidia.com/compute/cuda/11.6.0/local_installers/cuda_11.6.0_510.39.01_linux.run + sudo sh cuda_11.6.0_510.39.01_linux.run --override --silent --toolkit + cd + - name: test CUDA and cuBLAS + run: | + /usr/local/cuda/bin/nvcc --version + cat /usr/local/cuda/version.json + cat /usr/local/cuda/include/cublas.h | grep CUBLAS - name: build hipSYCL run: | cd @@ -84,7 +90,7 @@ jobs: cd oneMKL mkdir build cd build - cmake -DCUDA_CUDA_LIBRARY=/usr/local/cuda-11.8/lib64/stubs/libcuda.so \ + cmake -DCUDA_CUDA_LIBRARY=/usr/local/cuda-11.6/lib64/stubs/libcuda.so \ -DENABLE_CUBLAS_BACKEND=True \ -DENABLE_CURAND_BACKEND=False \ -DENABLE_CUSOLVER_BACKEND=False \ From 329f613532425a2106e6b90389ab47c5001c857c Mon Sep 17 00:00:00 2001 From: Sanchi Vaishnavi Date: Wed, 23 Nov 2022 18:12:12 +0100 Subject: [PATCH 15/17] update hipsycl target --- .github/workflows/linux.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index c1ab2f1a1..dd526277e 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -99,7 +99,7 @@ jobs: -DENABLE_NETLIB_BACKEND=False \ -DENABLE_ROCBLAS_BACKEND=False \ -DTARGET_DOMAINS=blas \ - -DHIPSYCL_TARGETS=omp\;hip:gfx906 \ + -DHIPSYCL_TARGETS=omp\;cuda:sm_61\ -DONEMKL_SYCL_IMPLEMENTATION=hipSYCL \ -DREF_BLAS_ROOT=/opt/lapack/ .. make -j8 From d03712a2da96d18ab3ec01d73edcb9ea40d5b151 Mon Sep 17 00:00:00 2001 From: Sanchi Vaishnavi Date: Tue, 29 Nov 2022 16:46:22 +0100 Subject: [PATCH 16/17] add path to clang --- .github/workflows/linux.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index dd526277e..8c3f4b4c3 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -68,7 +68,7 @@ jobs: -DWITH_LEVEL_ZERO_BACKEND=OFF \ -DCMAKE_INSTALL_PREFIX=/opt/hipSYCL \ -DROCM_PATH=/opt/rocm-${{matrix.rocm_version}} .. - make -j4 install + make -j2 install - name: install LAPACK (for CBLAS) run: | cd @@ -90,7 +90,10 @@ jobs: cd oneMKL mkdir build cd build - cmake -DCUDA_CUDA_LIBRARY=/usr/local/cuda-11.6/lib64/stubs/libcuda.so \ + cmake \ + -DCMAKE_CXX_COMPILER=/usr/bin/clang++-${{matrix.clang_version}} \ + -DCMAKE_C_COMPILER=/usr/bin/clang-${{matrix.clang_version}} \ + -DCUDA_CUDA_LIBRARY=/usr/local/cuda-11.6/lib64/stubs/libcuda.so \ -DENABLE_CUBLAS_BACKEND=True \ -DENABLE_CURAND_BACKEND=False \ -DENABLE_CUSOLVER_BACKEND=False \ @@ -102,4 +105,6 @@ jobs: -DHIPSYCL_TARGETS=omp\;cuda:sm_61\ -DONEMKL_SYCL_IMPLEMENTATION=hipSYCL \ -DREF_BLAS_ROOT=/opt/lapack/ .. - make -j8 + cmake --build . -j2 + ctest + cmake --install . --prefix /usr From 784babff126c4408846fc5d01c35c6b18e259282 Mon Sep 17 00:00:00 2001 From: Sanchi Vaishnavi Date: Mon, 5 Dec 2022 13:31:58 +0100 Subject: [PATCH 17/17] path to cuda --- .github/workflows/linux.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 8c3f4b4c3..dc01307b5 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -9,6 +9,7 @@ jobs: matrix: clang_version: [13] rocm_version: ['5.1.1'] + cuda_version: ['11.6'] os: [ubuntu-20.04, ubuntu-18.04] runs-on: ${{matrix.os}} steps: @@ -67,7 +68,8 @@ jobs: -DWITH_ROCM_BACKEND=OFF \ -DWITH_LEVEL_ZERO_BACKEND=OFF \ -DCMAKE_INSTALL_PREFIX=/opt/hipSYCL \ - -DROCM_PATH=/opt/rocm-${{matrix.rocm_version}} .. + -DROCM_PATH=/opt/rocm-${{matrix.rocm_version}} \ + -DCUDA_PATH=/usr/local/cuda-${{matrix.cuda_version}} .. make -j2 install - name: install LAPACK (for CBLAS) run: | @@ -94,6 +96,7 @@ jobs: -DCMAKE_CXX_COMPILER=/usr/bin/clang++-${{matrix.clang_version}} \ -DCMAKE_C_COMPILER=/usr/bin/clang-${{matrix.clang_version}} \ -DCUDA_CUDA_LIBRARY=/usr/local/cuda-11.6/lib64/stubs/libcuda.so \ + -DCUDA_PATH=/usr/local/cuda-${{matrix.cuda_version}} \ -DENABLE_CUBLAS_BACKEND=True \ -DENABLE_CURAND_BACKEND=False \ -DENABLE_CUSOLVER_BACKEND=False \