-
Notifications
You must be signed in to change notification settings - Fork 19
173 lines (154 loc) · 5.56 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
name: CI
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-22.04
strategy:
fail-fast: false
matrix:
include:
# Oldest supported versions
- name: Linux (CUDA 11.8, Python 3.10, PyTorch 2.0)
enable_cuda: true
cuda-version: "11.8"
cuda: "11.8.0"
gcc: "10.3.*"
nvcc: "11.8"
python: "3.10.*"
torchani: "2.2.*"
pytorch: "2.0.*"
# Latest supported versions (with CUDA)
- name: Linux (CUDA 12, Python 3.13, PyTorch 2.5)
enable_cuda: true
cuda-version: "12.6"
cuda: "12.6.0"
gcc: "10.3.*"
nvcc: "12.*"
python: "3.13.*"
torchani: "2.2.*"
pytorch: "2.5.*"
# Latest supported versions (without CUDA)
- name: Linux (no CUDA, Python 3.13, PyTorch 2.5)
enable_cuda: false
gcc: "10.3.*"
python: "3.13.*"
torchani: "2.2.*"
pytorch: "2.5.*"
steps:
- name: Check out
uses: actions/checkout@v2
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
# - name: Manage disk space
# if: startsWith(matrix.os, 'ubuntu')
# run: |
# sudo mkdir -p /opt/empty_dir || true
# for d in \
# /opt/ghc \
# /opt/hostedtoolcache \
# /usr/lib/jvm \
# /usr/local/.ghcup \
# /usr/local/lib/android \
# /usr/local/share/powershell \
# /usr/share/dotnet \
# /usr/share/swift \
# ; do
# sudo rsync --stats -a --delete /opt/empty_dir/ $d || true
# done
# sudo apt-get purge -y -f firefox \
# google-chrome-stable \
# microsoft-edge-stable
# sudo apt-get autoremove -y >& /dev/null
# sudo apt-get autoclean -y >& /dev/null
# sudo docker image prune --all --force
# df -h
# - name: Install CUDA Toolkit
# uses: Jimver/cuda-toolkit@v0.2.21
# with:
# cuda: ${{ matrix.cuda }}
# linux-local-args: '["--toolkit", "--override"]'
# if: ${{ matrix.enable_cuda }}
- name: "Install CUDA"
if: ${{ matrix.enable_cuda }}
env:
CUDA_VERSION: ${{ matrix.cuda-version }}
run: |
sudo apt-key del 7fa2af80
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.1-1_all.deb
sudo dpkg -i cuda-keyring_1.1-1_all.deb
sudo apt-get update
CUDA_APT=${CUDA_VERSION/./-}
sudo apt-get install -y \
libgl1-mesa-dev cuda-compiler-${CUDA_APT} \
cuda-drivers cuda-driver-dev-${CUDA_APT} \
cuda-cudart-${CUDA_APT} cuda-cudart-dev-${CUDA_APT} \
libcufft-${CUDA_APT} libcufft-dev-${CUDA_APT} \
cuda-nvrtc-${CUDA_APT} cuda-nvrtc-dev-${CUDA_APT} \
cuda-nvprof-${CUDA_APT} cuda-profiler-api-${CUDA_APT}
sudo apt-get clean
export CUDA_HOME=/usr/local/cuda-${CUDA_VERSION}
export LD_LIBRARY_PATH=${CUDA_HOME}/lib64:${LD_LIBRARY_PATH:-}
export PATH=${CUDA_HOME}/bin:${PATH}
- name: Install Miniconda
uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: ""
auto-activate-base: true
miniforge-variant: Miniforge3
use-mamba: true
- name: Prepare dependencies (with CUDA)
if: ${{ matrix.enable_cuda }}
run: |
sed -i -e "/cudatoolkit/c\ - cudatoolkit ${{ 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: Prepare dependencies (without CUDA)
if: ${{ !matrix.enable_cuda }}
run: |
sed -i -e "/cudatoolkit/c\ # - cudatoolkit" \
-e "/gxx_linux-64/c\ - gxx_linux-64 ${{ matrix.gcc }}" \
-e "/torchani/c\ - torchani ${{ matrix.torchani }}" \
-e "/nvcc_linux-64/c\ # - nvcc_linux-64" \
-e "/python/c\ - python ${{ matrix.python }}" \
-e "/pytorch-gpu/c\ - pytorch-cpu ${{ 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