From 7922bd57f1c00f92bc29bb807f95c849df772a19 Mon Sep 17 00:00:00 2001 From: Jennifer Wei Date: Mon, 16 Oct 2023 10:22:43 -0700 Subject: [PATCH 01/28] Removes conda installation from installation script. --- environment.yml | 5 ++- scripts/install_third_party_dependencies.sh | 39 +++++---------------- 2 files changed, 12 insertions(+), 32 deletions(-) diff --git a/environment.yml b/environment.yml index 8f92655..ff0c090 100644 --- a/environment.yml +++ b/environment.yml @@ -7,14 +7,16 @@ dependencies: - conda-forge::python=3.9 - conda-forge::setuptools=59.5.0 - conda-forge::pip + - conda-forge::cudatoolkit==11.3.* - conda-forge::openmm=7.5.1 - conda-forge::pdbfixer - - conda-forge::cudatoolkit==11.3.* - bioconda::hmmer==3.3.2 - bioconda::hhsuite==3.3.0 - bioconda::kalign2==2.04 - pytorch::pytorch=1.12.* - pip: + - packaging + - ninja==1.11.1 - biopython==1.79 - deepspeed==0.5.10 - dm-tree==0.1.6 @@ -29,3 +31,4 @@ dependencies: - wandb==0.12.21 - modelcif==0.7 - git+https://github.com/NVIDIA/dllogger.git + - git+https://github.com/Dao-AILab/flash-attention.git@5b838a8bef diff --git a/scripts/install_third_party_dependencies.sh b/scripts/install_third_party_dependencies.sh index e334159..3c49003 100755 --- a/scripts/install_third_party_dependencies.sh +++ b/scripts/install_third_party_dependencies.sh @@ -1,33 +1,8 @@ #!/bin/bash -CONDA_INSTALL_URL=${CONDA_INSTALL_URL:-"https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh"} - -source scripts/vars.sh - -# Install Miniconda locally -rm -rf lib/conda -rm -f /tmp/Miniconda3-latest-Linux-x86_64.sh -wget -P /tmp \ - "${CONDA_INSTALL_URL}" \ - && bash /tmp/Miniconda3-latest-Linux-x86_64.sh -b -p lib/conda \ - && rm /tmp/Miniconda3-latest-Linux-x86_64.sh - -# Grab conda-only packages -export PATH=lib/conda/bin:$PATH -lib/conda/bin/python3 -m pip install nvidia-pyindex -conda env create --name=${ENV_NAME} -f environment.yml -source scripts/activate_conda_env.sh - -echo "Attempting to install FlashAttention" -git clone https://github.com/HazyResearch/flash-attention -CUR_DIR=$PWD -cd flash-attention -git checkout 5b838a8bef -python3 setup.py install -cd $CUR_DIR # Install DeepMind's OpenMM patch OPENFOLD_DIR=$PWD -pushd lib/conda/envs/$ENV_NAME/lib/python3.9/site-packages/ \ +pushd $CONDA_DEFAULT_ENV/lib/python3.9/site-packages/ \ && patch -p0 < $OPENFOLD_DIR/lib/openmm.patch \ && popd @@ -39,11 +14,13 @@ wget --no-check-certificate -P openfold/resources \ mkdir -p tests/test_data/alphafold/common ln -rs openfold/resources/stereo_chemical_props.txt tests/test_data/alphafold/common -echo "Downloading OpenFold parameters..." -bash scripts/download_openfold_params.sh openfold/resources - -echo "Downloading AlphaFold parameters..." -bash scripts/download_alphafold_params.sh openfold/resources +# echo "Downloading OpenFold parameters..." +# bash scripts/download_openfold_params.sh openfold/resources +# +# echo "Downloading AlphaFold parameters..." +# bash scripts/download_alphafold_params.sh openfold/resources # Decompress test data gunzip -c tests/test_data/sample_feats.pickle.gz > tests/test_data/sample_feats.pickle + +python setup.py install From 4fde713c05eb216f56e1a38863cf0392bf544cac Mon Sep 17 00:00:00 2001 From: Jennifer Wei Date: Tue, 17 Oct 2023 08:22:46 -0700 Subject: [PATCH 02/28] update installation scripts. --- environment.yml | 2 +- scripts/install_third_party_dependencies.sh | 8 +------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/environment.yml b/environment.yml index ff0c090..3d5631c 100644 --- a/environment.yml +++ b/environment.yml @@ -8,7 +8,7 @@ dependencies: - conda-forge::setuptools=59.5.0 - conda-forge::pip - conda-forge::cudatoolkit==11.3.* - - conda-forge::openmm=7.5.1 + - conda-forge::openmm=7.7.0 - conda-forge::pdbfixer - bioconda::hmmer==3.3.2 - bioconda::hhsuite==3.3.0 diff --git a/scripts/install_third_party_dependencies.sh b/scripts/install_third_party_dependencies.sh index 3c49003..d158228 100755 --- a/scripts/install_third_party_dependencies.sh +++ b/scripts/install_third_party_dependencies.sh @@ -1,13 +1,7 @@ #!/bin/bash -# Install DeepMind's OpenMM patch -OPENFOLD_DIR=$PWD -pushd $CONDA_DEFAULT_ENV/lib/python3.9/site-packages/ \ - && patch -p0 < $OPENFOLD_DIR/lib/openmm.patch \ - && popd - # Download folding resources -wget --no-check-certificate -P openfold/resources \ +wget -N --no-check-certificate -P openfold/resources \ https://git.scicore.unibas.ch/schwede/openstructure/-/raw/7102c63615b64735c4941278d92b554ec94415f8/modules/mol/alg/src/stereo_chemical_props.txt # Certain tests need access to this file From 705c26773d0cf862320a248e19498c9ef34ef123 Mon Sep 17 00:00:00 2001 From: Jennifer Wei Date: Tue, 17 Oct 2023 09:10:49 -0700 Subject: [PATCH 03/28] Updating $LD_LIBRARY_PATH to include conda environment library. --- scripts/install_third_party_dependencies.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/install_third_party_dependencies.sh b/scripts/install_third_party_dependencies.sh index d158228..de6ee6d 100755 --- a/scripts/install_third_party_dependencies.sh +++ b/scripts/install_third_party_dependencies.sh @@ -18,3 +18,6 @@ ln -rs openfold/resources/stereo_chemical_props.txt tests/test_data/alphafold/co gunzip -c tests/test_data/sample_feats.pickle.gz > tests/test_data/sample_feats.pickle python setup.py install + +# Setup LD_LIBRARY_PATH to include conda directory: +export LD_LIBRARY_PATH=$CONDA_PREFIX/lib:$LD_LIBRARY_PATH` From fb34a0cb62e02c9e3ae238ee7013b61915d79b78 Mon Sep 17 00:00:00 2001 From: Jennifer Date: Tue, 17 Oct 2023 17:10:24 -0400 Subject: [PATCH 04/28] Remove openmm patches --- lib/openmm.patch | 42 ----------------------------- openfold/np/relax/amber_minimize.py | 16 +++-------- openfold/np/relax/cleanup.py | 10 ++----- openfold/np/relax/utils.py | 10 ++----- 4 files changed, 8 insertions(+), 70 deletions(-) delete mode 100644 lib/openmm.patch diff --git a/lib/openmm.patch b/lib/openmm.patch deleted file mode 100644 index cc09e9c..0000000 --- a/lib/openmm.patch +++ /dev/null @@ -1,42 +0,0 @@ -Index: simtk/openmm/app/topology.py -=================================================================== ---- simtk.orig/openmm/app/topology.py -+++ simtk/openmm/app/topology.py -@@ -356,19 +356,35 @@ - def isCyx(res): - names = [atom.name for atom in res._atoms] - return 'SG' in names and 'HG' not in names -+ # This function is used to prevent multiple di-sulfide bonds from being -+ # assigned to a given atom. This is a DeepMind modification. -+ def isDisulfideBonded(atom): -+ for b in self._bonds: -+ if (atom in b and b[0].name == 'SG' and -+ b[1].name == 'SG'): -+ return True -+ -+ return False - - cyx = [res for res in self.residues() if res.name == 'CYS' and isCyx(res)] - atomNames = [[atom.name for atom in res._atoms] for res in cyx] - for i in range(len(cyx)): - sg1 = cyx[i]._atoms[atomNames[i].index('SG')] - pos1 = positions[sg1.index] -+ candidate_distance, candidate_atom = 0.3*nanometers, None - for j in range(i): - sg2 = cyx[j]._atoms[atomNames[j].index('SG')] - pos2 = positions[sg2.index] - delta = [x-y for (x,y) in zip(pos1, pos2)] - distance = sqrt(delta[0]*delta[0] + delta[1]*delta[1] + delta[2]*delta[2]) -- if distance < 0.3*nanometers: -- self.addBond(sg1, sg2) -+ if distance < candidate_distance and not isDisulfideBonded(sg2): -+ candidate_distance = distance -+ candidate_atom = sg2 -+ # Assign bond to closest pair. -+ if candidate_atom: -+ self.addBond(sg1, candidate_atom) -+ -+ - - class Chain(object): - """A Chain object represents a chain within a Topology.""" diff --git a/openfold/np/relax/amber_minimize.py b/openfold/np/relax/amber_minimize.py index 6448e15..3cfbf22 100644 --- a/openfold/np/relax/amber_minimize.py +++ b/openfold/np/relax/amber_minimize.py @@ -28,18 +28,10 @@ import openfold.utils.loss as loss from openfold.np.relax import cleanup, utils import ml_collections import numpy as np -try: - # openmm >= 7.6 - import openmm - from openmm import unit - from openmm import app as openmm_app - from openmm.app.internal.pdbstructure import PdbStructure -except ImportError: - # openmm < 7.6 (requires DeepMind patch) - from simtk import openmm - from simtk import unit - from simtk.openmm import app as openmm_app - from simtk.openmm.app.internal.pdbstructure import PdbStructure +import openmm +from openmm import unit +from openmm import app as openmm_app +from openmm.app.internal.pdbstructure import PdbStructure ENERGY = unit.kilocalories_per_mole LENGTH = unit.angstroms diff --git a/openfold/np/relax/cleanup.py b/openfold/np/relax/cleanup.py index 472068b..a435692 100644 --- a/openfold/np/relax/cleanup.py +++ b/openfold/np/relax/cleanup.py @@ -20,14 +20,8 @@ cases like removing chains of length one (see clean_structure). import io import pdbfixer -try: - # openmm >= 7.6 - from openmm import app - from openmm.app import element -except ImportError: - # openmm < 7.6 (requires DeepMind patch) - from simtk.openmm import app - from simtk.openmm.app import element +from openmm import app +from openmm.app import element def fix_pdb(pdbfile, alterations_info): diff --git a/openfold/np/relax/utils.py b/openfold/np/relax/utils.py index b844953..fc19a91 100644 --- a/openfold/np/relax/utils.py +++ b/openfold/np/relax/utils.py @@ -18,14 +18,8 @@ import io from openfold.np import residue_constants from Bio import PDB import numpy as np -try: - # openmm >= 7.6 - from openmm import app as openmm_app - from openmm.app.internal.pdbstructure import PdbStructure -except ImportError: - # openmm < 7.6 (requires DeepMind patch) - from simtk.openmm import app as openmm_app - from simtk.openmm.app.internal.pdbstructure import PdbStructure +from openmm import app as openmm_app +from openmm.app.internal.pdbstructure import PdbStructure def overwrite_pdb_coordinates(pdb_str: str, pos) -> str: From fcba33580eab1c6dc559a3f245cd742538e1a944 Mon Sep 17 00:00:00 2001 From: Jennifer Wei Date: Fri, 20 Oct 2023 06:48:05 -0700 Subject: [PATCH 05/28] - Moves python packages to conda installation instead of pip - Adds helper line to automatically prepend conda library to $LD_LIBRARY_PATH --- environment.yml | 18 ++++++++++-------- scripts/install_third_party_dependencies.sh | 13 +++++-------- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/environment.yml b/environment.yml index 3d5631c..7bb387f 100644 --- a/environment.yml +++ b/environment.yml @@ -10,23 +10,25 @@ dependencies: - conda-forge::cudatoolkit==11.3.* - conda-forge::openmm=7.7.0 - conda-forge::pdbfixer + - conda-forge::awscli + - conda-forge::biopython==1.79 + - conda-forge::ninja + - conda-forge::numpy==1.21.2 + - conda-forge::scipy==1.7.1 + - conda-forge::pyyaml==5.4.1 + - conda-forge::packaging + - conda-forge::tqdm==4.62.2 + - conda-forge::typing-extensions==3.10.0.2 - bioconda::hmmer==3.3.2 - bioconda::hhsuite==3.3.0 - bioconda::kalign2==2.04 + - bioconda::aria2 - pytorch::pytorch=1.12.* - pip: - - packaging - - ninja==1.11.1 - - biopython==1.79 - deepspeed==0.5.10 - dm-tree==0.1.6 - ml-collections==0.1.0 - - numpy==1.21.2 - - PyYAML==5.4.1 - requests==2.26.0 - - scipy==1.7.1 - - tqdm==4.62.2 - - typing-extensions==3.10.0.2 - pytorch_lightning==1.5.10 - wandb==0.12.21 - modelcif==0.7 diff --git a/scripts/install_third_party_dependencies.sh b/scripts/install_third_party_dependencies.sh index de6ee6d..62fb620 100755 --- a/scripts/install_third_party_dependencies.sh +++ b/scripts/install_third_party_dependencies.sh @@ -8,16 +8,13 @@ wget -N --no-check-certificate -P openfold/resources \ mkdir -p tests/test_data/alphafold/common ln -rs openfold/resources/stereo_chemical_props.txt tests/test_data/alphafold/common -# echo "Downloading OpenFold parameters..." -# bash scripts/download_openfold_params.sh openfold/resources -# -# echo "Downloading AlphaFold parameters..." -# bash scripts/download_alphafold_params.sh openfold/resources - # Decompress test data gunzip -c tests/test_data/sample_feats.pickle.gz > tests/test_data/sample_feats.pickle python setup.py install -# Setup LD_LIBRARY_PATH to include conda directory: -export LD_LIBRARY_PATH=$CONDA_PREFIX/lib:$LD_LIBRARY_PATH` +export LD_LIBRARY_PATH=$CONDA_PREFIX/lib:$LD_LIBRARY_PATH + +# The following will prepend conda library environment to $LD_LIBRARY_PATH +# upon conda library activation +# conda env config vars set LD_LIBRARY_PATH=$CONDA_PREFIX/lib:$LD_LIBRARY_PATH From 3e3f07c7f2d0d111dc497d029ecf31bd8dc38fb4 Mon Sep 17 00:00:00 2001 From: Jennifer Wei Date: Fri, 20 Oct 2023 07:02:11 -0700 Subject: [PATCH 06/28] Updates installation instructions in the README. --- README.md | 36 ++++++++---------------------------- 1 file changed, 8 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index fbcdd61..e5b41f6 100644 --- a/README.md +++ b/README.md @@ -48,37 +48,17 @@ and one of {`jackhmmer`, [MMseqs2](https://github.com/soedinglab/mmseqs2) (night installed on on your system. You'll need `git-lfs` to download OpenFold parameters. Finally, some download scripts require `aria2c` and `aws`. -For convenience, we provide a script that installs Miniconda locally, creates a -`conda` virtual environment, installs all Python dependencies, and downloads -useful resources, including both sets of model parameters. Run: +This package is currently supported for CUDA 11 and Pytorch 1.12 -```bash -scripts/install_third_party_dependencies.sh -``` +To install: +1. Clone the repository, e.g. `git clone https://github.com/aqlaboratory/openfold.git` +1. From the `openfold` repo: + - Create an [Anaconda/Mamba](https://docs.anaconda.com/free/anaconda/install/index.html) environment, e.g. `conda env create -n openfold_env` + - Activate the environment, e.g `conda activate openfold_env` +1. Run `scripts/install_third_party_dependencies.sh` to configure kernels and folding resources. -To activate the environment, run: +For some systems, it may help to append the Conda environment library path to `$LD_LIBRARY_PATH`. The `install_third_party_dependencies.sh` script does this once, but you may need this for each bash instance. -```bash -source scripts/activate_conda_env.sh -``` - -To deactivate it, run: - -```bash -source scripts/deactivate_conda_env.sh -``` - -With the environment active, compile OpenFold's CUDA kernels with - -```bash -python3 setup.py install -``` - -To install the HH-suite to `/usr/bin`, run - -```bash -# scripts/install_hh_suite.sh -``` ## Usage From b3a118fc83de2079924393f57997263fd35bad77 Mon Sep 17 00:00:00 2001 From: Jennifer Wei Date: Fri, 20 Oct 2023 09:20:35 -0700 Subject: [PATCH 07/28] Updates Dockerfile to not use OpenMM patches. --- Dockerfile | 2 -- 1 file changed, 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4a9f647..207a3b0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -28,9 +28,7 @@ COPY scripts /opt/openfold/scripts COPY run_pretrained_openfold.py /opt/openfold/run_pretrained_openfold.py COPY train_openfold.py /opt/openfold/train_openfold.py COPY setup.py /opt/openfold/setup.py -COPY lib/openmm.patch /opt/openfold/lib/openmm.patch RUN wget -q -P /opt/openfold/openfold/resources \ https://git.scicore.unibas.ch/schwede/openstructure/-/raw/7102c63615b64735c4941278d92b554ec94415f8/modules/mol/alg/src/stereo_chemical_props.txt -RUN patch -p0 -d /opt/conda/lib/python3.9/site-packages/ < /opt/openfold/lib/openmm.patch WORKDIR /opt/openfold RUN python3 setup.py install From d6ae9f58944bbc952dee6618a6ae049410fe1e00 Mon Sep 17 00:00:00 2001 From: jnwei Date: Fri, 20 Oct 2023 15:44:34 -0400 Subject: [PATCH 08/28] Remove conda env config setting and update to README --- README.md | 3 ++- scripts/install_third_party_dependencies.sh | 4 ---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index e5b41f6..25bd605 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,8 @@ This package is currently supported for CUDA 11 and Pytorch 1.12 To install: 1. Clone the repository, e.g. `git clone https://github.com/aqlaboratory/openfold.git` 1. From the `openfold` repo: - - Create an [Anaconda/Mamba](https://docs.anaconda.com/free/anaconda/install/index.html) environment, e.g. `conda env create -n openfold_env` + - Create an [Anaconda/Mamba](https://docs.anaconda.com/free/anaconda/install/index.html) environment, e.g. + `conda env create -n openfold_env -f environment.yml` - Activate the environment, e.g `conda activate openfold_env` 1. Run `scripts/install_third_party_dependencies.sh` to configure kernels and folding resources. diff --git a/scripts/install_third_party_dependencies.sh b/scripts/install_third_party_dependencies.sh index 62fb620..86d5ee8 100755 --- a/scripts/install_third_party_dependencies.sh +++ b/scripts/install_third_party_dependencies.sh @@ -14,7 +14,3 @@ gunzip -c tests/test_data/sample_feats.pickle.gz > tests/test_data/sample_feats. python setup.py install export LD_LIBRARY_PATH=$CONDA_PREFIX/lib:$LD_LIBRARY_PATH - -# The following will prepend conda library environment to $LD_LIBRARY_PATH -# upon conda library activation -# conda env config vars set LD_LIBRARY_PATH=$CONDA_PREFIX/lib:$LD_LIBRARY_PATH From 0c20e3c98938e62fece153ac1c61924c733b7fa0 Mon Sep 17 00:00:00 2001 From: Gustaf Ahdritz Date: Thu, 19 Oct 2023 18:44:01 -0400 Subject: [PATCH 09/28] Update BibTex --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 25bd605..62aa9fa 100644 --- a/README.md +++ b/README.md @@ -442,7 +442,7 @@ Please cite our paper: ```bibtex @article {Ahdritz2022.11.20.517210, - author = {Ahdritz, Gustaf and Bouatta, Nazim and Kadyan, Sachin and Xia, Qinghui and Gerecke, William and O{\textquoteright}Donnell, Timothy J and Berenberg, Daniel and Fisk, Ian and Zanichelli, Niccolò and Zhang, Bo and Nowaczynski, Arkadiusz and Wang, Bei and Stepniewska-Dziubinska, Marta M and Zhang, Shang and Ojewole, Adegoke and Guney, Murat Efe and Biderman, Stella and Watkins, Andrew M and Ra, Stephen and Lorenzo, Pablo Ribalta and Nivon, Lucas and Weitzner, Brian and Ban, Yih-En Andrew and Sorger, Peter K and Mostaque, Emad and Zhang, Zhao and Bonneau, Richard and AlQuraishi, Mohammed}, + author = {Ahdritz, Gustaf and Bouatta, Nazim and Floristean, Christina and Kadyan, Sachin and Xia, Qinghui and Gerecke, William and O{\textquoteright}Donnell, Timothy J and Berenberg, Daniel and Fisk, Ian and Zanichelli, Niccolò and Zhang, Bo and Nowaczynski, Arkadiusz and Wang, Bei and Stepniewska-Dziubinska, Marta M and Zhang, Shang and Ojewole, Adegoke and Guney, Murat Efe and Biderman, Stella and Watkins, Andrew M and Ra, Stephen and Lorenzo, Pablo Ribalta and Nivon, Lucas and Weitzner, Brian and Ban, Yih-En Andrew and Sorger, Peter K and Mostaque, Emad and Zhang, Zhao and Bonneau, Richard and AlQuraishi, Mohammed}, title = {{O}pen{F}old: {R}etraining {A}lpha{F}old2 yields new insights into its learning mechanisms and capacity for generalization}, elocation-id = {2022.11.20.517210}, year = {2022}, From 6bf5c8cea1fac91f37dd475259da1ad0161b025f Mon Sep 17 00:00:00 2001 From: "Matthew W. Thompson" Date: Mon, 23 Oct 2023 15:37:36 -0500 Subject: [PATCH 10/28] Update environment YAML --- environment.yml | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/environment.yml b/environment.yml index 8f92655..ea1ab30 100644 --- a/environment.yml +++ b/environment.yml @@ -2,30 +2,30 @@ name: openfold_venv channels: - conda-forge - bioconda - - pytorch dependencies: - - conda-forge::python=3.9 - - conda-forge::setuptools=59.5.0 - - conda-forge::pip - - conda-forge::openmm=7.5.1 - - conda-forge::pdbfixer - - conda-forge::cudatoolkit==11.3.* + - python=3.9 + - setuptools=59.5.0 + - pip + - openmm=7.7 + - pdbfixer + - cudatoolkit==11.3.* + - pytorch=1.12.* + - pytorch_lightning==1.5.10 + - biopython==1.79 + - numpy==1.21 + - PyYAML==5.4.1 + - requests + - scipy==1.7 + - tqdm==4.62.2 + - typing-extensions==3.10 + - wandb==0.12.21 + - modelcif==0.7 - bioconda::hmmer==3.3.2 - bioconda::hhsuite==3.3.0 - bioconda::kalign2==2.04 - - pytorch::pytorch=1.12.* - pip: - - biopython==1.79 - - deepspeed==0.5.10 - - dm-tree==0.1.6 - - ml-collections==0.1.0 - - numpy==1.21.2 - - PyYAML==5.4.1 - - requests==2.26.0 - - scipy==1.7.1 - - tqdm==4.62.2 - - typing-extensions==3.10.0.2 - - pytorch_lightning==1.5.10 - - wandb==0.12.21 - - modelcif==0.7 + - deepspeed==0.5.10 # can this be updated? + - dm-tree==0.1.6 # 0.1.6 yanked from conda-forge - update? + - ml-collections==0.1.0 # 0.1.1 is oldest available on conda-forge - update? - git+https://github.com/NVIDIA/dllogger.git + - git+https://github.com/Dao-AILab/flash-attention.git@5b838a8bef From f86d42f40ef14ae1795a007a510ed6d95041dfd1 Mon Sep 17 00:00:00 2001 From: "Matthew W. Thompson" Date: Mon, 23 Oct 2023 15:45:33 -0500 Subject: [PATCH 11/28] Switch to Miniforge3 --- Dockerfile | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4a9f647..fe6b6d1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,24 +13,22 @@ RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/ RUN apt-get update && apt-get install -y wget libxml2 cuda-minimal-build-11-3 libcusparse-dev-11-3 libcublas-dev-11-3 libcusolver-dev-11-3 git RUN wget -P /tmp \ - "https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh" \ - && bash /tmp/Miniconda3-latest-Linux-x86_64.sh -b -p /opt/conda \ - && rm /tmp/Miniconda3-latest-Linux-x86_64.sh + "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh" \ + && bash /tmp/Miniforge3-Linux-x86_64.sh -b -p /opt/conda \ + && rm /tmp/Miniforge3-Linux-x86_64.sh ENV PATH /opt/conda/bin:$PATH COPY environment.yml /opt/openfold/environment.yml # installing into the base environment since the docker container wont do anything other than run openfold -RUN conda env update -n base --file /opt/openfold/environment.yml && conda clean --all +RUN mamba env update -n base --file /opt/openfold/environment.yml && mamba clean --all COPY openfold /opt/openfold/openfold COPY scripts /opt/openfold/scripts COPY run_pretrained_openfold.py /opt/openfold/run_pretrained_openfold.py COPY train_openfold.py /opt/openfold/train_openfold.py COPY setup.py /opt/openfold/setup.py -COPY lib/openmm.patch /opt/openfold/lib/openmm.patch RUN wget -q -P /opt/openfold/openfold/resources \ https://git.scicore.unibas.ch/schwede/openstructure/-/raw/7102c63615b64735c4941278d92b554ec94415f8/modules/mol/alg/src/stereo_chemical_props.txt -RUN patch -p0 -d /opt/conda/lib/python3.9/site-packages/ < /opt/openfold/lib/openmm.patch WORKDIR /opt/openfold RUN python3 setup.py install From 32c11376d726a7bc51d2bb239eba14a8939a59ff Mon Sep 17 00:00:00 2001 From: "Matthew W. Thompson" Date: Mon, 23 Oct 2023 15:52:39 -0500 Subject: [PATCH 12/28] Update checkout action --- .github/workflows/docker-image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index b8ce53b..44a422a 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -10,6 +10,6 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Build the Docker image run: docker build . --file Dockerfile --tag openfold:$(date +%s) \ No newline at end of file From 736d668741fee86b4cbe69a81b5b6f9d0fa6969b Mon Sep 17 00:00:00 2001 From: "Matthew W. Thompson" Date: Mon, 23 Oct 2023 15:53:34 -0500 Subject: [PATCH 13/28] Add Dependabot for Actions --- .github/dependabot.yml | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..ae992e3 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,7 @@ +version: 2 +updates: + + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" From 582103505d7c38ef6d21006abf90c7e65254f03c Mon Sep 17 00:00:00 2001 From: "Matthew W. Thompson" Date: Mon, 23 Oct 2023 16:01:16 -0500 Subject: [PATCH 14/28] Update name to `pytorch-lightning` --- environment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/environment.yml b/environment.yml index ea1ab30..3111fdd 100644 --- a/environment.yml +++ b/environment.yml @@ -10,7 +10,7 @@ dependencies: - pdbfixer - cudatoolkit==11.3.* - pytorch=1.12.* - - pytorch_lightning==1.5.10 + - pytorch-lightning==1.5.10 - biopython==1.79 - numpy==1.21 - PyYAML==5.4.1 From 7666c802723e97640b5d0387f0d05054ae5335a3 Mon Sep 17 00:00:00 2001 From: "Matthew W. Thompson" Date: Mon, 23 Oct 2023 16:13:16 -0500 Subject: [PATCH 15/28] Use conventional "short hash" style --- environment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/environment.yml b/environment.yml index 3111fdd..0190405 100644 --- a/environment.yml +++ b/environment.yml @@ -28,4 +28,4 @@ dependencies: - dm-tree==0.1.6 # 0.1.6 yanked from conda-forge - update? - ml-collections==0.1.0 # 0.1.1 is oldest available on conda-forge - update? - git+https://github.com/NVIDIA/dllogger.git - - git+https://github.com/Dao-AILab/flash-attention.git@5b838a8bef + - git+https://github.com/Dao-AILab/flash-attention.git@5b838a8 From a90da39554ca10f2f43d61727f4dd9e8c8aa30c5 Mon Sep 17 00:00:00 2001 From: jnwei Date: Tue, 24 Oct 2023 13:50:32 -0400 Subject: [PATCH 16/28] Test flash-attention v0.2.1 on docker CI --- environment.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/environment.yml b/environment.yml index ecb2bc8..33accb3 100644 --- a/environment.yml +++ b/environment.yml @@ -21,13 +21,14 @@ dependencies: - wandb==0.12.21 - modelcif==0.7 - awscli + - ml-collections - bioconda::aria2 - bioconda::hmmer==3.3.2 - bioconda::hhsuite==3.3.0 - bioconda::kalign2==2.04 - pip: - - deepspeed==0.5.10 # can this be updated? - - dm-tree==0.1.6 # 0.1.6 yanked from conda-forge - update? - - ml-collections==0.1.0 # 0.1.1 is oldest available on conda-forge - update? + - deepspeed==0.5.10 + - dm-tree==0.1.6 - git+https://github.com/NVIDIA/dllogger.git - - git+https://github.com/Dao-AILab/flash-attention.git@5b838a8 + - git+https://github.com/Dao-AILab/flash-attention.git=0.2.1 + # - git+https://github.com/Dao-AILab/flash-attention.git@5b838a8 From f06657fe8ab44820e39bf4463b58bab76bbeabbf Mon Sep 17 00:00:00 2001 From: Jennifer Wei Date: Tue, 24 Oct 2023 13:54:21 -0700 Subject: [PATCH 17/28] Add git to environment.yml --- environment.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/environment.yml b/environment.yml index 33accb3..4c94a81 100644 --- a/environment.yml +++ b/environment.yml @@ -22,7 +22,8 @@ dependencies: - modelcif==0.7 - awscli - ml-collections - - bioconda::aria2 + - aria2 + - git - bioconda::hmmer==3.3.2 - bioconda::hhsuite==3.3.0 - bioconda::kalign2==2.04 @@ -30,5 +31,5 @@ dependencies: - deepspeed==0.5.10 - dm-tree==0.1.6 - git+https://github.com/NVIDIA/dllogger.git - - git+https://github.com/Dao-AILab/flash-attention.git=0.2.1 + - git+https://github.com/Dao-AILab/flash-attention.git@v0.2.1 # - git+https://github.com/Dao-AILab/flash-attention.git@5b838a8 From a5a86d4323487858ef2285632a507c8df18ece88 Mon Sep 17 00:00:00 2001 From: jnwei Date: Tue, 24 Oct 2023 18:07:06 -0400 Subject: [PATCH 18/28] update flash-attention-version --- environment.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/environment.yml b/environment.yml index 4c94a81..e183bb6 100644 --- a/environment.yml +++ b/environment.yml @@ -32,4 +32,3 @@ dependencies: - dm-tree==0.1.6 - git+https://github.com/NVIDIA/dllogger.git - git+https://github.com/Dao-AILab/flash-attention.git@v0.2.1 - # - git+https://github.com/Dao-AILab/flash-attention.git@5b838a8 From 3817d9409881c1295181cf1da7acd7be2510b4ac Mon Sep 17 00:00:00 2001 From: jnwei Date: Tue, 24 Oct 2023 18:09:42 -0400 Subject: [PATCH 19/28] Update Dockerfile to add conda path to $LD_LIBRARY_PATH --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index fe6b6d1..6a2d674 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,6 +22,7 @@ COPY environment.yml /opt/openfold/environment.yml # installing into the base environment since the docker container wont do anything other than run openfold RUN mamba env update -n base --file /opt/openfold/environment.yml && mamba clean --all +EXPORT LD_LIBRARY_PATH=${CONDA_PREFIX}/lib:${LD_LIBRARY_PATH} COPY openfold /opt/openfold/openfold COPY scripts /opt/openfold/scripts From 5efba4425aa8763e8e9bcee1d3410aae63310274 Mon Sep 17 00:00:00 2001 From: jnwei Date: Tue, 24 Oct 2023 18:31:13 -0400 Subject: [PATCH 20/28] Fix export statement --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 6a2d674..cac5ee8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,7 +22,7 @@ COPY environment.yml /opt/openfold/environment.yml # installing into the base environment since the docker container wont do anything other than run openfold RUN mamba env update -n base --file /opt/openfold/environment.yml && mamba clean --all -EXPORT LD_LIBRARY_PATH=${CONDA_PREFIX}/lib:${LD_LIBRARY_PATH} +RUN export LD_LIBRARY_PATH=${CONDA_PREFIX}/lib:${LD_LIBRARY_PATH} COPY openfold /opt/openfold/openfold COPY scripts /opt/openfold/scripts From 6fe34248b2825be27757b60d27a06dbe35d3e687 Mon Sep 17 00:00:00 2001 From: jnwei Date: Tue, 24 Oct 2023 19:32:15 -0400 Subject: [PATCH 21/28] Test nvidia image 11.4.3-cudnn8-runtime-unbuntu18.04 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index cac5ee8..63091de 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM nvidia/cuda:11.3.1-cudnn8-runtime-ubuntu18.04 +FROM nvidia/cuda:11.4.3-cudnn8-runtime-ubuntu18.04 # metainformation LABEL org.opencontainers.image.version = "1.0.0" From e2bb3c4b906f5f424a489794358a65ee68158bab Mon Sep 17 00:00:00 2001 From: jnwei Date: Tue, 24 Oct 2023 19:43:58 -0400 Subject: [PATCH 22/28] Change docker image to use cudnn devel environment --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 63091de..6e8fa41 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM nvidia/cuda:11.4.3-cudnn8-runtime-ubuntu18.04 +FROM nvidia/cuda:11.4.3-cudnn8-devel-ubuntu18.04 # metainformation LABEL org.opencontainers.image.version = "1.0.0" From a5c69a79c638a83156648cadf5f84dd113c05f39 Mon Sep 17 00:00:00 2001 From: jnwei Date: Tue, 24 Oct 2023 19:55:58 -0400 Subject: [PATCH 23/28] Test docker image nvidia/11.7.1-cudnn8-devel-ubuntu18.04 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 6e8fa41..03678d6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM nvidia/cuda:11.4.3-cudnn8-devel-ubuntu18.04 +FROM nvidia/cuda:11.7.1-cudnn8-devel-ubuntu18.04 # metainformation LABEL org.opencontainers.image.version = "1.0.0" From f68a6c694b1556e2e73a76f2ce2ac1d3377ee2ab Mon Sep 17 00:00:00 2001 From: jnwei Date: Wed, 25 Oct 2023 08:51:58 -0400 Subject: [PATCH 24/28] Update readme, also reset flash attention version to 0.2.1 in environment.yml --- Dockerfile | 2 +- README.md | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 03678d6..c7d9483 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM nvidia/cuda:11.7.1-cudnn8-devel-ubuntu18.04 +FROM nvidia/cuda:11.3.1-cudnn8-devel-ubuntu18.04 # metainformation LABEL org.opencontainers.image.version = "1.0.0" diff --git a/README.md b/README.md index 62aa9fa..c3adadd 100644 --- a/README.md +++ b/README.md @@ -53,8 +53,9 @@ This package is currently supported for CUDA 11 and Pytorch 1.12 To install: 1. Clone the repository, e.g. `git clone https://github.com/aqlaboratory/openfold.git` 1. From the `openfold` repo: - - Create an [Anaconda/Mamba](https://docs.anaconda.com/free/anaconda/install/index.html) environment, e.g. - `conda env create -n openfold_env -f environment.yml` + - Create a [Mamba]("https://github.com/conda-forge/miniforge/releases/latest/download/) environment, e.g. + `mamba env create -n openfold_env -f environment.yml` + Mamba is recommended as the dependencies required by OpenFold are quite large and mamba can speed up the process. - Activate the environment, e.g `conda activate openfold_env` 1. Run `scripts/install_third_party_dependencies.sh` to configure kernels and folding resources. From 13f0f6fe165dc0cb8af29662b9137bfa26d8349e Mon Sep 17 00:00:00 2001 From: Jennifer Wei Date: Fri, 27 Oct 2023 11:30:53 -0700 Subject: [PATCH 25/28] Adds libgcc and pytorch::pytorch to environment.yml --- environment.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/environment.yml b/environment.yml index e183bb6..49d9050 100644 --- a/environment.yml +++ b/environment.yml @@ -1,15 +1,16 @@ -name: openfold_venv +name: openfold-venv channels: - conda-forge - bioconda + - pytorch dependencies: - python=3.9 + - libgcc=7.2 - setuptools=59.5.0 - pip - openmm=7.7 - pdbfixer - cudatoolkit==11.3.* - - pytorch=1.12.* - pytorch-lightning==1.5.10 - biopython==1.79 - numpy==1.21 @@ -27,8 +28,9 @@ dependencies: - bioconda::hmmer==3.3.2 - bioconda::hhsuite==3.3.0 - bioconda::kalign2==2.04 + - pytorch::pytorch=1.12.* - pip: - deepspeed==0.5.10 - dm-tree==0.1.6 - git+https://github.com/NVIDIA/dllogger.git - - git+https://github.com/Dao-AILab/flash-attention.git@v0.2.1 + - git+https://github.com/Dao-AILab/flash-attention.git@5b838a8 From e3716118cda704a2432e44b46a0714bf35ca4b05 Mon Sep 17 00:00:00 2001 From: Jennifer Wei Date: Fri, 27 Oct 2023 12:04:15 -0700 Subject: [PATCH 26/28] Adds KMP_AFFINITY to conda environment. --- scripts/install_third_party_dependencies.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/install_third_party_dependencies.sh b/scripts/install_third_party_dependencies.sh index 86d5ee8..3756a87 100755 --- a/scripts/install_third_party_dependencies.sh +++ b/scripts/install_third_party_dependencies.sh @@ -14,3 +14,5 @@ gunzip -c tests/test_data/sample_feats.pickle.gz > tests/test_data/sample_feats. python setup.py install export LD_LIBRARY_PATH=$CONDA_PREFIX/lib:$LD_LIBRARY_PATH +# This setting is used to fix a worker assignment issue during data loading +conda env config vars set KMP_AFFINITY=none From 13728b120333820e560dc43cc9e4be79b3f57b4c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 27 Oct 2023 19:25:04 +0000 Subject: [PATCH 27/28] Bump actions/checkout from 2 to 4 Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 4. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v2...v4) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/undefined_names.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/undefined_names.yml b/.github/workflows/undefined_names.yml index 8ff9f24..07cb311 100644 --- a/.github/workflows/undefined_names.yml +++ b/.github/workflows/undefined_names.yml @@ -4,7 +4,7 @@ jobs: undefined_names: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: actions/setup-python@v2 - run: pip install --upgrade pip - run: pip install flake8 From dcd809d9c290d163168776e219223e29b440087f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 30 Oct 2023 14:55:31 +0000 Subject: [PATCH 28/28] Bump actions/setup-python from 2 to 4 Bumps [actions/setup-python](https://github.com/actions/setup-python) from 2 to 4. - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](https://github.com/actions/setup-python/compare/v2...v4) --- updated-dependencies: - dependency-name: actions/setup-python dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/undefined_names.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/undefined_names.yml b/.github/workflows/undefined_names.yml index 07cb311..a689751 100644 --- a/.github/workflows/undefined_names.yml +++ b/.github/workflows/undefined_names.yml @@ -5,7 +5,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: actions/setup-python@v2 + - uses: actions/setup-python@v4 - run: pip install --upgrade pip - run: pip install flake8 - run: flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics