From bfb8dbea4df275d5719c764d0090ebca22eb7a75 Mon Sep 17 00:00:00 2001 From: Viraj Malia <96500051+virajmalia@users.noreply.github.com> Date: Sat, 9 Sep 2023 00:18:55 -0700 Subject: [PATCH 01/15] Create docker-image.yml --- .github/workflows/docker-image.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .github/workflows/docker-image.yml diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml new file mode 100644 index 000000000..958202202 --- /dev/null +++ b/.github/workflows/docker-image.yml @@ -0,0 +1,18 @@ +name: Docker Image CI + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +jobs: + + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Build the Docker image + run: docker build . --file Dockerfile --tag onemkl_0.2:$(date +%s) From c125b2e72289874a6b3a1f2d227fa5793a6368ab Mon Sep 17 00:00:00 2001 From: Viraj Malia <96500051+virajmalia@users.noreply.github.com> Date: Sat, 9 Sep 2023 00:44:55 -0700 Subject: [PATCH 02/15] Add a basic Dockerfile for the default configuration (#1) --- Dockerfile | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..cc90d0866 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,24 @@ +# Copyright (c) 2019-2020 Intel Corporation. +# SPDX-License-Identifier: BSD-3-Clause + +# Get Base image from Docker Hub Intel repo +ARG base_image="intel/oneapi-basekit" +FROM "$base_image" + +ARG DEBIAN_FRONTEND=noninteractive +ARG APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 + +# Install build essentials +RUN apt-get update -y && \ + apt-get install -y -o=Dpkg::Use-Pty=0 \ + python3-pip cmake + +# Setup Working Directory +COPY . /home/oneMKL +RUN mkdir -p /home/oneMKL/BUILD +WORKDIR /home/oneMKL/BUILD + +# Build +RUN cmake .. -DCMAKE_CXX_COMPILER=icpx -DBUILD_FUNCTIONAL_TESTS=OFF -DTARGET_DOMAINS="rng" +RUN cmake --build . -j$(nproc) +CMD ctest -j$(nproc) From c614dd253b4696e46458527760ba05e0362d0fc5 Mon Sep 17 00:00:00 2001 From: Viraj Malia <96500051+virajmalia@users.noreply.github.com> Date: Sat, 9 Sep 2023 00:18:55 -0700 Subject: [PATCH 03/15] Create github CI yaml --- .github/workflows/onemkl-ci.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .github/workflows/onemkl-ci.yml diff --git a/.github/workflows/onemkl-ci.yml b/.github/workflows/onemkl-ci.yml new file mode 100644 index 000000000..413c162fc --- /dev/null +++ b/.github/workflows/onemkl-ci.yml @@ -0,0 +1,17 @@ +name: oneMKL Interfaces CI + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +jobs: + build_n_test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Build oneMKL + run: | + docker build . --file Dockerfile --tag onemkl_0.2:$(date +%s) + docker run onemkl_0.2 From 00cf75ed61b3536291a95737ad8ac4d9637f9c05 Mon Sep 17 00:00:00 2001 From: "Malia, Viraj" Date: Sat, 9 Sep 2023 11:07:37 -0700 Subject: [PATCH 04/15] Enable Reference-LAPACK v3.11.0 --- CMakeLists.txt | 4 +-- Dockerfile | 43 +++++++++++++++++++++++++++------ tests/unit_tests/CMakeLists.txt | 6 +---- 3 files changed, 39 insertions(+), 14 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 41d799873..83e16526e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -284,8 +284,8 @@ else() endif() if(DEFINED REF_BLAS_ROOT) - find_file(REF_BLAS_LIBNAME NAMES blas.dll libblas.so HINTS ${REF_BLAS_ROOT} PATH_SUFFIXES lib lib64) - find_file(REF_CBLAS_LIBNAME NAMES cblas.dll libcblas.so HINTS ${REF_BLAS_ROOT} PATH_SUFFIXES lib lib64) + find_file(REF_BLAS_LIBNAME NAMES blas.dll libblas64.so HINTS ${REF_BLAS_ROOT} PATH_SUFFIXES lib lib64) + find_file(REF_CBLAS_LIBNAME NAMES cblas.dll libcblas64.so HINTS ${REF_BLAS_ROOT} PATH_SUFFIXES lib lib64) endif() # Add source directory and output to bin/ diff --git a/Dockerfile b/Dockerfile index cc90d0866..6e1df945e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,17 +1,44 @@ -# Copyright (c) 2019-2020 Intel Corporation. -# SPDX-License-Identifier: BSD-3-Clause +#=============================================================================== +# Copyright 2023 Intel Corporation +# Copyright (C) 2022 Heidelberg University, Engineering Mathematics and Computing Lab (EMCL) and Computing Centre (URZ) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# +# SPDX-License-Identifier: Apache-2.0 +#=============================================================================== -# Get Base image from Docker Hub Intel repo -ARG base_image="intel/oneapi-basekit" -FROM "$base_image" +# Get oneAPI BaseKit image from the Docker Hub Intel repo +FROM intel/oneapi-basekit:2023.2.1-devel-ubuntu22.04 AS BACKEND_MKL ARG DEBIAN_FRONTEND=noninteractive ARG APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 +ARG NETLIB_VERSION_TAG=3.11.0 # Install build essentials RUN apt-get update -y && \ apt-get install -y -o=Dpkg::Use-Pty=0 \ - python3-pip cmake + python3-pip cmake gcc gfortran + +# Setup Reference BLAS and LAPACK Implementation for functional testing +RUN mkdir -p /home/Reference-LAPACK +WORKDIR /home/Reference-LAPACK +RUN wget https://github.com/Reference-LAPACK/lapack/archive/refs/tags/v${NETLIB_VERSION_TAG}.tar.gz && tar -xf v${NETLIB_VERSION_TAG}.tar.gz + +# Build Reference BLAS and LAPACK +WORKDIR /home/Reference-LAPACK/lapack-${NETLIB_VERSION_TAG}/BUILD +RUN cmake -DBUILD_INDEX64=ON -DCBLAS=ON -DLAPACKE=ON -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_LIBDIR=/home/Reference-LAPACK/OUTPUT/lib .. +RUN cmake --build . -j$(nproc) --target install # Setup Working Directory COPY . /home/oneMKL @@ -19,6 +46,8 @@ RUN mkdir -p /home/oneMKL/BUILD WORKDIR /home/oneMKL/BUILD # Build -RUN cmake .. -DCMAKE_CXX_COMPILER=icpx -DBUILD_FUNCTIONAL_TESTS=OFF -DTARGET_DOMAINS="rng" +RUN cmake .. -DCMAKE_CXX_COMPILER=icpx -DREF_BLAS_ROOT=/home/Reference-LAPACK/OUTPUT -DREF_LAPACK_ROOT=/home/Reference-LAPACK/OUTPUT RUN cmake --build . -j$(nproc) + +# Run testing CMD ctest -j$(nproc) diff --git a/tests/unit_tests/CMakeLists.txt b/tests/unit_tests/CMakeLists.txt index 464d8841c..11dc10069 100644 --- a/tests/unit_tests/CMakeLists.txt +++ b/tests/unit_tests/CMakeLists.txt @@ -17,11 +17,7 @@ # SPDX-License-Identifier: Apache-2.0 #=============================================================================== -if("blas" IN_LIST TARGET_DOMAINS) - find_package(CBLAS REQUIRED) -endif() - -if("lapack" IN_LIST TARGET_DOMAINS) +if("blas" IN_LIST TARGET_DOMAINS OR "lapack" IN_LIST TARGET_DOMAINS) find_package(LAPACKE REQUIRED) endif() From 1ae58cda3053dfd85bcf37659376fd9e173cee26 Mon Sep 17 00:00:00 2001 From: "Malia, Viraj" Date: Sat, 9 Sep 2023 13:22:08 -0700 Subject: [PATCH 05/15] Use ninja-build --- Dockerfile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6e1df945e..eb26ecaea 100644 --- a/Dockerfile +++ b/Dockerfile @@ -28,7 +28,7 @@ ARG NETLIB_VERSION_TAG=3.11.0 # Install build essentials RUN apt-get update -y && \ apt-get install -y -o=Dpkg::Use-Pty=0 \ - python3-pip cmake gcc gfortran + cmake ninja-build gcc gfortran # Setup Reference BLAS and LAPACK Implementation for functional testing RUN mkdir -p /home/Reference-LAPACK @@ -37,8 +37,8 @@ RUN wget https://github.com/Reference-LAPACK/lapack/archive/refs/tags/v${NETLIB_ # Build Reference BLAS and LAPACK WORKDIR /home/Reference-LAPACK/lapack-${NETLIB_VERSION_TAG}/BUILD -RUN cmake -DBUILD_INDEX64=ON -DCBLAS=ON -DLAPACKE=ON -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_LIBDIR=/home/Reference-LAPACK/OUTPUT/lib .. -RUN cmake --build . -j$(nproc) --target install +RUN cmake -G "Ninja" -DBUILD_INDEX64=ON -DCBLAS=ON -DLAPACKE=ON -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_LIBDIR=/home/Reference-LAPACK/OUTPUT/lib .. +RUN ninja install # Setup Working Directory COPY . /home/oneMKL @@ -46,8 +46,8 @@ RUN mkdir -p /home/oneMKL/BUILD WORKDIR /home/oneMKL/BUILD # Build -RUN cmake .. -DCMAKE_CXX_COMPILER=icpx -DREF_BLAS_ROOT=/home/Reference-LAPACK/OUTPUT -DREF_LAPACK_ROOT=/home/Reference-LAPACK/OUTPUT -RUN cmake --build . -j$(nproc) +RUN cmake -G "Ninja" .. -DCMAKE_CXX_COMPILER=icpx -DREF_BLAS_ROOT=/home/Reference-LAPACK/OUTPUT -DREF_LAPACK_ROOT=/home/Reference-LAPACK/OUTPUT +RUN ninja -# Run testing +# Test CMD ctest -j$(nproc) From 57babc95c908aea53f75c5cc74175e599439c0c7 Mon Sep 17 00:00:00 2001 From: "Malia, Viraj" Date: Sat, 9 Sep 2023 13:35:37 -0700 Subject: [PATCH 06/15] Enable manual trigger of CI --- .github/workflows/onemkl-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/onemkl-ci.yml b/.github/workflows/onemkl-ci.yml index 413c162fc..26557b759 100644 --- a/.github/workflows/onemkl-ci.yml +++ b/.github/workflows/onemkl-ci.yml @@ -5,6 +5,7 @@ on: branches: [ "master" ] pull_request: branches: [ "master" ] + workflow_dispatch: jobs: build_n_test: From bf20c1197ee7c4ca414bac1dcfaf87775fdc2c21 Mon Sep 17 00:00:00 2001 From: Viraj Malia <96500051+virajmalia@users.noreply.github.com> Date: Sat, 9 Sep 2023 16:44:03 -0700 Subject: [PATCH 07/15] Enable CI and Nightly workflows (#3) * Create CI and Nightly flows * Fix * Enable intel gpu --- .github/workflows/onemkl-ci.yml | 2 +- .github/workflows/onemkl-nightly.yml | 16 +++++++++ Dockerfile.ci | 49 ++++++++++++++++++++++++++++ Dockerfile => Dockerfile.nightly | 2 +- 4 files changed, 67 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/onemkl-nightly.yml create mode 100644 Dockerfile.ci rename Dockerfile => Dockerfile.nightly (92%) diff --git a/.github/workflows/onemkl-ci.yml b/.github/workflows/onemkl-ci.yml index 26557b759..0c421d340 100644 --- a/.github/workflows/onemkl-ci.yml +++ b/.github/workflows/onemkl-ci.yml @@ -14,5 +14,5 @@ jobs: - uses: actions/checkout@v3 - name: Build oneMKL run: | - docker build . --file Dockerfile --tag onemkl_0.2:$(date +%s) + docker build . --file Dockerfile.ci --tag onemkl_0.2 docker run onemkl_0.2 diff --git a/.github/workflows/onemkl-nightly.yml b/.github/workflows/onemkl-nightly.yml new file mode 100644 index 000000000..00f424be7 --- /dev/null +++ b/.github/workflows/onemkl-nightly.yml @@ -0,0 +1,16 @@ +name: oneMKL Interfaces Nightly + +on: + schedule: + - cron: '00 7 * * 0,1,2,3,4,5,6' + workflow_dispatch: + +jobs: + build_n_test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Build oneMKL + run: | + docker build . --file Dockerfile.nightly --tag onemkl_nightly_0.2:$(date +%Y%m%d) + docker run onemkl_nightly_0.2:$(date +%Y%m%d) diff --git a/Dockerfile.ci b/Dockerfile.ci new file mode 100644 index 000000000..bf8a1a314 --- /dev/null +++ b/Dockerfile.ci @@ -0,0 +1,49 @@ +#=============================================================================== +# Copyright 2023 Intel Corporation +# Copyright (C) 2022 Heidelberg University, Engineering Mathematics and Computing Lab (EMCL) and Computing Centre (URZ) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# +# SPDX-License-Identifier: Apache-2.0 +#=============================================================================== + +# Get oneAPI BaseKit image from the Docker Hub Intel repo +FROM intel/oneapi-basekit:2023.2.1-devel-ubuntu22.04 AS BACKEND_MKL + +ARG DEBIAN_FRONTEND=noninteractive +ARG APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 + +RUN apt-get install -y gpg-agent +RUN wget -qO - https://repositories.intel.com/graphics/intel-graphics.key | gpg --dearmor --output /usr/share/keyrings/intel-graphics.gpg +RUN echo 'deb [arch=amd64 signed-by=/usr/share/keyrings/intel-graphics.gpg] https://repositories.intel.com/graphics/ubuntu focal main' | tee -a /etc/apt/sources.list.d/intel.list + +# Install build essentials +RUN apt-get update -y && apt-get dist-upgrade -y && \ + apt-get install -y -o=Dpkg::Use-Pty=0 \ + intel-opencl-icd \ + intel-level-zero-gpu level-zero \ + intel-media-va-driver-non-free libmfx1 libmfxgen1 libvpl2 \ + cmake ninja-build + +# Setup Working Directory +COPY . /home/oneMKL +RUN mkdir -p /home/oneMKL/BUILD +WORKDIR /home/oneMKL/BUILD + +# Build +RUN cmake -G "Ninja" .. -DBUILD_FUNCTIONAL_TESTS=OFF -DCMAKE_CXX_COMPILER=icpx +RUN ninja + +# Test +# RUN ctest -j$(nproc) diff --git a/Dockerfile b/Dockerfile.nightly similarity index 92% rename from Dockerfile rename to Dockerfile.nightly index eb26ecaea..9a36fc55a 100644 --- a/Dockerfile +++ b/Dockerfile.nightly @@ -46,7 +46,7 @@ RUN mkdir -p /home/oneMKL/BUILD WORKDIR /home/oneMKL/BUILD # Build -RUN cmake -G "Ninja" .. -DCMAKE_CXX_COMPILER=icpx -DREF_BLAS_ROOT=/home/Reference-LAPACK/OUTPUT -DREF_LAPACK_ROOT=/home/Reference-LAPACK/OUTPUT +RUN cmake -G "Ninja" .. -DBUILD_EXAMPLES=OFF -DCMAKE_CXX_COMPILER=icpx -DREF_BLAS_ROOT=/home/Reference-LAPACK/OUTPUT -DREF_LAPACK_ROOT=/home/Reference-LAPACK/OUTPUT RUN ninja # Test From c6c73c45ae97152ac794c67c3f35fd2d77c93c4c Mon Sep 17 00:00:00 2001 From: Viraj Malia <96500051+virajmalia@users.noreply.github.com> Date: Sat, 9 Sep 2023 18:13:24 -0700 Subject: [PATCH 08/15] Rename default branch for ci (#5) * rename default branch * enable testing of examples in CI * fix --- .github/workflows/onemkl-ci.yml | 4 ++-- Dockerfile.ci | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/onemkl-ci.yml b/.github/workflows/onemkl-ci.yml index 0c421d340..32acdde6a 100644 --- a/.github/workflows/onemkl-ci.yml +++ b/.github/workflows/onemkl-ci.yml @@ -2,9 +2,9 @@ name: oneMKL Interfaces CI on: push: - branches: [ "master" ] + branches: [ "main" ] pull_request: - branches: [ "master" ] + branches: [ "main" ] workflow_dispatch: jobs: diff --git a/Dockerfile.ci b/Dockerfile.ci index bf8a1a314..8449e4fa5 100644 --- a/Dockerfile.ci +++ b/Dockerfile.ci @@ -29,7 +29,7 @@ RUN wget -qO - https://repositories.intel.com/graphics/intel-graphics.key | gpg RUN echo 'deb [arch=amd64 signed-by=/usr/share/keyrings/intel-graphics.gpg] https://repositories.intel.com/graphics/ubuntu focal main' | tee -a /etc/apt/sources.list.d/intel.list # Install build essentials -RUN apt-get update -y && apt-get dist-upgrade -y && \ +RUN apt-get update -y && \ apt-get install -y -o=Dpkg::Use-Pty=0 \ intel-opencl-icd \ intel-level-zero-gpu level-zero \ @@ -46,4 +46,4 @@ RUN cmake -G "Ninja" .. -DBUILD_FUNCTIONAL_TESTS=OFF -DCMAKE_CXX_COMPILER=icpx RUN ninja # Test -# RUN ctest -j$(nproc) +RUN ctest -j$(nproc) From 10a7d2d7b755a12b7a9c72e4594223c504271e8d Mon Sep 17 00:00:00 2001 From: Viraj Malia <96500051+virajmalia@users.noreply.github.com> Date: Sat, 9 Sep 2023 18:14:36 -0700 Subject: [PATCH 09/15] Delete .github/workflows/docker-image.yml --- .github/workflows/docker-image.yml | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100644 .github/workflows/docker-image.yml diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml deleted file mode 100644 index 958202202..000000000 --- a/.github/workflows/docker-image.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: Docker Image CI - -on: - push: - branches: [ "master" ] - pull_request: - branches: [ "master" ] - -jobs: - - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - name: Build the Docker image - run: docker build . --file Dockerfile --tag onemkl_0.2:$(date +%s) From d8bbbf712204542af56c8752defbba08fe6d478d Mon Sep 17 00:00:00 2001 From: "Malia, Viraj" Date: Sun, 10 Sep 2023 15:36:56 -0700 Subject: [PATCH 10/15] Separate workflows by build technology --- .github/workflows/cmake-ci.yml | 120 ++++++++++++++++++ .../{onemkl-ci.yml => docker-ci.yml} | 7 +- ...{onemkl-nightly.yml => docker-nightly.yml} | 3 +- Dockerfile.ci | 13 +- Dockerfile.nightly | 10 +- 5 files changed, 142 insertions(+), 11 deletions(-) create mode 100644 .github/workflows/cmake-ci.yml rename .github/workflows/{onemkl-ci.yml => docker-ci.yml} (69%) rename .github/workflows/{onemkl-nightly.yml => docker-nightly.yml} (74%) diff --git a/.github/workflows/cmake-ci.yml b/.github/workflows/cmake-ci.yml new file mode 100644 index 000000000..4b26504f9 --- /dev/null +++ b/.github/workflows/cmake-ci.yml @@ -0,0 +1,120 @@ +name: oneMKL Interfaces CMake CI + +on: + push: + branches: [ "develop" ] + pull_request: + branches: [ "develop" ] + +jobs: + CI: + runs-on: ["${{ matrix.os }}"] + strategy: + # Set fail-fast to false to ensure that feedback is delivered for all matrix combinations. Consider changing this to true when your workflow is stable. + fail-fast: false + matrix: + os: [ubuntu-22.04, windows-latest] + build_type: [Release] + include: + - os: windows-latest + cpp_compiler: icx + - os: ubuntu-22.04 + cpp_compiler: icpx + + steps: + - name: Install oneMKL and Intel C++/DPC++ compiler + id: basekit-install-lnx + if: matrix.os == 'ubuntu-22.04' + 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-common-vars intel-oneapi-common-licensing-2023.2.0 \ + intel-oneapi-compiler-dpcpp-cpp-2023.2.0 \ + intel-oneapi-mkl-devel-2023.2.0 + + - name: Install oneMKL and Intel C++/DPC++ compiler + id: basekit-install-win + if: matrix.os == 'windows-latest' + shell: cmd + run: | + curl -o C:\oneapi_installer.exe https://registrationcenter-download.intel.com/akdlm/IRC_NAS/f96c71db-2c6c-45d9-8c1f-0348ef5885cf/w_BaseKit_p_2023.2.0.49396_offline.exe + dir C: + call "C:\oneapi_installer.exe" -s -a --silent --eula accept --install-dir "C:\Program Files (x86)\Intel\oneAPI" + + - name: Setup oneAPI environment Linux + id: env-setup-lnx + if: matrix.os == 'ubuntu-22.04' + run: | + source /opt/intel/oneapi/setvars.sh + echo "oneapi_ld_libpath=${LD_LIBRARY_PATH}" >> "$GITHUB_ENV" + echo "oneapi_path=${PATH}" >> "$GITHUB_ENV" + echo "oneapi_cpath=${CPATH}" >> "$GITHUB_ENV" + echo "oneapi_mklroot=${MKLROOT}" >> "$GITHUB_ENV" + echo "config_shell=bash" >> "$GITHUB_ENV" + + - name: Setup oneAPI environment Windows + id: env-setup-win + if: matrix.os == 'windows-latest' + shell: cmd + run: | + call "C:\Program Files (x86)\Intel\oneAPI\setvars.bat" + echo "oneapi_libpath=%LIBRARY_PATH%" >> "%GITHUB_ENV%" + echo "oneapi_path=%PATH%" >> "%GITHUB_ENV%" + echo "oneapi_cpath=%CPATH%" >> "%GITHUB_ENV%" + echo "oneapi_mklroot=%MKLROOT%" >> "%GITHUB_ENV%" + + - uses: actions/checkout@v3 + - name: Set reusable strings + # Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file. + id: strings + run: | + echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" + + - uses: seanmiddleditch/gha-setup-ninja@master + - name: Configure and Build (Linux) + id: build-step-lnx + if: matrix.os == 'ubuntu-22.04' + env: + PATH: ${{ env.oneapi_path }} + CPATH: ${{ env.oneapi_cpath }} + LIBRARY_PATH: ${{ env.oneapi_libpath }} + LD_LIBRARY_PATH: ${{ env.oneapi_ld_libpath }} + MKLROOT: ${{ env.oneapi_mklroot }} + run: | + ${{ matrix.cpp_compiler }} --version + cmake -B ${{ steps.strings.outputs.build-output-dir }} \ + -G "Ninja" \ + -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} \ + -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ + -DBUILD_FUNCTIONAL_TESTS=OFF \ + -S ${{ github.workspace }} + cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} + + - name: Configure and Build (Windows) + id: build-step-win + if: matrix.os == 'windows-latest' + shell: cmd + env: + PATH: ${{ env.oneapi_path }} + CPATH: ${{ env.oneapi_cpath }} + LIBRARY_PATH: ${{ env.oneapi_libpath }} + LD_LIBRARY_PATH: ${{ env.oneapi_ld_libpath }} + MKLROOT: ${{ env.oneapi_mklroot }} + run: | + ${{ matrix.cpp_compiler }} --version + cmake -B ${{ steps.strings.outputs.build-output-dir }} -G "Ninja" -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DBUILD_FUNCTIONAL_TESTS=OFF -S ${{ github.workspace }} + cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} +# Note that --config is needed because the default Windows generator is a multi-config generator (Visual Studio generator). + + - name: Test + working-directory: ${{ steps.strings.outputs.build-output-dir }} + env: + PATH: ${{ env.oneapi_path }} + CPATH: ${{ env.oneapi_cpath }} + LIBRARY_PATH: ${{ env.oneapi_libpath }} + LD_LIBRARY_PATH: ${{ env.oneapi_ld_libpath }} + # Execute tests defined by the CMake configuration. Note that --build-config is needed because the default Windows generator is a multi-config generator (Visual Studio generator). + # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail + run: ctest -V --build-config ${{ matrix.build_type }} diff --git a/.github/workflows/onemkl-ci.yml b/.github/workflows/docker-ci.yml similarity index 69% rename from .github/workflows/onemkl-ci.yml rename to .github/workflows/docker-ci.yml index 32acdde6a..90a0f94a6 100644 --- a/.github/workflows/onemkl-ci.yml +++ b/.github/workflows/docker-ci.yml @@ -1,10 +1,10 @@ -name: oneMKL Interfaces CI +name: oneMKL Interfaces Docker CI on: push: - branches: [ "main" ] + branches: [ "develop" ] pull_request: - branches: [ "main" ] + branches: [ "develop" ] workflow_dispatch: jobs: @@ -15,4 +15,3 @@ jobs: - name: Build oneMKL run: | docker build . --file Dockerfile.ci --tag onemkl_0.2 - docker run onemkl_0.2 diff --git a/.github/workflows/onemkl-nightly.yml b/.github/workflows/docker-nightly.yml similarity index 74% rename from .github/workflows/onemkl-nightly.yml rename to .github/workflows/docker-nightly.yml index 00f424be7..965749d10 100644 --- a/.github/workflows/onemkl-nightly.yml +++ b/.github/workflows/docker-nightly.yml @@ -1,4 +1,4 @@ -name: oneMKL Interfaces Nightly +name: oneMKL Interfaces Docker Nightly on: schedule: @@ -13,4 +13,3 @@ jobs: - name: Build oneMKL run: | docker build . --file Dockerfile.nightly --tag onemkl_nightly_0.2:$(date +%Y%m%d) - docker run onemkl_nightly_0.2:$(date +%Y%m%d) diff --git a/Dockerfile.ci b/Dockerfile.ci index 8449e4fa5..ab4d5e49c 100644 --- a/Dockerfile.ci +++ b/Dockerfile.ci @@ -24,6 +24,12 @@ FROM intel/oneapi-basekit:2023.2.1-devel-ubuntu22.04 AS BACKEND_MKL ARG DEBIAN_FRONTEND=noninteractive ARG APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 +# Make space in the docker image +RUN echo "Removing large directories" +# deleting 15GB +RUN rm -rf /usr/share/dotnet/ +RUN df -h + RUN apt-get install -y gpg-agent RUN wget -qO - https://repositories.intel.com/graphics/intel-graphics.key | gpg --dearmor --output /usr/share/keyrings/intel-graphics.gpg RUN echo 'deb [arch=amd64 signed-by=/usr/share/keyrings/intel-graphics.gpg] https://repositories.intel.com/graphics/ubuntu focal main' | tee -a /etc/apt/sources.list.d/intel.list @@ -31,9 +37,6 @@ RUN echo 'deb [arch=amd64 signed-by=/usr/share/keyrings/intel-graphics.gpg] http # Install build essentials RUN apt-get update -y && \ apt-get install -y -o=Dpkg::Use-Pty=0 \ - intel-opencl-icd \ - intel-level-zero-gpu level-zero \ - intel-media-va-driver-non-free libmfx1 libmfxgen1 libvpl2 \ cmake ninja-build # Setup Working Directory @@ -45,5 +48,7 @@ WORKDIR /home/oneMKL/BUILD RUN cmake -G "Ninja" .. -DBUILD_FUNCTIONAL_TESTS=OFF -DCMAKE_CXX_COMPILER=icpx RUN ninja +# Run cpu device only +# Known Intel GPU support issue in docker https://github.com/docker/cli/issues/2063. # Test -RUN ctest -j$(nproc) +RUN ctest -R cpu diff --git a/Dockerfile.nightly b/Dockerfile.nightly index 9a36fc55a..67cdd4794 100644 --- a/Dockerfile.nightly +++ b/Dockerfile.nightly @@ -25,6 +25,12 @@ ARG DEBIAN_FRONTEND=noninteractive ARG APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 ARG NETLIB_VERSION_TAG=3.11.0 +# Make space in the docker image +RUN echo "Removing large directories" +# deleting 15GB +RUN rm -rf /usr/share/dotnet/ +RUN df -h + # Install build essentials RUN apt-get update -y && \ apt-get install -y -o=Dpkg::Use-Pty=0 \ @@ -49,5 +55,7 @@ WORKDIR /home/oneMKL/BUILD RUN cmake -G "Ninja" .. -DBUILD_EXAMPLES=OFF -DCMAKE_CXX_COMPILER=icpx -DREF_BLAS_ROOT=/home/Reference-LAPACK/OUTPUT -DREF_LAPACK_ROOT=/home/Reference-LAPACK/OUTPUT RUN ninja +# Run cpu device only +# Known Intel GPU support issue in docker https://github.com/docker/cli/issues/2063. # Test -CMD ctest -j$(nproc) +RUN ctest -R cpu From d31b6a763b0c0c9f18f1d2ead1424ee122457983 Mon Sep 17 00:00:00 2001 From: "Malia, Viraj" Date: Fri, 15 Sep 2023 22:26:40 -0700 Subject: [PATCH 11/15] os-wise jobs --- .../workflows/{docker-ci.yml => linux-ci.yml} | 4 +- .../{docker-nightly.yml => linux-nightly.yml} | 4 +- .../{cmake-ci.yml => windows-ci.yml} | 65 +++---------------- 3 files changed, 14 insertions(+), 59 deletions(-) rename .github/workflows/{docker-ci.yml => linux-ci.yml} (84%) rename .github/workflows/{docker-nightly.yml => linux-nightly.yml} (80%) rename .github/workflows/{cmake-ci.yml => windows-ci.yml} (54%) diff --git a/.github/workflows/docker-ci.yml b/.github/workflows/linux-ci.yml similarity index 84% rename from .github/workflows/docker-ci.yml rename to .github/workflows/linux-ci.yml index 90a0f94a6..e682bf9e9 100644 --- a/.github/workflows/docker-ci.yml +++ b/.github/workflows/linux-ci.yml @@ -1,4 +1,4 @@ -name: oneMKL Interfaces Docker CI +name: Linux CI - oneMKL backend on: push: @@ -8,7 +8,7 @@ on: workflow_dispatch: jobs: - build_n_test: + CI: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/docker-nightly.yml b/.github/workflows/linux-nightly.yml similarity index 80% rename from .github/workflows/docker-nightly.yml rename to .github/workflows/linux-nightly.yml index 965749d10..cefc3b3e8 100644 --- a/.github/workflows/docker-nightly.yml +++ b/.github/workflows/linux-nightly.yml @@ -1,4 +1,4 @@ -name: oneMKL Interfaces Docker Nightly +name: Linux Nightly - oneMKL backend on: schedule: @@ -6,7 +6,7 @@ on: workflow_dispatch: jobs: - build_n_test: + Nightly: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/cmake-ci.yml b/.github/workflows/windows-ci.yml similarity index 54% rename from .github/workflows/cmake-ci.yml rename to .github/workflows/windows-ci.yml index 4b26504f9..f3dd32b83 100644 --- a/.github/workflows/cmake-ci.yml +++ b/.github/workflows/windows-ci.yml @@ -1,4 +1,4 @@ -name: oneMKL Interfaces CMake CI +name: Windows CI - oneMKL backend on: push: @@ -13,50 +13,23 @@ jobs: # Set fail-fast to false to ensure that feedback is delivered for all matrix combinations. Consider changing this to true when your workflow is stable. fail-fast: false matrix: - os: [ubuntu-22.04, windows-latest] + os: [windows-latest] build_type: [Release] include: - os: windows-latest cpp_compiler: icx - - os: ubuntu-22.04 - cpp_compiler: icpx steps: - name: Install oneMKL and Intel C++/DPC++ compiler - id: basekit-install-lnx - if: matrix.os == 'ubuntu-22.04' - 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-common-vars intel-oneapi-common-licensing-2023.2.0 \ - intel-oneapi-compiler-dpcpp-cpp-2023.2.0 \ - intel-oneapi-mkl-devel-2023.2.0 - - - name: Install oneMKL and Intel C++/DPC++ compiler - id: basekit-install-win - if: matrix.os == 'windows-latest' + id: basekit-install shell: cmd run: | curl -o C:\oneapi_installer.exe https://registrationcenter-download.intel.com/akdlm/IRC_NAS/f96c71db-2c6c-45d9-8c1f-0348ef5885cf/w_BaseKit_p_2023.2.0.49396_offline.exe dir C: call "C:\oneapi_installer.exe" -s -a --silent --eula accept --install-dir "C:\Program Files (x86)\Intel\oneAPI" - - name: Setup oneAPI environment Linux - id: env-setup-lnx - if: matrix.os == 'ubuntu-22.04' - run: | - source /opt/intel/oneapi/setvars.sh - echo "oneapi_ld_libpath=${LD_LIBRARY_PATH}" >> "$GITHUB_ENV" - echo "oneapi_path=${PATH}" >> "$GITHUB_ENV" - echo "oneapi_cpath=${CPATH}" >> "$GITHUB_ENV" - echo "oneapi_mklroot=${MKLROOT}" >> "$GITHUB_ENV" - echo "config_shell=bash" >> "$GITHUB_ENV" - - - name: Setup oneAPI environment Windows - id: env-setup-win - if: matrix.os == 'windows-latest' + - name: Setup oneAPI environment + id: env-setup shell: cmd run: | call "C:\Program Files (x86)\Intel\oneAPI\setvars.bat" @@ -73,28 +46,8 @@ jobs: echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" - uses: seanmiddleditch/gha-setup-ninja@master - - name: Configure and Build (Linux) - id: build-step-lnx - if: matrix.os == 'ubuntu-22.04' - env: - PATH: ${{ env.oneapi_path }} - CPATH: ${{ env.oneapi_cpath }} - LIBRARY_PATH: ${{ env.oneapi_libpath }} - LD_LIBRARY_PATH: ${{ env.oneapi_ld_libpath }} - MKLROOT: ${{ env.oneapi_mklroot }} - run: | - ${{ matrix.cpp_compiler }} --version - cmake -B ${{ steps.strings.outputs.build-output-dir }} \ - -G "Ninja" \ - -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} \ - -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ - -DBUILD_FUNCTIONAL_TESTS=OFF \ - -S ${{ github.workspace }} - cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} - - - name: Configure and Build (Windows) - id: build-step-win - if: matrix.os == 'windows-latest' + - name: Configure and Build + id: build-step shell: cmd env: PATH: ${{ env.oneapi_path }} @@ -110,6 +63,7 @@ jobs: - name: Test working-directory: ${{ steps.strings.outputs.build-output-dir }} + shell: cmd env: PATH: ${{ env.oneapi_path }} CPATH: ${{ env.oneapi_cpath }} @@ -117,4 +71,5 @@ jobs: LD_LIBRARY_PATH: ${{ env.oneapi_ld_libpath }} # Execute tests defined by the CMake configuration. Note that --build-config is needed because the default Windows generator is a multi-config generator (Visual Studio generator). # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail - run: ctest -V --build-config ${{ matrix.build_type }} + # Github actions does not provide GPU-accelerated hosts, so run cpu only + run: ctest -V -R cpu --build-config ${{ matrix.build_type }} From 606df7d90ecd9e372dcfd75b090345f189c174a2 Mon Sep 17 00:00:00 2001 From: "Malia, Viraj" Date: Fri, 15 Sep 2023 22:39:04 -0700 Subject: [PATCH 12/15] add ci badges --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 37a753166..2327f9c3c 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,9 @@ # oneAPI Math Kernel Library (oneMKL) Interfaces +|Linux|Windows +|---|---| +|[![oneMKL backend](https://github.com/virajmalia/oneMKL/actions/workflows/linux-ci.yml/badge.svg)](https://github.com/virajmalia/oneMKL/actions/workflows/linux-ci.yml)|[![oneMKL backend](https://github.com/virajmalia/oneMKL/actions/workflows/windows-ci.yml/badge.svg)](https://github.com/virajmalia/oneMKL/actions/workflows/windows-ci.yml)| + oneAPI logo oneMKL Interfaces is an open-source implementation of the oneMKL Data Parallel C++ (DPC++) interface according to the [oneMKL specification](https://spec.oneapi.com/versions/latest/elements/oneMKL/source/index.html). It works with multiple devices (backends) using device-specific libraries underneath. From 191f74fee562d9a0f1bfa77e9a39646d009be57e Mon Sep 17 00:00:00 2001 From: "Malia, Viraj" Date: Sat, 16 Sep 2023 07:35:19 -0700 Subject: [PATCH 13/15] use same names as vars --- .github/workflows/windows-ci.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/windows-ci.yml b/.github/workflows/windows-ci.yml index f3dd32b83..0500c1ce2 100644 --- a/.github/workflows/windows-ci.yml +++ b/.github/workflows/windows-ci.yml @@ -33,10 +33,10 @@ jobs: shell: cmd run: | call "C:\Program Files (x86)\Intel\oneAPI\setvars.bat" - echo "oneapi_libpath=%LIBRARY_PATH%" >> "%GITHUB_ENV%" - echo "oneapi_path=%PATH%" >> "%GITHUB_ENV%" - echo "oneapi_cpath=%CPATH%" >> "%GITHUB_ENV%" - echo "oneapi_mklroot=%MKLROOT%" >> "%GITHUB_ENV%" + echo "LIBRARY_PATH=%LIBRARY_PATH%" >> "%GITHUB_ENV%" + echo "PATH=%PATH%" >> "%GITHUB_ENV%" + echo "CPATH=%CPATH%" >> "%GITHUB_ENV%" + echo "MKLROOT=%MKLROOT%" >> "%GITHUB_ENV%" - uses: actions/checkout@v3 - name: Set reusable strings @@ -50,11 +50,11 @@ jobs: id: build-step shell: cmd env: - PATH: ${{ env.oneapi_path }} - CPATH: ${{ env.oneapi_cpath }} - LIBRARY_PATH: ${{ env.oneapi_libpath }} - LD_LIBRARY_PATH: ${{ env.oneapi_ld_libpath }} - MKLROOT: ${{ env.oneapi_mklroot }} + PATH: ${{ env.PATH }} + CPATH: ${{ env.CPATH }} + LIBRARY_PATH: ${{ env.LIBRARY_PATH }} + LD_LIBRARY_PATH: ${{ env.LD_LIBRARY_PATH }} + MKLROOT: ${{ env.MKLROOT }} run: | ${{ matrix.cpp_compiler }} --version cmake -B ${{ steps.strings.outputs.build-output-dir }} -G "Ninja" -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DBUILD_FUNCTIONAL_TESTS=OFF -S ${{ github.workspace }} From b9d0c1ebca6633451aab0944c709325c972a419e Mon Sep 17 00:00:00 2001 From: "Malia, Viraj" Date: Sun, 17 Sep 2023 13:21:24 -0700 Subject: [PATCH 14/15] Revert "use same names as vars" This reverts commit 191f74fee562d9a0f1bfa77e9a39646d009be57e. --- .github/workflows/windows-ci.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/windows-ci.yml b/.github/workflows/windows-ci.yml index 0500c1ce2..f3dd32b83 100644 --- a/.github/workflows/windows-ci.yml +++ b/.github/workflows/windows-ci.yml @@ -33,10 +33,10 @@ jobs: shell: cmd run: | call "C:\Program Files (x86)\Intel\oneAPI\setvars.bat" - echo "LIBRARY_PATH=%LIBRARY_PATH%" >> "%GITHUB_ENV%" - echo "PATH=%PATH%" >> "%GITHUB_ENV%" - echo "CPATH=%CPATH%" >> "%GITHUB_ENV%" - echo "MKLROOT=%MKLROOT%" >> "%GITHUB_ENV%" + echo "oneapi_libpath=%LIBRARY_PATH%" >> "%GITHUB_ENV%" + echo "oneapi_path=%PATH%" >> "%GITHUB_ENV%" + echo "oneapi_cpath=%CPATH%" >> "%GITHUB_ENV%" + echo "oneapi_mklroot=%MKLROOT%" >> "%GITHUB_ENV%" - uses: actions/checkout@v3 - name: Set reusable strings @@ -50,11 +50,11 @@ jobs: id: build-step shell: cmd env: - PATH: ${{ env.PATH }} - CPATH: ${{ env.CPATH }} - LIBRARY_PATH: ${{ env.LIBRARY_PATH }} - LD_LIBRARY_PATH: ${{ env.LD_LIBRARY_PATH }} - MKLROOT: ${{ env.MKLROOT }} + PATH: ${{ env.oneapi_path }} + CPATH: ${{ env.oneapi_cpath }} + LIBRARY_PATH: ${{ env.oneapi_libpath }} + LD_LIBRARY_PATH: ${{ env.oneapi_ld_libpath }} + MKLROOT: ${{ env.oneapi_mklroot }} run: | ${{ matrix.cpp_compiler }} --version cmake -B ${{ steps.strings.outputs.build-output-dir }} -G "Ninja" -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DBUILD_FUNCTIONAL_TESTS=OFF -S ${{ github.workspace }} From 7e8468c20fae2ec978fe49fd4cad18f9a4540d19 Mon Sep 17 00:00:00 2001 From: "Malia, Viraj" Date: Sun, 17 Sep 2023 13:33:27 -0700 Subject: [PATCH 15/15] move shell after env --- .github/workflows/windows-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows-ci.yml b/.github/workflows/windows-ci.yml index f3dd32b83..5687dd8b5 100644 --- a/.github/workflows/windows-ci.yml +++ b/.github/workflows/windows-ci.yml @@ -48,13 +48,13 @@ jobs: - uses: seanmiddleditch/gha-setup-ninja@master - name: Configure and Build id: build-step - shell: cmd env: PATH: ${{ env.oneapi_path }} CPATH: ${{ env.oneapi_cpath }} LIBRARY_PATH: ${{ env.oneapi_libpath }} LD_LIBRARY_PATH: ${{ env.oneapi_ld_libpath }} MKLROOT: ${{ env.oneapi_mklroot }} + shell: cmd run: | ${{ matrix.cpp_compiler }} --version cmake -B ${{ steps.strings.outputs.build-output-dir }} -G "Ninja" -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DBUILD_FUNCTIONAL_TESTS=OFF -S ${{ github.workspace }}