From 4e1a0e47cb32c53cec2e004cf608f44b11ff4226 Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Tue, 23 Jan 2024 15:41:25 +0100 Subject: [PATCH 001/100] Factorize builds --- .github/workflows/base_images.yaml | 46 +++++++ .github/workflows/cmake.yml | 186 +++++++++++------------------ docker/{nvidia => cuda}/Dockerfile | 0 docker/{amd => hip}/Dockerfile | 0 install_test/bin/install_cuda.sh | 4 +- install_test/bin/install_hip.sh | 4 +- 6 files changed, 119 insertions(+), 121 deletions(-) create mode 100644 .github/workflows/base_images.yaml rename docker/{nvidia => cuda}/Dockerfile (100%) rename docker/{amd => hip}/Dockerfile (100%) diff --git a/.github/workflows/base_images.yaml b/.github/workflows/base_images.yaml new file mode 100644 index 00000000..310ba851 --- /dev/null +++ b/.github/workflows/base_images.yaml @@ -0,0 +1,46 @@ +name: Build base images + +on: + workflow_call: + # push: + # branches: + # - main + # pull_request: + # branches: + # - main + # schedule: + # # TODO enable scheduler + # cron: "0 1 2,16 * *" # every 2nd and 16th of the month at 1am UTC + +jobs: + build_base: + runs-on: ubuntu-latest + + strategy: + matrix: + backend: + # - openmp + - cuda + # - hip + + steps: + - name: Free Disk Space (Ubuntu) + uses: jlumbroso/free-disk-space@v1.2.0 + with: + tool-cache: true + large-packages: false + + - name: Checkout repository + uses: actions/checkout@v3 + + # TODO check if current build has a different Dockerfile + + - name: Build image + # TODO improve with caching https://docs.docker.com/engine/reference/commandline/image_build/#cache-from + run: docker build -t base_${{ matrix.backend }} docker/${{ matrix.backend }} + + - name: Login in GitHub Containers Repository + run: echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin + + - name: Push image + run: docker push ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend }} diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 2755d1ce..699306d1 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -1,8 +1,9 @@ -name: CMake +name: Build and test on: pull_request: - branches: [ "main" ] + branches: + - main env: # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) @@ -20,128 +21,79 @@ jobs: extensions: 'hpp,cpp' clangFormatVersion: 12 - build_nvidia: - # The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac. - # You can convert this to a matrix build if you need cross-platform coverage. - # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix - runs-on: ubuntu-latest - - env: - backends: OPENMP CUDA CUDA_HOST_DEVICE - CUDA_ARCHITECTURES: AMPERE80 - CMAKE_CXX_COMPILER: /work/tpls/kokkos/bin/nvcc_wrapper - container: nvidia_env - - steps: - - name: Free Disk Space (Ubuntu) - uses: jlumbroso/free-disk-space@v1.2.0 - with: { tool-cache: true, large-packages: false } - - - name: Checkout built branch - uses: actions/checkout@v3 - with: - submodules: recursive - - - name: Update submodules - run: git submodule update --remote --recursive - - - name: Build docker - run: docker build -t ${{ env.container }} docker/nvidia - - - name: Configure CMake for OpenMP backend - # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. - # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type - run: | - docker run -v ${{github.workspace}}:/work ${{ env.container }} cmake -B build_OPENMP \ - -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_CXX_COMPILER=g++ \ - -DCMAKE_CXX_STANDARD=17 -DKokkos_ENABLE_OPENMP=ON -DBUILD_TESTING=ON -DKokkosFFT_INTERNAL_Kokkos=ON - - - name: Configure CMake for CUDA backend - # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. - # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type - run: | - docker run -v ${{github.workspace}}:/work ${{ env.container }} cmake -B build_CUDA \ - -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_CXX_COMPILER=${{env.CMAKE_CXX_COMPILER}} \ - -DCMAKE_CXX_STANDARD=17 -DKokkos_ENABLE_CUDA=ON -DKokkos_ARCH_${{env.CUDA_ARCHITECTURES}}=ON -DBUILD_TESTING=ON -DKokkosFFT_INTERNAL_Kokkos=ON - - - name: Configure CMake for CUDA backend with HOST and DEVICE option - # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. - # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type - run: | - docker run -v ${{github.workspace}}:/work ${{ env.container }} cmake -B build_CUDA_HOST_DEVICE \ - -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_CXX_COMPILER=${{env.CMAKE_CXX_COMPILER}} \ - -DCMAKE_CXX_STANDARD=17 -DKokkos_ENABLE_CUDA=ON -DKokkos_ARCH_${{env.CUDA_ARCHITECTURES}}=ON -DBUILD_TESTING=ON \ - -DKokkosFFT_ENABLE_HOST_AND_DEVICE=ON -DKokkosFFT_INTERNAL_Kokkos=ON - - - name: Build - # Build your program with the given configuration - run: | - for backend in ${{ env.backends }}; do - docker run -v ${{github.workspace}}:/work ${{ env.container }} cmake --build build_${backend} --config ${{env.BUILD_TYPE}} -j 2 - done - - - name: Test for OpenMP backend - # Execute tests defined by the CMake configuration. Testing on CPUs only - run: | - docker run -v ${{github.workspace}}:/work ${{ env.container }} ctest --output-on-failure --test-dir build_OPENMP -C ${{env.BUILD_TYPE}} - - - name: Install test for OpenMP backend - run: | - docker run -v ${{github.workspace}}:/work ${{ env.container }} ./install_test/bin/install_cpu.sh /tmp + build_base: + uses: ./.github/workflows/base_images.yaml - - name: Install test for CUDA backend - run: | - for backend in ${{ env.backends }}; do - if [ ${backend} != "OPENMP" ]; then - docker run -v ${{github.workspace}}:/work ${{ env.container }} ./install_test/bin/install_cuda.sh /tmp ${backend} - fi - done - - build_amd: - # The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac. - # You can convert this to a matrix build if you need cross-platform coverage. - # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix + build: runs-on: ubuntu-latest - env: - #backends: HIP HIP_HOST_DEVICE - architecture: VEGA90A - CMAKE_CXX_COMPILER: hipcc - container: amd_env - strategy: matrix: - backend: [ {name: HIP, option: ""}, {name: HIP_HOST_DEVICE, option: "-DKokkosFFT_ENABLE_HOST_AND_DEVICE=ON"} ] + backend: + # - name: openmp + # cmake_flags: -DKokkos_ENABLE_OPENMP + - name: cuda + cmake_flags: -DKokkos_ENABLE_CUDA -DKokkos_ARCH_AMPERE80 + # - name: hip + # cmake_flags: -DKokkos_ENABLE_HIP -DKokkos_ARCH_VEGA90A + target: + - name: native + cmake_flags: "" + - name: host_device + cmake_flags: -DKokkosFFT_ENABLE_HOST_AND_DEVICE=ON + exclude: + - backend: + name: openmp + target: + name: host_device + + needs: + - build_base steps: - - name: Free Disk Space (Ubuntu) - uses: jlumbroso/free-disk-space@v1.2.0 - with: { tool-cache: true, large-packages: false } - - - name: Checkout built branch - uses: actions/checkout@v3 - with: - submodules: recursive - - - name: Update submodules - run: git submodule update --remote --recursive - - - name: Build docker - run: docker build -t ${{ env.container }} docker/amd - - - name: Configure CMake for HIP backend - # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. - # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type - run: | - docker run -v ${{github.workspace}}:/work ${{ env.container }} cmake -B build_${{matrix.backend.name}} \ - -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_CXX_COMPILER=${{env.CMAKE_CXX_COMPILER}} \ - -DCMAKE_CXX_STANDARD=17 -DKokkos_ENABLE_HIP=ON -DKokkosFFT_INTERNAL_Kokkos=ON -DKokkos_ARCH_${{env.architecture}}=ON -DBUILD_TESTING=ON ${{matrix.backend.option}} - - - name: Build - # Build your program with the given configuration - run: | - docker run -v ${{github.workspace}}:/work ${{ env.container }} cmake --build build_${{matrix.backend.name}} --config ${{env.BUILD_TYPE}} -j 2 + - name: Free Disk Space (Ubuntu) + uses: jlumbroso/free-disk-space@v1.2.0 + with: + tool-cache: true + large-packages: false + + - name: Checkout built branch + uses: actions/checkout@v3 + with: + submodules: recursive + + - name: Login in GitHub Containers Repository + run: echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin + + - name: Pull image + run: docker pull ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }} + + - name: Configure + run: | + docker run -v ${{github.workspace}}:/work base_${{ matrix.backend.name }} \ + cmake -B build \ + -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \ + -DCMAKE_CXX_STANDARD=17 \ + -DBUILD_TESTING=ON \ + -DKokkosFFT_INTERNAL_Kokkos=ON \ + ${{ matrix.backend.cmake_flags }} \ + ${{ matrix.target.cmake_flags }} \ + + - name: Build + run: | + docker run -v ${{github.workspace}}:/work base_${{ matrix.backend.name }} \ + cmake --build build -j 2 + + - name: Save image + run: docker commit nvidia_base ghcr.io/cexa-project/kokkos-fft/kokkos_fft_${{ matrix.backend.name }} + + - name: Install + run: docker run -v ${{github.workspace}}:/work base_${{ matrix.backend.name }} \ + ./install_test/bin/install_${{ matrix.backend.name }}.sh /tmp ${{ matrix.backend.name }} + + - name: Push image + run: docker push ghcr.io/cexa-project/kokkos-fft/kokkos_fft_${{ matrix.backend.name }} - name: Install test for HIP backend run: | - docker run -v ${{github.workspace}}:/work ${{ env.container }} ./install_test/bin/install_hip.sh /tmp ${{matrix.backend.name}} \ No newline at end of file + docker run -v ${{github.workspace}}:/work ${{ env.container }} ./install_test/bin/install_hip.sh /tmp ${{matrix.target.name}} diff --git a/docker/nvidia/Dockerfile b/docker/cuda/Dockerfile similarity index 100% rename from docker/nvidia/Dockerfile rename to docker/cuda/Dockerfile diff --git a/docker/amd/Dockerfile b/docker/hip/Dockerfile similarity index 100% rename from docker/amd/Dockerfile rename to docker/hip/Dockerfile diff --git a/install_test/bin/install_cuda.sh b/install_test/bin/install_cuda.sh index 7efaf85f..4ea77d8f 100755 --- a/install_test/bin/install_cuda.sh +++ b/install_test/bin/install_cuda.sh @@ -36,7 +36,7 @@ fi # Install KokkosFFT cd ${WK_DIR} mkdir ${KOKKOSFFT_BUILD_DIR} && cd ${KOKKOSFFT_BUILD_DIR} -if [ $TARGET == "CUDA" ]; then +if [ $TARGET == "native" ]; then cmake -DCMAKE_CXX_COMPILER=${CXX_COMPILER} \ -DCMAKE_CXX_STANDARD=17 -DKokkos_ENABLE_CUDA=ON -DKokkos_ARCH_AMPERE80=ON \ -DCMAKE_INSTALL_PREFIX=${KOKKOSFFT_INSTALL_PREFIX} .. @@ -61,4 +61,4 @@ if [ $? -eq 0 ]; then else echo "*** install test: build FAILED ***" exit 1; -fi \ No newline at end of file +fi diff --git a/install_test/bin/install_hip.sh b/install_test/bin/install_hip.sh index 01e8c9fc..8796ab41 100755 --- a/install_test/bin/install_hip.sh +++ b/install_test/bin/install_hip.sh @@ -35,7 +35,7 @@ fi # Install KokkosFFT cd ${WK_DIR} mkdir ${KOKKOSFFT_BUILD_DIR} && cd ${KOKKOSFFT_BUILD_DIR} -if [ $TARGET == "HIP" ]; then +if [ $TARGET == "native" ]; then cmake -DCMAKE_CXX_COMPILER=hipcc \ -DCMAKE_CXX_STANDARD=17 -DKokkos_ENABLE_HIP=ON -DKokkos_ARCH_VEGA90A=ON \ -DCMAKE_INSTALL_PREFIX=${KOKKOSFFT_INSTALL_PREFIX} .. @@ -61,4 +61,4 @@ if [ $? -eq 0 ]; then else echo "*** install test: build FAILED ***" exit 1; -fi \ No newline at end of file +fi From 370f3d92ae75695623afc92bc14d0b7c8bd5febd Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Tue, 23 Jan 2024 16:25:24 +0100 Subject: [PATCH 002/100] Build base image in test --- .github/workflows/base_images.yaml | 6 ++++- .github/workflows/cmake.yml | 35 +++++++++++++++++++++++++++++- 2 files changed, 39 insertions(+), 2 deletions(-) diff --git a/.github/workflows/base_images.yaml b/.github/workflows/base_images.yaml index 310ba851..19b57de2 100644 --- a/.github/workflows/base_images.yaml +++ b/.github/workflows/base_images.yaml @@ -37,7 +37,11 @@ jobs: - name: Build image # TODO improve with caching https://docs.docker.com/engine/reference/commandline/image_build/#cache-from - run: docker build -t base_${{ matrix.backend }} docker/${{ matrix.backend }} + run: docker build \ + -t ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend }} \ + --cache-from ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend }} \ + --build-arg BUIDKIT_INLINE_CACHE=1 \ + docker/${{ matrix.backend }} - name: Login in GitHub Containers Repository run: echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 699306d1..71f59b36 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -22,7 +22,40 @@ jobs: clangFormatVersion: 12 build_base: - uses: ./.github/workflows/base_images.yaml + runs-on: ubuntu-latest + + strategy: + matrix: + backend: + # - openmp + - cuda + # - hip + + steps: + - name: Free Disk Space (Ubuntu) + uses: jlumbroso/free-disk-space@v1.2.0 + with: + tool-cache: true + large-packages: false + + - name: Checkout repository + uses: actions/checkout@v3 + + # TODO check if current build has a different Dockerfile + + - name: Build image + # TODO improve with caching https://docs.docker.com/engine/reference/commandline/image_build/#cache-from + run: docker build \ + -t ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend }} \ + --cache-from ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend }} \ + --build-arg BUIDKIT_INLINE_CACHE=1 \ + docker/${{ matrix.backend }} + + - name: Login in GitHub Containers Repository + run: echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin + + - name: Push image + run: docker push ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend }} build: runs-on: ubuntu-latest From 126934348cb30cb5714a1bd955bf692b51e33550 Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Tue, 23 Jan 2024 16:43:45 +0100 Subject: [PATCH 003/100] Rename build job --- .github/workflows/cmake.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 71f59b36..cb3c70c7 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -57,7 +57,7 @@ jobs: - name: Push image run: docker push ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend }} - build: + build_kokkos_fft: runs-on: ubuntu-latest strategy: From d0d7d10ffe271c4a3b988488d2c3754b7e08f4c9 Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Tue, 23 Jan 2024 16:45:30 +0100 Subject: [PATCH 004/100] Fix syntax error --- .github/workflows/cmake.yml | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index cb3c70c7..7904e121 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -45,11 +45,12 @@ jobs: - name: Build image # TODO improve with caching https://docs.docker.com/engine/reference/commandline/image_build/#cache-from - run: docker build \ - -t ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend }} \ - --cache-from ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend }} \ - --build-arg BUIDKIT_INLINE_CACHE=1 \ - docker/${{ matrix.backend }} + run: | + docker build \ + -t ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend }} \ + --cache-from ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend }} \ + --build-arg BUIDKIT_INLINE_CACHE=1 \ + docker/${{ matrix.backend }} - name: Login in GitHub Containers Repository run: echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin @@ -57,7 +58,7 @@ jobs: - name: Push image run: docker push ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend }} - build_kokkos_fft: + build: runs-on: ubuntu-latest strategy: @@ -103,14 +104,14 @@ jobs: - name: Configure run: | - docker run -v ${{github.workspace}}:/work base_${{ matrix.backend.name }} \ - cmake -B build \ - -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \ - -DCMAKE_CXX_STANDARD=17 \ - -DBUILD_TESTING=ON \ - -DKokkosFFT_INTERNAL_Kokkos=ON \ - ${{ matrix.backend.cmake_flags }} \ - ${{ matrix.target.cmake_flags }} \ + docker run -v ${{github.workspace}}:/work base_${{ matrix.backend.name }} \ + cmake -B build \ + -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \ + -DCMAKE_CXX_STANDARD=17 \ + -DBUILD_TESTING=ON \ + -DKokkosFFT_INTERNAL_Kokkos=ON \ + ${{ matrix.backend.cmake_flags }} \ + ${{ matrix.target.cmake_flags }} \ - name: Build run: | @@ -121,7 +122,8 @@ jobs: run: docker commit nvidia_base ghcr.io/cexa-project/kokkos-fft/kokkos_fft_${{ matrix.backend.name }} - name: Install - run: docker run -v ${{github.workspace}}:/work base_${{ matrix.backend.name }} \ + run: | + docker run -v ${{github.workspace}}:/work base_${{ matrix.backend.name }} \ ./install_test/bin/install_${{ matrix.backend.name }}.sh /tmp ${{ matrix.backend.name }} - name: Push image From 28b67c201393314136736790abb44d9390ac7952 Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Tue, 23 Jan 2024 16:54:24 +0100 Subject: [PATCH 005/100] Remove old line in ci --- .github/workflows/cmake.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 7904e121..2917dbe1 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -128,7 +128,3 @@ jobs: - name: Push image run: docker push ghcr.io/cexa-project/kokkos-fft/kokkos_fft_${{ matrix.backend.name }} - - - name: Install test for HIP backend - run: | - docker run -v ${{github.workspace}}:/work ${{ env.container }} ./install_test/bin/install_hip.sh /tmp ${{matrix.target.name}} From a7fd9553d70d439fe952e2c006e1b99e2f0589d1 Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Tue, 23 Jan 2024 17:15:19 +0100 Subject: [PATCH 006/100] Fix docker images name --- .github/workflows/cmake.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 2917dbe1..6de13901 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -9,6 +9,9 @@ env: # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) BUILD_TYPE: RelWithDebInfo + # Force the use of BuildKit for Docker + DOCKER_BUILDKIT: 1 + jobs: lint: runs-on: ubuntu-latest @@ -50,6 +53,7 @@ jobs: -t ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend }} \ --cache-from ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend }} \ --build-arg BUIDKIT_INLINE_CACHE=1 \ + --progress=plain \ docker/${{ matrix.backend }} - name: Login in GitHub Containers Repository @@ -104,7 +108,7 @@ jobs: - name: Configure run: | - docker run -v ${{github.workspace}}:/work base_${{ matrix.backend.name }} \ + docker run -v ${{github.workspace}}:/work ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend }} \ cmake -B build \ -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \ -DCMAKE_CXX_STANDARD=17 \ @@ -115,7 +119,7 @@ jobs: - name: Build run: | - docker run -v ${{github.workspace}}:/work base_${{ matrix.backend.name }} \ + docker run -v ${{github.workspace}}:/work ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend }} \ cmake --build build -j 2 - name: Save image @@ -123,7 +127,7 @@ jobs: - name: Install run: | - docker run -v ${{github.workspace}}:/work base_${{ matrix.backend.name }} \ + docker run -v ${{github.workspace}}:/work ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend }} \ ./install_test/bin/install_${{ matrix.backend.name }}.sh /tmp ${{ matrix.backend.name }} - name: Push image From 1956c95beb20a8254edd71996e0369b0b2287727 Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Tue, 23 Jan 2024 17:24:21 +0100 Subject: [PATCH 007/100] Fix incorrect backend accesses --- .github/workflows/cmake.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 6de13901..960dacba 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -108,7 +108,7 @@ jobs: - name: Configure run: | - docker run -v ${{github.workspace}}:/work ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend }} \ + docker run -v ${{github.workspace}}:/work ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }} \ cmake -B build \ -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \ -DCMAKE_CXX_STANDARD=17 \ @@ -119,7 +119,7 @@ jobs: - name: Build run: | - docker run -v ${{github.workspace}}:/work ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend }} \ + docker run -v ${{github.workspace}}:/work ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }} \ cmake --build build -j 2 - name: Save image @@ -127,7 +127,7 @@ jobs: - name: Install run: | - docker run -v ${{github.workspace}}:/work ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend }} \ + docker run -v ${{github.workspace}}:/work ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }} \ ./install_test/bin/install_${{ matrix.backend.name }}.sh /tmp ${{ matrix.backend.name }} - name: Push image From d331b07c7a192bcc898e55d3e3a338fb0c4a2da6 Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Tue, 23 Jan 2024 17:34:41 +0100 Subject: [PATCH 008/100] Fix Cmake flags --- .github/workflows/cmake.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 960dacba..d097f149 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -69,11 +69,11 @@ jobs: matrix: backend: # - name: openmp - # cmake_flags: -DKokkos_ENABLE_OPENMP + # cmake_flags: -DKokkos_ENABLE_OPENMP=ON - name: cuda - cmake_flags: -DKokkos_ENABLE_CUDA -DKokkos_ARCH_AMPERE80 + cmake_flags: -DKokkos_ENABLE_CUDA=ON -DKokkos_ARCH_AMPERE80=ON # - name: hip - # cmake_flags: -DKokkos_ENABLE_HIP -DKokkos_ARCH_VEGA90A + # cmake_flags: -DKokkos_ENABLE_HIP=ON -DKokkos_ARCH_VEGA90A=ON target: - name: native cmake_flags: "" From 6299e601019ef05f02c49f43a509b1db6cc40ada Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Tue, 23 Jan 2024 17:49:44 +0100 Subject: [PATCH 009/100] Fix save image step and restrict to create images for native target only --- .github/workflows/cmake.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index d097f149..b24dcae0 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -123,7 +123,8 @@ jobs: cmake --build build -j 2 - name: Save image - run: docker commit nvidia_base ghcr.io/cexa-project/kokkos-fft/kokkos_fft_${{ matrix.backend.name }} + run: docker commit ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }} ghcr.io/cexa-project/kokkos-fft/kokkos_fft_${{ matrix.backend.name }} + if: ${{ matrix.target.name }} == "native" - name: Install run: | @@ -132,3 +133,4 @@ jobs: - name: Push image run: docker push ghcr.io/cexa-project/kokkos-fft/kokkos_fft_${{ matrix.backend.name }} + if: ${{ matrix.target.name }} == "native" From 312009e3dfecc9840013fcb14740311a2d592460 Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Wed, 24 Jan 2024 14:28:45 +0100 Subject: [PATCH 010/100] Use a base nvcc Docker image from Kokkos --- .github/workflows/cmake.yml | 22 ++++++++++------ docker/base/cuda/Dockerfile | 43 ++++++++++++++++++++++++++++++++ docker/{ => base}/hip/Dockerfile | 0 docker/cuda/Dockerfile | 28 --------------------- docker/tests/cuda/Dockerfile | 7 ++++++ 5 files changed, 64 insertions(+), 36 deletions(-) create mode 100644 docker/base/cuda/Dockerfile rename docker/{ => base}/hip/Dockerfile (100%) delete mode 100644 docker/cuda/Dockerfile create mode 100644 docker/tests/cuda/Dockerfile diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index b24dcae0..6cbfd8cc 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -47,14 +47,13 @@ jobs: # TODO check if current build has a different Dockerfile - name: Build image - # TODO improve with caching https://docs.docker.com/engine/reference/commandline/image_build/#cache-from run: | docker build \ -t ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend }} \ --cache-from ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend }} \ --build-arg BUIDKIT_INLINE_CACHE=1 \ --progress=plain \ - docker/${{ matrix.backend }} + docker/base/${{ matrix.backend }} - name: Login in GitHub Containers Repository run: echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin @@ -100,9 +99,6 @@ jobs: with: submodules: recursive - - name: Login in GitHub Containers Repository - run: echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin - - name: Pull image run: docker pull ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }} @@ -122,8 +118,15 @@ jobs: docker run -v ${{github.workspace}}:/work ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }} \ cmake --build build -j 2 - - name: Save image - run: docker commit ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }} ghcr.io/cexa-project/kokkos-fft/kokkos_fft_${{ matrix.backend.name }} + - name: Build image + run: | + docker build \ + -t ghcr.io/cexa-project/kokkos-fft/tests_${{ matrix.backend.name }} \ + --cache-from ghcr.io/cexa-project/kokkos-fft/tests_${{ matrix.backend.name }} \ + --build-arg BUIDKIT_INLINE_CACHE=1 \ + --progress=plain \ + -f docker/tests/${{ matrix.backend.name }}/Dockerfile \ + . if: ${{ matrix.target.name }} == "native" - name: Install @@ -131,6 +134,9 @@ jobs: docker run -v ${{github.workspace}}:/work ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }} \ ./install_test/bin/install_${{ matrix.backend.name }}.sh /tmp ${{ matrix.backend.name }} + - name: Login in GitHub Containers Repository + run: echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin + - name: Push image - run: docker push ghcr.io/cexa-project/kokkos-fft/kokkos_fft_${{ matrix.backend.name }} + run: docker push ghcr.io/cexa-project/kokkos-fft/tests_${{ matrix.backend.name }} if: ${{ matrix.target.name }} == "native" diff --git a/docker/base/cuda/Dockerfile b/docker/base/cuda/Dockerfile new file mode 100644 index 00000000..b7439a93 --- /dev/null +++ b/docker/base/cuda/Dockerfile @@ -0,0 +1,43 @@ +ARG BASE=nvidia/cuda:12.3.1-devel-ubuntu20.04 +FROM $BASE + +ARG ADDITIONAL_PACKAGES + +RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/3bf863cc.pub + +RUN apt-get update && apt-get install -y \ + bc \ + wget \ + ccache \ + libfftw3-dev \ + $ADDITIONAL_PACKAGES \ + && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* + +RUN KEYDUMP_URL=https://cloud.cees.ornl.gov/download && \ + KEYDUMP_FILE=keydump && \ + wget --quiet ${KEYDUMP_URL}/${KEYDUMP_FILE} && \ + wget --quiet ${KEYDUMP_URL}/${KEYDUMP_FILE}.sig && \ + gpg --import ${KEYDUMP_FILE} && \ + gpg --verify ${KEYDUMP_FILE}.sig ${KEYDUMP_FILE} && \ + rm ${KEYDUMP_FILE}* + +ARG CMAKE_VERSION=3.23.2 +ENV CMAKE_DIR=/opt/cmake +RUN CMAKE_URL=https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION} && \ + CMAKE_SCRIPT=cmake-${CMAKE_VERSION}-Linux-x86_64.sh && \ + CMAKE_SHA256=cmake-${CMAKE_VERSION}-SHA-256.txt && \ + wget --quiet ${CMAKE_URL}/${CMAKE_SHA256} && \ + wget --quiet ${CMAKE_URL}/${CMAKE_SHA256}.asc && \ + wget --quiet ${CMAKE_URL}/${CMAKE_SCRIPT} && \ + gpg --verify ${CMAKE_SHA256}.asc ${CMAKE_SHA256} && \ + grep -i ${CMAKE_SCRIPT} ${CMAKE_SHA256} | sed -e s/linux/Linux/ | sha256sum --check && \ + mkdir -p ${CMAKE_DIR} && \ + sh ${CMAKE_SCRIPT} --skip-license --prefix=${CMAKE_DIR} && \ + rm cmake* +ENV PATH=${CMAKE_DIR}/bin:$PATH + +WORKDIR /work +ENV FFTWDIR "/usr" +CMD ["bash"] diff --git a/docker/hip/Dockerfile b/docker/base/hip/Dockerfile similarity index 100% rename from docker/hip/Dockerfile rename to docker/base/hip/Dockerfile diff --git a/docker/cuda/Dockerfile b/docker/cuda/Dockerfile deleted file mode 100644 index e50ed871..00000000 --- a/docker/cuda/Dockerfile +++ /dev/null @@ -1,28 +0,0 @@ -ARG TENSORFLOW_VERSION=21.12 -FROM nvcr.io/nvidia/tensorflow:${TENSORFLOW_VERSION}-tf2-py3 - -RUN apt-get update && apt-get -y upgrade && \ - apt-get install -y sudo && \ - apt-get install -y wget && \ - apt-get install -y git && \ - apt-get install -y libfftw3-dev && \ - apt-get clean && \ - git config --global --add safe.directory '*' && \ - rm -rf /var/lib/apt/lists/* - -# Install newer CMake manually -ARG CMAKE_VERSION=3.23.2 -ARG build_dir=/tmp/build - -ENV CMAKE_DIR=/opt/cmake -RUN CMAKE_SCRIPT=cmake-${CMAKE_VERSION}-linux-x86_64.sh && \ - mkdir -p ${build_dir} && mkdir -p ${CMAKE_DIR} \ - cd ${build_dir} && \ - wget https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/${CMAKE_SCRIPT} && \ - sh ${CMAKE_SCRIPT} --skip-license --prefix=${CMAKE_DIR} && \ - cd ${HOME} && rm -rf ${build_dir} -ENV PATH=${CMAKE_DIR}/bin:$PATH - -WORKDIR /work -ENV FFTWDIR "/usr" -CMD ["bash"] \ No newline at end of file diff --git a/docker/tests/cuda/Dockerfile b/docker/tests/cuda/Dockerfile new file mode 100644 index 00000000..93dca71d --- /dev/null +++ b/docker/tests/cuda/Dockerfile @@ -0,0 +1,7 @@ +ARG BASE=ghcr.io/cexa-project/kokkos-fft/base_cuda +FROM $BASE + +ARG BUILD_DIR=./build +COPY $BUILD_DIR /work/build + +WORKDIR /work/build From 0deb0fb49fcf8f367d3d659fe2ea79e35462c4b7 Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Wed, 24 Jan 2024 15:19:18 +0100 Subject: [PATCH 011/100] Fix install step --- .github/workflows/cmake.yml | 37 ++++++++++++++++++++++++++----------- 1 file changed, 26 insertions(+), 11 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 6cbfd8cc..1fb7df47 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -46,6 +46,9 @@ jobs: # TODO check if current build has a different Dockerfile + - name: Login in GitHub Containers Repository + run: echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin + - name: Build image run: | docker build \ @@ -55,9 +58,6 @@ jobs: --progress=plain \ docker/base/${{ matrix.backend }} - - name: Login in GitHub Containers Repository - run: echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin - - name: Push image run: docker push ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend }} @@ -99,6 +99,9 @@ jobs: with: submodules: recursive + - name: Login in GitHub Containers Repository + run: echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin + - name: Pull image run: docker pull ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }} @@ -106,16 +109,17 @@ jobs: run: | docker run -v ${{github.workspace}}:/work ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }} \ cmake -B build \ + -DCMAKE_INSTALL_PREFIX=/work/install \ -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \ -DCMAKE_CXX_STANDARD=17 \ -DBUILD_TESTING=ON \ -DKokkosFFT_INTERNAL_Kokkos=ON \ ${{ matrix.backend.cmake_flags }} \ - ${{ matrix.target.cmake_flags }} \ + ${{ matrix.target.cmake_flags }} - name: Build run: | - docker run -v ${{github.workspace}}:/work ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }} \ + docker run -v ${{github.workspace}}:/work ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }} \ cmake --build build -j 2 - name: Build image @@ -129,14 +133,25 @@ jobs: . if: ${{ matrix.target.name }} == "native" + - name: Push image + run: docker push ghcr.io/cexa-project/kokkos-fft/tests_${{ matrix.backend.name }} + if: ${{ matrix.target.name }} == "native" + - name: Install run: | docker run -v ${{github.workspace}}:/work ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }} \ - ./install_test/bin/install_${{ matrix.backend.name }}.sh /tmp ${{ matrix.backend.name }} + cmake --install build - - name: Login in GitHub Containers Repository - run: echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin + - name: Configure test code + run: | + docker run -v ${{github.workspace}}:/work ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }} \ + cmake -B /tmp/test \ + -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \ + -DCMAKE_CXX_STANDARD=17 \ + -DKokkosFFT_INTERNAL_Kokkos=ON \ + ${{ matrix.backend.cmake_flags }} \ + ${{ matrix.target.cmake_flags }} - - name: Push image - run: docker push ghcr.io/cexa-project/kokkos-fft/tests_${{ matrix.backend.name }} - if: ${{ matrix.target.name }} == "native" + - name: Build test code + docker run -v ${{github.workspace}}:/work ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }} \ + cmake --build /tmp/test -j 2 From 2d2af45dd7a87bf468b0fbe849f8f6da221dbfb1 Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Wed, 24 Jan 2024 15:20:20 +0100 Subject: [PATCH 012/100] Fix ci --- .github/workflows/cmake.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 1fb7df47..b2fecc5f 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -153,5 +153,6 @@ jobs: ${{ matrix.target.cmake_flags }} - name: Build test code + run: | docker run -v ${{github.workspace}}:/work ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }} \ cmake --build /tmp/test -j 2 From 79e3ade957d9f09d489edb4d4d55b30ef5c928c7 Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Wed, 24 Jan 2024 17:22:45 +0100 Subject: [PATCH 013/100] Only use base image --- .github/workflows/cmake.yml | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index b2fecc5f..12bf7848 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -61,6 +61,18 @@ jobs: - name: Push image run: docker push ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend }} + - name: Get Singularity + uses: eWaterCycle/setup-singularity@v7 + + - name: Convert image to singularity + run: singularity build base_${{ matrix.backend.name }}.sif docker://ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }} + + - name: Login in GitHub Containers Repository with singularity + run: echo ${{ secrets.GITHUB_TOKEN }} | singularity remote login -u ${{ github.actor }} --password-stdin oras://ghcr.io + + - name: Push image to singularity + run: singularity push base_${{ matrix.backend.name }}.sif oras://ghcr.io/cexa-project/kokkos-fft + build: runs-on: ubuntu-latest @@ -122,20 +134,11 @@ jobs: docker run -v ${{github.workspace}}:/work ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }} \ cmake --build build -j 2 - - name: Build image - run: | - docker build \ - -t ghcr.io/cexa-project/kokkos-fft/tests_${{ matrix.backend.name }} \ - --cache-from ghcr.io/cexa-project/kokkos-fft/tests_${{ matrix.backend.name }} \ - --build-arg BUIDKIT_INLINE_CACHE=1 \ - --progress=plain \ - -f docker/tests/${{ matrix.backend.name }}/Dockerfile \ - . - if: ${{ matrix.target.name }} == "native" - - - name: Push image - run: docker push ghcr.io/cexa-project/kokkos-fft/tests_${{ matrix.backend.name }} - if: ${{ matrix.target.name }} == "native" + - name: Save artifacts + uses: actions/upload-artifact@v4 + with: + name: tests_${{ matrix.backend.name }} + path: build - name: Install run: | From 2fd2228f89f96f20dc38d264e8a829d0127fca80 Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Wed, 24 Jan 2024 17:27:08 +0100 Subject: [PATCH 014/100] Set singularity version --- .github/workflows/cmake.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 12bf7848..d1232d8b 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -63,6 +63,8 @@ jobs: - name: Get Singularity uses: eWaterCycle/setup-singularity@v7 + with: + singularity-version: 3.8.3 - name: Convert image to singularity run: singularity build base_${{ matrix.backend.name }}.sif docker://ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }} From 450b412932a77ca74690dd05c8aac346cbb921cd Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Wed, 24 Jan 2024 17:37:00 +0100 Subject: [PATCH 015/100] Fix singularity version --- .github/workflows/cmake.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index d1232d8b..a359425a 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -64,7 +64,7 @@ jobs: - name: Get Singularity uses: eWaterCycle/setup-singularity@v7 with: - singularity-version: 3.8.3 + singularity-version: 3.8.3-1337439394 - name: Convert image to singularity run: singularity build base_${{ matrix.backend.name }}.sif docker://ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }} From 502108efd4c837200b93a57a7c6625f552271927 Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Wed, 24 Jan 2024 17:40:22 +0100 Subject: [PATCH 016/100] Downgrade singularity --- .github/workflows/cmake.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index a359425a..fbeb2b59 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -64,7 +64,7 @@ jobs: - name: Get Singularity uses: eWaterCycle/setup-singularity@v7 with: - singularity-version: 3.8.3-1337439394 + singularity-version: 3.6.4 - name: Convert image to singularity run: singularity build base_${{ matrix.backend.name }}.sif docker://ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }} From 6ecf5dea006d98f72a2ae08a11bfaff7d2c28f7c Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Wed, 24 Jan 2024 17:53:35 +0100 Subject: [PATCH 017/100] Install singularity manually --- .github/workflows/cmake.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index fbeb2b59..2170315f 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -62,9 +62,11 @@ jobs: run: docker push ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend }} - name: Get Singularity - uses: eWaterCycle/setup-singularity@v7 - with: - singularity-version: 3.6.4 + env: + SINGULARITY_VERSION: 3.11.2 + run: | + wget https://github.com/sylabs/singularity/releases/download/v${{ env.SINGULARITY_VERSION }}/singularity-ce_${{ env.SINGULARITY_VERSION }}-jammy_amd64.deb + apt-get install singularity-ce_${{ env.SINGULARITY_VERSION }}-jammy_amd64.deb - name: Convert image to singularity run: singularity build base_${{ matrix.backend.name }}.sif docker://ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }} From 504dce3bdf142fc034e3bd20a555cdbb72b8b068 Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Wed, 24 Jan 2024 17:54:22 +0100 Subject: [PATCH 018/100] Fix manual install --- .github/workflows/cmake.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 2170315f..842ee2b9 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -66,7 +66,7 @@ jobs: SINGULARITY_VERSION: 3.11.2 run: | wget https://github.com/sylabs/singularity/releases/download/v${{ env.SINGULARITY_VERSION }}/singularity-ce_${{ env.SINGULARITY_VERSION }}-jammy_amd64.deb - apt-get install singularity-ce_${{ env.SINGULARITY_VERSION }}-jammy_amd64.deb + apt-get ./install singularity-ce_${{ env.SINGULARITY_VERSION }}-jammy_amd64.deb - name: Convert image to singularity run: singularity build base_${{ matrix.backend.name }}.sif docker://ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }} From 7719bde55dd80e70fddc4fb624aebe9e2243bf39 Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Wed, 24 Jan 2024 17:57:18 +0100 Subject: [PATCH 019/100] Reorder singularity installation --- .github/workflows/cmake.yml | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 842ee2b9..a05ab773 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -46,10 +46,20 @@ jobs: # TODO check if current build has a different Dockerfile - - name: Login in GitHub Containers Repository + - name: Get Singularity + env: + SINGULARITY_VERSION: 3.11.2 + run: | + wget https://github.com/sylabs/singularity/releases/download/v${{ env.SINGULARITY_VERSION }}/singularity-ce_${{ env.SINGULARITY_VERSION }}-jammy_amd64.deb + apt-get install ./singularity-ce_${{ env.SINGULARITY_VERSION }}-jammy_amd64.deb + + - name: Login in GitHub Containers Repository with Docker run: echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin - - name: Build image + - name: Login in GitHub Containers Repository with Singularity + run: echo ${{ secrets.GITHUB_TOKEN }} | singularity remote login -u ${{ github.actor }} --password-stdin oras://ghcr.io + + - name: Build Docker image run: | docker build \ -t ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend }} \ @@ -58,23 +68,13 @@ jobs: --progress=plain \ docker/base/${{ matrix.backend }} - - name: Push image + - name: Push Docker image run: docker push ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend }} - - name: Get Singularity - env: - SINGULARITY_VERSION: 3.11.2 - run: | - wget https://github.com/sylabs/singularity/releases/download/v${{ env.SINGULARITY_VERSION }}/singularity-ce_${{ env.SINGULARITY_VERSION }}-jammy_amd64.deb - apt-get ./install singularity-ce_${{ env.SINGULARITY_VERSION }}-jammy_amd64.deb - - - name: Convert image to singularity + - name: Convert Docker image to Singularity run: singularity build base_${{ matrix.backend.name }}.sif docker://ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }} - - name: Login in GitHub Containers Repository with singularity - run: echo ${{ secrets.GITHUB_TOKEN }} | singularity remote login -u ${{ github.actor }} --password-stdin oras://ghcr.io - - - name: Push image to singularity + - name: Push Singularity image run: singularity push base_${{ matrix.backend.name }}.sif oras://ghcr.io/cexa-project/kokkos-fft build: From b26dd9ddb0404eb3a86d79ca3a8dc6c92947e0c7 Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Wed, 24 Jan 2024 17:58:27 +0100 Subject: [PATCH 020/100] Fix permission --- .github/workflows/cmake.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index a05ab773..c44cdace 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -51,7 +51,7 @@ jobs: SINGULARITY_VERSION: 3.11.2 run: | wget https://github.com/sylabs/singularity/releases/download/v${{ env.SINGULARITY_VERSION }}/singularity-ce_${{ env.SINGULARITY_VERSION }}-jammy_amd64.deb - apt-get install ./singularity-ce_${{ env.SINGULARITY_VERSION }}-jammy_amd64.deb + sudo apt-get install ./singularity-ce_${{ env.SINGULARITY_VERSION }}-jammy_amd64.deb - name: Login in GitHub Containers Repository with Docker run: echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin From 2406529b5ef7f9310eb7d777d4bf06f83baab758 Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Wed, 24 Jan 2024 18:02:35 +0100 Subject: [PATCH 021/100] Fix CI --- .github/workflows/cmake.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index c44cdace..3b910a90 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -72,10 +72,10 @@ jobs: run: docker push ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend }} - name: Convert Docker image to Singularity - run: singularity build base_${{ matrix.backend.name }}.sif docker://ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }} + run: singularity build base_${{ matrix.backend }}.sif docker://ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend }} - name: Push Singularity image - run: singularity push base_${{ matrix.backend.name }}.sif oras://ghcr.io/cexa-project/kokkos-fft + run: singularity push base_${{ matrix.backend }}.sif oras://ghcr.io/cexa-project/kokkos-fft build: runs-on: ubuntu-latest From 61fa461df5c6b57452e6298bf5ed28d01ba42db3 Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Wed, 24 Jan 2024 18:32:41 +0100 Subject: [PATCH 022/100] Fix execution rights and singularity image name --- .github/workflows/cmake.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 3b910a90..899cb512 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -75,7 +75,7 @@ jobs: run: singularity build base_${{ matrix.backend }}.sif docker://ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend }} - name: Push Singularity image - run: singularity push base_${{ matrix.backend }}.sif oras://ghcr.io/cexa-project/kokkos-fft + run: singularity push base_${{ matrix.backend }}.sif oras://ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend }}.sif build: runs-on: ubuntu-latest @@ -138,11 +138,15 @@ jobs: docker run -v ${{github.workspace}}:/work ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }} \ cmake --build build -j 2 + - name: Prepare artifacts + # this is mandatory to preserve execution rights + run: tar -cvf tests_${{ matrix.backend.name }}.tar build/ + - name: Save artifacts uses: actions/upload-artifact@v4 with: name: tests_${{ matrix.backend.name }} - path: build + path: tests_${{ matrix.backend.name }}.tar - name: Install run: | From 26774486cd9913766971d8ac667bf580c9e2ada4 Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Thu, 25 Jan 2024 12:05:35 +0100 Subject: [PATCH 023/100] Fix test build --- .github/workflows/cmake.yml | 53 ++++++++++++++++++++++++++++--------- 1 file changed, 41 insertions(+), 12 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 899cb512..bcd06dbf 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -123,7 +123,7 @@ jobs: - name: Configure run: | - docker run -v ${{github.workspace}}:/work ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }} \ + docker run -v ${{ github.workspace }}:/work ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }} \ cmake -B build \ -DCMAKE_INSTALL_PREFIX=/work/install \ -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \ @@ -135,35 +135,64 @@ jobs: - name: Build run: | - docker run -v ${{github.workspace}}:/work ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }} \ + docker run -v ${{ github.workspace }}:/work ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }} \ cmake --build build -j 2 - name: Prepare artifacts # this is mandatory to preserve execution rights run: tar -cvf tests_${{ matrix.backend.name }}.tar build/ + if: ${{ matrix.target.name }} == "native" - name: Save artifacts uses: actions/upload-artifact@v4 with: name: tests_${{ matrix.backend.name }} path: tests_${{ matrix.backend.name }}.tar + if: ${{ matrix.target.name }} == "native" - name: Install run: | - docker run -v ${{github.workspace}}:/work ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }} \ + docker run -v ${{ github.workspace }}:/work ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }} \ cmake --install build - - name: Configure test code + - name: Configure, build and install Kokkos run: | - docker run -v ${{github.workspace}}:/work ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }} \ - cmake -B /tmp/test \ + docker run -v ${{ github.workspace }}:/work ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }} \ + cmake -B build_kokkos \ + -DCMAKE_INSTALL_PREFIX=/work/local \ -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \ -DCMAKE_CXX_STANDARD=17 \ - -DKokkosFFT_INTERNAL_Kokkos=ON \ ${{ matrix.backend.cmake_flags }} \ - ${{ matrix.target.cmake_flags }} - - - name: Build test code + ${{ matrix.target.cmake_flags }} \ + tpls/kokkos + docker run -v ${{ github.workspace }}:/work ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }} \ + cmake --build build_kokkos -j 8 + docker run -v ${{ github.workspace }}:/work ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }} \ + cmake --install build_kokkos + + - name: Configure, build and install Kokkos FFT + run: | + docker run -v ${{ github.workspace }}:/work ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }} -e LD_LIBRARY_PATH=/work/local/lib \ + cmake -B build_kokkos_fft \ + -DCMAKE_INSTALL_PREFIX=/work/local \ + -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \ + -DCMAKE_CXX_STANDARD=17 \ + ${{ matrix.backend.cmake_flags }} \ + ${{ matrix.target.cmake_flags }} \ + . + docker run -v ${{ github.workspace }}:/work ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }} -e LD_LIBRARY_PATH=/work/local/lib \ + cmake --build build_kokkos_fft -j 8 + docker run -v ${{ github.workspace }}:/work ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }} -e LD_LIBRARY_PATH=/work/local/lib \ + cmake --install build_kokkos_fft + + - name: Configure and build test code run: | - docker run -v ${{github.workspace}}:/work ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }} \ - cmake --build /tmp/test -j 2 + docker run -v ${{ github.workspace }}:/work ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }} -e LD_LIBRARY_PATH=/work/local/lib \ + cmake -B build_test \ + -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \ + -DCMAKE_CXX_STANDARD=17 \ + ${{ matrix.backend.cmake_flags }} \ + ${{ matrix.target.cmake_flags }} \ + install_test/src + docker run -v ${{ github.workspace }}:/work ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }} -e LD_LIBRARY_PATH=/work/local/lib \ + cmake --build build_test -j 8 From 87549312669034a0656a72cade46f4d024c631e0 Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Thu, 25 Jan 2024 12:32:27 +0100 Subject: [PATCH 024/100] Fix environment for test build --- .github/workflows/cmake.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index bcd06dbf..489ff92b 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -172,7 +172,7 @@ jobs: - name: Configure, build and install Kokkos FFT run: | - docker run -v ${{ github.workspace }}:/work ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }} -e LD_LIBRARY_PATH=/work/local/lib \ + docker run -v ${{ github.workspace }}:/work -e LD_LIBRARY_PATH=/work/local/lib ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }} \ cmake -B build_kokkos_fft \ -DCMAKE_INSTALL_PREFIX=/work/local \ -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \ @@ -180,19 +180,19 @@ jobs: ${{ matrix.backend.cmake_flags }} \ ${{ matrix.target.cmake_flags }} \ . - docker run -v ${{ github.workspace }}:/work ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }} -e LD_LIBRARY_PATH=/work/local/lib \ + docker run -v ${{ github.workspace }}:/work -e LD_LIBRARY_PATH=/work/local/lib ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }} \ cmake --build build_kokkos_fft -j 8 - docker run -v ${{ github.workspace }}:/work ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }} -e LD_LIBRARY_PATH=/work/local/lib \ + docker run -v ${{ github.workspace }}:/work -e LD_LIBRARY_PATH=/work/local/lib ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }} \ cmake --install build_kokkos_fft - name: Configure and build test code run: | - docker run -v ${{ github.workspace }}:/work ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }} -e LD_LIBRARY_PATH=/work/local/lib \ + docker run -v ${{ github.workspace }}:/work -e LD_LIBRARY_PATH=/work/local/lib ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }} \ cmake -B build_test \ -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \ -DCMAKE_CXX_STANDARD=17 \ ${{ matrix.backend.cmake_flags }} \ ${{ matrix.target.cmake_flags }} \ install_test/src - docker run -v ${{ github.workspace }}:/work ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }} -e LD_LIBRARY_PATH=/work/local/lib \ + docker run -v ${{ github.workspace }}:/work -e LD_LIBRARY_PATH=/work/local/lib ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }} \ cmake --build build_test -j 8 From 9f6c43a6bec9f327a9dbae0ab9391b84a17077ac Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Thu, 25 Jan 2024 13:14:05 +0100 Subject: [PATCH 025/100] Fix ifs --- .github/workflows/cmake.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 489ff92b..c477970f 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -140,15 +140,15 @@ jobs: - name: Prepare artifacts # this is mandatory to preserve execution rights - run: tar -cvf tests_${{ matrix.backend.name }}.tar build/ - if: ${{ matrix.target.name }} == "native" + run: tar --exclude CMakeFiles -cvf tests_${{ matrix.backend.name }}.tar build/ + if: matrix.target.name == "native" - name: Save artifacts uses: actions/upload-artifact@v4 with: name: tests_${{ matrix.backend.name }} path: tests_${{ matrix.backend.name }}.tar - if: ${{ matrix.target.name }} == "native" + if: matrix.target.name == "native" - name: Install run: | From 1172c03613b066e5e4be4a9071e3404a4a61f900 Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Thu, 25 Jan 2024 13:16:41 +0100 Subject: [PATCH 026/100] Fix if quotes --- .github/workflows/cmake.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index c477970f..16e549ec 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -141,14 +141,14 @@ jobs: - name: Prepare artifacts # this is mandatory to preserve execution rights run: tar --exclude CMakeFiles -cvf tests_${{ matrix.backend.name }}.tar build/ - if: matrix.target.name == "native" + if: matrix.target.name == 'native' - name: Save artifacts uses: actions/upload-artifact@v4 with: name: tests_${{ matrix.backend.name }} path: tests_${{ matrix.backend.name }}.tar - if: matrix.target.name == "native" + if: matrix.target.name == 'native' - name: Install run: | From 439b5d8bee16d9cbc3e37eebf7a443ffd4d78428 Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Thu, 25 Jan 2024 15:35:30 +0100 Subject: [PATCH 027/100] Improve and fix build of test code --- .github/workflows/cmake.yml | 68 +++++++++++++++++++------------------ 1 file changed, 35 insertions(+), 33 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 16e549ec..4013fed4 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -140,7 +140,7 @@ jobs: - name: Prepare artifacts # this is mandatory to preserve execution rights - run: tar --exclude CMakeFiles -cvf tests_${{ matrix.backend.name }}.tar build/ + run: tar --exclude CMakeFiles cvf tests_${{ matrix.backend.name }}.tar build/ if: matrix.target.name == 'native' - name: Save artifacts @@ -155,44 +155,46 @@ jobs: docker run -v ${{ github.workspace }}:/work ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }} \ cmake --install build - - name: Configure, build and install Kokkos + - name: Configure and build test code run: | docker run -v ${{ github.workspace }}:/work ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }} \ - cmake -B build_kokkos \ - -DCMAKE_INSTALL_PREFIX=/work/local \ + cmake -B build_test \ -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \ -DCMAKE_CXX_STANDARD=17 \ - ${{ matrix.backend.cmake_flags }} \ - ${{ matrix.target.cmake_flags }} \ - tpls/kokkos - docker run -v ${{ github.workspace }}:/work ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }} \ - cmake --build build_kokkos -j 8 + -DCMAKE_PREFIX_PATH=/work/install \ + install_test/src docker run -v ${{ github.workspace }}:/work ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }} \ - cmake --install build_kokkos + cmake --build build_test -j 8 + + test-cuda: + # run CUDA tests on Ruche supercomputer + runs-on: + - self-hosted + - cuda + + needs: + - build + + env: + SINGULARITY_VERSION: 3.8.3/gcc-11.2.0 + + steps: + - name: Get artifacts + uses: actions/download-artifact@v4 + with: + name: tests_cuda + + - name: Deploy artifacts + run: tar xvf base_cuda.tar - - name: Configure, build and install Kokkos FFT + - name: Pull Singularity image run: | - docker run -v ${{ github.workspace }}:/work -e LD_LIBRARY_PATH=/work/local/lib ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }} \ - cmake -B build_kokkos_fft \ - -DCMAKE_INSTALL_PREFIX=/work/local \ - -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \ - -DCMAKE_CXX_STANDARD=17 \ - ${{ matrix.backend.cmake_flags }} \ - ${{ matrix.target.cmake_flags }} \ - . - docker run -v ${{ github.workspace }}:/work -e LD_LIBRARY_PATH=/work/local/lib ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }} \ - cmake --build build_kokkos_fft -j 8 - docker run -v ${{ github.workspace }}:/work -e LD_LIBRARY_PATH=/work/local/lib ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }} \ - cmake --install build_kokkos_fft + module load singularity/${{ env.SINGULARITY_VERSION }} + singularity pull oras://ghcr.io/cexa-project/kokkos-fft/base_cuda.sif - - name: Configure and build test code + - name: Run test within Slurm job run: | - docker run -v ${{ github.workspace }}:/work -e LD_LIBRARY_PATH=/work/local/lib ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }} \ - cmake -B build_test \ - -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \ - -DCMAKE_CXX_STANDARD=17 \ - ${{ matrix.backend.cmake_flags }} \ - ${{ matrix.target.cmake_flags }} \ - install_test/src - docker run -v ${{ github.workspace }}:/work -e LD_LIBRARY_PATH=/work/local/lib ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }} \ - cmake --build build_test -j 8 + srun --nodes=1 --time=01:00:00 -p gpua100 --gres=gpu:1 bash -c " \ + module load singularity/${{ env.SINGULARITY_VERSION }}; \ + singularity run --nv --bind $PWD:/work/build -W /work/build base_cuda.sif ctest \ + " From b79adcfd3f0daccf1683d60a9934aba4907f9988 Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Thu, 25 Jan 2024 15:36:09 +0100 Subject: [PATCH 028/100] Set number of workers for building --- .github/workflows/cmake.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 4013fed4..acebb41d 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -136,7 +136,7 @@ jobs: - name: Build run: | docker run -v ${{ github.workspace }}:/work ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }} \ - cmake --build build -j 2 + cmake --build build -j $(( $(nproc) * 2 + 1 )) - name: Prepare artifacts # this is mandatory to preserve execution rights @@ -164,7 +164,7 @@ jobs: -DCMAKE_PREFIX_PATH=/work/install \ install_test/src docker run -v ${{ github.workspace }}:/work ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }} \ - cmake --build build_test -j 8 + cmake --build build_test -j $(( $(nproc) * 2 + 1 )) test-cuda: # run CUDA tests on Ruche supercomputer From dfa198ae1a075f39a0c836af0f3f3c5816bde992 Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Thu, 25 Jan 2024 16:51:57 +0100 Subject: [PATCH 029/100] Harmonize KokkosFFT name within CMake files --- CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index abe4edca..281f93ac 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,11 +1,11 @@ cmake_minimum_required(VERSION 3.23) -project(kokkos-fft LANGUAGES CXX) +project(KokkosFFT LANGUAGES CXX) # Add cmake helpers for FFTW list(INSERT CMAKE_MODULE_PATH 0 "${CMAKE_SOURCE_DIR}/cmake") # Options -option(BUILD_EXAMPLES "Build kokkos-fft examples" ON) +option(BUILD_EXAMPLES "Build KokkosFFT examples" ON) option(KokkosFFT_ENABLE_HOST_AND_DEVICE "Enable fft on both host and device" OFF) option(KokkosFFT_INTERNAL_Kokkos "Build internal Kokkos instead of relying on external one" OFF) @@ -29,7 +29,7 @@ include(GNUInstallDirs) set(LIBDIR ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}) set(INSTALL_INCLUDEDIR ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}) set(INSTALL_LIBDIR ${CMAKE_INSTALL_PREFIX}/${LIBDIR}) -set(KokkosFFT_EXPORT_TARGET "KokkosFFT-Targets") +set(KokkosFFT_EXPORT_TARGET "${PROJECT_NAME}-Targets") add_subdirectory(common) add_subdirectory(fft) @@ -76,4 +76,4 @@ install( FILES ${CMAKE_CURRENT_BINARY_DIR}/KokkosFFTConfig.cmake ${CMAKE_CURRENT_BINARY_DIR}/KokkosFFTConfigVersion.cmake DESTINATION ${INSTALL_LIBDIR} -) \ No newline at end of file +) From 5df49888fb8c58e1e16b91ed2d69a16e7bb9501d Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Thu, 25 Jan 2024 16:52:58 +0100 Subject: [PATCH 030/100] Disable self-hosted runner label --- .github/workflows/cmake.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index acebb41d..234ef4d5 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -170,7 +170,7 @@ jobs: # run CUDA tests on Ruche supercomputer runs-on: - self-hosted - - cuda + # - cuda needs: - build From 412abb11409cf54f1d5b509630abc44b91b023ec Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Thu, 25 Jan 2024 17:23:08 +0100 Subject: [PATCH 031/100] Fix calls to tar command --- .github/workflows/cmake.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 234ef4d5..70588fc4 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -140,7 +140,7 @@ jobs: - name: Prepare artifacts # this is mandatory to preserve execution rights - run: tar --exclude CMakeFiles cvf tests_${{ matrix.backend.name }}.tar build/ + run: tar --exclude CMakeFiles -cvf tests_${{ matrix.backend.name }}.tar build/ if: matrix.target.name == 'native' - name: Save artifacts @@ -185,7 +185,7 @@ jobs: name: tests_cuda - name: Deploy artifacts - run: tar xvf base_cuda.tar + run: tar -xvf base_cuda.tar - name: Pull Singularity image run: | From 932e7c5dc7a80ff5cc7066a18a25814b0857ff85 Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Thu, 25 Jan 2024 19:23:07 +0100 Subject: [PATCH 032/100] Do not rebuild base image if not modified --- .github/workflows/cmake.yml | 35 ++++++++++++++++++++++++++++++----- 1 file changed, 30 insertions(+), 5 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 70588fc4..ed8c4dd6 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -24,9 +24,30 @@ jobs: extensions: 'hpp,cpp' clangFormatVersion: 12 + check_build_base_needed: + runs-on: ubuntu-latest + + outputs: + changed_docker_files: steps.changed_docker_files.outputs.any_changed == 'true' + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 2 + + - name: Get changed Docker files + id: changed_docker_files + uses: tj-actions/changed-files@v42 + with: + files: docker/base/**/Dockerfile + build_base: runs-on: ubuntu-latest + needs: check_build_base_needed + + if: needs.check_build_base_needed.outputs.changed_docker_files == 'true' + strategy: matrix: backend: @@ -80,6 +101,11 @@ jobs: build: runs-on: ubuntu-latest + needs: build_base + + # run this job even if build_base did not run + if: always() + strategy: matrix: backend: @@ -100,9 +126,6 @@ jobs: target: name: host_device - needs: - - build_base - steps: - name: Free Disk Space (Ubuntu) uses: jlumbroso/free-disk-space@v1.2.0 @@ -172,8 +195,10 @@ jobs: - self-hosted # - cuda - needs: - - build + needs: build + + # run this job even if build_base did not run + if: always() && needs.build.result == 'success' env: SINGULARITY_VERSION: 3.8.3/gcc-11.2.0 From 3ec18d755d0475d2aec974017acd12f109402758 Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Fri, 26 Jan 2024 10:22:39 +0100 Subject: [PATCH 033/100] Update checkout to v4 --- .github/workflows/cmake.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index ed8c4dd6..105efdaf 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -16,7 +16,7 @@ jobs: lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: DoozyX/clang-format-lint-action@v0.13 with: source: 'common/ fft/ examples/' @@ -63,7 +63,7 @@ jobs: large-packages: false - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 # TODO check if current build has a different Dockerfile @@ -134,7 +134,7 @@ jobs: large-packages: false - name: Checkout built branch - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: recursive From 4b16ccd4cbb2301ed9dcd7f11810f379574dc40e Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Fri, 26 Jan 2024 12:01:20 +0100 Subject: [PATCH 034/100] Downgrade download-artifacts to v3 --- .github/workflows/cmake.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 105efdaf..33645852 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -205,7 +205,7 @@ jobs: steps: - name: Get artifacts - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v3 with: name: tests_cuda From a9a5aa3ea71f3633e570db8f864d1491e9552765 Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Fri, 26 Jan 2024 12:02:01 +0100 Subject: [PATCH 035/100] Add cuda label --- .github/workflows/cmake.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 33645852..ba9ea416 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -193,7 +193,7 @@ jobs: # run CUDA tests on Ruche supercomputer runs-on: - self-hosted - # - cuda + - cuda needs: build From 582a75d651ce4f0dd44ec6e1a9d900aa6161b6b6 Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Fri, 26 Jan 2024 12:11:51 +0100 Subject: [PATCH 036/100] Downgrade upload-artifact to v3 --- .github/workflows/cmake.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index ba9ea416..f6491e2a 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -167,7 +167,7 @@ jobs: if: matrix.target.name == 'native' - name: Save artifacts - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v3 with: name: tests_${{ matrix.backend.name }} path: tests_${{ matrix.backend.name }}.tar @@ -189,7 +189,7 @@ jobs: docker run -v ${{ github.workspace }}:/work ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }} \ cmake --build build_test -j $(( $(nproc) * 2 + 1 )) - test-cuda: + test_cuda: # run CUDA tests on Ruche supercomputer runs-on: - self-hosted From cedef9e2f3b46a8c5e1a1448b8b6da3f7b64a760 Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Fri, 26 Jan 2024 12:22:13 +0100 Subject: [PATCH 037/100] Fix archive name --- .github/workflows/cmake.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index f6491e2a..bff681fa 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -210,7 +210,7 @@ jobs: name: tests_cuda - name: Deploy artifacts - run: tar -xvf base_cuda.tar + run: tar -xvf tests_cuda.tar - name: Pull Singularity image run: | From 12627bbf3804aecea4f1e47feea981b2b53daf35 Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Fri, 26 Jan 2024 12:36:43 +0100 Subject: [PATCH 038/100] Fix singularity image name when pulling --- .github/workflows/cmake.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index bff681fa..c9615665 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -215,7 +215,7 @@ jobs: - name: Pull Singularity image run: | module load singularity/${{ env.SINGULARITY_VERSION }} - singularity pull oras://ghcr.io/cexa-project/kokkos-fft/base_cuda.sif + singularity pull oras://ghcr.io/cexa-project/kokkos-fft/base_cuda.sif:latest - name: Run test within Slurm job run: | From be0e3353b9339a8a1b9f1a8ef5508226db2a4c51 Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Fri, 26 Jan 2024 12:51:10 +0100 Subject: [PATCH 039/100] Fix Singularity image name to run --- .github/workflows/cmake.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index c9615665..397b5b19 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -221,5 +221,5 @@ jobs: run: | srun --nodes=1 --time=01:00:00 -p gpua100 --gres=gpu:1 bash -c " \ module load singularity/${{ env.SINGULARITY_VERSION }}; \ - singularity run --nv --bind $PWD:/work/build -W /work/build base_cuda.sif ctest \ + singularity run --nv --bind $PWD:/work/build -W /work/build base_cuda.sif_latest.sif ctest \ " From 8eae0794e4fa935600d6dac9e38bedbc683001aa Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Fri, 26 Jan 2024 13:16:43 +0100 Subject: [PATCH 040/100] Add cleanup step on self-hosted runner --- .github/workflows/cmake.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 397b5b19..23167482 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -223,3 +223,7 @@ jobs: module load singularity/${{ env.SINGULARITY_VERSION }}; \ singularity run --nv --bind $PWD:/work/build -W /work/build base_cuda.sif_latest.sif ctest \ " + + - name: Cleanup + uses: colpal/actions-clean@v1 + if: always() From 453bad632243028bada4d101e4a5ce10d17e45b2 Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Fri, 26 Jan 2024 13:18:06 +0100 Subject: [PATCH 041/100] Fix syntax --- .github/workflows/cmake.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 23167482..57465b9d 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -226,4 +226,4 @@ jobs: - name: Cleanup uses: colpal/actions-clean@v1 - if: always() + if: always() From 3f81ce68dd75940f44c705d1f023efe6ffd4385b Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Fri, 26 Jan 2024 13:58:18 +0100 Subject: [PATCH 042/100] Remove cleanup and rely on runner scripts --- .github/workflows/cmake.yml | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 57465b9d..37e4f409 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -200,9 +200,6 @@ jobs: # run this job even if build_base did not run if: always() && needs.build.result == 'success' - env: - SINGULARITY_VERSION: 3.8.3/gcc-11.2.0 - steps: - name: Get artifacts uses: actions/download-artifact@v3 @@ -213,17 +210,7 @@ jobs: run: tar -xvf tests_cuda.tar - name: Pull Singularity image - run: | - module load singularity/${{ env.SINGULARITY_VERSION }} - singularity pull oras://ghcr.io/cexa-project/kokkos-fft/base_cuda.sif:latest + run: singularity pull oras://ghcr.io/cexa-project/kokkos-fft/base_cuda.sif:latest - name: Run test within Slurm job - run: | - srun --nodes=1 --time=01:00:00 -p gpua100 --gres=gpu:1 bash -c " \ - module load singularity/${{ env.SINGULARITY_VERSION }}; \ - singularity run --nv --bind $PWD:/work/build -W /work/build base_cuda.sif_latest.sif ctest \ - " - - - name: Cleanup - uses: colpal/actions-clean@v1 - if: always() + run: srun --nodes=1 --time=01:00:00 -p gpua100 --gres=gpu:1 singularity run --nv --bind $PWD:/work/build -W /work/build base_cuda.sif_latest.sif ctest From c2bd5d342b935fd52c4169a78cc986173460f952 Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Fri, 26 Jan 2024 14:24:50 +0100 Subject: [PATCH 043/100] Do not exclude CMake files --- .github/workflows/cmake.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 37e4f409..431d0880 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -163,7 +163,7 @@ jobs: - name: Prepare artifacts # this is mandatory to preserve execution rights - run: tar --exclude CMakeFiles -cvf tests_${{ matrix.backend.name }}.tar build/ + run: tar -cvf tests_${{ matrix.backend.name }}.tar build/ if: matrix.target.name == 'native' - name: Save artifacts From dbf9868f6558435d4e3305c194a1cd3bd00c36fc Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Fri, 26 Jan 2024 14:59:18 +0100 Subject: [PATCH 044/100] Fix Singularity setup --- .github/workflows/cmake.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 431d0880..41c5c843 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -213,4 +213,4 @@ jobs: run: singularity pull oras://ghcr.io/cexa-project/kokkos-fft/base_cuda.sif:latest - name: Run test within Slurm job - run: srun --nodes=1 --time=01:00:00 -p gpua100 --gres=gpu:1 singularity run --nv --bind $PWD:/work/build -W /work/build base_cuda.sif_latest.sif ctest + run: srun --nodes=1 --time=01:00:00 -p gpua100 --gres=gpu:1 singularity run --nv --bind $PWD/build:/work/build -H /work/build base_cuda.sif_latest.sif ctest From 9f4b2c270452956eba296644db748e8badb9c70d Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Fri, 26 Jan 2024 17:06:15 +0100 Subject: [PATCH 045/100] Enable CUDA constexpr --- .github/workflows/cmake.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 41c5c843..8422c8f4 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -112,7 +112,7 @@ jobs: # - name: openmp # cmake_flags: -DKokkos_ENABLE_OPENMP=ON - name: cuda - cmake_flags: -DKokkos_ENABLE_CUDA=ON -DKokkos_ARCH_AMPERE80=ON + cmake_flags: -DKokkos_ENABLE_CUDA=ON -DKokkos_ARCH_AMPERE80=ON -DKokkos_ENABLE_CUDA_CONSTEXPR=ON # - name: hip # cmake_flags: -DKokkos_ENABLE_HIP=ON -DKokkos_ARCH_VEGA90A=ON target: From 22be7a07e42290742fe9acfb5000fddccf13349d Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Fri, 26 Jan 2024 17:24:53 +0100 Subject: [PATCH 046/100] Change images name --- .github/workflows/cmake.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 8422c8f4..59aa1775 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -65,8 +65,6 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - # TODO check if current build has a different Dockerfile - - name: Get Singularity env: SINGULARITY_VERSION: 3.11.2 @@ -96,7 +94,7 @@ jobs: run: singularity build base_${{ matrix.backend }}.sif docker://ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend }} - name: Push Singularity image - run: singularity push base_${{ matrix.backend }}.sif oras://ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend }}.sif + run: singularity push base_${{ matrix.backend }}.sif oras://ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend }}_singularity build: runs-on: ubuntu-latest @@ -210,7 +208,7 @@ jobs: run: tar -xvf tests_cuda.tar - name: Pull Singularity image - run: singularity pull oras://ghcr.io/cexa-project/kokkos-fft/base_cuda.sif:latest + run: singularity pull oras://ghcr.io/cexa-project/kokkos-fft/base_cuda_singularity:latest - name: Run test within Slurm job - run: srun --nodes=1 --time=01:00:00 -p gpua100 --gres=gpu:1 singularity run --nv --bind $PWD/build:/work/build -H /work/build base_cuda.sif_latest.sif ctest + run: srun --nodes=1 --time=01:00:00 -p gpua100 --gres=gpu:1 singularity run --nv --bind $PWD/build:/work/build -H /work/build base_cuda_singularity_latest.sif ctest From 383fabab36a7c84b5ef9a16cc9b861cf52595adc Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Fri, 26 Jan 2024 17:26:09 +0100 Subject: [PATCH 047/100] Enable HIP builds --- .github/workflows/cmake.yml | 6 ++--- docker/base/cuda/Dockerfile | 3 ++- docker/base/hip/Dockerfile | 52 +++++++++++++++++++++++++------------ 3 files changed, 41 insertions(+), 20 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 59aa1775..18c8f27e 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -53,7 +53,7 @@ jobs: backend: # - openmp - cuda - # - hip + - hip steps: - name: Free Disk Space (Ubuntu) @@ -111,8 +111,8 @@ jobs: # cmake_flags: -DKokkos_ENABLE_OPENMP=ON - name: cuda cmake_flags: -DKokkos_ENABLE_CUDA=ON -DKokkos_ARCH_AMPERE80=ON -DKokkos_ENABLE_CUDA_CONSTEXPR=ON - # - name: hip - # cmake_flags: -DKokkos_ENABLE_HIP=ON -DKokkos_ARCH_VEGA90A=ON + - name: hip + cmake_flags: -DKokkos_ENABLE_HIP=ON -DKokkos_ARCH_VEGA90A=ON target: - name: native cmake_flags: "" diff --git a/docker/base/cuda/Dockerfile b/docker/base/cuda/Dockerfile index b7439a93..ad42dd74 100644 --- a/docker/base/cuda/Dockerfile +++ b/docker/base/cuda/Dockerfile @@ -15,6 +15,8 @@ RUN apt-get update && apt-get install -y \ apt-get clean && \ rm -rf /var/lib/apt/lists/* +ENV FFTWDIR "/usr" + RUN KEYDUMP_URL=https://cloud.cees.ornl.gov/download && \ KEYDUMP_FILE=keydump && \ wget --quiet ${KEYDUMP_URL}/${KEYDUMP_FILE} && \ @@ -39,5 +41,4 @@ RUN CMAKE_URL=https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSIO ENV PATH=${CMAKE_DIR}/bin:$PATH WORKDIR /work -ENV FFTWDIR "/usr" CMD ["bash"] diff --git a/docker/base/hip/Dockerfile b/docker/base/hip/Dockerfile index 15554935..bc4979b7 100644 --- a/docker/base/hip/Dockerfile +++ b/docker/base/hip/Dockerfile @@ -1,25 +1,45 @@ -ARG ROCM_VERSION=5.2.0 -ARG TENSORFLOW_VERSION=2.9 -FROM rocm/tensorflow:rocm${ROCM_VERSION}-tf${TENSORFLOW_VERSION}-dev +ARG BASE=rocm/dev-ubuntu-20.04:5.2 +FROM $BASE -RUN apt-get update && apt-get -y upgrade && \ - apt-get install -y git && \ - git config --global --add safe.directory '*' +ARG ADDITIONAL_PACKAGES -# Install newer CMake manually -ARG CMAKE_VERSION=3.23.2 -ARG build_dir=/tmp/build +RUN apt-get update && apt-get install -y \ + kmod \ + wget \ + ccache \ + file \ + libfftw3-dev \ + $ADDITIONAL_PACKAGES \ + && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* + +ENV PATH=/opt/rocm/bin:$PATH +ENV LD_LIBRARY_PATH /opt/rocm/hipfft/lib:$LD_LIBRARY_PATH +ENV CMAKE_PREFIX_PATH /opt/rocm/hip/:/opt/rocm/:$CMAKE_PREFIX_PATH +RUN KEYDUMP_URL=https://cloud.cees.ornl.gov/download && \ + KEYDUMP_FILE=keydump && \ + wget --quiet ${KEYDUMP_URL}/${KEYDUMP_FILE} && \ + wget --quiet ${KEYDUMP_URL}/${KEYDUMP_FILE}.sig && \ + gpg --import ${KEYDUMP_FILE} && \ + gpg --verify ${KEYDUMP_FILE}.sig ${KEYDUMP_FILE} && \ + rm ${KEYDUMP_FILE}* + +ARG CMAKE_VERSION=3.23.2 ENV CMAKE_DIR=/opt/cmake -RUN CMAKE_SCRIPT=cmake-${CMAKE_VERSION}-linux-x86_64.sh && \ - mkdir -p ${build_dir} && mkdir -p ${CMAKE_DIR} \ - cd ${build_dir} && \ - wget https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/${CMAKE_SCRIPT} && \ +RUN CMAKE_URL=https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION} && \ + CMAKE_SCRIPT=cmake-${CMAKE_VERSION}-Linux-x86_64.sh && \ + CMAKE_SHA256=cmake-${CMAKE_VERSION}-SHA-256.txt && \ + wget --quiet ${CMAKE_URL}/${CMAKE_SHA256} && \ + wget --quiet ${CMAKE_URL}/${CMAKE_SHA256}.asc && \ + wget --quiet ${CMAKE_URL}/${CMAKE_SCRIPT} && \ + gpg --verify ${CMAKE_SHA256}.asc ${CMAKE_SHA256} && \ + grep -i ${CMAKE_SCRIPT} ${CMAKE_SHA256} | sed -e s/linux/Linux/ | sha256sum --check && \ + mkdir -p ${CMAKE_DIR} && \ sh ${CMAKE_SCRIPT} --skip-license --prefix=${CMAKE_DIR} && \ - cd ${HOME} && rm -rf ${build_dir} + rm cmake* ENV PATH=${CMAKE_DIR}/bin:$PATH WORKDIR /work -ENV CMAKE_PREFIX_PATH "$CMAKE_PREFIX_PATH;/opt/rocm/hip/;/opt/rocm/" -ENV LD_LIBRARY_PATH $LD_LIBRARY_PATH:/opt/rocm/hipfft/lib CMD ["bash"] From a9da39d2c748bd482102c14809181900b0145268 Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Fri, 26 Jan 2024 17:30:35 +0100 Subject: [PATCH 048/100] Remove Docker tests files --- .github/workflows/cmake.yml | 2 +- docker/{base => }/cuda/Dockerfile | 0 docker/{base => }/hip/Dockerfile | 0 docker/tests/cuda/Dockerfile | 7 ------- 4 files changed, 1 insertion(+), 8 deletions(-) rename docker/{base => }/cuda/Dockerfile (100%) rename docker/{base => }/hip/Dockerfile (100%) delete mode 100644 docker/tests/cuda/Dockerfile diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 18c8f27e..f5d40f90 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -85,7 +85,7 @@ jobs: --cache-from ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend }} \ --build-arg BUIDKIT_INLINE_CACHE=1 \ --progress=plain \ - docker/base/${{ matrix.backend }} + docker/${{ matrix.backend }} - name: Push Docker image run: docker push ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend }} diff --git a/docker/base/cuda/Dockerfile b/docker/cuda/Dockerfile similarity index 100% rename from docker/base/cuda/Dockerfile rename to docker/cuda/Dockerfile diff --git a/docker/base/hip/Dockerfile b/docker/hip/Dockerfile similarity index 100% rename from docker/base/hip/Dockerfile rename to docker/hip/Dockerfile diff --git a/docker/tests/cuda/Dockerfile b/docker/tests/cuda/Dockerfile deleted file mode 100644 index 93dca71d..00000000 --- a/docker/tests/cuda/Dockerfile +++ /dev/null @@ -1,7 +0,0 @@ -ARG BASE=ghcr.io/cexa-project/kokkos-fft/base_cuda -FROM $BASE - -ARG BUILD_DIR=./build -COPY $BUILD_DIR /work/build - -WORKDIR /work/build From a85e9f65dbb0cb9f389e47c5a388e77c06045e1a Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Fri, 26 Jan 2024 17:33:04 +0100 Subject: [PATCH 049/100] Fix CI --- .github/workflows/cmake.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index f5d40f90..b4340175 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -39,7 +39,7 @@ jobs: id: changed_docker_files uses: tj-actions/changed-files@v42 with: - files: docker/base/**/Dockerfile + files: docker/**/Dockerfile build_base: runs-on: ubuntu-latest From 180b335cf705c483f7d2793f532a2f384f59acff Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Fri, 26 Jan 2024 18:12:55 +0100 Subject: [PATCH 050/100] Change depth --- .github/workflows/cmake.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index b4340175..6a18c107 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -33,7 +33,7 @@ jobs: steps: - uses: actions/checkout@v4 with: - fetch-depth: 2 + fetch-depth: 0 - name: Get changed Docker files id: changed_docker_files From 5f819499243abe6136591692e81fa39e5bb04bb7 Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Fri, 26 Jan 2024 18:15:57 +0100 Subject: [PATCH 051/100] List changed Dockerfiles --- .github/workflows/cmake.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 6a18c107..40456c53 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -35,12 +35,21 @@ jobs: with: fetch-depth: 0 - - name: Get changed Docker files + - name: Get changed Dockerfiles id: changed_docker_files uses: tj-actions/changed-files@v42 with: files: docker/**/Dockerfile + - name: List changed Dockerfiles + if: steps.changed_docker_files.outputs.any_changed == 'true' + env: + ALL_CHANGED_FILES: ${{ steps.changed_docker_files.outputs.all_changed_files }} + run: | + for file in "$ALL_CHANGED_FILES"; do + echo "$file was changed" + done + build_base: runs-on: ubuntu-latest From 8c0b346cf01a25c0ec4a6fa15cd342d4c30522cf Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Fri, 26 Jan 2024 18:28:43 +0100 Subject: [PATCH 052/100] Fix chaining jobs --- .github/workflows/cmake.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 40456c53..88f3633e 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -28,7 +28,7 @@ jobs: runs-on: ubuntu-latest outputs: - changed_docker_files: steps.changed_docker_files.outputs.any_changed == 'true' + changed_docker_files: ${{ steps.changed_docker_files.outputs.any_changed == 'true' }} steps: - uses: actions/checkout@v4 From 36e312d0c9bbc9e539d6312f6015418be0fc6869 Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Fri, 26 Jan 2024 18:38:49 +0100 Subject: [PATCH 053/100] Fix incorrectly spelled inline cache argument --- .github/workflows/cmake.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 88f3633e..71c124d2 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -92,7 +92,7 @@ jobs: docker build \ -t ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend }} \ --cache-from ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend }} \ - --build-arg BUIDKIT_INLINE_CACHE=1 \ + --build-arg BUILDKIT_INLINE_CACHE=1 \ --progress=plain \ docker/${{ matrix.backend }} From e193f19d35831707f13b7e6b64aac10fea5d8806 Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Fri, 26 Jan 2024 18:50:59 +0100 Subject: [PATCH 054/100] Add HIPFFT in HIP image --- docker/hip/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/docker/hip/Dockerfile b/docker/hip/Dockerfile index bc4979b7..3309e2f1 100644 --- a/docker/hip/Dockerfile +++ b/docker/hip/Dockerfile @@ -8,6 +8,7 @@ RUN apt-get update && apt-get install -y \ wget \ ccache \ file \ + hipfft \ libfftw3-dev \ $ADDITIONAL_PACKAGES \ && \ From ae242c4777af78de46a4b6ca33f7880def7d0228 Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Fri, 26 Jan 2024 19:20:26 +0100 Subject: [PATCH 055/100] Specify compiler command --- .github/workflows/cmake.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 71c124d2..6f3d81c1 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -117,10 +117,16 @@ jobs: matrix: backend: # - name: openmp + # c_compiler: gcc + # cxx_compiler: g++ # cmake_flags: -DKokkos_ENABLE_OPENMP=ON - name: cuda + c_compiler: gcc + cxx_compiler: g++ cmake_flags: -DKokkos_ENABLE_CUDA=ON -DKokkos_ARCH_AMPERE80=ON -DKokkos_ENABLE_CUDA_CONSTEXPR=ON - name: hip + c_compiler: hipcc + cxx_compiler: hipcc cmake_flags: -DKokkos_ENABLE_HIP=ON -DKokkos_ARCH_VEGA90A=ON target: - name: native @@ -156,7 +162,9 @@ jobs: docker run -v ${{ github.workspace }}:/work ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }} \ cmake -B build \ -DCMAKE_INSTALL_PREFIX=/work/install \ - -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \ + -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \ + -DCMAKE_C_COMPILER=${{ matrix.backend.c_compiler }} \ + -DCMAKE_CXX_COMPILER=${{ matrix.backend.cxx_compiler }} \ -DCMAKE_CXX_STANDARD=17 \ -DBUILD_TESTING=ON \ -DKokkosFFT_INTERNAL_Kokkos=ON \ @@ -190,6 +198,8 @@ jobs: docker run -v ${{ github.workspace }}:/work ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }} \ cmake -B build_test \ -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \ + -DCMAKE_C_COMPILER=${{ matrix.backend.c_compiler }} \ + -DCMAKE_CXX_COMPILER=${{ matrix.backend.cxx_compiler }} \ -DCMAKE_CXX_STANDARD=17 \ -DCMAKE_PREFIX_PATH=/work/install \ install_test/src From c10fdf3e66c3841d7963fc8b6db0551ebd4019e6 Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Fri, 26 Jan 2024 19:21:00 +0100 Subject: [PATCH 056/100] Disable free disk space --- .github/workflows/cmake.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 6f3d81c1..112b6834 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -65,11 +65,11 @@ jobs: - hip steps: - - name: Free Disk Space (Ubuntu) - uses: jlumbroso/free-disk-space@v1.2.0 - with: - tool-cache: true - large-packages: false + # - name: Free Disk Space (Ubuntu) + # uses: jlumbroso/free-disk-space@v1.2.0 + # with: + # tool-cache: true + # large-packages: false - name: Checkout repository uses: actions/checkout@v4 @@ -140,11 +140,11 @@ jobs: name: host_device steps: - - name: Free Disk Space (Ubuntu) - uses: jlumbroso/free-disk-space@v1.2.0 - with: - tool-cache: true - large-packages: false + # - name: Free Disk Space (Ubuntu) + # uses: jlumbroso/free-disk-space@v1.2.0 + # with: + # tool-cache: true + # large-packages: false - name: Checkout built branch uses: actions/checkout@v4 From ca20d83c7d0fa6e38d183933ff0f7462af56cfa7 Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Fri, 26 Jan 2024 19:35:51 +0100 Subject: [PATCH 057/100] Improve conditions --- .github/workflows/cmake.yml | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 112b6834..49e6a9e5 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -42,7 +42,7 @@ jobs: files: docker/**/Dockerfile - name: List changed Dockerfiles - if: steps.changed_docker_files.outputs.any_changed == 'true' + if: ${{ steps.changed_docker_files.outputs.any_changed == 'true' }} env: ALL_CHANGED_FILES: ${{ steps.changed_docker_files.outputs.all_changed_files }} run: | @@ -55,7 +55,7 @@ jobs: needs: check_build_base_needed - if: needs.check_build_base_needed.outputs.changed_docker_files == 'true' + if: ${{ needs.check_build_base_needed.outputs.changed_docker_files == 'true' }} strategy: matrix: @@ -111,7 +111,7 @@ jobs: needs: build_base # run this job even if build_base did not run - if: always() + if: ${{ always() && (needs.build_base.result != 'success' || needs.build_base.result == 'skipped') }} strategy: matrix: @@ -140,11 +140,12 @@ jobs: name: host_device steps: - # - name: Free Disk Space (Ubuntu) - # uses: jlumbroso/free-disk-space@v1.2.0 - # with: - # tool-cache: true - # large-packages: false + - name: Free Disk Space (Ubuntu) + uses: jlumbroso/free-disk-space@v1.2.0 + with: + tool-cache: true + large-packages: false + if: ${{ matrix.backend.name == 'cuda' }} - name: Checkout built branch uses: actions/checkout@v4 @@ -179,14 +180,14 @@ jobs: - name: Prepare artifacts # this is mandatory to preserve execution rights run: tar -cvf tests_${{ matrix.backend.name }}.tar build/ - if: matrix.target.name == 'native' + if: ${{ matrix.target.name == 'native' }} - name: Save artifacts uses: actions/upload-artifact@v3 with: name: tests_${{ matrix.backend.name }} path: tests_${{ matrix.backend.name }}.tar - if: matrix.target.name == 'native' + if: ${{ matrix.target.name == 'native' }} - name: Install run: | @@ -215,7 +216,7 @@ jobs: needs: build # run this job even if build_base did not run - if: always() && needs.build.result == 'success' + if: ${{ always() && needs.build.result == 'success' }} steps: - name: Get artifacts From d0aea65cc0dae7709cfd0bad473cd4fe48b7bbbe Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Fri, 26 Jan 2024 19:41:33 +0100 Subject: [PATCH 058/100] Add ROCFFT to HIP image --- docker/hip/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/docker/hip/Dockerfile b/docker/hip/Dockerfile index 3309e2f1..4e2e9be9 100644 --- a/docker/hip/Dockerfile +++ b/docker/hip/Dockerfile @@ -9,6 +9,7 @@ RUN apt-get update && apt-get install -y \ ccache \ file \ hipfft \ + rocfft \ libfftw3-dev \ $ADDITIONAL_PACKAGES \ && \ From c22a92b5027c3cc838284c6db174b10d33be940a Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Fri, 26 Jan 2024 19:55:57 +0100 Subject: [PATCH 059/100] Fix CI --- .github/workflows/cmake.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 49e6a9e5..6c792db5 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -65,11 +65,11 @@ jobs: - hip steps: - # - name: Free Disk Space (Ubuntu) - # uses: jlumbroso/free-disk-space@v1.2.0 - # with: - # tool-cache: true - # large-packages: false + - name: Free Disk Space (Ubuntu) + uses: jlumbroso/free-disk-space@v1.2.0 + with: + tool-cache: true + large-packages: false - name: Checkout repository uses: actions/checkout@v4 @@ -145,7 +145,6 @@ jobs: with: tool-cache: true large-packages: false - if: ${{ matrix.backend.name == 'cuda' }} - name: Checkout built branch uses: actions/checkout@v4 From 4ae3ef7a38a2d71bb992904af0ab974a967ea4ea Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Fri, 26 Jan 2024 19:58:18 +0100 Subject: [PATCH 060/100] Fix CI --- .github/workflows/cmake.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 6c792db5..e2326e46 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -111,7 +111,7 @@ jobs: needs: build_base # run this job even if build_base did not run - if: ${{ always() && (needs.build_base.result != 'success' || needs.build_base.result == 'skipped') }} + if: ${{ always() && (needs.build_base.result == 'success' || needs.build_base.result == 'skipped') }} strategy: matrix: From defc4a4692b01278391ea845dc3aa0cd5251b0d0 Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Tue, 30 Jan 2024 10:21:00 +0100 Subject: [PATCH 061/100] Enable SYCL CI --- .github/workflows/cmake.yml | 7 +++++ docker/intel/Dockerfile | 63 ------------------------------------- 2 files changed, 7 insertions(+), 63 deletions(-) delete mode 100644 docker/intel/Dockerfile diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index e2326e46..42072b5d 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -63,6 +63,7 @@ jobs: # - openmp - cuda - hip + - sycl steps: - name: Free Disk Space (Ubuntu) @@ -101,9 +102,11 @@ jobs: - name: Convert Docker image to Singularity run: singularity build base_${{ matrix.backend }}.sif docker://ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend }} + if: ${{ matrix.backend.name == "cuda" }} - name: Push Singularity image run: singularity push base_${{ matrix.backend }}.sif oras://ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend }}_singularity + if: ${{ matrix.backend.name == "cuda" }} build: runs-on: ubuntu-latest @@ -128,6 +131,10 @@ jobs: c_compiler: hipcc cxx_compiler: hipcc cmake_flags: -DKokkos_ENABLE_HIP=ON -DKokkos_ARCH_VEGA90A=ON + - name: sycl + c_compiler: icx + cxx_compiler: icpx + cmake_flags: -DKokkos_ENABLE_SYCL=ON -DKokkos_ARCH_INTEL_GEN=ON target: - name: native cmake_flags: "" diff --git a/docker/intel/Dockerfile b/docker/intel/Dockerfile deleted file mode 100644 index 33bca3f1..00000000 --- a/docker/intel/Dockerfile +++ /dev/null @@ -1,63 +0,0 @@ -ARG BASE=nvidia/cuda:11.7.1-devel-ubuntu22.04 -FROM $BASE - -RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/3bf863cc.pub - -RUN apt-get update && apt-get install -y \ - bc \ - wget \ - ccache \ - ninja-build \ - python3 \ - git \ - libfftw3-dev \ - libomp-dev \ - && \ - apt-get clean && \ - git config --global --add safe.directory '*' && \ - rm -rf /var/lib/apt/lists/* - -RUN KEYDUMP_URL=https://cloud.cees.ornl.gov/download && \ - KEYDUMP_FILE=keydump && \ - wget --quiet ${KEYDUMP_URL}/${KEYDUMP_FILE} && \ - wget --quiet ${KEYDUMP_URL}/${KEYDUMP_FILE}.sig && \ - gpg --import ${KEYDUMP_FILE} && \ - gpg --verify ${KEYDUMP_FILE}.sig ${KEYDUMP_FILE} && \ - rm ${KEYDUMP_FILE}* - -ARG CMAKE_VERSION=3.26.0 -ARG build_dir=/tmp/build - -ENV CMAKE_DIR=/opt/cmake -RUN CMAKE_SCRIPT=cmake-${CMAKE_VERSION}-linux-x86_64.sh && \ - mkdir -p ${build_dir} && mkdir -p ${CMAKE_DIR} \ - cd ${build_dir} && \ - wget https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/${CMAKE_SCRIPT} && \ - sh ${CMAKE_SCRIPT} --skip-license --prefix=${CMAKE_DIR} && \ - cd ${HOME} && rm -rf ${build_dir} -ENV PATH=${CMAKE_DIR}/bin:$PATH - -RUN wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB && \ - apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB && \ - echo "deb https://apt.repos.intel.com/oneapi all main" | tee /etc/apt/sources.list.d/oneAPI.list && \ - apt-get update -o Dir::Etc::sourcelist="sources.list.d/oneAPI.list" -o APT::Get::List-Cleanup="0" && \ - apt-get install -y intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic-2023.0.0 && \ - apt-get clean && \ - rm -rf /var/lib/apt/lists/* - -RUN wget https://cloud.cees.ornl.gov/download/oneapi-for-nvidia-gpus-2023.0.0-linux.sh && \ - chmod +x oneapi-for-nvidia-gpus-2023.0.0-linux.sh && \ - ./oneapi-for-nvidia-gpus-2023.0.0-linux.sh -y && \ - rm oneapi-for-nvidia-gpus-2023.0.0-linux.sh - -RUN wget https://registrationcenter-download.intel.com/akdlm/IRC_NAS/163da6e4-56eb-4948-aba3-debcec61c064/l_BaseKit_p_2024.0.1.46.sh &&\ - chmod +x ./l_BaseKit_p_2024.0.1.46.sh && \ - ./l_BaseKit_p_2024.0.1.46.sh -a -s --eula accept && \ - rm l_BaseKit_p_2024.0.1.46.sh - -WORKDIR /work -ENV FFTWDIR "/usr" - -ENV PATH=${CMAKE_DIR}/bin:/opt/intel/oneapi/compiler/latest/bin/compiler:$PATH - -CMD ["bash"] \ No newline at end of file From 1a9cf59696a73e36a8cfa9f677efb892a47f44a3 Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Tue, 30 Jan 2024 10:22:18 +0100 Subject: [PATCH 062/100] Fix CI --- .github/workflows/cmake.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 42072b5d..7844b455 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -102,11 +102,11 @@ jobs: - name: Convert Docker image to Singularity run: singularity build base_${{ matrix.backend }}.sif docker://ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend }} - if: ${{ matrix.backend.name == "cuda" }} + if: ${{ matrix.backend.name == 'cuda' }} - name: Push Singularity image run: singularity push base_${{ matrix.backend }}.sif oras://ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend }}_singularity - if: ${{ matrix.backend.name == "cuda" }} + if: ${{ matrix.backend.name == 'cuda' }} build: runs-on: ubuntu-latest From de1f94056edccd14dd1c8965f91e7c15bb73c254 Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Tue, 30 Jan 2024 10:29:59 +0100 Subject: [PATCH 063/100] Add missing SYCL Docker file --- docker/sycl/Dockerfile | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 docker/sycl/Dockerfile diff --git a/docker/sycl/Dockerfile b/docker/sycl/Dockerfile new file mode 100644 index 00000000..d0d599c8 --- /dev/null +++ b/docker/sycl/Dockerfile @@ -0,0 +1,42 @@ +ARG BASE=intel/oneapi-basekit:2024.0.1-devel-ubuntu20.04 +FROM $BASE + +ARG ADDITIONAL_PACKAGES + +RUN apt-get update && apt-get install -y \ + bc \ + wget \ + ccache \ + libfftw3-dev \ + $ADDITIONAL_PACKAGES \ + && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* + +ENV FFTWDIR "/usr" + +RUN KEYDUMP_URL=https://cloud.cees.ornl.gov/download && \ + KEYDUMP_FILE=keydump && \ + wget --quiet ${KEYDUMP_URL}/${KEYDUMP_FILE} && \ + wget --quiet ${KEYDUMP_URL}/${KEYDUMP_FILE}.sig && \ + gpg --import ${KEYDUMP_FILE} && \ + gpg --verify ${KEYDUMP_FILE}.sig ${KEYDUMP_FILE} && \ + rm ${KEYDUMP_FILE}* + +ARG CMAKE_VERSION=3.23.2 +ENV CMAKE_DIR=/opt/cmake +RUN CMAKE_URL=https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION} && \ + CMAKE_SCRIPT=cmake-${CMAKE_VERSION}-Linux-x86_64.sh && \ + CMAKE_SHA256=cmake-${CMAKE_VERSION}-SHA-256.txt && \ + wget --quiet ${CMAKE_URL}/${CMAKE_SHA256} && \ + wget --quiet ${CMAKE_URL}/${CMAKE_SHA256}.asc && \ + wget --quiet ${CMAKE_URL}/${CMAKE_SCRIPT} && \ + gpg --verify ${CMAKE_SHA256}.asc ${CMAKE_SHA256} && \ + grep -i ${CMAKE_SCRIPT} ${CMAKE_SHA256} | sed -e s/linux/Linux/ | sha256sum --check && \ + mkdir -p ${CMAKE_DIR} && \ + sh ${CMAKE_SCRIPT} --skip-license --prefix=${CMAKE_DIR} && \ + rm cmake* +ENV PATH=${CMAKE_DIR}/bin:$PATH + +WORKDIR /work +CMD ["bash"] From 7da5bd33dc8124575a0d29e6f84cade505298380 Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Tue, 30 Jan 2024 10:41:19 +0100 Subject: [PATCH 064/100] Convert to Singularity image conditionnaly --- .github/workflows/cmake.yml | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 7844b455..dce70e1d 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -60,10 +60,14 @@ jobs: strategy: matrix: backend: - # - openmp - - cuda - - hip - - sycl + # - name: openmp + # use_singularity: false + - name: cuda + use_singularity: true + - name: hip + use_singularity: false + - name: sycl + use_singularity: false steps: - name: Free Disk Space (Ubuntu) @@ -91,22 +95,22 @@ jobs: - name: Build Docker image run: | docker build \ - -t ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend }} \ - --cache-from ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend }} \ + -t ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }} \ + --cache-from ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }} \ --build-arg BUILDKIT_INLINE_CACHE=1 \ --progress=plain \ - docker/${{ matrix.backend }} + docker/${{ matrix.backend.name }} - name: Push Docker image - run: docker push ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend }} + run: docker push ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }} - name: Convert Docker image to Singularity - run: singularity build base_${{ matrix.backend }}.sif docker://ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend }} - if: ${{ matrix.backend.name == 'cuda' }} + run: singularity build base_${{ matrix.backend.name }}.sif docker://ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }} + if: ${{ matrix.backend.use_singularity }} - name: Push Singularity image - run: singularity push base_${{ matrix.backend }}.sif oras://ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend }}_singularity - if: ${{ matrix.backend.name == 'cuda' }} + run: singularity push base_${{ matrix.backend.name }}.sif oras://ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }}_singularity + if: ${{ matrix.backend.use_singularity }} build: runs-on: ubuntu-latest From 36ebe0d9e6ec5425c5de2c3484df7335bbba628d Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Tue, 30 Jan 2024 10:41:41 +0100 Subject: [PATCH 065/100] Remove CUDA constexpr flag --- .github/workflows/cmake.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index dce70e1d..0cca4866 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -130,7 +130,7 @@ jobs: - name: cuda c_compiler: gcc cxx_compiler: g++ - cmake_flags: -DKokkos_ENABLE_CUDA=ON -DKokkos_ARCH_AMPERE80=ON -DKokkos_ENABLE_CUDA_CONSTEXPR=ON + cmake_flags: -DKokkos_ENABLE_CUDA=ON -DKokkos_ARCH_AMPERE80=ON - name: hip c_compiler: hipcc cxx_compiler: hipcc From f203a0ebee59efaed3396e4d737c0f41db3480dd Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Tue, 30 Jan 2024 10:50:29 +0100 Subject: [PATCH 066/100] Fix Git settings in SYCL Docker file --- docker/sycl/Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docker/sycl/Dockerfile b/docker/sycl/Dockerfile index d0d599c8..f812c14e 100644 --- a/docker/sycl/Dockerfile +++ b/docker/sycl/Dockerfile @@ -15,6 +15,8 @@ RUN apt-get update && apt-get install -y \ ENV FFTWDIR "/usr" +RUN git config --global --add safe.directory '/work' + RUN KEYDUMP_URL=https://cloud.cees.ornl.gov/download && \ KEYDUMP_FILE=keydump && \ wget --quiet ${KEYDUMP_URL}/${KEYDUMP_FILE} && \ From 51f488b2f39218c1be0bdfd3f072a13fa3710beb Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Tue, 30 Jan 2024 14:31:03 +0100 Subject: [PATCH 067/100] Fix SYCL Docker file for Git and CMake version --- docker/sycl/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker/sycl/Dockerfile b/docker/sycl/Dockerfile index f812c14e..5cdff5c2 100644 --- a/docker/sycl/Dockerfile +++ b/docker/sycl/Dockerfile @@ -15,7 +15,7 @@ RUN apt-get update && apt-get install -y \ ENV FFTWDIR "/usr" -RUN git config --global --add safe.directory '/work' +RUN git config --global --add safe.directory '/work/*' RUN KEYDUMP_URL=https://cloud.cees.ornl.gov/download && \ KEYDUMP_FILE=keydump && \ @@ -25,7 +25,7 @@ RUN KEYDUMP_URL=https://cloud.cees.ornl.gov/download && \ gpg --verify ${KEYDUMP_FILE}.sig ${KEYDUMP_FILE} && \ rm ${KEYDUMP_FILE}* -ARG CMAKE_VERSION=3.23.2 +ARG CMAKE_VERSION=3.25.2 ENV CMAKE_DIR=/opt/cmake RUN CMAKE_URL=https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION} && \ CMAKE_SCRIPT=cmake-${CMAKE_VERSION}-Linux-x86_64.sh && \ From a0a1b779e176963faaf4d9664ec22dc2d7f6a751 Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Tue, 30 Jan 2024 14:46:37 +0100 Subject: [PATCH 068/100] Fix SYCL Docker file --- docker/sycl/Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docker/sycl/Dockerfile b/docker/sycl/Dockerfile index 5cdff5c2..f9d0e1eb 100644 --- a/docker/sycl/Dockerfile +++ b/docker/sycl/Dockerfile @@ -15,7 +15,8 @@ RUN apt-get update && apt-get install -y \ ENV FFTWDIR "/usr" -RUN git config --global --add safe.directory '/work/*' +RUN git config --global --add safe.directory '/work' && \ + git config --global --add safe.directory '/work/tpls/kokkos' RUN KEYDUMP_URL=https://cloud.cees.ornl.gov/download && \ KEYDUMP_FILE=keydump && \ From b4500b13b193fc637a80ba4cb3c5de90afc6064f Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Tue, 30 Jan 2024 16:46:06 +0000 Subject: [PATCH 069/100] Fix missing SYCL configuration for install --- cmake/KokkosFFTConfig.cmake.in | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cmake/KokkosFFTConfig.cmake.in b/cmake/KokkosFFTConfig.cmake.in index 08a81f44..f6215a43 100644 --- a/cmake/KokkosFFTConfig.cmake.in +++ b/cmake/KokkosFFTConfig.cmake.in @@ -18,6 +18,11 @@ elseif(@Kokkos_ENABLE_HIP@) if(@KokkosFFT_ENABLE_HOST_AND_DEVICE@) find_dependency(FFTW MODULE) endif() +elseif(@Kokkos_ENABLE_SYCL@) + find_dependency(MKL COMPONENTS SYCL) + if(@KokkosFFT_ENABLE_HOST_AND_DEVICE@) + find_dependency(FFTW MODULE) + endif() elseif(@Kokkos_ENABLE_OPENMP@) find_dependency(FFTW MODULE) elseif(@Kokkos_ENABLE_SERIAL@) @@ -26,4 +31,4 @@ endif() include(${KokkosFFT_TARGET_FILE}) -check_required_components(KokkosFFT) \ No newline at end of file +check_required_components(KokkosFFT) From 4cfc6b0b1dbee866295c213ec2d2ed14e56397c7 Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Wed, 31 Jan 2024 11:54:50 +0100 Subject: [PATCH 070/100] Enable OpenMP backend --- .github/workflows/cmake.yml | 12 ++++----- docker/openmp/Dockerfile | 50 +++++++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+), 6 deletions(-) create mode 100644 docker/openmp/Dockerfile diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 0cca4866..45d59d2f 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -60,8 +60,8 @@ jobs: strategy: matrix: backend: - # - name: openmp - # use_singularity: false + - name: openmp + use_singularity: false - name: cuda use_singularity: true - name: hip @@ -123,10 +123,10 @@ jobs: strategy: matrix: backend: - # - name: openmp - # c_compiler: gcc - # cxx_compiler: g++ - # cmake_flags: -DKokkos_ENABLE_OPENMP=ON + - name: openmp + c_compiler: gcc + cxx_compiler: g++ + cmake_flags: -DKokkos_ENABLE_OPENMP=ON - name: cuda c_compiler: gcc cxx_compiler: g++ diff --git a/docker/openmp/Dockerfile b/docker/openmp/Dockerfile new file mode 100644 index 00000000..247c84fc --- /dev/null +++ b/docker/openmp/Dockerfile @@ -0,0 +1,50 @@ +ARG BASE=ubuntu:20.04 +FROM $BASE + +ENV DEBIAN_FRONTEND=noninteractive +RUN apt-get update && apt-get install -y \ + build-essential \ + wget \ + git \ + bc \ + ccache \ + libfftw3-dev \ + && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* + +ENV FFTWDIR "/usr" + +ARG GCC_VERSION=8 +RUN echo "deb http://dk.archive.ubuntu.com/ubuntu/ xenial main" >> /etc/apt/sources.list && \ + echo "deb http://dk.archive.ubuntu.com/ubuntu/ xenial universe" >> /etc/apt/sources.list && \ + apt-get update && apt-get install -y g++-$GCC_VERSION && \ + update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-$GCC_VERSION $GCC_VERSION && \ + update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-$GCC_VERSION $GCC_VERSION && \ + apt-get clean && rm -rf /var/lib/apt/lists/* + +RUN KEYDUMP_URL=https://cloud.cees.ornl.gov/download && \ + KEYDUMP_FILE=keydump && \ + wget --quiet ${KEYDUMP_URL}/${KEYDUMP_FILE} && \ + wget --quiet ${KEYDUMP_URL}/${KEYDUMP_FILE}.sig && \ + gpg --import ${KEYDUMP_FILE} && \ + gpg --verify ${KEYDUMP_FILE}.sig ${KEYDUMP_FILE} && \ + rm ${KEYDUMP_FILE}* + +ARG CMAKE_VERSION=3.23.2 +ENV CMAKE_DIR=/opt/cmake +RUN CMAKE_URL=https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION} && \ + CMAKE_SCRIPT=cmake-${CMAKE_VERSION}-Linux-x86_64.sh && \ + CMAKE_SHA256=cmake-${CMAKE_VERSION}-SHA-256.txt && \ + wget --quiet ${CMAKE_URL}/${CMAKE_SHA256} && \ + wget --quiet ${CMAKE_URL}/${CMAKE_SHA256}.asc && \ + wget --quiet ${CMAKE_URL}/${CMAKE_SCRIPT} && \ + gpg --verify ${CMAKE_SHA256}.asc ${CMAKE_SHA256} && \ + grep -i ${CMAKE_SCRIPT} ${CMAKE_SHA256} | sed -e s/linux/Linux/ | sha256sum --check && \ + mkdir -p ${CMAKE_DIR} && \ + sh ${CMAKE_SCRIPT} --skip-license --prefix=${CMAKE_DIR} && \ + rm cmake* +ENV PATH=${CMAKE_DIR}/bin:$PATH + +WORKDIR /work +CMD ["bash"] From c963d8f685b233f06759cf75be8f68ca05038283 Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Wed, 31 Jan 2024 11:56:22 +0100 Subject: [PATCH 071/100] Do not login to ghcr when building --- .github/workflows/cmake.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 45d59d2f..8ca1f672 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -162,9 +162,6 @@ jobs: with: submodules: recursive - - name: Login in GitHub Containers Repository - run: echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin - - name: Pull image run: docker pull ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }} From 22c44a474f3899879dfac11d0fb19939f9be6295 Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Wed, 31 Jan 2024 13:10:32 +0100 Subject: [PATCH 072/100] Fix Git safe directories in all Docker files --- docker/cuda/Dockerfile | 2 ++ docker/hip/Dockerfile | 4 ++++ docker/openmp/Dockerfile | 2 ++ docker/sycl/Dockerfile | 3 +-- 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/docker/cuda/Dockerfile b/docker/cuda/Dockerfile index ad42dd74..b2144fc6 100644 --- a/docker/cuda/Dockerfile +++ b/docker/cuda/Dockerfile @@ -17,6 +17,8 @@ RUN apt-get update && apt-get install -y \ ENV FFTWDIR "/usr" +run git config --global --add safe.directory "*" + RUN KEYDUMP_URL=https://cloud.cees.ornl.gov/download && \ KEYDUMP_FILE=keydump && \ wget --quiet ${KEYDUMP_URL}/${KEYDUMP_FILE} && \ diff --git a/docker/hip/Dockerfile b/docker/hip/Dockerfile index 4e2e9be9..4c380274 100644 --- a/docker/hip/Dockerfile +++ b/docker/hip/Dockerfile @@ -16,10 +16,14 @@ RUN apt-get update && apt-get install -y \ apt-get clean && \ rm -rf /var/lib/apt/lists/* +ENV FFTWDIR "/usr" + ENV PATH=/opt/rocm/bin:$PATH ENV LD_LIBRARY_PATH /opt/rocm/hipfft/lib:$LD_LIBRARY_PATH ENV CMAKE_PREFIX_PATH /opt/rocm/hip/:/opt/rocm/:$CMAKE_PREFIX_PATH +run git config --global --add safe.directory "*" + RUN KEYDUMP_URL=https://cloud.cees.ornl.gov/download && \ KEYDUMP_FILE=keydump && \ wget --quiet ${KEYDUMP_URL}/${KEYDUMP_FILE} && \ diff --git a/docker/openmp/Dockerfile b/docker/openmp/Dockerfile index 247c84fc..48f7fee9 100644 --- a/docker/openmp/Dockerfile +++ b/docker/openmp/Dockerfile @@ -15,6 +15,8 @@ RUN apt-get update && apt-get install -y \ ENV FFTWDIR "/usr" +run git config --global --add safe.directory "*" + ARG GCC_VERSION=8 RUN echo "deb http://dk.archive.ubuntu.com/ubuntu/ xenial main" >> /etc/apt/sources.list && \ echo "deb http://dk.archive.ubuntu.com/ubuntu/ xenial universe" >> /etc/apt/sources.list && \ diff --git a/docker/sycl/Dockerfile b/docker/sycl/Dockerfile index f9d0e1eb..69c7eea6 100644 --- a/docker/sycl/Dockerfile +++ b/docker/sycl/Dockerfile @@ -15,8 +15,7 @@ RUN apt-get update && apt-get install -y \ ENV FFTWDIR "/usr" -RUN git config --global --add safe.directory '/work' && \ - git config --global --add safe.directory '/work/tpls/kokkos' +run git config --global --add safe.directory "*" RUN KEYDUMP_URL=https://cloud.cees.ornl.gov/download && \ KEYDUMP_FILE=keydump && \ From 7779042dc0510ffd3c6cfde11ffb3ea3871c8f5a Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Wed, 31 Jan 2024 13:18:33 +0100 Subject: [PATCH 073/100] Fix CI --- docker/hip/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/docker/hip/Dockerfile b/docker/hip/Dockerfile index 4c380274..d3afa18f 100644 --- a/docker/hip/Dockerfile +++ b/docker/hip/Dockerfile @@ -7,6 +7,7 @@ RUN apt-get update && apt-get install -y \ kmod \ wget \ ccache \ + git \ file \ hipfft \ rocfft \ From 5a4c118a9a57dc0555f8467fbbd3a1960752a0bb Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Wed, 31 Jan 2024 13:58:47 +0100 Subject: [PATCH 074/100] Add Git to all Docker files --- docker/cuda/Dockerfile | 1 + docker/sycl/Dockerfile | 1 + 2 files changed, 2 insertions(+) diff --git a/docker/cuda/Dockerfile b/docker/cuda/Dockerfile index b2144fc6..270cc6dc 100644 --- a/docker/cuda/Dockerfile +++ b/docker/cuda/Dockerfile @@ -8,6 +8,7 @@ RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/ RUN apt-get update && apt-get install -y \ bc \ wget \ + git \ ccache \ libfftw3-dev \ $ADDITIONAL_PACKAGES \ diff --git a/docker/sycl/Dockerfile b/docker/sycl/Dockerfile index 69c7eea6..96990cfa 100644 --- a/docker/sycl/Dockerfile +++ b/docker/sycl/Dockerfile @@ -6,6 +6,7 @@ ARG ADDITIONAL_PACKAGES RUN apt-get update && apt-get install -y \ bc \ wget \ + git \ ccache \ libfftw3-dev \ $ADDITIONAL_PACKAGES \ From e24df928ae5e2c66b4b3553bf960b2f6fae12b74 Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Wed, 31 Jan 2024 15:09:47 +0100 Subject: [PATCH 075/100] Enable OpenMP tests in CI --- .github/workflows/cmake.yml | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 8ca1f672..edfc154c 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -214,17 +214,24 @@ jobs: docker run -v ${{ github.workspace }}:/work ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }} \ cmake --build build_test -j $(( $(nproc) * 2 + 1 )) - test_cuda: - # run CUDA tests on Ruche supercomputer - runs-on: - - self-hosted - - cuda + test: + runs-on: ${{ matrix.backend.runner }} needs: build # run this job even if build_base did not run if: ${{ always() && needs.build.result == 'success' }} + strategy: + matrix: + backend: + # run CUDA tests on Ruche supercomputer + - name: cuda + runner: [self-hosted, cuda] + # run OpenMP tests on Azure server + - name: openmp + runner: ubuntu-latest + steps: - name: Get artifacts uses: actions/download-artifact@v3 @@ -234,8 +241,15 @@ jobs: - name: Deploy artifacts run: tar -xvf tests_cuda.tar - - name: Pull Singularity image - run: singularity pull oras://ghcr.io/cexa-project/kokkos-fft/base_cuda_singularity:latest + - name: Run CUDA tests within Slurm job and Singularity image + run: | + srun --nodes=1 --time=01:00:00 -p gpua100 --gres=gpu:1 \ + singularity run --nv --bind $PWD/build:/work/build -H /work/build oras://ghcr.io/cexa-project/kokkos-fft/base_cuda_singularity:latest \ + ctest + if: ${{ matrix.backend.name == 'cuda' }} - - name: Run test within Slurm job - run: srun --nodes=1 --time=01:00:00 -p gpua100 --gres=gpu:1 singularity run --nv --bind $PWD/build:/work/build -H /work/build base_cuda_singularity_latest.sif ctest + - name: Run OpenMP tests within Docker image + run: | + docker run -v $PWD/build:/work/build ghcr.io/cexa-project/kokkos-fft/base_cuda_openmp \ + ctest + if: ${{ matrix.backend.name == 'openmp' }} From 1258f5af6f015c56f08709010f9d96d98054472b Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Wed, 31 Jan 2024 16:06:46 +0100 Subject: [PATCH 076/100] Fix CI for tests --- .github/workflows/cmake.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index edfc154c..c6b33f5e 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -190,6 +190,7 @@ jobs: if: ${{ matrix.target.name == 'native' }} - name: Save artifacts + # use v3 as more recent versions cannot run on Ruche uses: actions/upload-artifact@v3 with: name: tests_${{ matrix.backend.name }} @@ -234,22 +235,23 @@ jobs: steps: - name: Get artifacts + # use v3 as more recent versions cannot run on Ruche uses: actions/download-artifact@v3 with: - name: tests_cuda + name: tests_${{ matrix.backend.name }} - name: Deploy artifacts - run: tar -xvf tests_cuda.tar + run: tar -xvf tests_${{ matrix.backend.name }}.tar - name: Run CUDA tests within Slurm job and Singularity image run: | srun --nodes=1 --time=01:00:00 -p gpua100 --gres=gpu:1 \ - singularity run --nv --bind $PWD/build:/work/build -H /work/build oras://ghcr.io/cexa-project/kokkos-fft/base_cuda_singularity:latest \ + singularity run --nv --bind $PWD/build:/work/build -H /work/build oras://ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }}_singularity:latest \ ctest if: ${{ matrix.backend.name == 'cuda' }} - name: Run OpenMP tests within Docker image run: | - docker run -v $PWD/build:/work/build ghcr.io/cexa-project/kokkos-fft/base_cuda_openmp \ + docker run -v $PWD/build:/work/build ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }} \ ctest if: ${{ matrix.backend.name == 'openmp' }} From 06abc81d7f0fd86e7df625bca8742362129e86cf Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Thu, 1 Feb 2024 11:36:36 +0100 Subject: [PATCH 077/100] Fix OpenMP tests --- .github/workflows/cmake.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index c6b33f5e..5dbfce92 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -252,6 +252,6 @@ jobs: - name: Run OpenMP tests within Docker image run: | - docker run -v $PWD/build:/work/build ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }} \ + docker run -v $PWD/build:/work/build -w /work/build ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }} \ ctest if: ${{ matrix.backend.name == 'openmp' }} From 89150c95138ced02683540973a79fec4dc75e79b Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Thu, 1 Feb 2024 13:43:14 +0100 Subject: [PATCH 078/100] Use a distinct image for PRs that modified Docker files --- .github/workflows/cmake.yml | 50 ++++++++++++++++++++----------------- 1 file changed, 27 insertions(+), 23 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 5dbfce92..d405d897 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -24,11 +24,14 @@ jobs: extensions: 'hpp,cpp' clangFormatVersion: 12 - check_build_base_needed: + check_docker_files: runs-on: ubuntu-latest outputs: - changed_docker_files: ${{ steps.changed_docker_files.outputs.any_changed == 'true' }} + # true if any Docker file was modified in the PR (PR mode) or since last pushed commit (push mode) + docker_files_have_changed: ${{ steps.get_changed_docker_files.outputs.any_changed == 'true' }} + # use "_pr" as image name suffix if on PR mode and if any Docker file was modified + image_name_suffix: ${{ steps.get_changed_docker_files.outputs.any_changed == 'true' && github.event_name == 'pull_request' && '_pr' || '' }} steps: - uses: actions/checkout@v4 @@ -36,15 +39,15 @@ jobs: fetch-depth: 0 - name: Get changed Dockerfiles - id: changed_docker_files + id: get_changed_docker_files uses: tj-actions/changed-files@v42 with: files: docker/**/Dockerfile - name: List changed Dockerfiles - if: ${{ steps.changed_docker_files.outputs.any_changed == 'true' }} + if: ${{ steps.docker_files_have_changed.outputs.any_changed == 'true' }} env: - ALL_CHANGED_FILES: ${{ steps.changed_docker_files.outputs.all_changed_files }} + ALL_CHANGED_FILES: ${{ steps.docker_files_have_changed.outputs.all_changed_files }} run: | for file in "$ALL_CHANGED_FILES"; do echo "$file was changed" @@ -53,9 +56,9 @@ jobs: build_base: runs-on: ubuntu-latest - needs: check_build_base_needed + needs: check_docker_files - if: ${{ needs.check_build_base_needed.outputs.changed_docker_files == 'true' }} + if: ${{ needs.check_docker_files.outputs.docker_files_have_changed == 'true' }} strategy: matrix: @@ -95,27 +98,29 @@ jobs: - name: Build Docker image run: | docker build \ - -t ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }} \ + -t ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }}${{ needs.check_docker_files.outputs.image_name_suffix }} \ --cache-from ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }} \ --build-arg BUILDKIT_INLINE_CACHE=1 \ --progress=plain \ docker/${{ matrix.backend.name }} - name: Push Docker image - run: docker push ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }} + run: docker push ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }}${{ needs.check_docker_files.outputs.image_name_suffix }} - name: Convert Docker image to Singularity - run: singularity build base_${{ matrix.backend.name }}.sif docker://ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }} + run: singularity build base_${{ matrix.backend.name }}.sif docker://ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }}${{ needs.check_docker_files.outputs.image_name_suffix }} if: ${{ matrix.backend.use_singularity }} - name: Push Singularity image - run: singularity push base_${{ matrix.backend.name }}.sif oras://ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }}_singularity + run: singularity push base_${{ matrix.backend.name }}.sif oras://ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }}_singularity${{ needs.check_docker_files.outputs.image_name_suffix }} if: ${{ matrix.backend.use_singularity }} build: runs-on: ubuntu-latest - needs: build_base + needs: + - needs.check_docker_files + - build_base # run this job even if build_base did not run if: ${{ always() && (needs.build_base.result == 'success' || needs.build_base.result == 'skipped') }} @@ -162,12 +167,9 @@ jobs: with: submodules: recursive - - name: Pull image - run: docker pull ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }} - - name: Configure run: | - docker run -v ${{ github.workspace }}:/work ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }} \ + docker run -v ${{ github.workspace }}:/work ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }}${{ needs.check_docker_files.outputs.image_name_suffix }} \ cmake -B build \ -DCMAKE_INSTALL_PREFIX=/work/install \ -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \ @@ -181,7 +183,7 @@ jobs: - name: Build run: | - docker run -v ${{ github.workspace }}:/work ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }} \ + docker run -v ${{ github.workspace }}:/work ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }}${{ needs.check_docker_files.outputs.image_name_suffix }} \ cmake --build build -j $(( $(nproc) * 2 + 1 )) - name: Prepare artifacts @@ -199,12 +201,12 @@ jobs: - name: Install run: | - docker run -v ${{ github.workspace }}:/work ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }} \ + docker run -v ${{ github.workspace }}:/work ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }}${{ needs.check_docker_files.outputs.image_name_suffix }} \ cmake --install build - name: Configure and build test code run: | - docker run -v ${{ github.workspace }}:/work ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }} \ + docker run -v ${{ github.workspace }}:/work ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }}${{ needs.check_docker_files.outputs.image_name_suffix }} \ cmake -B build_test \ -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \ -DCMAKE_C_COMPILER=${{ matrix.backend.c_compiler }} \ @@ -212,13 +214,15 @@ jobs: -DCMAKE_CXX_STANDARD=17 \ -DCMAKE_PREFIX_PATH=/work/install \ install_test/src - docker run -v ${{ github.workspace }}:/work ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }} \ + docker run -v ${{ github.workspace }}:/work ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }}${{ needs.check_docker_files.outputs.image_name_suffix }} \ cmake --build build_test -j $(( $(nproc) * 2 + 1 )) test: runs-on: ${{ matrix.backend.runner }} - needs: build + needs: + - check_docker_files + - build # run this job even if build_base did not run if: ${{ always() && needs.build.result == 'success' }} @@ -246,12 +250,12 @@ jobs: - name: Run CUDA tests within Slurm job and Singularity image run: | srun --nodes=1 --time=01:00:00 -p gpua100 --gres=gpu:1 \ - singularity run --nv --bind $PWD/build:/work/build -H /work/build oras://ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }}_singularity:latest \ + singularity run --nv --bind $PWD/build:/work/build -H /work/build oras://ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }}_singularity${{ needs.check_docker_files.outputs.image_name_suffix }}:latest \ ctest if: ${{ matrix.backend.name == 'cuda' }} - name: Run OpenMP tests within Docker image run: | - docker run -v $PWD/build:/work/build -w /work/build ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }} \ + docker run -v $PWD/build:/work/build -w /work/build ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }}${{ needs.check_docker_files.outputs.image_name_suffix }} \ ctest if: ${{ matrix.backend.name == 'openmp' }} From 7e8fd5fe13324edaf63b13bc1c10fc227f044270 Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Thu, 1 Feb 2024 13:46:03 +0100 Subject: [PATCH 079/100] Fix CI --- .github/workflows/cmake.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index d405d897..3aa218f9 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -119,7 +119,7 @@ jobs: runs-on: ubuntu-latest needs: - - needs.check_docker_files + - check_docker_files - build_base # run this job even if build_base did not run From 3746620ab38583651a282c2202de3404e88913f4 Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Thu, 1 Feb 2024 13:54:05 +0100 Subject: [PATCH 080/100] Fix lower-case commands in Docker files --- docker/cuda/Dockerfile | 2 +- docker/hip/Dockerfile | 2 +- docker/openmp/Dockerfile | 2 +- docker/sycl/Dockerfile | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docker/cuda/Dockerfile b/docker/cuda/Dockerfile index 270cc6dc..fdd955a9 100644 --- a/docker/cuda/Dockerfile +++ b/docker/cuda/Dockerfile @@ -18,7 +18,7 @@ RUN apt-get update && apt-get install -y \ ENV FFTWDIR "/usr" -run git config --global --add safe.directory "*" +RUN git config --global --add safe.directory "*" RUN KEYDUMP_URL=https://cloud.cees.ornl.gov/download && \ KEYDUMP_FILE=keydump && \ diff --git a/docker/hip/Dockerfile b/docker/hip/Dockerfile index d3afa18f..3e94d376 100644 --- a/docker/hip/Dockerfile +++ b/docker/hip/Dockerfile @@ -23,7 +23,7 @@ ENV PATH=/opt/rocm/bin:$PATH ENV LD_LIBRARY_PATH /opt/rocm/hipfft/lib:$LD_LIBRARY_PATH ENV CMAKE_PREFIX_PATH /opt/rocm/hip/:/opt/rocm/:$CMAKE_PREFIX_PATH -run git config --global --add safe.directory "*" +RUN git config --global --add safe.directory "*" RUN KEYDUMP_URL=https://cloud.cees.ornl.gov/download && \ KEYDUMP_FILE=keydump && \ diff --git a/docker/openmp/Dockerfile b/docker/openmp/Dockerfile index 48f7fee9..d432af36 100644 --- a/docker/openmp/Dockerfile +++ b/docker/openmp/Dockerfile @@ -15,7 +15,7 @@ RUN apt-get update && apt-get install -y \ ENV FFTWDIR "/usr" -run git config --global --add safe.directory "*" +RUN git config --global --add safe.directory "*" ARG GCC_VERSION=8 RUN echo "deb http://dk.archive.ubuntu.com/ubuntu/ xenial main" >> /etc/apt/sources.list && \ diff --git a/docker/sycl/Dockerfile b/docker/sycl/Dockerfile index 96990cfa..9e4b3a32 100644 --- a/docker/sycl/Dockerfile +++ b/docker/sycl/Dockerfile @@ -16,7 +16,7 @@ RUN apt-get update && apt-get install -y \ ENV FFTWDIR "/usr" -run git config --global --add safe.directory "*" +RUN git config --global --add safe.directory "*" RUN KEYDUMP_URL=https://cloud.cees.ornl.gov/download && \ KEYDUMP_FILE=keydump && \ From 5e912dfe0bd1de534a1455105c5d8a6da91b390b Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Thu, 1 Feb 2024 14:57:01 +0100 Subject: [PATCH 081/100] Rename local SIF files to simpler terms --- .github/workflows/cmake.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 3aa218f9..d53dc0a9 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -108,11 +108,11 @@ jobs: run: docker push ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }}${{ needs.check_docker_files.outputs.image_name_suffix }} - name: Convert Docker image to Singularity - run: singularity build base_${{ matrix.backend.name }}.sif docker://ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }}${{ needs.check_docker_files.outputs.image_name_suffix }} + run: singularity build base.sif docker://ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }}${{ needs.check_docker_files.outputs.image_name_suffix }} if: ${{ matrix.backend.use_singularity }} - name: Push Singularity image - run: singularity push base_${{ matrix.backend.name }}.sif oras://ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }}_singularity${{ needs.check_docker_files.outputs.image_name_suffix }} + run: singularity push base.sif oras://ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }}_singularity${{ needs.check_docker_files.outputs.image_name_suffix }} if: ${{ matrix.backend.use_singularity }} build: From d442209d39887619ff053d775141b8ebdff4d6ab Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Thu, 1 Feb 2024 15:38:26 +0100 Subject: [PATCH 082/100] Replace always by not cancelled on CI --- .github/workflows/cmake.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index d53dc0a9..fb127e3d 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -123,7 +123,7 @@ jobs: - build_base # run this job even if build_base did not run - if: ${{ always() && (needs.build_base.result == 'success' || needs.build_base.result == 'skipped') }} + if: ${{ ! cancelled() && (needs.build_base.result == 'success' || needs.build_base.result == 'skipped') }} strategy: matrix: @@ -225,7 +225,7 @@ jobs: - build # run this job even if build_base did not run - if: ${{ always() && needs.build.result == 'success' }} + if: ${{ ! cancelled() && needs.build.result == 'success' }} strategy: matrix: From e78d1762db8c4fc55aac53e1313ef2adf942d324 Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Thu, 1 Feb 2024 15:41:36 +0100 Subject: [PATCH 083/100] Use _main suffix for main images --- .github/workflows/cmake.yml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index fb127e3d..b91ac340 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -31,7 +31,7 @@ jobs: # true if any Docker file was modified in the PR (PR mode) or since last pushed commit (push mode) docker_files_have_changed: ${{ steps.get_changed_docker_files.outputs.any_changed == 'true' }} # use "_pr" as image name suffix if on PR mode and if any Docker file was modified - image_name_suffix: ${{ steps.get_changed_docker_files.outputs.any_changed == 'true' && github.event_name == 'pull_request' && '_pr' || '' }} + image_name_suffix: ${{ steps.get_changed_docker_files.outputs.any_changed == 'true' && github.event_name == 'pull_request' && 'pr' || 'main' }} steps: - uses: actions/checkout@v4 @@ -98,21 +98,21 @@ jobs: - name: Build Docker image run: | docker build \ - -t ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }}${{ needs.check_docker_files.outputs.image_name_suffix }} \ - --cache-from ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }} \ + -t ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }}_${{ needs.check_docker_files.outputs.image_name_suffix }} \ + --cache-from ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }}_main \ --build-arg BUILDKIT_INLINE_CACHE=1 \ --progress=plain \ docker/${{ matrix.backend.name }} - name: Push Docker image - run: docker push ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }}${{ needs.check_docker_files.outputs.image_name_suffix }} + run: docker push ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }}_${{ needs.check_docker_files.outputs.image_name_suffix }} - name: Convert Docker image to Singularity - run: singularity build base.sif docker://ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }}${{ needs.check_docker_files.outputs.image_name_suffix }} + run: singularity build base.sif docker://ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }}_${{ needs.check_docker_files.outputs.image_name_suffix }} if: ${{ matrix.backend.use_singularity }} - name: Push Singularity image - run: singularity push base.sif oras://ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }}_singularity${{ needs.check_docker_files.outputs.image_name_suffix }} + run: singularity push base.sif oras://ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }}_singularity_${{ needs.check_docker_files.outputs.image_name_suffix }} if: ${{ matrix.backend.use_singularity }} build: @@ -169,7 +169,7 @@ jobs: - name: Configure run: | - docker run -v ${{ github.workspace }}:/work ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }}${{ needs.check_docker_files.outputs.image_name_suffix }} \ + docker run -v ${{ github.workspace }}:/work ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }}_${{ needs.check_docker_files.outputs.image_name_suffix }} \ cmake -B build \ -DCMAKE_INSTALL_PREFIX=/work/install \ -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \ @@ -183,7 +183,7 @@ jobs: - name: Build run: | - docker run -v ${{ github.workspace }}:/work ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }}${{ needs.check_docker_files.outputs.image_name_suffix }} \ + docker run -v ${{ github.workspace }}:/work ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }}_${{ needs.check_docker_files.outputs.image_name_suffix }} \ cmake --build build -j $(( $(nproc) * 2 + 1 )) - name: Prepare artifacts @@ -201,12 +201,12 @@ jobs: - name: Install run: | - docker run -v ${{ github.workspace }}:/work ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }}${{ needs.check_docker_files.outputs.image_name_suffix }} \ + docker run -v ${{ github.workspace }}:/work ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }}_${{ needs.check_docker_files.outputs.image_name_suffix }} \ cmake --install build - name: Configure and build test code run: | - docker run -v ${{ github.workspace }}:/work ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }}${{ needs.check_docker_files.outputs.image_name_suffix }} \ + docker run -v ${{ github.workspace }}:/work ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }}_${{ needs.check_docker_files.outputs.image_name_suffix }} \ cmake -B build_test \ -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \ -DCMAKE_C_COMPILER=${{ matrix.backend.c_compiler }} \ @@ -214,7 +214,7 @@ jobs: -DCMAKE_CXX_STANDARD=17 \ -DCMAKE_PREFIX_PATH=/work/install \ install_test/src - docker run -v ${{ github.workspace }}:/work ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }}${{ needs.check_docker_files.outputs.image_name_suffix }} \ + docker run -v ${{ github.workspace }}:/work ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }}_${{ needs.check_docker_files.outputs.image_name_suffix }} \ cmake --build build_test -j $(( $(nproc) * 2 + 1 )) test: @@ -250,12 +250,12 @@ jobs: - name: Run CUDA tests within Slurm job and Singularity image run: | srun --nodes=1 --time=01:00:00 -p gpua100 --gres=gpu:1 \ - singularity run --nv --bind $PWD/build:/work/build -H /work/build oras://ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }}_singularity${{ needs.check_docker_files.outputs.image_name_suffix }}:latest \ + singularity run --nv --bind $PWD/build:/work/build -H /work/build oras://ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }}_singularity_${{ needs.check_docker_files.outputs.image_name_suffix }}:latest \ ctest if: ${{ matrix.backend.name == 'cuda' }} - name: Run OpenMP tests within Docker image run: | - docker run -v $PWD/build:/work/build -w /work/build ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }}${{ needs.check_docker_files.outputs.image_name_suffix }} \ + docker run -v $PWD/build:/work/build -w /work/build ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }}_${{ needs.check_docker_files.outputs.image_name_suffix }} \ ctest if: ${{ matrix.backend.name == 'openmp' }} From 37c511946e3a2a0edaa124e73fc47936bf1a2c34 Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Thu, 1 Feb 2024 17:32:12 +0100 Subject: [PATCH 084/100] Remove install test scripts --- .github/workflows/cmake.yml | 2 +- install_test/{src => }/CMakeLists.txt | 0 install_test/bin/install_cpu.sh | 48 -------------------- install_test/bin/install_cuda.sh | 64 --------------------------- install_test/bin/install_hip.sh | 64 --------------------------- install_test/{src => }/main.cpp | 0 6 files changed, 1 insertion(+), 177 deletions(-) rename install_test/{src => }/CMakeLists.txt (100%) delete mode 100755 install_test/bin/install_cpu.sh delete mode 100755 install_test/bin/install_cuda.sh delete mode 100755 install_test/bin/install_hip.sh rename install_test/{src => }/main.cpp (100%) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index b91ac340..e8013ead 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -213,7 +213,7 @@ jobs: -DCMAKE_CXX_COMPILER=${{ matrix.backend.cxx_compiler }} \ -DCMAKE_CXX_STANDARD=17 \ -DCMAKE_PREFIX_PATH=/work/install \ - install_test/src + install_test docker run -v ${{ github.workspace }}:/work ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }}_${{ needs.check_docker_files.outputs.image_name_suffix }} \ cmake --build build_test -j $(( $(nproc) * 2 + 1 )) diff --git a/install_test/src/CMakeLists.txt b/install_test/CMakeLists.txt similarity index 100% rename from install_test/src/CMakeLists.txt rename to install_test/CMakeLists.txt diff --git a/install_test/bin/install_cpu.sh b/install_test/bin/install_cpu.sh deleted file mode 100755 index b0572b5e..00000000 --- a/install_test/bin/install_cpu.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/bash - -args=$# -ROOT_DIR=$1 -WK_DIR=$(pwd) -TARGET="cpu" - -# Install Kokkos -export KOKKOS_INSTALL_PREFIX=${ROOT_DIR}/usr/local/kokkos_${TARGET} -export Kokkos_DIR=${KOKKOS_INSTALL_PREFIX}/lib/cmake/Kokkos -export KOKKOS_BUILD_DIR=build_Kokkos_${TARGET} - -export KOKKOSFFT_INSTALL_PREFIX=${ROOT_DIR}/usr/local/kokkosFFT_${TARGET} -export KokkosFFT_DIR=${KOKKOSFFT_INSTALL_PREFIX}/lib/cmake/KokkosFFT -export KOKKOSFFT_BUILD_DIR=build_KokkosFFT_${TARGET} - -export EXAMPLE_BUILD_DIR=build_example_${TARGET} - -# Install Kokkos -cd ${WK_DIR} -mkdir ${KOKKOS_BUILD_DIR} && cd ${KOKKOS_BUILD_DIR} - -# Get Kokkos from github repo and build -git clone https://github.com/kokkos/kokkos.git -cmake -DBUILD_TESTING=OFF -DCMAKE_BUILD_TYPE=RelWithDebInfo -DKokkos_ENABLE_OPENMP=ON -DCMAKE_INSTALL_PREFIX=${KOKKOS_INSTALL_PREFIX} kokkos -cmake --build . -j 8 -cmake --install . - -# Install KokkosFFT -cd ${WK_DIR} -mkdir ${KOKKOSFFT_BUILD_DIR} && cd ${KOKKOSFFT_BUILD_DIR} -cmake -DBUILD_TESTING=OFF -DCMAKE_BUILD_TYPE=RelWithDebInfo -DKokkos_ENABLE_OPENMP=ON -DCMAKE_INSTALL_PREFIX=${KOKKOSFFT_INSTALL_PREFIX} .. -cmake --build . -j 8 -cmake --install . - -# Try to build an example -# Build KokkosFFT code using installed KokkosFFT -cd ${WK_DIR} -mkdir ${EXAMPLE_BUILD_DIR} && cd ${EXAMPLE_BUILD_DIR} -cmake -DCMAKE_BUILD_TYPE=Release -DKokkos_ENABLE_OPENMP=ON ../install_test/src -cmake --build . -j 8 - -if [ $? -eq 0 ]; then - echo "*** install test: build SUCCESSFUL ***" -else - echo "*** install test: build FAILED ***" - exit 1; -fi diff --git a/install_test/bin/install_cuda.sh b/install_test/bin/install_cuda.sh deleted file mode 100755 index 8b9343d8..00000000 --- a/install_test/bin/install_cuda.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/bin/bash - -args=$# -ROOT_DIR=$1 -WK_DIR=$(pwd) -TARGET=$2 -KOKKOS_TARGET=${TARGET} - -# Install Kokkos -export KOKKOS_INSTALL_PREFIX=${ROOT_DIR}/usr/local/kokkos_${KOKKOS_TARGET} -export Kokkos_DIR=${KOKKOS_INSTALL_PREFIX}/lib/cmake/Kokkos -export KOKKOS_BUILD_DIR=build_Kokkos_${KOKKOS_TARGET} - -export KOKKOSFFT_INSTALL_PREFIX=${ROOT_DIR}/usr/local/kokkosFFT_${TARGET} -export KokkosFFT_DIR=${KOKKOSFFT_INSTALL_PREFIX}/lib/cmake/KokkosFFT -export KOKKOSFFT_BUILD_DIR=build_KokkosFFT_${TARGET} - -export EXAMPLE_BUILD_DIR=build_example_${TARGET} -export CXX_COMPILER=${WK_DIR}/${KOKKOS_BUILD_DIR}/kokkos/bin/nvcc_wrapper - -# Install Kokkos if not exist -if [ ! -d ${Kokkos_DIR} ]; then - cd ${WK_DIR} - mkdir ${KOKKOS_BUILD_DIR} && cd ${KOKKOS_BUILD_DIR} - - # Get Kokkos from github repo and build - git clone https://github.com/kokkos/kokkos.git - cmake -DCMAKE_CXX_COMPILER=${CXX_COMPILER} \ - -DCMAKE_CXX_STANDARD=17 -DKokkos_ENABLE_CUDA=ON -DKokkos_ARCH_AMPERE80=ON \ - -DCMAKE_INSTALL_PREFIX=${KOKKOS_INSTALL_PREFIX} kokkos - - cmake --build . -j 8 - cmake --install . -fi - -# Install KokkosFFT -cd ${WK_DIR} -mkdir ${KOKKOSFFT_BUILD_DIR} && cd ${KOKKOSFFT_BUILD_DIR} -if [ $TARGET == "native" ]; then - cmake -DCMAKE_CXX_COMPILER=${CXX_COMPILER} \ - -DCMAKE_CXX_STANDARD=17 -DKokkos_ENABLE_CUDA=ON -DKokkos_ARCH_AMPERE80=ON \ - -DCMAKE_INSTALL_PREFIX=${KOKKOSFFT_INSTALL_PREFIX} .. -else - cmake -DCMAKE_CXX_COMPILER=${CXX_COMPILER} \ - -DCMAKE_CXX_STANDARD=17 -DKokkos_ENABLE_CUDA=ON -DKokkos_ARCH_AMPERE80=ON \ - -DCMAKE_INSTALL_PREFIX=${KOKKOSFFT_INSTALL_PREFIX} -DKokkosFFT_ENABLE_HOST_AND_DEVICE=ON .. -fi -cmake --build . -j 8 -cmake --install . - -# Try to build an example -# Build KokkosFFT code using installed KokkosFFT -cd ${WK_DIR} -mkdir ${EXAMPLE_BUILD_DIR} && cd ${EXAMPLE_BUILD_DIR} -cmake -DCMAKE_CXX_COMPILER=${CXX_COMPILER} \ - -DCMAKE_CXX_STANDARD=17 -DKokkos_ENABLE_CUDA=ON -DKokkos_ARCH_AMPERE80=ON ../install_test/src -cmake --build . -j 8 - -if [ $? -eq 0 ]; then - echo "*** install test: build SUCCESSFUL ***" -else - echo "*** install test: build FAILED ***" - exit 1; -fi diff --git a/install_test/bin/install_hip.sh b/install_test/bin/install_hip.sh deleted file mode 100755 index d223953a..00000000 --- a/install_test/bin/install_hip.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/bin/bash - -args=$# -ROOT_DIR=$1 -WK_DIR=$(pwd) -TARGET=$2 -KOKKOS_TARGET=${TARGET} - -# Install Kokkos -export KOKKOS_INSTALL_PREFIX=${ROOT_DIR}/usr/local/kokkos_${KOKKOS_TARGET} -export Kokkos_DIR=${KOKKOS_INSTALL_PREFIX}/lib/cmake/Kokkos -export KOKKOS_BUILD_DIR=build_Kokkos_${KOKKOS_TARGET} - -export KOKKOSFFT_INSTALL_PREFIX=${ROOT_DIR}/usr/local/kokkosFFT_${TARGET} -export KokkosFFT_DIR=${KOKKOSFFT_INSTALL_PREFIX}/lib/cmake/KokkosFFT -export KOKKOSFFT_BUILD_DIR=build_KokkosFFT_${TARGET} - -export EXAMPLE_BUILD_DIR=build_example_${TARGET} - -# Install Kokkos if not exist -if [ ! -d ${Kokkos_DIR} ]; then - cd ${WK_DIR} - mkdir ${KOKKOS_BUILD_DIR} && cd ${KOKKOS_BUILD_DIR} - - # Get Kokkos from github repo and build - git clone https://github.com/kokkos/kokkos.git - cmake -DCMAKE_CXX_COMPILER=hipcc \ - -DCMAKE_CXX_STANDARD=17 -DKokkos_ENABLE_HIP=ON -DKokkos_ARCH_VEGA90A=ON \ - -DCMAKE_INSTALL_PREFIX=${KOKKOS_INSTALL_PREFIX} kokkos - - cmake --build . -j 8 - cmake --install . -fi - -# Install KokkosFFT -cd ${WK_DIR} -mkdir ${KOKKOSFFT_BUILD_DIR} && cd ${KOKKOSFFT_BUILD_DIR} -if [ $TARGET == "native" ]; then - cmake -DCMAKE_CXX_COMPILER=hipcc \ - -DCMAKE_CXX_STANDARD=17 -DKokkos_ENABLE_HIP=ON -DKokkos_ARCH_VEGA90A=ON \ - -DCMAKE_INSTALL_PREFIX=${KOKKOSFFT_INSTALL_PREFIX} .. -else - cmake -DCMAKE_CXX_COMPILER=hipcc \ - -DCMAKE_CXX_STANDARD=17 -DKokkos_ENABLE_HIP=ON -DKokkos_ARCH_VEGA90A=ON \ - -DCMAKE_INSTALL_PREFIX=${KOKKOSFFT_INSTALL_PREFIX} -DKokkosFFT_ENABLE_HOST_AND_DEVICE=ON .. -fi -cmake --build . -j 8 -cmake --install . - -# Try to build an example -# Build KokkosFFT code using installed KokkosFFT -cd ${WK_DIR} -mkdir ${EXAMPLE_BUILD_DIR} && cd ${EXAMPLE_BUILD_DIR} -cmake -DCMAKE_CXX_COMPILER=hipcc \ - -DCMAKE_CXX_STANDARD=17 -DKokkos_ENABLE_HIP=ON -DKokkos_ARCH_VEGA90A=ON \ - ../install_test/src -cmake --build . -j 8 - -if [ $? -eq 0 ]; then - echo "*** install test: build SUCCESSFUL ***" -else - echo "*** install test: build FAILED ***" - exit 1; -fi diff --git a/install_test/src/main.cpp b/install_test/main.cpp similarity index 100% rename from install_test/src/main.cpp rename to install_test/main.cpp From 8b91e6f21e58740847ab460720a60c1ba281d244 Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Fri, 2 Feb 2024 09:33:24 +0100 Subject: [PATCH 085/100] Update documentation --- .github/workflows/cmake.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index e8013ead..8b5169f5 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -30,7 +30,8 @@ jobs: outputs: # true if any Docker file was modified in the PR (PR mode) or since last pushed commit (push mode) docker_files_have_changed: ${{ steps.get_changed_docker_files.outputs.any_changed == 'true' }} - # use "_pr" as image name suffix if on PR mode and if any Docker file was modified + # use "pr" as image name suffix if on PR mode and if any Docker file was modified, otherwise use "main" + # this is intended to avoid a PR test to alter Docker images for other PRs or for the main branch image_name_suffix: ${{ steps.get_changed_docker_files.outputs.any_changed == 'true' && github.event_name == 'pull_request' && 'pr' || 'main' }} steps: From 3c14f7d4cdb841d26b0e66f2316558765712ab01 Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Fri, 2 Feb 2024 09:42:51 +0100 Subject: [PATCH 086/100] Move test file --- .github/workflows/{cmake.yml => build_test.yaml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{cmake.yml => build_test.yaml} (100%) diff --git a/.github/workflows/cmake.yml b/.github/workflows/build_test.yaml similarity index 100% rename from .github/workflows/cmake.yml rename to .github/workflows/build_test.yaml From b3e1811f7797b9ba51c5dfb3ef5ac2921e7ac232 Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Fri, 2 Feb 2024 10:28:03 +0100 Subject: [PATCH 087/100] Build base image in a different workflow --- .github/workflows/__build_base.yaml | 73 +++++++++++++++++++++++++++++ .github/workflows/base_images.yaml | 50 -------------------- .github/workflows/build_test.yaml | 58 ++--------------------- 3 files changed, 76 insertions(+), 105 deletions(-) create mode 100644 .github/workflows/__build_base.yaml delete mode 100644 .github/workflows/base_images.yaml diff --git a/.github/workflows/__build_base.yaml b/.github/workflows/__build_base.yaml new file mode 100644 index 00000000..c369af0b --- /dev/null +++ b/.github/workflows/__build_base.yaml @@ -0,0 +1,73 @@ +name: Build base images + +on: + workflow_call: + inputs: + # suffix of the Docker and Singularity images + image_name_suffix: + required: false + default: main + type: string + +env: + # Force the use of BuildKit for Docker + DOCKER_BUILDKIT: 1 + +jobs: + build_base: + runs-on: ubuntu-latest + + strategy: + matrix: + backend: + - name: openmp + use_singularity: false + - name: cuda + use_singularity: true + - name: hip + use_singularity: false + - name: sycl + use_singularity: false + + steps: + - name: Free Disk Space (Ubuntu) + uses: jlumbroso/free-disk-space@v1.2.0 + with: + tool-cache: true + large-packages: false + + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Get Singularity + env: + SINGULARITY_VERSION: 3.11.2 + run: | + wget https://github.com/sylabs/singularity/releases/download/v${{ env.SINGULARITY_VERSION }}/singularity-ce_${{ env.SINGULARITY_VERSION }}-jammy_amd64.deb + sudo apt-get install ./singularity-ce_${{ env.SINGULARITY_VERSION }}-jammy_amd64.deb + + - name: Login in GitHub Containers Repository with Docker + run: echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin + + - name: Login in GitHub Containers Repository with Singularity + run: echo ${{ secrets.GITHUB_TOKEN }} | singularity remote login -u ${{ github.actor }} --password-stdin oras://ghcr.io + + - name: Build Docker image + run: | + docker build \ + -t ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }}_${{ inputs.image_name_suffix }} \ + --cache-from ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }}_main \ + --build-arg BUILDKIT_INLINE_CACHE=1 \ + --progress=plain \ + docker/${{ matrix.backend.name }} + + - name: Push Docker image + run: docker push ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }}_${{ inputs.image_name_suffix }} + + - name: Convert Docker image to Singularity + run: singularity build base.sif docker://ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }}_${{ inputs.image_name_suffix }} + if: ${{ matrix.backend.use_singularity }} + + - name: Push Singularity image + run: singularity push base.sif oras://ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }}_singularity_${{ inputs.image_name_suffix }} + if: ${{ matrix.backend.use_singularity }} diff --git a/.github/workflows/base_images.yaml b/.github/workflows/base_images.yaml deleted file mode 100644 index 19b57de2..00000000 --- a/.github/workflows/base_images.yaml +++ /dev/null @@ -1,50 +0,0 @@ -name: Build base images - -on: - workflow_call: - # push: - # branches: - # - main - # pull_request: - # branches: - # - main - # schedule: - # # TODO enable scheduler - # cron: "0 1 2,16 * *" # every 2nd and 16th of the month at 1am UTC - -jobs: - build_base: - runs-on: ubuntu-latest - - strategy: - matrix: - backend: - # - openmp - - cuda - # - hip - - steps: - - name: Free Disk Space (Ubuntu) - uses: jlumbroso/free-disk-space@v1.2.0 - with: - tool-cache: true - large-packages: false - - - name: Checkout repository - uses: actions/checkout@v3 - - # TODO check if current build has a different Dockerfile - - - name: Build image - # TODO improve with caching https://docs.docker.com/engine/reference/commandline/image_build/#cache-from - run: docker build \ - -t ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend }} \ - --cache-from ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend }} \ - --build-arg BUIDKIT_INLINE_CACHE=1 \ - docker/${{ matrix.backend }} - - - name: Login in GitHub Containers Repository - run: echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin - - - name: Push image - run: docker push ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend }} diff --git a/.github/workflows/build_test.yaml b/.github/workflows/build_test.yaml index 8b5169f5..9c11a988 100644 --- a/.github/workflows/build_test.yaml +++ b/.github/workflows/build_test.yaml @@ -55,66 +55,14 @@ jobs: done build_base: - runs-on: ubuntu-latest - needs: check_docker_files if: ${{ needs.check_docker_files.outputs.docker_files_have_changed == 'true' }} - strategy: - matrix: - backend: - - name: openmp - use_singularity: false - - name: cuda - use_singularity: true - - name: hip - use_singularity: false - - name: sycl - use_singularity: false - - steps: - - name: Free Disk Space (Ubuntu) - uses: jlumbroso/free-disk-space@v1.2.0 - with: - tool-cache: true - large-packages: false - - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Get Singularity - env: - SINGULARITY_VERSION: 3.11.2 - run: | - wget https://github.com/sylabs/singularity/releases/download/v${{ env.SINGULARITY_VERSION }}/singularity-ce_${{ env.SINGULARITY_VERSION }}-jammy_amd64.deb - sudo apt-get install ./singularity-ce_${{ env.SINGULARITY_VERSION }}-jammy_amd64.deb - - - name: Login in GitHub Containers Repository with Docker - run: echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin - - - name: Login in GitHub Containers Repository with Singularity - run: echo ${{ secrets.GITHUB_TOKEN }} | singularity remote login -u ${{ github.actor }} --password-stdin oras://ghcr.io + uses: ./github/workflows/__build_base.yaml - - name: Build Docker image - run: | - docker build \ - -t ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }}_${{ needs.check_docker_files.outputs.image_name_suffix }} \ - --cache-from ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }}_main \ - --build-arg BUILDKIT_INLINE_CACHE=1 \ - --progress=plain \ - docker/${{ matrix.backend.name }} - - - name: Push Docker image - run: docker push ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }}_${{ needs.check_docker_files.outputs.image_name_suffix }} - - - name: Convert Docker image to Singularity - run: singularity build base.sif docker://ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }}_${{ needs.check_docker_files.outputs.image_name_suffix }} - if: ${{ matrix.backend.use_singularity }} - - - name: Push Singularity image - run: singularity push base.sif oras://ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }}_singularity_${{ needs.check_docker_files.outputs.image_name_suffix }} - if: ${{ matrix.backend.use_singularity }} + with: + image_name_suffix: ${{ needs.check_docker_files.outputs.image_name_suffix }} build: runs-on: ubuntu-latest From 9dd14f484544ca618aa310dfa95654b22a523236 Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Fri, 2 Feb 2024 10:29:49 +0100 Subject: [PATCH 088/100] Fix CI --- .github/workflows/build_test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_test.yaml b/.github/workflows/build_test.yaml index 9c11a988..cfab736c 100644 --- a/.github/workflows/build_test.yaml +++ b/.github/workflows/build_test.yaml @@ -59,7 +59,7 @@ jobs: if: ${{ needs.check_docker_files.outputs.docker_files_have_changed == 'true' }} - uses: ./github/workflows/__build_base.yaml + uses: ./.github/workflows/__build_base.yaml with: image_name_suffix: ${{ needs.check_docker_files.outputs.image_name_suffix }} From 3dfc193b746dd8e67c4ef2c8621618c8eb96c5fd Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Fri, 2 Feb 2024 11:53:10 +0100 Subject: [PATCH 089/100] Fix pull error on Ruche --- .github/workflows/build_test.yaml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_test.yaml b/.github/workflows/build_test.yaml index cfab736c..35f0b5c2 100644 --- a/.github/workflows/build_test.yaml +++ b/.github/workflows/build_test.yaml @@ -196,10 +196,15 @@ jobs: - name: Deploy artifacts run: tar -xvf tests_${{ matrix.backend.name }}.tar + - name: Pull Singularity image + # pulling the image in advance seems necessary as sometimes invoking `singularity run` on the image URL fails because it cannot find ghcr.io + run: singularity pull oras://ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }}_singularity_${{ needs.check_docker_files.outputs.image_name_suffix }}:latest + if: ${{ matrix.backend.name == 'cuda' }} + - name: Run CUDA tests within Slurm job and Singularity image run: | srun --nodes=1 --time=01:00:00 -p gpua100 --gres=gpu:1 \ - singularity run --nv --bind $PWD/build:/work/build -H /work/build oras://ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }}_singularity_${{ needs.check_docker_files.outputs.image_name_suffix }}:latest \ + singularity run --nv --bind $PWD/build:/work/build -H /work/build base_${{ matrix.backend.name }}_singularity_${{ needs.check_docker_files.outputs.image_name_suffix }}_latest.sif \ ctest if: ${{ matrix.backend.name == 'cuda' }} From 5d43004b5f97addd5daff19789f6e2288b57db6a Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Fri, 2 Feb 2024 14:26:30 +0100 Subject: [PATCH 090/100] Force generation of main images --- .github/workflows/build_test.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_test.yaml b/.github/workflows/build_test.yaml index 35f0b5c2..dcfcc2a6 100644 --- a/.github/workflows/build_test.yaml +++ b/.github/workflows/build_test.yaml @@ -61,8 +61,8 @@ jobs: uses: ./.github/workflows/__build_base.yaml - with: - image_name_suffix: ${{ needs.check_docker_files.outputs.image_name_suffix }} + # with: + # image_name_suffix: ${{ needs.check_docker_files.outputs.image_name_suffix }} build: runs-on: ubuntu-latest From 3f4cee9f9f3bf5897ee3deaf0b6cdbc2c68d7d29 Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Fri, 2 Feb 2024 16:59:13 +0100 Subject: [PATCH 091/100] Revert "Force generation of main images" This reverts commit 5d43004b5f97addd5daff19789f6e2288b57db6a. --- .github/workflows/build_test.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_test.yaml b/.github/workflows/build_test.yaml index dcfcc2a6..35f0b5c2 100644 --- a/.github/workflows/build_test.yaml +++ b/.github/workflows/build_test.yaml @@ -61,8 +61,8 @@ jobs: uses: ./.github/workflows/__build_base.yaml - # with: - # image_name_suffix: ${{ needs.check_docker_files.outputs.image_name_suffix }} + with: + image_name_suffix: ${{ needs.check_docker_files.outputs.image_name_suffix }} build: runs-on: ubuntu-latest From 3f083b1599549af96ad952d1a3c8b52add150ca1 Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Fri, 2 Feb 2024 16:59:51 +0100 Subject: [PATCH 092/100] Add automatic base images generation and cleanup workflows --- .github/workflows/cleanup_base.yaml | 26 ++++++++++++++++++++++++++ .github/workflows/pre_build_base.yaml | 9 +++++++++ 2 files changed, 35 insertions(+) create mode 100644 .github/workflows/cleanup_base.yaml create mode 100644 .github/workflows/pre_build_base.yaml diff --git a/.github/workflows/cleanup_base.yaml b/.github/workflows/cleanup_base.yaml new file mode 100644 index 00000000..4c36b846 --- /dev/null +++ b/.github/workflows/cleanup_base.yaml @@ -0,0 +1,26 @@ +name: Cleanup base images + +on: + schedule: + cron: "0 3 2,16 * *" # every 2nd and 16th of the month at 3am UTC + +jobs: + cleanup: + runs-on: ubuntu-latest + + steps: + - name: Cleanup old images + uses: SmartsquareGmbH/delete-old-packages@v0.7.0 + with: + type: container + names: | + base_cuda_main + base_cuda_pr + base_cuda_singularity_main + base_cuda_singularity_pr + base_hip_main + base_hip_pr + base_openmp_main + base_openmp_pr + base_sycl_main + base_sycl_pr diff --git a/.github/workflows/pre_build_base.yaml b/.github/workflows/pre_build_base.yaml new file mode 100644 index 00000000..9d4dabef --- /dev/null +++ b/.github/workflows/pre_build_base.yaml @@ -0,0 +1,9 @@ +name: Pre-build base images + +on: + schedule: + cron: "0 1 2,16 * *" # every 2nd and 16th of the month at 1am UTC + +jobs: + build_base: + uses: ./.github/workflows/__build_base.yaml From 7f9e4fe28741fe755c8a09049b4ae64ac75b7ec1 Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Fri, 2 Feb 2024 17:04:56 +0100 Subject: [PATCH 093/100] Collapse pull and run on Ruche --- .github/workflows/build_test.yaml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build_test.yaml b/.github/workflows/build_test.yaml index 35f0b5c2..347ffc66 100644 --- a/.github/workflows/build_test.yaml +++ b/.github/workflows/build_test.yaml @@ -196,16 +196,14 @@ jobs: - name: Deploy artifacts run: tar -xvf tests_${{ matrix.backend.name }}.tar - - name: Pull Singularity image - # pulling the image in advance seems necessary as sometimes invoking `singularity run` on the image URL fails because it cannot find ghcr.io - run: singularity pull oras://ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }}_singularity_${{ needs.check_docker_files.outputs.image_name_suffix }}:latest - if: ${{ matrix.backend.name == 'cuda' }} - - name: Run CUDA tests within Slurm job and Singularity image run: | + # pulling the image in advance seems necessary as sometimes invoking `singularity run` on the image URL fails because it cannot find ghcr.io + singularity pull oras://ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }}_singularity_${{ needs.check_docker_files.outputs.image_name_suffix }}:latest + # actual test on a GPU node srun --nodes=1 --time=01:00:00 -p gpua100 --gres=gpu:1 \ - singularity run --nv --bind $PWD/build:/work/build -H /work/build base_${{ matrix.backend.name }}_singularity_${{ needs.check_docker_files.outputs.image_name_suffix }}_latest.sif \ - ctest + singularity run --nv --bind $PWD/build:/work/build -H /work/build base_${{ matrix.backend.name }}_singularity_${{ needs.check_docker_files.outputs.image_name_suffix }}_latest.sif \ + ctest if: ${{ matrix.backend.name == 'cuda' }} - name: Run OpenMP tests within Docker image From 413a09a5a3827c5c897f2693997d8cea84a72590 Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Fri, 2 Feb 2024 17:48:55 +0100 Subject: [PATCH 094/100] Add comment for SYCL generic code --- .github/workflows/build_test.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build_test.yaml b/.github/workflows/build_test.yaml index 347ffc66..89fb681a 100644 --- a/.github/workflows/build_test.yaml +++ b/.github/workflows/build_test.yaml @@ -92,6 +92,8 @@ jobs: - name: sycl c_compiler: icx cxx_compiler: icpx + # building for Intel PVC was unsuccessful without the proper device + # for now on, we simply use Intel GPU generic code cmake_flags: -DKokkos_ENABLE_SYCL=ON -DKokkos_ARCH_INTEL_GEN=ON target: - name: native From f76955f4db5cd528b3f582e4a3c8a8eec3e400a7 Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Fri, 2 Feb 2024 18:00:04 +0100 Subject: [PATCH 095/100] Revert "Collapse pull and run on Ruche" This reverts commit 7f9e4fe28741fe755c8a09049b4ae64ac75b7ec1. --- .github/workflows/build_test.yaml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build_test.yaml b/.github/workflows/build_test.yaml index 89fb681a..5772ab10 100644 --- a/.github/workflows/build_test.yaml +++ b/.github/workflows/build_test.yaml @@ -198,14 +198,16 @@ jobs: - name: Deploy artifacts run: tar -xvf tests_${{ matrix.backend.name }}.tar + - name: Pull Singularity image + # pulling the image in advance seems necessary as sometimes invoking `singularity run` on the image URL fails because it cannot find ghcr.io + run: singularity pull oras://ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }}_singularity_${{ needs.check_docker_files.outputs.image_name_suffix }}:latest + if: ${{ matrix.backend.name == 'cuda' }} + - name: Run CUDA tests within Slurm job and Singularity image run: | - # pulling the image in advance seems necessary as sometimes invoking `singularity run` on the image URL fails because it cannot find ghcr.io - singularity pull oras://ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }}_singularity_${{ needs.check_docker_files.outputs.image_name_suffix }}:latest - # actual test on a GPU node srun --nodes=1 --time=01:00:00 -p gpua100 --gres=gpu:1 \ - singularity run --nv --bind $PWD/build:/work/build -H /work/build base_${{ matrix.backend.name }}_singularity_${{ needs.check_docker_files.outputs.image_name_suffix }}_latest.sif \ - ctest + singularity run --nv --bind $PWD/build:/work/build -H /work/build base_${{ matrix.backend.name }}_singularity_${{ needs.check_docker_files.outputs.image_name_suffix }}_latest.sif \ + ctest if: ${{ matrix.backend.name == 'cuda' }} - name: Run OpenMP tests within Docker image From bd3d299dc20e173a2b46c923141e34cff2701db3 Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Fri, 2 Feb 2024 18:11:25 +0100 Subject: [PATCH 096/100] Add comment for test code --- .github/workflows/build_test.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build_test.yaml b/.github/workflows/build_test.yaml index 5772ab10..83e4c562 100644 --- a/.github/workflows/build_test.yaml +++ b/.github/workflows/build_test.yaml @@ -156,6 +156,7 @@ jobs: cmake --install build - name: Configure and build test code + # Use the built and installed Kokkos FFT library to build a test code run: | docker run -v ${{ github.workspace }}:/work ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }}_${{ needs.check_docker_files.outputs.image_name_suffix }} \ cmake -B build_test \ From a8562324c95cd51cb7ca05587828b046827042b5 Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Fri, 2 Feb 2024 18:15:02 +0100 Subject: [PATCH 097/100] Fix crons --- .github/workflows/cleanup_base.yaml | 2 +- .github/workflows/pre_build_base.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cleanup_base.yaml b/.github/workflows/cleanup_base.yaml index 4c36b846..6063fca0 100644 --- a/.github/workflows/cleanup_base.yaml +++ b/.github/workflows/cleanup_base.yaml @@ -2,7 +2,7 @@ name: Cleanup base images on: schedule: - cron: "0 3 2,16 * *" # every 2nd and 16th of the month at 3am UTC + - cron: "0 3 2,16 * *" # every 2nd and 16th of the month at 3am UTC jobs: cleanup: diff --git a/.github/workflows/pre_build_base.yaml b/.github/workflows/pre_build_base.yaml index 9d4dabef..3a5591a6 100644 --- a/.github/workflows/pre_build_base.yaml +++ b/.github/workflows/pre_build_base.yaml @@ -2,7 +2,7 @@ name: Pre-build base images on: schedule: - cron: "0 1 2,16 * *" # every 2nd and 16th of the month at 1am UTC + - cron: "0 1 2,16 * *" # every 2nd and 16th of the month at 1am UTC jobs: build_base: From f4cf21625651aaf473079a2a1183574d999d1da6 Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Tue, 6 Feb 2024 13:40:14 +0100 Subject: [PATCH 098/100] Add workflow documentation and add CI badge --- .github/workflows/__build_base.yaml | 6 ++++++ .github/workflows/build_test.yaml | 4 ++++ .github/workflows/cleanup_base.yaml | 2 ++ .github/workflows/pre_build_base.yaml | 5 +++++ README.md | 2 +- 5 files changed, 18 insertions(+), 1 deletion(-) diff --git a/.github/workflows/__build_base.yaml b/.github/workflows/__build_base.yaml index c369af0b..0891c7e2 100644 --- a/.github/workflows/__build_base.yaml +++ b/.github/workflows/__build_base.yaml @@ -1,3 +1,9 @@ +# Generate base images for each backend. Images are stored on Github registry +# as Docker format inconditionnaly and as Singularity format only if requested. +# Docker images are used for building Kokkos FFT, while Singularity images are +# used for test execution on the righteous hardware. This workflow can only be +# invoked through another workflows. + name: Build base images on: diff --git a/.github/workflows/build_test.yaml b/.github/workflows/build_test.yaml index 83e4c562..6506e90f 100644 --- a/.github/workflows/build_test.yaml +++ b/.github/workflows/build_test.yaml @@ -1,3 +1,7 @@ +# Build and test Kokkos FFT using Docker and Singularity images. Pre-generated +# images are pulled from Github registry; they are updated only if the current +# PR or commit modified the Docker files. + name: Build and test on: diff --git a/.github/workflows/cleanup_base.yaml b/.github/workflows/cleanup_base.yaml index 6063fca0..484cf443 100644 --- a/.github/workflows/cleanup_base.yaml +++ b/.github/workflows/cleanup_base.yaml @@ -1,3 +1,5 @@ +# Clean old Docker and Singularity images that are too old periodically. + name: Cleanup base images on: diff --git a/.github/workflows/pre_build_base.yaml b/.github/workflows/pre_build_base.yaml index 3a5591a6..5784b263 100644 --- a/.github/workflows/pre_build_base.yaml +++ b/.github/workflows/pre_build_base.yaml @@ -1,3 +1,8 @@ +# Recreate the base images inconditionnaly on a regural basis. This is to +# ensure that anybody using the Docker files for local development does not +# encounter weird bugs unnoticed by the CI, because the images would be too +# old. + name: Pre-build base images on: diff --git a/README.md b/README.md index d4725ab1..cc06b912 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # kokkos-fft -[![CI](https://github.com/CExA-project/kokkos-fft/actions/workflows/cmake.yml/badge.svg)](https://github.com/CExA-project/kokkos-fft/actions) +[![CI](https://github.com/CExA-project/kokkos-fft/actions/workflows/build_test.yaml/badge.svg)](https://github.com/CExA-project/kokkos-fft/actions) UNOFFICIAL FFT interfaces for Kokkos C++ Performance Portability Programming EcoSystem From 259f856e7554af3efda00f91f2c2ee52e01a718f Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Tue, 6 Feb 2024 13:51:05 +0100 Subject: [PATCH 099/100] Rename main CI worflow for badge --- .github/workflows/build_test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_test.yaml b/.github/workflows/build_test.yaml index 6506e90f..e150a9a1 100644 --- a/.github/workflows/build_test.yaml +++ b/.github/workflows/build_test.yaml @@ -2,7 +2,7 @@ # images are pulled from Github registry; they are updated only if the current # PR or commit modified the Docker files. -name: Build and test +name: CI on: pull_request: From 06a71907adf962a1d983be983e5e7edf65c1a9dd Mon Sep 17 00:00:00 2001 From: Paul Zehner Date: Tue, 6 Feb 2024 13:51:52 +0100 Subject: [PATCH 100/100] Change build type to Release --- .github/workflows/build_test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_test.yaml b/.github/workflows/build_test.yaml index e150a9a1..1f8e1610 100644 --- a/.github/workflows/build_test.yaml +++ b/.github/workflows/build_test.yaml @@ -11,7 +11,7 @@ on: env: # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) - BUILD_TYPE: RelWithDebInfo + BUILD_TYPE: Release # Force the use of BuildKit for Docker DOCKER_BUILDKIT: 1