Skip to content

Commit d447643

Browse files
authored
Attempts at fixing CI (#144)
* Try to fix CI on Linux * Don't install POCL on Mac * Don't install khronos-opencl-icd-loader * Update OpenMM version * Updated tested versions * Fixed version number * Install correct packages for CUDA 12 * Debugging * Debugging * Debugging * Debugging * Debugging * Debugging * Debugging * Debugging * Debugging * Debugging * Debugging * Debugging * Debugging * Try different method of installing CUDA * Try not installing CUDA packages from conda * Debugging * Debugging * Debugging * Debugging * Debugging * Don't build OpenCL on Mac * Don't try to run tests that can't run correctly * Update C++ version and minimum macOS version * Debugging * Debugging * Debugging * Debugging * Debugging * Debugging * Fixed working directory for tests * Fixes to testing * Try using PyTorch 2.3 * Try using PyTorch 2.2 * Switch back to PyTorch 2.1
1 parent e17b5d0 commit d447643

File tree

7 files changed

+41
-27
lines changed

7 files changed

+41
-27
lines changed

.github/workflows/CI.yml

Lines changed: 28 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,24 +22,13 @@ jobs:
2222
fail-fast: false
2323
matrix:
2424
include:
25-
# Oldest supported versions
26-
# NOTE: renable CUDA 10.2 when it supported by NNPOps (https://github.com/conda-forge/nnpops-feedstock/pull/8)
27-
- name: Linux (CUDA 11.0, Python 3.7, PyTorch 1.11)
28-
os: ubuntu-22.04
29-
cuda-version: "11.0.3"
30-
gcc-version: "8.5.*"
31-
nvcc-version: "11.0"
32-
python-version: "3.7"
33-
pytorch-version: "1.11.*"
34-
35-
# Latest supported versions
36-
- name: Linux (CUDA 11.8, Python 3.10, PyTorch 2.0)
25+
- name: Linux (CUDA 11.8, Python 3.10, PyTorch 2.1)
3726
os: ubuntu-22.04
3827
cuda-version: "11.8.0"
3928
gcc-version: "10.3.*"
4029
nvcc-version: "11.8"
4130
python-version: "3.10"
42-
pytorch-version: "2.0.*"
31+
pytorch-version: "2.1.*"
4332

4433
- name: MacOS (Python 3.9, PyTorch 1.9)
4534
os: macos-11
@@ -55,12 +44,36 @@ jobs:
5544
uses: actions/checkout@v2
5645

5746
- name: "Install CUDA Toolkit on Linux (if needed)"
58-
uses: Jimver/cuda-toolkit@v0.2.10
47+
uses: Jimver/cuda-toolkit@v0.2.15
5948
with:
6049
cuda: ${{ matrix.cuda-version }}
6150
linux-local-args: '["--toolkit", "--override"]'
6251
if: startsWith(matrix.os, 'ubuntu')
6352

53+
- name: Manage disk space
54+
if: startsWith(matrix.os, 'ubuntu')
55+
run: |
56+
sudo mkdir -p /opt/empty_dir || true
57+
for d in \
58+
/opt/ghc \
59+
/opt/hostedtoolcache \
60+
/usr/lib/jvm \
61+
/usr/local/.ghcup \
62+
/usr/local/lib/android \
63+
/usr/local/share/powershell \
64+
/usr/share/dotnet \
65+
/usr/share/swift \
66+
; do
67+
sudo rsync --stats -a --delete /opt/empty_dir/ $d || true
68+
done
69+
sudo apt-get purge -y -f firefox \
70+
google-chrome-stable \
71+
microsoft-edge-stable
72+
sudo apt-get autoremove -y >& /dev/null
73+
sudo apt-get autoclean -y >& /dev/null
74+
sudo docker image prune --all --force
75+
df -h
76+
6477
- name: "Install SDK on MacOS (if needed)"
6578
run: source devtools/scripts/install_macos_sdk.sh
6679
if: startsWith(matrix.os, 'macos')
@@ -130,7 +143,7 @@ jobs:
130143
run: |
131144
export LD_LIBRARY_PATH="${CONDA_PREFIX}/lib/python${{ matrix.python-version }}/site-packages/torch/lib:${LD_LIBRARY_PATH}"
132145
cd build
133-
ctest --output-on-failure --exclude-regex TestCuda
146+
ctest --output-on-failure --exclude-regex "TestCuda|TestOpenCL"
134147
135148
- name: "Run Python test"
136149
shell: bash -l {0}

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ SET(CMAKE_PREFIX_PATH "${PYTORCH_DIR}")
1515
FIND_PACKAGE(Torch REQUIRED)
1616

1717
# Specify the C++ version we are building for.
18-
SET (CMAKE_CXX_STANDARD 14)
18+
SET (CMAKE_CXX_STANDARD 17)
1919

2020
# Set flags for linking on mac
2121
IF(APPLE)

devtools/conda-envs/build-macos-11.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,9 @@ channels:
44
dependencies:
55
- cmake
66
- compilers
7-
- khronos-opencl-icd-loader
87
- make
9-
- openmm >=7.7
8+
- openmm >=8.1
109
- pip
11-
- pocl
1210
- pytest
1311
- python
1412
- pytorch-cpu @PYTORCH_VERSION@

devtools/conda-envs/build-ubuntu-22.04.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ dependencies:
99
- nnpops
1010
- nvcc_linux-64 @NVCC_VERSION@
1111
- ocl-icd
12-
- openmm >=7.7
12+
- openmm >=8.1
1313
- pip
1414
- pocl
1515
- pytest
@@ -18,3 +18,4 @@ dependencies:
1818
- swig
1919
- sysroot_linux-64 2.17
2020
- torchani
21+
- libxcrypt

python/setup.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
torch_dir, _ = os.path.split('@TORCH_LIBRARY@')
1010

1111
# setup extra compile and link arguments on Mac
12-
extra_compile_args = ['-std=c++14']
12+
extra_compile_args = ['-std=c++17']
1313
extra_link_args = []
1414

1515
if platform.system() == 'Darwin':
16-
extra_compile_args += ['-stdlib=libc++', '-mmacosx-version-min=10.7']
17-
extra_link_args += ['-stdlib=libc++', '-mmacosx-version-min=10.7', '-Wl', '-rpath', openmm_dir+'/lib', '-rpath', torch_dir]
16+
extra_compile_args += ['-stdlib=libc++', '-mmacosx-version-min=10.13']
17+
extra_link_args += ['-stdlib=libc++', '-mmacosx-version-min=10.13', '-Wl', '-rpath', openmm_dir+'/lib', '-rpath', torch_dir]
1818

1919
extension = Extension(name='_openmmtorch',
2020
sources=['TorchPluginWrapper.cpp'],

python/tests/TestTorchForce.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def testConstructors(model_file):
2121
('../../tests/forces.pt', True, False),
2222
('../../tests/forces.pt', True, True)])
2323
@pytest.mark.parametrize('use_cv_force', [True, False])
24-
@pytest.mark.parametrize('platform', ['Reference', 'CPU', 'CUDA', 'OpenCL'])
24+
@pytest.mark.parametrize('platform', [mm.Platform.getPlatform(i).getName() for i in range(mm.Platform.getNumPlatforms())])
2525
def testForce(model_file, output_forces, use_module_constructor, use_cv_force, platform):
2626

2727
if pt.cuda.device_count() < 1 and platform == 'CUDA':
@@ -54,8 +54,10 @@ def testForce(model_file, output_forces, use_module_constructor, use_cv_force, p
5454

5555
# Compute the forces and energy.
5656
integ = mm.VerletIntegrator(1.0)
57-
platform = mm.Platform.getPlatformByName(platform)
58-
context = mm.Context(system, integ, platform)
57+
try:
58+
context = mm.Context(system, integ, mm.Platform.getPlatformByName(platform))
59+
except:
60+
pytest.skip(f'Unable to create Context with {platform}')
5961
context.setPositions(positions)
6062
state = context.getState(getEnergy=True, getForces=True)
6163

serialization/tests/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ FOREACH(TEST_PROG ${TEST_PROGS})
1212
ADD_EXECUTABLE(${TEST_ROOT} ${TEST_PROG})
1313
TARGET_LINK_LIBRARIES(${TEST_ROOT} ${SHARED_NN_TARGET})
1414
SET_TARGET_PROPERTIES(${TEST_ROOT} PROPERTIES LINK_FLAGS "${EXTRA_COMPILE_FLAGS}" COMPILE_FLAGS "${EXTRA_COMPILE_FLAGS}")
15-
ADD_TEST(${TEST_ROOT} ${EXECUTABLE_OUTPUT_PATH}/${TEST_ROOT})
15+
ADD_TEST(NAME "${TEST_ROOT}" COMMAND "${EXECUTABLE_OUTPUT_PATH}/${TEST_ROOT}" WORKING_DIRECTORY "${CMAKE_BINARY_DIR}")
1616

1717
ENDFOREACH(TEST_PROG ${TEST_PROGS})

0 commit comments

Comments
 (0)