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

Running examples with GPU using docker container. #874

Merged
merged 6 commits into from
Oct 14, 2021
Merged
Changes from 2 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
20 changes: 20 additions & 0 deletions docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,23 @@ All differences are within tolerance.
```
Note: `perses` currently works best on a single GPU.
See the documentation [here](https://docs.docker.com/config/containers/resource_constraints/#access-an-nvidia-gpu) for how to specify a single GPU on a multi-GPU system.

## Running perses examples from the container in GPUs using CUDA

If you plan to use our docker container and CUDA/GPUs, quick instructions to get the examples running are as follows.

We have our examples with minimalistic setups to satisfy our current continuous integration (CI) workflow. To get more "realistic" simulations I recommend making the following modifications.
ijpulidos marked this conversation as resolved.
Show resolved Hide resolved

1) Clone our repository (say it lives in `$HOME/repos/perses`)
ijpulidos marked this conversation as resolved.
Show resolved Hide resolved

2) Modify the `run_neq_distrib_flattened.py` inside each of the examples you want to run:
ijpulidos marked this conversation as resolved.
Show resolved Hide resolved
- Change the platform name to 'CUDA '(it is CPU by default to satisfy our continuous integration). Should be in line 21 in the script.
- (recommended) You might want to change the nsteps_eq and nsteps_neq (number of steps for equilibrium and nonequilibrium, respectively) to a larger value. Something around 250000 steps (1ns in time) for each should be okay. These should be lines 17 and 18 in the scripts.
- (recommended) Please change the save frequency or else you would be storing A LOT! I guess the actual value depends on what you actually want to see, but please do change it if you increase the number of steps as in the previous item.
ijpulidos marked this conversation as resolved.
Show resolved Hide resolved

3) Run our latest docker container and execute an example.
For example for the kinase-neq-switching example, you would do something like:
```bash
docker run -it --rm --gpus device=0 --mount type=bind,source=$HOME/.OpenEye/,target=/openeye/,readonly --mount type=bind,source=$HOME/repos/perses/examples/,target=/mnt/ -w /mnt/kinase-neq-switching choderalab/perses:0.9.2 python run_neq_distrib_flattened.py
```
Of importance there are the paths to the OpenEye license file (in this example is `$HOME/.OpenEye/`), path to the examples directory in perses (`$HOME/repos/perses/examples/`) and the actual example subdirectory example you want to run (`/mnt/kinase-neq-switching`)