From 7e958a531dee6eb724bb31dd05585a5fa166aa1e Mon Sep 17 00:00:00 2001 From: RaulPPealez Date: Fri, 17 Nov 2023 10:46:06 +0100 Subject: [PATCH] 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