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

Support HIP #951

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
23 changes: 23 additions & 0 deletions news/support_hip.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
**Added:**

* HIP Platform Support

**Changed:**

* <news item>

**Deprecated:**

* <news item>

**Removed:**

* <news item>

**Fixed:**

* <news item>

**Security:**

* <news item>
7 changes: 4 additions & 3 deletions openfe/protocols/openmm_rfe/_rfe_utils/compute.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ def get_openmm_platform(platform_name=None):
'cpu': 'CPU',
'opencl': 'OpenCL',
'cuda': 'CUDA',
'hip': 'HIP',
}[str(platform_name).lower()]
except KeyError:
pass
Expand All @@ -43,14 +44,14 @@ def get_openmm_platform(platform_name=None):
platform = Platform.getPlatformByName(platform_name)
# Set precision and properties
name = platform.getName()
if name in ['CUDA', 'OpenCL']:
if name in ['CUDA', 'OpenCL', 'HIP']:
platform.setPropertyDefaultValue(
'Precision', 'mixed')
if name == 'CUDA':
if name in ['CUDA', 'HIP']:
platform.setPropertyDefaultValue(
'DeterministicForces', 'true')

if name != 'CUDA':
Copy link
Member

Choose a reason for hiding this comment

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

Do we need to set DeterministicForces or Percision for HIP?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch, I was able to do that with the OpenMM API, but I need to test on a real GPU to see if it works (as in, setting those properties worked on my openMM HIP build but it could crash as soon as I try and run a MD step on the GPU)

Copy link
Member

Choose a reason for hiding this comment

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

Is there an easy way to test this out? I.e. would spinning up an AWS runner that uses an AMD card work?

if name not in ['CUDA', 'HIP']:
wmsg = (f"Non-GPU platform selected: {name}, this may significantly "
"impact simulation performance")
warnings.warn(wmsg)
Expand Down
Loading