Skip to content

Commit c3fceed

Browse files
committed
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 5ee7dd1 Author: Nils Friess <[email protected]> Date: Thu Jun 30 11:44:57 2022 +0200 Also test on Ubuntu 18.04 (requires installing boost from source) commit 4cfe3aa Author: Nils Friess <[email protected]> Date: Thu Jun 23 22:49:30 2022 +0200 Renamed workflow file commit 911b977 Author: Nils Friess <[email protected]> Date: Thu Jun 23 22:22:39 2022 +0200 Run also on pull requests commit 18670fa Author: Nils Friess <[email protected]> Date: Thu Jun 23 22:08:56 2022 +0200 Revert "Also test on Ubuntu 22.04 LTS" This reverts commit 1912951. ROCm currently cannot be installed on 22.04. commit 1912951 Author: Nils Friess <[email protected]> Date: Thu Jun 23 22:02:05 2022 +0200 Also test on Ubuntu 22.04 LTS commit 2aca44b Author: Nils Friess <[email protected]> Date: Thu Jun 23 22:01:41 2022 +0200 Format and remove unused flags etc. commit c976018 Author: Nils Friess <[email protected]> Date: Tue Jun 21 11:13:31 2022 +0200 Fix typo in CMake command commit 716a3ff Author: Nils Friess <[email protected]> Date: Tue Jun 21 11:04:53 2022 +0200 Update apt sources before installing boost commit 78c0b74 Author: Nils Friess <[email protected]> Date: Tue Jun 21 10:51:38 2022 +0200 Remove commands to install tbb and mkl since they are not necessary commit c3b1abd Author: Nils Friess <[email protected]> Date: Mon Jun 20 14:25:29 2022 +0200 Run cmake install as sudo commit 7f4ddbd Author: Nils Friess <[email protected]> Date: Mon Jun 20 14:15:49 2022 +0200 Add path to lapack in cmake command commit 33d23a5 Author: Nils Friess <[email protected]> Date: Mon Jun 20 14:12:42 2022 +0200 Install LAPACK from source commit f87e040 Author: Nils Friess <[email protected]> Date: Mon Jun 20 13:53:46 2022 +0200 Add command to build oneMKL commit 159db62 Author: Nils Friess <[email protected]> Date: Mon Jun 20 13:53:18 2022 +0200 Fix typo in cmake flag commit 4d50f8b Author: Nils Friess <[email protected]> Date: Sun Jun 19 13:58:20 2022 +0200 Add command to install CBLAS (for simplicity we install libatlas) commit 3527cd8 Author: Nils Friess <[email protected]> Date: Sun Jun 19 13:43:03 2022 +0200 Add command to install cblas commit 4a6906c Author: Nils Friess <[email protected]> Date: Sun Jun 19 13:28:53 2022 +0200 Add path to cmake config of hsa-runtime64 as env variable commit f6f62a9 Author: Nils Friess <[email protected]> Date: Sun Jun 19 13:15:35 2022 +0200 Add path to amd_comgr cmake config as env variable commit 6fd04a0 Author: Nils Friess <[email protected]> Date: Sun Jun 19 12:52:27 2022 +0200 Add path to cmake config for AMDDeviceLibs as env variable commit d9fc104 Author: Nils Friess <[email protected]> Date: Sun Jun 19 12:41:25 2022 +0200 Add path to hip cmake config as environment variable commit 5125368 Author: Nils Friess <[email protected]> Date: Sun Jun 19 12:32:52 2022 +0200 Install rocblas together with rocm commit 483bdc6 Author: Nils Friess <[email protected]> Date: Sun Jun 19 12:23:05 2022 +0200 Add rocblas_DIR to cmake command commit fa58d4b Author: Nils Friess <[email protected]> Date: Sun Jun 19 12:13:32 2022 +0200 Add rocBLAS CMake config path as environment variable commit 52065e9 Author: Nils Friess <[email protected]> Date: Sun Jun 19 11:00:08 2022 +0200 Fix hipSYCL build paths commit bd79ccf Author: Nils Friess <[email protected]> Date: Sun Jun 19 10:45:27 2022 +0200 Add commands for building oneMKL commit 4b44a68 Merge: be11ced 6b95323 Author: Nils Friess <[email protected]> Date: Wed Jun 8 23:26:20 2022 +0200 Merge branch 'github-ci-test' of github.com:nilsfriess/oneMKL into github-ci-test commit be11ced Author: Nils Friess <[email protected]> Date: Wed Jun 8 23:23:11 2022 +0200 Add hipsycl build (including setup for CUDA and ROCm) commit 6b95323 Author: Nils Friess <[email protected]> Date: Wed Jun 8 23:20:41 2022 +0200 Remove sudo and add hipsycl build commit 8378aba Author: Nils Friess <[email protected]> Date: Wed Jun 8 23:03:34 2022 +0200 Add github workflow test file
1 parent 606b28d commit c3fceed

File tree

1 file changed

+54
-73
lines changed

1 file changed

+54
-73
lines changed

.github/workflows/linux.yml

+54-73
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
1-
name: Linux build and test
1+
name: Build tests with hipSYCL
22

33
on: [push, pull_request]
44

55
jobs:
6-
test-clang-based:
7-
name: clang ${{ matrix.clang_version }}, ${{ matrix.os }}, CUDA ${{matrix.cuda}}
8-
runs-on: ubuntu-20.04
6+
test-with-hipsycl:
7+
name: Run tests with hipSYCL
98
strategy:
109
matrix:
1110
clang_version: [13]
1211
rocm_version: ['5.1.1']
13-
os: [ubuntu-20.04]
14-
cuda: [11.0]
12+
os: [ubuntu-20.04, ubuntu-18.04]
13+
runs-on: ${{matrix.os}}
1514
steps:
1615
- uses: actions/checkout@v2
1716
with:
@@ -22,90 +21,72 @@ jobs:
2221
wget -q -O - https://repo.radeon.com/rocm/rocm.gpg.key | sudo apt-key add -
2322
echo 'deb [arch=amd64] https://repo.radeon.com/rocm/apt/${{matrix.rocm_version}}/ ubuntu main' | sudo tee /etc/apt/sources.list.d/rocm.list
2423
sudo apt update
25-
sudo apt install rocm-dev
26-
- name: install CUDA 11.0
27-
if: matrix.cuda == 11.0
28-
run: |
29-
mkdir -p /opt/hipSYCL/cuda
30-
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
31-
sudo sh ./cuda.sh --override --silent --toolkit --no-man-page --no-drm --no-opengl-libs --installpath=/opt/hipSYCL/cuda || true
32-
echo "CUDA Version 11.0.0" | sudo tee /opt/hipSYCL/cuda/version.txt
24+
sudo apt install rocm-dev rocblas
3325
- name: install LLVM
3426
run: |
3527
wget https://apt.llvm.org/llvm.sh
3628
chmod +x llvm.sh
3729
sudo ./llvm.sh ${{matrix.clang_version}}
3830
sudo apt install libclang-${{matrix.clang_version}}-dev clang-tools-${{matrix.clang_version}} libomp-${{matrix.clang_version}}-dev
39-
- name: install boost (from source)
31+
- name: install boost from apt
32+
if: matrix.os == 'ubuntu-20.04'
33+
run: |
34+
sudo apt update
35+
sudo apt install libboost-all-dev
36+
- name: install boost from source
4037
if: matrix.os == 'ubuntu-18.04'
4138
run: |
39+
cd
4240
wget -q https://boostorg.jfrog.io/artifactory/main/release/1.70.0/source/boost_1_70_0.zip
4341
unzip boost_1_70_0.zip
4442
cd boost_1_70_0
4543
./bootstrap.sh --prefix=/usr
46-
sudo ./b2 link=static,shared install -j$(nproc) || true
47-
cd ..
48-
- name: install boost (from apt)
49-
if: matrix.os == 'ubuntu-20.04'
50-
run: |
51-
sudo apt install libboost-all-dev
44+
./b2
45+
sudo ./b2 install -j4
5246
- name: build hipSYCL
5347
run: |
48+
cd
5449
git clone https://github.com/illuhad/hipSYCL.git
5550
cd hipSYCL
5651
mkdir build && cd build
57-
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 ..
58-
make -j2 install
59-
cp /opt/hipSYCL/cuda/lib64/stubs/libcuda.so `pwd`/install/lib/libcuda.so
60-
cp /opt/hipSYCL/cuda/lib64/stubs/libcuda.so `pwd`/install/lib/libcuda.so.1
61-
- name: build CPU tests
62-
run: |
63-
mkdir /home/runner/work/hipSYCL/hipSYCL/build/tests-cpu
64-
cd /home/runner/work/hipSYCL/hipSYCL/build/tests-cpu
65-
cmake -DHIPSYCL_TARGETS="omp" -DhipSYCL_DIR=/home/runner/work/hipSYCL/hipSYCL/build/install/lib/cmake/hipSYCL /home/runner/work/hipSYCL/hipSYCL/tests
66-
make -j2
67-
- name: build CUDA tests
68-
run: |
69-
mkdir /home/runner/work/hipSYCL/hipSYCL/build/tests-cuda
70-
cd /home/runner/work/hipSYCL/hipSYCL/build/tests-cuda
71-
cmake -DHIPSYCL_TARGETS="cuda:sm_60" -DhipSYCL_DIR=/home/runner/work/hipSYCL/hipSYCL/build/install/lib/cmake/hipSYCL /home/runner/work/hipSYCL/hipSYCL/tests
72-
make -j2
73-
- name: build ROCm tests
74-
run: |
75-
mkdir /home/runner/work/hipSYCL/hipSYCL/build/tests-rocm
76-
cd /home/runner/work/hipSYCL/hipSYCL/build/tests-rocm
77-
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
78-
make -j2
79-
- name: run CPU tests
52+
cmake -DCMAKE_CXX_COMPILER=/usr/bin/clang++-${{matrix.clang_version}} \
53+
-DCLANG_EXECUTABLE_PATH=/usr/bin/clang++-${{matrix.clang_version}} \
54+
-DLLVM_DIR=/usr/lib/llvm-${{matrix.clang_version}}/cmake \
55+
-DWITH_CUDA_BACKEND=OFF \
56+
-DWITH_ROCM_BACKEND=ON \
57+
-DWITH_LEVEL_ZERO_BACKEND=OFF \
58+
-DCMAKE_INSTALL_PREFIX=/opt/hipSYCL \
59+
-DROCM_PATH=/opt/rocm-${{matrix.rocm_version}} ..
60+
make -j4 install
61+
- name: install LAPACK (for CBLAS)
8062
run: |
81-
cd /home/runner/work/hipSYCL/hipSYCL/build/tests-cpu
82-
LD_LIBRARY_PATH=/home/runner/work/hipSYCL/hipSYCL/build/install/lib ./sycl_tests
83-
84-
test-dpcpp-based:
85-
name: Test dpcpp based compilation
86-
runs-on: ubuntu-20.04
87-
steps:
88-
- uses: actions/checkout@v2
89-
with:
90-
submodules: 'recursive'
91-
- name: Install dpcpp
92-
run: |
93-
wget https://registrationcenter-download.intel.com/akdlm/irc_nas/18236/l_BaseKit_p_2021.4.0.3422.sh
94-
bash l_BaseKit_p_2021.4.0.3422.sh \
95-
-a --action install \
96-
-s --eula accept \
97-
--components=\
98-
intel.oneapi.lin.tbb.devel:\
99-
intel.oneapi.lin.dpcpp-cpp-compiler:\
100-
intel.oneapi.lin.mkl.devel \
101-
--install-dir /opt/intel/ \
102-
--download-dir /opt/intel/dw/ \
103-
--download-cache /opt/intel/dw/ \
104-
--package-path /opt/intel/intel
105-
106-
- name: Clone oneMKL
63+
cd
64+
git clone https://github.com/Reference-LAPACK/lapack.git
65+
cd lapack
66+
mkdir build && cd build
67+
cmake -DCMAKE_INSTALL_LIBDIR=/opt/lapack -DBUILD_SHARED_LIBS=ON -DCBLAS=ON ..
68+
sudo cmake --build . -j --target install
69+
- name: clone and build oneMKL
70+
env:
71+
rocblas_DIR: /opt/rocm-${{matrix.rocm_version}}/lib/cmake/rocblas/
72+
hip_DIR: /opt/rocm-${{matrix.rocm_version}}/lib/cmake/hip/
73+
AMDDeviceLibs_DIR: /opt/rocm-${{matrix.rocm_version}}/lib/cmake/AMDDeviceLibs/
74+
amd_comgr_DIR: /opt/rocm-${{matrix.rocm_version}}/lib/cmake/amd_comgr/
75+
hsa-runtime64_DIR: /opt/rocm-${{matrix.rocm_version}}/lib/cmake/hsa-runtime64/
10776
run: |
77+
cd
10878
git clone https://github.com/oneapi-src/oneMKL.git
109-
110-
111-
79+
cd oneMKL
80+
mkdir build
81+
cd build
82+
cmake -DENABLE_CUBLAS_BACKEND=False \
83+
-DENABLE_MKLGPU_BACKEND=False \
84+
-DENABLE_MKLCPU_BACKEND=False \
85+
-DENABLE_NETLIB_BACKEND=False \
86+
-DENABLE_ROCBLAS_BACKEND=True \
87+
-DTARGET_DOMAINS=blas \
88+
-DHIPSYCL_TARGETS=omp\;hip:gfx906 \
89+
-DONEMKL_SYCL_IMPLEMENTATION=hipSYCL \
90+
-DREF_BLAS_ROOT=/opt/lapack/ ..
91+
make -j8
92+

0 commit comments

Comments
 (0)