openforcefield / openff-evaluator

A physical property evaluation toolkit from the Open Forcefield Consortium.
https://docs.openforcefield.org/projects/evaluator
MIT License
55 stars 18 forks source link

[WIP] Add option to use AMD GPUs - OpenCL #426

Closed jeff231li closed 1 year ago

jeff231li commented 2 years ago

Description

This PR adds the option to use OpenCL kernel instead of CUDA. This will allow users to run the (OpenMM) calculations on AMD GPUs. In addition, the precision level exposed to the user.

Todos

Notable points that this PR has either accomplished or will accomplish.

Questions

Status

dotsdl commented 2 years ago

@jeff231li is this PR ready for review? Or would you like assistance with it?

jeff231li commented 2 years ago

Happy to assist with getting tests and docs updated to push this over the line.

@dotsdl I need help with getting the tests up and running.

mattwthompson commented 2 years ago

Just as heads-up, I think the master branch is in a partially-broken state as it tracks the upstream changes to the toolkit, the migration to which is not yet complete.

These test failures in particular:

=========================== short test summary info ============================
FAILED openff/evaluator/tests/test_utils/test_openmm.py::test_update_context_with_positions[None]
FAILED openff/evaluator/tests/test_utils/test_openmm.py::test_update_context_with_positions[box_vectors1]
FAILED openff/evaluator/tests/test_utils/test_openmm.py::test_update_context_with_pdb

aren't new and should be resolved with #413, if those are what you're worried about.

jeff231li commented 2 years ago

@mattwthompson thank you for the clarification, I guess this PR is near complete then. @ocmadin can you give this a try on the AMD GPU you have access to?

ocmadin commented 2 years ago

@mattwthompson thank you for the clarification, I guess this PR is near complete then. @ocmadin can you give this a try on the AMD GPU you have access to?

I'll try to get this working when I've got time to set it up in a couple weeks (conferences/comprehensive exam prep/revisions have eaten up all my bandwidth)! Thanks for pushing ahead with this and sorry for the delay on my end.

mrshirts commented 2 years ago

@ocmadin, Chris Walker should be able to help with running OpenMM on AMD CPU's here at CU.

mattwthompson commented 2 years ago

I've updated this to point to a new base branch (v0-3-x) which is based off of the latest release of Evaluator (0.3.11) and does not use any biopolymer functionality of the toolkit. This enables the tests in this branch to be meaningful with respect to the actual changes and also makes it easier to add this to a new 0.3.12 release.

Could somebody with access to AMD GPUs test this branch? Maybe one of @jeff231li @ocmadin @cwalker7 has access to an AMD-based cluster?

Since this is the only change compared to the most recent release, installing it should be as simple as installing that release and then installing against this branch. So something like

$ mamba install "openff-evaluator=0.3.11" -c conda-forge
$ pip install git+https://github.com/openforcefield/openff-evaluator@add_opencl_option

Alternatively, if anybody has been using these features in production already, that would be enough to approve this as-is. The code changes seem good, we just want to verify that the behavior works as intended.

codecov[bot] commented 2 years ago

Codecov Report

:exclamation: No coverage uploaded for pull request base (v0-3-x@9d17bc1). Click here to learn what that means. The diff coverage is n/a.

mattwthompson commented 1 year ago

I'm closing this only to avoid confusion with respect to whether or not Evaluator supports OpenCL - if for any reason you'd like this merged into v0-3-x just let me know!