Comments (9)
@HiteSit Thank you for raising this issue!
"We" (not the OpenFE team but other orgs I am apart of) are working to get ROCm/HIP onto conda-forge so that no hacks will be needed to install openmm.
Can you link the line of code that has this assert? Also do you know how OpenMM reports the HIP platform string-wise? I would be happy to get this working.
from openfe.
So,
the utils file is under:
/mambaforge/envs/cheminf_3_11/lib/python3.11/site-packages/openmmtools/utils/utils.py
def platform_supports_precision(platform, precision):
"""Determine whether the specified OpenMM Platform supports the specified minimum precision.
Parameters
----------
platform : str or openmm.Platform
The platform or platform name to check
precision : str
One of ['single', 'mixed', 'double']
Returns
-------
is_supported : bool
True if the platform supports the specified precision; False otherwise
"""
SUPPORTED_PRECISIONS = ['single', 'mixed', 'double']
assert precision in SUPPORTED_PRECISIONS, f"Precision {precision} must be one of {SUPPORTED_PRECISIONS}"
if isinstance(platform, str):
# Get the actual Platform object if the platform_name was specified
platform = openmm.Platform.getPlatformByName(platform)
if platform.getName() == 'Reference':
# Reference is double precision
return (precision == 'double')
if platform.getName() == 'CPU':
return precision in ['mixed']
if platform.getName() in ['CUDA', 'OpenCL']:
properties = { 'Precision' : precision }
system = openmm.System()
system.addParticle(1.0) # Cannot create Context on a system with no particles
integrator = openmm.VerletIntegrator(0.001)
try:
context = openmm.Context(system, integrator, platform, properties)
del context, integrator
return True
except Exception as e:
return False
raise Exception(f"Platform {platform.getName()} unknown")
def get_available_platforms(minimum_precision='mixed'):
"""Return a list of the available OpenMM Platforms that can satisfy the requested minimum precision.
Parameters
----------
minimum_precision : str, optional, default='mixed'
One of [None, 'single', 'mixed', 'double']
If None, all available platforms will be returned.
Returns
-------
platforms : list of openmm.Platform
Platforms that support specified minimumprecision
"""
platforms = [openmm.Platform.getPlatform(i) for i in range(openmm.Platform.getNumPlatforms())]
if minimum_precision is not None:
# Filter based on precision support
platforms = [ platform for platform in platforms if platform_supports_precision(platform, minimum_precision) ]
return platforms
def get_fastest_platform(minimum_precision='mixed'):
"""Return the fastest available platform.
This relies on the hardcoded speed values in Platform.getSpeed().
Parameters
----------
minimum_precision : str, optional, default='mixed'
One of ['single', 'mixed', 'double']
Returns
-------
platform : openmm.Platform
The fastest available platform.
"""
platforms = get_available_platforms(minimum_precision=minimum_precision)
fastest_platform = max(platforms, key=lambda x: x.getSpeed())
return fastest_platform
If I run:
platforms = [openmm.Platform.getPlatform(i) for i in range(openmm.Platform.getNumPlatforms())]
for platform in platforms:
name = platform.getName()
print(name)
>>> Something like "CPU", "OpenCL", "HIP"
Wrong timing, this week LUMI HPC is down for maintenance, I will edit this message with the output from the print
. But I'm quite sure that the only problem is that assert
. I would like to edit the code by myself and report if just adding to the assert
also ["HIP"]
would work, but LUMI install Conda (OpenFF, OpenMM, OpenFreeEnergy and so on) using Singularity enviroments (read-only) and I could not figure it out yet how to use it with --sandbox
, If I figure it out I will edit this post.
from openfe.
Support for the HIP platform would be nice, however I would warn that it definitely needs validation prior to use. Untested platforms tend to be prone to odd behaviour in the alchemical world. Validation would require at least an HFE validation test & a couple of RBFE test cases.
Is this something you'd be willing to take on @HiteSit ?
from openfe.
@IAlibay
Surely I would like to contribute.
First I have to resolve the problem with the Singularity Enviroment. Beside that I can code quite well but I do not have a enough experience with alchemical transformation so I need to be guided.
from openfe.
@HiteSit - we need to discuss this internally first, but the requirement here would be mostly to run a suitably large set of alchemical simulations to verify that the results are reasonable. This would mostly require access to suitable AMD HIP compute resources to do such a validation, which unfortunately we do not have :(
from openfe.
@IAlibay
Yes I understood you need access to the platform. I will try to grab some computational time (node/hours) for free, but anyway if you do not need an astonishing amount of computational time (maybe try to give me more or less a range of node/hours) I'm willing to share my computational time without problem. It's my pleasure to contribute.
You can contact me on [email protected]
from openfe.
@HiteSit - I'm re-opening this issue if it's ok, there definitely needs to be some kind of update to our compute platform selection to allow for HIP. My question was more of a "once this is one, someone will need to check it works".
from openfe.
@IAlibay
I can check, the only constraint is the computational time, I have a limited amount of computational time, but as rule of thumb if the testing is around let's say 10 proteins each of them with 30 ligands should not be a problem. If it's more I can figure it out a way to grab more computational time.
from openfe.
Thanks for pointing to the code file! I will raise this as a separate issue on the openmmtools side of things since there isn't really any reason why we couldn't add support for HIP there, but as @IAlibay said, when it comes to using it in an openfe workflow, we will need it validated.
from openfe.
Related Issues (20)
- Prepare release announcement for social media HOT 1
- Frequent "Should have \sum_n W_nk = 1" errors in analysis HOT 4
- Add a warning/note in the setup that protein inputs may need to be equilibrated before running RBFE? HOT 1
- Get macos-12+, including osx-arm64 (i.e. macos-latest) runners working in CI HOT 1
- [docs] Showcase notebook failing to render HOT 2
- Unpin rdkit on mypy HOT 3
- Run through tutorial using 1.0 release HOT 3
- mark gaff tests as xfail HOT 1
- [docs] find new home for `OpenFE_showcase_1_RBFE_of_T4lysozyme.ipynb` example
- Using customized force field for small molecules HOT 8
- raise a warning if a user supplies an unsupported key in a settings yaml
- CalledProcessError: 9 HOT 2
- Fix OpenFE tests to match main on Lomap
- Validate OpenFE working on latest of our key tools
- Add rever instructions to release instructions in the wiki
- Add install instructions for the conda lock files
- Issue with PyMBAR4
- Using OPC water models for RBFE calculations HOT 3
- Using other versions of small ligand ff (GAFF) instead of the default one HOT 1
- [CLI] inspect command for json output files
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from openfe.