From 1fe80c6e9a0a9c293b6d911052043ca6c66835b0 Mon Sep 17 00:00:00 2001 From: Benjamin Brock Date: Thu, 20 Feb 2025 16:13:45 -0800 Subject: [PATCH 01/10] First attempt at adding Intel LLVM to CI --- .github/workflows/ci.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 73ea26c..df9c1a9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,3 +40,24 @@ jobs: run: make -C build -j `nproc` - name: Test run: ./build/test/gtest/spblas-tests + + intel-llvm: + runs-on: 'intel-ubuntu-latest' + name: intel-llvm + env: + CXX: icpx + steps: + - uses: actions/checkout@v4 + - name: Set up Intel + 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 + 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 + sudo apt-get update -y + sudo apt-get install -y intel-oneapi-compiler-dpcpp-cpp intel-oneapi-mkl-devel intel-hpckit + - name: CMake + run: cmake -B build + - name: Build + run: make -C build -j `nproc` + - name: Test + run: ./build/test/gtest/spblas-tests From df3f225cb5f9dfae3a31414683a18d21f757f1ac Mon Sep 17 00:00:00 2001 From: Benjamin Brock Date: Thu, 20 Feb 2025 16:17:19 -0800 Subject: [PATCH 02/10] Update --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index df9c1a9..0a7411c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,7 +42,7 @@ jobs: run: ./build/test/gtest/spblas-tests intel-llvm: - runs-on: 'intel-ubuntu-latest' + runs-on: 'ubuntu-latest' name: intel-llvm env: CXX: icpx From 5a26952b566397a6812afb816f3ddf48b0778bb4 Mon Sep 17 00:00:00 2001 From: Benjamin Brock Date: Thu, 20 Feb 2025 16:22:32 -0800 Subject: [PATCH 03/10] Source Intel environment --- .github/workflows/ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0a7411c..aaa8d96 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -55,8 +55,10 @@ jobs: 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 sudo apt-get update -y sudo apt-get install -y intel-oneapi-compiler-dpcpp-cpp intel-oneapi-mkl-devel intel-hpckit + source /opt/intel/oneapi/setvars.sh - name: CMake - run: cmake -B build + run: | + cmake -B build - name: Build run: make -C build -j `nproc` - name: Test From a14b80cbc9646c6f98238281e67c0253f2877a92 Mon Sep 17 00:00:00 2001 From: Benjamin Brock Date: Thu, 20 Feb 2025 16:32:40 -0800 Subject: [PATCH 04/10] Update --- .github/workflows/ci.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index aaa8d96..89b2c52 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -55,11 +55,15 @@ jobs: 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 sudo apt-get update -y sudo apt-get install -y intel-oneapi-compiler-dpcpp-cpp intel-oneapi-mkl-devel intel-hpckit - source /opt/intel/oneapi/setvars.sh - name: CMake run: | + source /opt/intel/oneapi/setvars.sh cmake -B build - name: Build - run: make -C build -j `nproc` + run: | + source /opt/intel/oneapi/setvars.sh + make -C build -j `nproc` - name: Test - run: ./build/test/gtest/spblas-tests + run: | + source /opt/intel/oneapi/setvars.sh + ./build/test/gtest/spblas-tests From 03989339b4fdea4d70aefd75e912b7d9f04a81b4 Mon Sep 17 00:00:00 2001 From: Benjamin Brock Date: Thu, 20 Feb 2025 16:36:27 -0800 Subject: [PATCH 05/10] Remove unnecessary intel-hpc-kit package --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 89b2c52..5d12b6e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -54,7 +54,7 @@ jobs: | gpg --dearmor | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null 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 sudo apt-get update -y - sudo apt-get install -y intel-oneapi-compiler-dpcpp-cpp intel-oneapi-mkl-devel intel-hpckit + sudo apt-get install -y intel-oneapi-compiler-dpcpp-cpp intel-oneapi-mkl-devel - name: CMake run: | source /opt/intel/oneapi/setvars.sh From 564f8e3b5365b31d2583c384c7fe5f8f3e216e5c Mon Sep 17 00:00:00 2001 From: Benjamin Brock Date: Thu, 20 Feb 2025 16:48:05 -0800 Subject: [PATCH 06/10] Add both MKL and non-MKL --- .github/workflows/ci.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5d12b6e..cf63ca3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -67,3 +67,30 @@ jobs: run: | source /opt/intel/oneapi/setvars.sh ./build/test/gtest/spblas-tests + + intel-llvm-mkl: + runs-on: 'ubuntu-latest' + name: intel-llvm + env: + CXX: icpx + steps: + - uses: actions/checkout@v4 + - name: Set up Intel + 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 + 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 + sudo apt-get update -y + sudo apt-get install -y intel-oneapi-compiler-dpcpp-cpp intel-oneapi-mkl-devel + - name: CMake + run: | + source /opt/intel/oneapi/setvars.sh + cmake -B build -DENABLE_ONEMKL=ON + - name: Build + run: | + source /opt/intel/oneapi/setvars.sh + make -C build -j `nproc` + - name: Test + run: | + source /opt/intel/oneapi/setvars.sh + ./build/test/gtest/spblas-tests From b6b8a0a5fb94470c75179781aa5cfaba9a16b053 Mon Sep 17 00:00:00 2001 From: Benjamin Brock Date: Thu, 20 Feb 2025 16:48:45 -0800 Subject: [PATCH 07/10] Fix name --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cf63ca3..6236d1f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -70,7 +70,7 @@ jobs: intel-llvm-mkl: runs-on: 'ubuntu-latest' - name: intel-llvm + name: intel-llvm-mkl env: CXX: icpx steps: From 03e3c0fae35b08d0335c39e47b6a9b133560f61e Mon Sep 17 00:00:00 2001 From: Benjamin Brock Date: Thu, 20 Feb 2025 16:57:38 -0800 Subject: [PATCH 08/10] Reduce copying --- .github/workflows/ci.yml | 34 +++++----------------------------- 1 file changed, 5 insertions(+), 29 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6236d1f..fd4a8bd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,34 +43,10 @@ jobs: intel-llvm: runs-on: 'ubuntu-latest' - name: intel-llvm - env: - CXX: icpx - steps: - - uses: actions/checkout@v4 - - name: Set up Intel - 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 - 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 - sudo apt-get update -y - sudo apt-get install -y intel-oneapi-compiler-dpcpp-cpp intel-oneapi-mkl-devel - - name: CMake - run: | - source /opt/intel/oneapi/setvars.sh - cmake -B build - - name: Build - run: | - source /opt/intel/oneapi/setvars.sh - make -C build -j `nproc` - - name: Test - run: | - source /opt/intel/oneapi/setvars.sh - ./build/test/gtest/spblas-tests - - intel-llvm-mkl: - runs-on: 'ubuntu-latest' - name: intel-llvm-mkl + strategy: + matrix: + mkl: [OFF, ON] + name: intel-llvm${{ matrix.mkl == 'ON' && '-mkl' || '' }} env: CXX: icpx steps: @@ -85,7 +61,7 @@ jobs: - name: CMake run: | source /opt/intel/oneapi/setvars.sh - cmake -B build -DENABLE_ONEMKL=ON + cmake -B build -DENABLE_ONEMKL=${{ matrix.mkl }} - name: Build run: | source /opt/intel/oneapi/setvars.sh From 8f08aeb70d3a7455ac90141fff691cdda7526f37 Mon Sep 17 00:00:00 2001 From: Benjamin Brock Date: Thu, 20 Feb 2025 17:00:42 -0800 Subject: [PATCH 09/10] Test that MKL CI works --- include/spblas/vendor/mkl/multiply_impl.hpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/spblas/vendor/mkl/multiply_impl.hpp b/include/spblas/vendor/mkl/multiply_impl.hpp index 219e64a..07bf942 100644 --- a/include/spblas/vendor/mkl/multiply_impl.hpp +++ b/include/spblas/vendor/mkl/multiply_impl.hpp @@ -35,6 +35,8 @@ void multiply(A&& a, B&& b, C&& c) { __ranges::data(c)) .wait(); + c[0] += 1; + oneapi::mkl::sparse::release_matrix_handle(q, &a_handle).wait(); } From a900716c74454cfef3cca1635aa224a568fdcc21 Mon Sep 17 00:00:00 2001 From: Benjamin Brock Date: Thu, 20 Feb 2025 17:08:15 -0800 Subject: [PATCH 10/10] Revert "Test that MKL CI works" --- include/spblas/vendor/mkl/multiply_impl.hpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/spblas/vendor/mkl/multiply_impl.hpp b/include/spblas/vendor/mkl/multiply_impl.hpp index 07bf942..219e64a 100644 --- a/include/spblas/vendor/mkl/multiply_impl.hpp +++ b/include/spblas/vendor/mkl/multiply_impl.hpp @@ -35,8 +35,6 @@ void multiply(A&& a, B&& b, C&& c) { __ranges::data(c)) .wait(); - c[0] += 1; - oneapi::mkl::sparse::release_matrix_handle(q, &a_handle).wait(); }