From acc626eac669827a5c70e95a018e87aa035b9ff7 Mon Sep 17 00:00:00 2001 From: RaulPPealez Date: Tue, 8 Aug 2023 13:26:02 +0200 Subject: [PATCH 01/25] Set c++17 standard in CMake --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 89f3491..a68df57 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,12 +32,12 @@ set(SRC_FILES src/ani/CpuANISymmetryFunctions.cpp # Build the library set(LIBRARY ${NAME}PyTorch) add_library(${LIBRARY} SHARED ${SRC_FILES}) -set_property(TARGET ${LIBRARY} PROPERTY CXX_STANDARD 14) +set_property(TARGET ${LIBRARY} PROPERTY CXX_STANDARD 17) target_include_directories(${LIBRARY} PRIVATE ${Python3_INCLUDE_DIRS} src/ani src/pytorch src/schnet) target_link_libraries(${LIBRARY} ${TORCH_LIBRARIES} ${Python3_LIBRARIES}) if(ENABLE_CUDA) - set_property(TARGET ${LIBRARY} PROPERTY CUDA_STANDARD 14) + set_property(TARGET ${LIBRARY} PROPERTY CUDA_STANDARD 17) target_compile_definitions(${LIBRARY} PRIVATE ENABLE_CUDA) endif(ENABLE_CUDA) From 0e16c493f9c16cdee0d023fdc3dd0acf0b3c0b93 Mon Sep 17 00:00:00 2001 From: RaulPPealez Date: Tue, 8 Aug 2023 13:38:58 +0200 Subject: [PATCH 02/25] Set C++17 only with CUDA>10 --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index a68df57..f54c9ab 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -37,7 +37,11 @@ target_include_directories(${LIBRARY} PRIVATE ${Python3_INCLUDE_DIRS} src/ani src/pytorch src/schnet) target_link_libraries(${LIBRARY} ${TORCH_LIBRARIES} ${Python3_LIBRARIES}) if(ENABLE_CUDA) + if(CMAKE_CUDA_COMPILER_VERSION VERSION_LESS 11) + set_property(TARGET ${LIBRARY} PROPERTY CUDA_STANDARD 14) + else() set_property(TARGET ${LIBRARY} PROPERTY CUDA_STANDARD 17) + endif() target_compile_definitions(${LIBRARY} PRIVATE ENABLE_CUDA) endif(ENABLE_CUDA) From 8ac9c6fca6fd4908d261193bd5704e8bfdddf459 Mon Sep 17 00:00:00 2001 From: RaulPPealez Date: Thu, 17 Aug 2023 16:13:10 +0200 Subject: [PATCH 03/25] Update Jimver/cuda-toolkit to v0.2.11 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 760f69b..c1e3e25 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -65,7 +65,7 @@ jobs: uses: actions/checkout@v2 - name: Install CUDA Toolkit - uses: Jimver/cuda-toolkit@v0.2.10 + uses: Jimver/cuda-toolkit@v0.2.11 with: cuda: ${{ matrix.cuda }} linux-local-args: '["--toolkit", "--override"]' From e8559a3af123a7d32a6b9ff8a8e08db9998b61c0 Mon Sep 17 00:00:00 2001 From: RaulPPealez Date: Thu, 17 Aug 2023 16:47:18 +0200 Subject: [PATCH 04/25] Spurious commit --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c1e3e25..ef917e8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -67,7 +67,7 @@ jobs: - name: Install CUDA Toolkit uses: Jimver/cuda-toolkit@v0.2.11 with: - cuda: ${{ matrix.cuda }} + cuda: ${{ matrix.cuda }} linux-local-args: '["--toolkit", "--override"]' if: ${{ matrix.enable_cuda }} From 1c1a504b2660367a56395d14dbff57aab47a01ad Mon Sep 17 00:00:00 2001 From: RaulPPealez Date: Thu, 17 Aug 2023 16:47:35 +0200 Subject: [PATCH 05/25] Undo spurious commit to trigger rerun --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ef917e8..c1e3e25 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -67,7 +67,7 @@ jobs: - name: Install CUDA Toolkit uses: Jimver/cuda-toolkit@v0.2.11 with: - cuda: ${{ matrix.cuda }} + cuda: ${{ matrix.cuda }} linux-local-args: '["--toolkit", "--override"]' if: ${{ matrix.enable_cuda }} From f70c859b9ae906052123e10d7e6c5efbd1ceaaaf Mon Sep 17 00:00:00 2001 From: RaulPPealez Date: Fri, 18 Aug 2023 08:06:54 +0200 Subject: [PATCH 06/25] Try network CUDA method --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c1e3e25..eebd90c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -68,6 +68,7 @@ jobs: uses: Jimver/cuda-toolkit@v0.2.11 with: cuda: ${{ matrix.cuda }} + method: "network" linux-local-args: '["--toolkit", "--override"]' if: ${{ matrix.enable_cuda }} From 56e1c72ca0e172020505dd9816f51d3c2f5a2700 Mon Sep 17 00:00:00 2001 From: RaulPPealez Date: Fri, 18 Aug 2023 08:19:30 +0200 Subject: [PATCH 07/25] Revert "Try network CUDA method" This reverts commit f70c859b9ae906052123e10d7e6c5efbd1ceaaaf. --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eebd90c..c1e3e25 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -68,7 +68,6 @@ jobs: uses: Jimver/cuda-toolkit@v0.2.11 with: cuda: ${{ matrix.cuda }} - method: "network" linux-local-args: '["--toolkit", "--override"]' if: ${{ matrix.enable_cuda }} From a09f4c3a928793b53108fad3981574384156d8ed Mon Sep 17 00:00:00 2001 From: RaulPPealez Date: Fri, 17 Nov 2023 09:12:46 +0100 Subject: [PATCH 08/25] Detect pytorch 2.1 to set cpp 17 --- CMakeLists.txt | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f54c9ab..5337d4b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,16 +32,20 @@ set(SRC_FILES src/ani/CpuANISymmetryFunctions.cpp # Build the library set(LIBRARY ${NAME}PyTorch) add_library(${LIBRARY} SHARED ${SRC_FILES}) -set_property(TARGET ${LIBRARY} PROPERTY CXX_STANDARD 17) +# Specify the C++ version we are building for. Latest pytorch versions require C++17 +message(STATUS "Found Torch: ${Torch_VERSION}") +if(${Torch_VERSION} VERSION_GREATER_EQUAL "2.1.0") + set(CMAKE_CXX_STANDARD 17) + message(STATUS "Setting C++ standard to C++17") +else() + set(CMAKE_CXX_STANDARD 14) + message(STATUS "Setting C++ standard to C++14") +endif() + target_include_directories(${LIBRARY} PRIVATE ${Python3_INCLUDE_DIRS} src/ani src/pytorch src/schnet) target_link_libraries(${LIBRARY} ${TORCH_LIBRARIES} ${Python3_LIBRARIES}) if(ENABLE_CUDA) - if(CMAKE_CUDA_COMPILER_VERSION VERSION_LESS 11) - set_property(TARGET ${LIBRARY} PROPERTY CUDA_STANDARD 14) - else() - set_property(TARGET ${LIBRARY} PROPERTY CUDA_STANDARD 17) - endif() target_compile_definitions(${LIBRARY} PRIVATE ENABLE_CUDA) endif(ENABLE_CUDA) @@ -55,10 +59,6 @@ endif(ENABLE_CUDA) foreach(TEST_PATH ${TEST_PATHS}) cmake_path(GET TEST_PATH STEM TEST_NAME) add_executable(${TEST_NAME} ${TEST_PATH}) - set_property(TARGET ${TEST_NAME} PROPERTY CXX_STANDARD 14) - if(ENABLE_CUDA) - set_property(TARGET ${TEST_NAME} PROPERTY CUDA_STANDARD 14) - endif(ENABLE_CUDA) target_link_libraries(${TEST_NAME} ${LIBRARY}) add_test(${TEST_NAME} ${TEST_NAME}) endforeach() From 573ba636208176d23499d38fd23236caf191a8b1 Mon Sep 17 00:00:00 2001 From: RaulPPealez Date: Fri, 17 Nov 2023 09:25:43 +0100 Subject: [PATCH 09/25] Set CUDA standard too --- CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5337d4b..1d6b92b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -36,9 +36,15 @@ add_library(${LIBRARY} SHARED ${SRC_FILES}) message(STATUS "Found Torch: ${Torch_VERSION}") if(${Torch_VERSION} VERSION_GREATER_EQUAL "2.1.0") set(CMAKE_CXX_STANDARD 17) + if(ENABLE_CUDA) + set(CMAKE_CUDA_STANDARD 17) + endif(ENABLE_CUDA) message(STATUS "Setting C++ standard to C++17") else() set(CMAKE_CXX_STANDARD 14) + if(ENABLE_CUDA) + set(CMAKE_CUDA_STANDARD 14) + endif(ENABLE_CUDA) message(STATUS "Setting C++ standard to C++14") endif() From a0ab9269ed8a06b0f4d6c476bc4da1e74c89b2f5 Mon Sep 17 00:00:00 2001 From: RaulPPealez Date: Fri, 17 Nov 2023 09:41:52 +0100 Subject: [PATCH 10/25] Update CMakeLists --- CMakeLists.txt | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1d6b92b..c0346d6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,6 +11,22 @@ endif(ENABLE_CUDA) # Find dependencies find_package(Python3 REQUIRED COMPONENTS Interpreter Development) find_package(Torch REQUIRED) +# Specify the C++ version we are building for. Latest pytorch versions require C++17 +message(STATUS "Found Torch: ${Torch_VERSION}") +if(${Torch_VERSION} VERSION_GREATER_EQUAL "2.1.0") + set(CMAKE_CXX_STANDARD 17) + if(ENABLE_CUDA) + set(CMAKE_CUDA_STANDARD 17) + endif(ENABLE_CUDA) + message(STATUS "Setting C++ standard to C++17") +else() + set(CMAKE_CXX_STANDARD 14) + if(ENABLE_CUDA) + set(CMAKE_CUDA_STANDARD 14) + endif(ENABLE_CUDA) + message(STATUS "Setting C++ standard to C++14") +endif() + enable_testing() # Source files of the library @@ -32,21 +48,6 @@ set(SRC_FILES src/ani/CpuANISymmetryFunctions.cpp # Build the library set(LIBRARY ${NAME}PyTorch) add_library(${LIBRARY} SHARED ${SRC_FILES}) -# Specify the C++ version we are building for. Latest pytorch versions require C++17 -message(STATUS "Found Torch: ${Torch_VERSION}") -if(${Torch_VERSION} VERSION_GREATER_EQUAL "2.1.0") - set(CMAKE_CXX_STANDARD 17) - if(ENABLE_CUDA) - set(CMAKE_CUDA_STANDARD 17) - endif(ENABLE_CUDA) - message(STATUS "Setting C++ standard to C++17") -else() - set(CMAKE_CXX_STANDARD 14) - if(ENABLE_CUDA) - set(CMAKE_CUDA_STANDARD 14) - endif(ENABLE_CUDA) - message(STATUS "Setting C++ standard to C++14") -endif() target_include_directories(${LIBRARY} PRIVATE ${Python3_INCLUDE_DIRS} src/ani src/pytorch src/schnet) From 888fc0e49fa8a1145e5794d3d9de4fe13aa2ce10 Mon Sep 17 00:00:00 2001 From: RaulPPealez Date: Fri, 17 Nov 2023 10:06:57 +0100 Subject: [PATCH 11/25] Update CI --- .github/workflows/ci.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c1e3e25..f9eac85 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,14 +43,14 @@ jobs: pytorch: "1.12.*" # Latest supported versions (with CUDA) - - name: Linux (CUDA 11.8, Python 3.10, PyTorch 2.0) + - name: Linux (CUDA 12, Python 3.11, PyTorch 2.1) enable_cuda: true - cuda: "11.8.0" - gcc: "10.3.*" - nvcc: "11.8" - python: "3.10.*" + cuda: "12.2.0" + gcc: "11.*" + nvcc: "12.*" + python: "3.11.*" torchani: "2.2.*" - pytorch: "2.0.*" + pytorch: "2.1.*" # Latest supported versions (without CUDA) - name: Linux (no CUDA, Python 3.10, PyTorch 2.0) From d2973f7a2fb5a8f805bedc4a12fe9b05a74a5b03 Mon Sep 17 00:00:00 2001 From: RaulPPealez Date: Fri, 17 Nov 2023 10:20:14 +0100 Subject: [PATCH 12/25] Update CI --- .github/workflows/ci.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f9eac85..d09a24c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -64,11 +64,13 @@ jobs: - name: Check out uses: actions/checkout@v2 - - name: Install CUDA Toolkit + - name: Install CUDA Toolkit uses: Jimver/cuda-toolkit@v0.2.11 with: cuda: ${{ matrix.cuda }} - linux-local-args: '["--toolkit", "--override"]' + method: 'network' # Use the network method for installing subpackages + linux-local-args: '["--toolkit", "--override"]' + sub-packages: '["nvcc"]' # Example subpackages if: ${{ matrix.enable_cuda }} - name: Install Miniconda From 7e958a531dee6eb724bb31dd05585a5fa166aa1e Mon Sep 17 00:00:00 2001 From: RaulPPealez Date: Fri, 17 Nov 2023 10:46:06 +0100 Subject: [PATCH 13/25] Add CI for cuda 12 --- .github/workflows/ci-cuda12.yml | 85 +++++++++++++++++++++++++++++++++ .github/workflows/ci.yml | 18 ++----- 2 files changed, 88 insertions(+), 15 deletions(-) create mode 100644 .github/workflows/ci-cuda12.yml diff --git a/.github/workflows/ci-cuda12.yml b/.github/workflows/ci-cuda12.yml new file mode 100644 index 0000000..883b9dd --- /dev/null +++ b/.github/workflows/ci-cuda12.yml @@ -0,0 +1,85 @@ +name: CI-CUDA12 + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + schedule: + # Run every Sunday at midnight + - cron: '0 0 * * 0' + +defaults: + run: + shell: bash -l {0} + +jobs: + build: + name: ${{ matrix.name }} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + include: + # Latest supported versions (with CUDA) + - name: Linux (CUDA 12, Python 3.11, PyTorch 2.1) + enable_cuda: true + cuda: "12.*" + gcc: "11.*" + nvcc: "12.*" + python: "3.11.*" + torchani: "2.2.*" + pytorch: "2.1.*" + + steps: + - name: Check out + uses: actions/checkout@v2 + + - name: Install Miniconda + uses: conda-incubator/setup-miniconda@v2 + with: + activate-environment: "" + auto-activate-base: true + miniforge-variant: Mambaforge + + - name: Prepare dependencies (with CUDA) + if: ${{ matrix.enable_cuda }} + run: | + sed -i -e "/cudatoolkit/c\ - cuda ${{ matrix.cuda }}" \ + -e "/gxx_linux-64/c\ - gxx_linux-64 ${{ matrix.gcc }}" \ + -e "/torchani/c\ - torchani ${{ matrix.torchani }}" \ + -e "/nvcc_linux-64/c\ - nvcc_linux-64 ${{ matrix.nvcc }}" \ + -e "/python/c\ - python ${{ matrix.python }}" \ + -e "/pytorch-gpu/c\ - pytorch-gpu ${{ matrix.pytorch }}" \ + environment.yml + + - name: Show dependency file + run: cat environment.yml + + - name: Install dependencies + run: mamba env create -n nnpops -f environment.yml + env: + # Needed to install pytorch-gpu on a machine without a GPU + CONDA_OVERRIDE_CUDA: ${{ matrix.nvcc }} + + - name: List conda environment + run: | + conda activate nnpops + conda list + + - name: Configure, compile, and install + run: | + conda activate nnpops + mkdir build && cd build + cmake .. \ + -DENABLE_CUDA=${{ matrix.enable_cuda }} \ + -DTorch_DIR=$(python -c 'import torch.utils; print(torch.utils.cmake_prefix_path)')/Torch \ + -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX + make install + + - name: Test + run: | + conda activate nnpops + cd build + ctest --verbose --exclude-regex TestCuda + diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d09a24c..8986d65 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,22 +42,12 @@ jobs: torchani: "2.2.*" pytorch: "1.12.*" - # Latest supported versions (with CUDA) - - name: Linux (CUDA 12, Python 3.11, PyTorch 2.1) - enable_cuda: true - cuda: "12.2.0" + # Latest supported versions (without CUDA) + - name: Linux (no CUDA, Python 3.11, PyTorch 2.1) + enable_cuda: false gcc: "11.*" - nvcc: "12.*" python: "3.11.*" - torchani: "2.2.*" pytorch: "2.1.*" - - # Latest supported versions (without CUDA) - - name: Linux (no CUDA, Python 3.10, PyTorch 2.0) - enable_cuda: false - gcc: "10.3.*" - python: "3.10.*" - pytorch: "2.0.*" torchani: "2.2.*" steps: @@ -68,9 +58,7 @@ jobs: uses: Jimver/cuda-toolkit@v0.2.11 with: cuda: ${{ matrix.cuda }} - method: 'network' # Use the network method for installing subpackages linux-local-args: '["--toolkit", "--override"]' - sub-packages: '["nvcc"]' # Example subpackages if: ${{ matrix.enable_cuda }} - name: Install Miniconda From 0deca16d50c858df60226e5ff7ef13dcb0d1823e Mon Sep 17 00:00:00 2001 From: RaulPPealez Date: Fri, 17 Nov 2023 10:54:21 +0100 Subject: [PATCH 14/25] Update ci --- .github/workflows/ci-cuda12.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-cuda12.yml b/.github/workflows/ci-cuda12.yml index 883b9dd..cea93e9 100644 --- a/.github/workflows/ci-cuda12.yml +++ b/.github/workflows/ci-cuda12.yml @@ -26,7 +26,6 @@ jobs: enable_cuda: true cuda: "12.*" gcc: "11.*" - nvcc: "12.*" python: "3.11.*" torchani: "2.2.*" pytorch: "2.1.*" @@ -46,9 +45,9 @@ jobs: if: ${{ matrix.enable_cuda }} run: | sed -i -e "/cudatoolkit/c\ - cuda ${{ matrix.cuda }}" \ - -e "/gxx_linux-64/c\ - gxx_linux-64 ${{ matrix.gcc }}" \ + -e "/gxx_linux-64/c\ - gxx ${{ matrix.gcc }}" \ -e "/torchani/c\ - torchani ${{ matrix.torchani }}" \ - -e "/nvcc_linux-64/c\ - nvcc_linux-64 ${{ matrix.nvcc }}" \ + -e "/nvcc_linux-64/d" \ -e "/python/c\ - python ${{ matrix.python }}" \ -e "/pytorch-gpu/c\ - pytorch-gpu ${{ matrix.pytorch }}" \ environment.yml From 81a5e2ed6e283202bf4ba717813d377f4d40ee69 Mon Sep 17 00:00:00 2001 From: RaulPPealez Date: Fri, 17 Nov 2023 10:57:56 +0100 Subject: [PATCH 15/25] Update ci --- .github/workflows/ci-cuda12.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-cuda12.yml b/.github/workflows/ci-cuda12.yml index cea93e9..30a8f3a 100644 --- a/.github/workflows/ci-cuda12.yml +++ b/.github/workflows/ci-cuda12.yml @@ -24,7 +24,7 @@ jobs: # Latest supported versions (with CUDA) - name: Linux (CUDA 12, Python 3.11, PyTorch 2.1) enable_cuda: true - cuda: "12.*" + cuda: "12" gcc: "11.*" python: "3.11.*" torchani: "2.2.*" From e9e6a6d18e27225a27c426937e46ca1bfa7cda3f Mon Sep 17 00:00:00 2001 From: RaulPPealez Date: Fri, 17 Nov 2023 10:59:55 +0100 Subject: [PATCH 16/25] Update CI --- .github/workflows/ci-cuda12.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/ci-cuda12.yml b/.github/workflows/ci-cuda12.yml index 30a8f3a..10da7ef 100644 --- a/.github/workflows/ci-cuda12.yml +++ b/.github/workflows/ci-cuda12.yml @@ -56,10 +56,7 @@ jobs: run: cat environment.yml - name: Install dependencies - run: mamba env create -n nnpops -f environment.yml - env: - # Needed to install pytorch-gpu on a machine without a GPU - CONDA_OVERRIDE_CUDA: ${{ matrix.nvcc }} + run: CONDA_OVERRIDE_CUDA=${{ matrix.nvcc }} mamba env create -n nnpops -f environment.yml - name: List conda environment run: | From d7075e8226f3fd39fa2b4a675c19499a64610bf6 Mon Sep 17 00:00:00 2001 From: RaulPPealez Date: Fri, 17 Nov 2023 11:02:41 +0100 Subject: [PATCH 17/25] Update CI --- .github/workflows/ci-cuda12.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-cuda12.yml b/.github/workflows/ci-cuda12.yml index 10da7ef..f2669f5 100644 --- a/.github/workflows/ci-cuda12.yml +++ b/.github/workflows/ci-cuda12.yml @@ -23,7 +23,6 @@ jobs: include: # Latest supported versions (with CUDA) - name: Linux (CUDA 12, Python 3.11, PyTorch 2.1) - enable_cuda: true cuda: "12" gcc: "11.*" python: "3.11.*" @@ -42,7 +41,6 @@ jobs: miniforge-variant: Mambaforge - name: Prepare dependencies (with CUDA) - if: ${{ matrix.enable_cuda }} run: | sed -i -e "/cudatoolkit/c\ - cuda ${{ matrix.cuda }}" \ -e "/gxx_linux-64/c\ - gxx ${{ matrix.gcc }}" \ @@ -56,7 +54,10 @@ jobs: run: cat environment.yml - name: Install dependencies - run: CONDA_OVERRIDE_CUDA=${{ matrix.nvcc }} mamba env create -n nnpops -f environment.yml + run: mamba env create -n nnpops -f environment.yml + env: + # Needed to install pytorch-gpu on a machine without a GPU + CONDA_OVERRIDE_CUDA: ${{ matrix.cuda }} - name: List conda environment run: | From 262dfd6315adbdd5ab02df4a48b97e5338db3a22 Mon Sep 17 00:00:00 2001 From: RaulPPealez Date: Fri, 17 Nov 2023 11:25:51 +0100 Subject: [PATCH 18/25] Update ci --- .github/workflows/ci-cuda12.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-cuda12.yml b/.github/workflows/ci-cuda12.yml index f2669f5..fb87bc5 100644 --- a/.github/workflows/ci-cuda12.yml +++ b/.github/workflows/ci-cuda12.yml @@ -58,20 +58,21 @@ jobs: env: # Needed to install pytorch-gpu on a machine without a GPU CONDA_OVERRIDE_CUDA: ${{ matrix.cuda }} - - name: List conda environment run: | conda activate nnpops conda list - name: Configure, compile, and install + # CUDA_INC_PATH is required because of a bug in the torch CMake files run: | conda activate nnpops mkdir build && cd build cmake .. \ -DENABLE_CUDA=${{ matrix.enable_cuda }} \ -DTorch_DIR=$(python -c 'import torch.utils; print(torch.utils.cmake_prefix_path)')/Torch \ - -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX + -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX \ + -DCUDA_INC_PATH=$CONDA_PREFIX/targets/x86_64-linux/include make install - name: Test From 170a26659aebcb351ab8edb3163a7ce2f4fa7e44 Mon Sep 17 00:00:00 2001 From: RaulPPealez Date: Fri, 17 Nov 2023 11:29:50 +0100 Subject: [PATCH 19/25] Update ci --- .github/workflows/ci-cuda12.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci-cuda12.yml b/.github/workflows/ci-cuda12.yml index fb87bc5..074f0b6 100644 --- a/.github/workflows/ci-cuda12.yml +++ b/.github/workflows/ci-cuda12.yml @@ -64,15 +64,14 @@ jobs: conda list - name: Configure, compile, and install - # CUDA_INC_PATH is required because of a bug in the torch CMake files + # CUDA_INC_PATH is required because conda-forge installs CUDA headers to a non standard place run: | conda activate nnpops mkdir build && cd build - cmake .. \ + CUDA_INC_PATH=$CONDA_PREFIX/targets/x86_64-linux/include cmake .. \ -DENABLE_CUDA=${{ matrix.enable_cuda }} \ -DTorch_DIR=$(python -c 'import torch.utils; print(torch.utils.cmake_prefix_path)')/Torch \ - -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX \ - -DCUDA_INC_PATH=$CONDA_PREFIX/targets/x86_64-linux/include + -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX make install - name: Test From a7002bf55c895d40a6123861921a231379ded5af Mon Sep 17 00:00:00 2001 From: RaulPPealez Date: Fri, 17 Nov 2023 11:33:21 +0100 Subject: [PATCH 20/25] Add nvtx --- .github/workflows/ci-cuda12.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-cuda12.yml b/.github/workflows/ci-cuda12.yml index 074f0b6..734afe9 100644 --- a/.github/workflows/ci-cuda12.yml +++ b/.github/workflows/ci-cuda12.yml @@ -49,7 +49,7 @@ jobs: -e "/python/c\ - python ${{ matrix.python }}" \ -e "/pytorch-gpu/c\ - pytorch-gpu ${{ matrix.pytorch }}" \ environment.yml - + echo "cuda-nvtx-dev" >> environment.yml - name: Show dependency file run: cat environment.yml From 256fb00cfb747553f6d37a8ac3316aa454504b15 Mon Sep 17 00:00:00 2001 From: RaulPPealez Date: Fri, 17 Nov 2023 11:34:55 +0100 Subject: [PATCH 21/25] typo --- .github/workflows/ci-cuda12.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-cuda12.yml b/.github/workflows/ci-cuda12.yml index 734afe9..fab5641 100644 --- a/.github/workflows/ci-cuda12.yml +++ b/.github/workflows/ci-cuda12.yml @@ -49,7 +49,7 @@ jobs: -e "/python/c\ - python ${{ matrix.python }}" \ -e "/pytorch-gpu/c\ - pytorch-gpu ${{ matrix.pytorch }}" \ environment.yml - echo "cuda-nvtx-dev" >> environment.yml + echo " - cuda-nvtx-dev" >> environment.yml - name: Show dependency file run: cat environment.yml From 2b7e61f174c53ae5a97f6f0bdcb3d673a4e05142 Mon Sep 17 00:00:00 2001 From: RaulPPealez Date: Fri, 17 Nov 2023 11:40:50 +0100 Subject: [PATCH 22/25] Update ci --- .github/workflows/ci-cuda12.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-cuda12.yml b/.github/workflows/ci-cuda12.yml index fab5641..f8d6fee 100644 --- a/.github/workflows/ci-cuda12.yml +++ b/.github/workflows/ci-cuda12.yml @@ -71,7 +71,8 @@ jobs: CUDA_INC_PATH=$CONDA_PREFIX/targets/x86_64-linux/include cmake .. \ -DENABLE_CUDA=${{ matrix.enable_cuda }} \ -DTorch_DIR=$(python -c 'import torch.utils; print(torch.utils.cmake_prefix_path)')/Torch \ - -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX + -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX \ + -DCMAKE_CUDA_ARCHITECTURES=OFF make install - name: Test From ed48fcb94060633196db67d99202448f8bfb50ab Mon Sep 17 00:00:00 2001 From: RaulPPealez Date: Fri, 17 Nov 2023 11:47:58 +0100 Subject: [PATCH 23/25] Set TORCH_CUDA_ARCH_LIST --- .github/workflows/ci-cuda12.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-cuda12.yml b/.github/workflows/ci-cuda12.yml index f8d6fee..e3b0305 100644 --- a/.github/workflows/ci-cuda12.yml +++ b/.github/workflows/ci-cuda12.yml @@ -72,7 +72,7 @@ jobs: -DENABLE_CUDA=${{ matrix.enable_cuda }} \ -DTorch_DIR=$(python -c 'import torch.utils; print(torch.utils.cmake_prefix_path)')/Torch \ -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX \ - -DCMAKE_CUDA_ARCHITECTURES=OFF + -DTORCH_CUDA_ARCH_LIST=8.9 make install - name: Test From f2bf8cc974cd3188a04975dcac24abf9bbccbc7e Mon Sep 17 00:00:00 2001 From: RaulPPealez Date: Fri, 17 Nov 2023 11:54:47 +0100 Subject: [PATCH 24/25] Use targetsDir --- .github/workflows/ci-cuda12.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-cuda12.yml b/.github/workflows/ci-cuda12.yml index e3b0305..4ba3777 100644 --- a/.github/workflows/ci-cuda12.yml +++ b/.github/workflows/ci-cuda12.yml @@ -65,10 +65,11 @@ jobs: - name: Configure, compile, and install # CUDA_INC_PATH is required because conda-forge installs CUDA headers to a non standard place + # TORCH_CUDA_ARCH_LIST is set to avoid torch setting an invalid one automatically run: | conda activate nnpops mkdir build && cd build - CUDA_INC_PATH=$CONDA_PREFIX/targets/x86_64-linux/include cmake .. \ + CUDA_INC_PATH=$CONDA_PREFIX/$targetsDir/include cmake .. \ -DENABLE_CUDA=${{ matrix.enable_cuda }} \ -DTorch_DIR=$(python -c 'import torch.utils; print(torch.utils.cmake_prefix_path)')/Torch \ -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX \ From e4e29719569c190bc7c9580a9bcd13d10ab86930 Mon Sep 17 00:00:00 2001 From: RaulPPealez Date: Mon, 4 Mar 2024 11:25:54 +0100 Subject: [PATCH 25/25] Empty commit to trigger github actions