Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempts at fixing CI #144

Merged
merged 42 commits into from
May 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
8ee2690
Try to fix CI on Linux
peastman May 16, 2024
3295508
Don't install POCL on Mac
peastman May 16, 2024
d999f82
Don't install khronos-opencl-icd-loader
peastman May 16, 2024
2e7e10b
Update OpenMM version
peastman May 16, 2024
dac8668
Updated tested versions
peastman May 16, 2024
e854539
Fixed version number
peastman May 16, 2024
8b73bd7
Install correct packages for CUDA 12
peastman May 17, 2024
6342238
Debugging
peastman May 17, 2024
ae97283
Debugging
peastman May 17, 2024
852bbba
Debugging
peastman May 17, 2024
be7d276
Debugging
peastman May 17, 2024
e829b39
Debugging
peastman May 17, 2024
956711d
Debugging
peastman May 17, 2024
5ce95d5
Debugging
peastman May 17, 2024
2ddca89
Debugging
peastman May 17, 2024
2a7290f
Debugging
peastman May 17, 2024
8d30496
Debugging
peastman May 17, 2024
dd0b2cb
Debugging
peastman May 17, 2024
4137432
Debugging
peastman May 21, 2024
7028d14
Debugging
peastman May 21, 2024
e21862a
Try different method of installing CUDA
peastman May 21, 2024
d5c931f
Try not installing CUDA packages from conda
peastman May 21, 2024
405bab7
Debugging
peastman May 21, 2024
767b7e1
Debugging
peastman May 21, 2024
931bacf
Debugging
peastman May 21, 2024
ff80350
Debugging
peastman May 21, 2024
ed38732
Debugging
peastman May 21, 2024
edac428
Don't build OpenCL on Mac
peastman May 21, 2024
6f3a150
Don't try to run tests that can't run correctly
peastman May 22, 2024
41090bd
Update C++ version and minimum macOS version
peastman May 23, 2024
2742f05
Merge branch 'master' into ci
peastman May 23, 2024
28d7319
Debugging
peastman May 23, 2024
4dedafd
Debugging
peastman May 23, 2024
1c644b4
Debugging
peastman May 23, 2024
6973feb
Debugging
peastman May 23, 2024
69b9e35
Debugging
peastman May 23, 2024
875a698
Debugging
peastman May 23, 2024
c84b975
Fixed working directory for tests
peastman May 23, 2024
e4c5d20
Fixes to testing
peastman May 24, 2024
3726621
Try using PyTorch 2.3
peastman May 24, 2024
6ab463a
Try using PyTorch 2.2
peastman May 24, 2024
1389ef4
Switch back to PyTorch 2.1
peastman May 24, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 28 additions & 15 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,13 @@ jobs:
fail-fast: false
matrix:
include:
# Oldest supported versions
# NOTE: renable CUDA 10.2 when it supported by NNPOps (https://github.com/conda-forge/nnpops-feedstock/pull/8)
- name: Linux (CUDA 11.0, Python 3.7, PyTorch 1.11)
os: ubuntu-22.04
cuda-version: "11.0.3"
gcc-version: "8.5.*"
nvcc-version: "11.0"
python-version: "3.7"
pytorch-version: "1.11.*"

# Latest supported versions
- name: Linux (CUDA 11.8, Python 3.10, PyTorch 2.0)
- name: Linux (CUDA 11.8, Python 3.10, PyTorch 2.1)
os: ubuntu-22.04
cuda-version: "11.8.0"
gcc-version: "10.3.*"
nvcc-version: "11.8"
python-version: "3.10"
pytorch-version: "2.0.*"
pytorch-version: "2.1.*"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is pytorch 2.3 in conda-forge.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just tried 2.3, but it fails to install.

Could not solve for environment specs
The following packages are incompatible
├─ __cuda is requested and can be installed;
├─ python 3.10**  is installable with the potential options
│  ├─ python [3.10.0|3.10.10|...|3.10.9], which can be installed;
│  └─ python [3.10.0|3.10.1|...|3.10.9] would require
│     └─ python_abi 3.10.* *_cp310, which can be installed;
└─ pytorch-gpu 2.3**  is not installable because there are no viable options
   ├─ pytorch-gpu 2.3.0 would require
   │  └─ pytorch 2.3.0 cuda118_py39hd44be3b_300, which requires
   │     ├─ python >=3.9,<3.10.0a0 , which conflicts with any installable versions previously reported;
   │     └─ python_abi 3.9.* *_cp39, which conflicts with any installable versions previously reported;
   └─ pytorch-gpu 2.3.0 would require
      └─ pytorch 2.3.0 cuda120_py38heb61fd4_300, which requires
         └─ cuda-version >=12.0,<13 , which requires
            └─ __cuda >=12 , which conflicts with any installable versions previously reported.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried 2.2, but it reports that version isn't available at all. I switched back to 2.1.

Copy link
Contributor

@RaulPPelaez RaulPPelaez May 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pytorch 2.3 requires CUDA >=12 it seems, but only for python>3.9?. tbh I am not sure, I can never fully grasp these conda errors.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Going forward, have proposed some suggestions that may help alleviate these issues ( #146 ). Also this may help with moving to CUDA 12 when that happens


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

- name: "Install CUDA Toolkit on Linux (if needed)"
uses: Jimver/[email protected].10
uses: Jimver/[email protected].15
with:
cuda: ${{ matrix.cuda-version }}
linux-local-args: '["--toolkit", "--override"]'
if: startsWith(matrix.os, 'ubuntu')

- 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 SDK on MacOS (if needed)"
run: source devtools/scripts/install_macos_sdk.sh
if: startsWith(matrix.os, 'macos')
Expand Down Expand Up @@ -130,7 +143,7 @@ jobs:
run: |
export LD_LIBRARY_PATH="${CONDA_PREFIX}/lib/python${{ matrix.python-version }}/site-packages/torch/lib:${LD_LIBRARY_PATH}"
cd build
ctest --output-on-failure --exclude-regex TestCuda
ctest --output-on-failure --exclude-regex "TestCuda|TestOpenCL"

- name: "Run Python test"
shell: bash -l {0}
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ SET(CMAKE_PREFIX_PATH "${PYTORCH_DIR}")
FIND_PACKAGE(Torch REQUIRED)

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

# Set flags for linking on mac
IF(APPLE)
Expand Down
4 changes: 1 addition & 3 deletions devtools/conda-envs/build-macos-11.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@ channels:
dependencies:
- cmake
- compilers
- khronos-opencl-icd-loader
- make
- openmm >=7.7
- openmm >=8.1
- pip
- pocl
- pytest
- python
- pytorch-cpu @PYTORCH_VERSION@
Expand Down
3 changes: 2 additions & 1 deletion devtools/conda-envs/build-ubuntu-22.04.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ dependencies:
- nnpops
- nvcc_linux-64 @NVCC_VERSION@
- ocl-icd
- openmm >=7.7
- openmm >=8.1
- pip
- pocl
- pytest
Expand All @@ -18,3 +18,4 @@ dependencies:
- swig
- sysroot_linux-64 2.17
- torchani
- libxcrypt
6 changes: 3 additions & 3 deletions python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
torch_dir, _ = os.path.split('@TORCH_LIBRARY@')

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

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

extension = Extension(name='_openmmtorch',
sources=['TorchPluginWrapper.cpp'],
Expand Down
8 changes: 5 additions & 3 deletions python/tests/TestTorchForce.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def testConstructors(model_file):
('../../tests/forces.pt', True, False),
('../../tests/forces.pt', True, True)])
@pytest.mark.parametrize('use_cv_force', [True, False])
@pytest.mark.parametrize('platform', ['Reference', 'CPU', 'CUDA', 'OpenCL'])
@pytest.mark.parametrize('platform', [mm.Platform.getPlatform(i).getName() for i in range(mm.Platform.getNumPlatforms())])
def testForce(model_file, output_forces, use_module_constructor, use_cv_force, platform):

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

# Compute the forces and energy.
integ = mm.VerletIntegrator(1.0)
platform = mm.Platform.getPlatformByName(platform)
context = mm.Context(system, integ, platform)
try:
context = mm.Context(system, integ, mm.Platform.getPlatformByName(platform))
except:
pytest.skip(f'Unable to create Context with {platform}')
context.setPositions(positions)
state = context.getState(getEnergy=True, getForces=True)

Expand Down
2 changes: 1 addition & 1 deletion serialization/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ FOREACH(TEST_PROG ${TEST_PROGS})
ADD_EXECUTABLE(${TEST_ROOT} ${TEST_PROG})
TARGET_LINK_LIBRARIES(${TEST_ROOT} ${SHARED_NN_TARGET})
SET_TARGET_PROPERTIES(${TEST_ROOT} PROPERTIES LINK_FLAGS "${EXTRA_COMPILE_FLAGS}" COMPILE_FLAGS "${EXTRA_COMPILE_FLAGS}")
ADD_TEST(${TEST_ROOT} ${EXECUTABLE_OUTPUT_PATH}/${TEST_ROOT})
ADD_TEST(NAME "${TEST_ROOT}" COMMAND "${EXECUTABLE_OUTPUT_PATH}/${TEST_ROOT}" WORKING_DIRECTORY "${CMAKE_BINARY_DIR}")

ENDFOREACH(TEST_PROG ${TEST_PROGS})
Loading