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

Set C++17 for latest pytorch versions. Add flags for CUDA 12 and 11.8 #641

Merged
merged 4 commits into from
Nov 14, 2023

Conversation

RaulPPelaez
Copy link
Contributor

I updated setup.py to add cuda archs for latests versions.
Also added c++17 when compiling with pytorch>= 2.1.
I removed the logic to download cub, it is bundled with CUDA via thrust since some versions ago.

I used this PR as a patch here for the conda-forge feedstock here conda-forge/torchani-feedstock#24

Copy link
Contributor

@yueyericardo yueyericardo left a comment

Choose a reason for hiding this comment

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

Thank you very much for the quick fix! Really appreciate it!

setup.py Show resolved Hide resolved
Comment on lines +73 to +74
pytorch_version = version.parse(torch.__version__)
cxx_args = ['-std=c++17'] if pytorch_version >= version.parse("2.1.0") else ['-std=c++14']
Copy link
Contributor

Choose a reason for hiding this comment

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

Updated to make it more robust to compare version. Using string to compare may not give correct result in rare cases
For example

>>> version.parse("2.10.0") >= version.parse("2.2.0")
True
>>> "2.10.0" >= "2.2.0"
False

@yueyericardo
Copy link
Contributor

Just FYI, we're planning to migrate all our internal code and update TorchANI to version 2.0 soon. We will do our best to ensure compatibility with the OpenMM ecosystem. We could discuss this further in the future.

@yueyericardo yueyericardo merged commit 17204c6 into aiqm:master Nov 14, 2023
21 of 53 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants