install_third_party_dependencies.sh 1.84 KB
Newer Older
Gustaf Ahdritz's avatar
Gustaf Ahdritz committed
1
#!/bin/bash
2
CONDA_INSTALL_URL=${CONDA_INSTALL_URL:-"https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh"}
Gustaf Ahdritz's avatar
Gustaf Ahdritz committed
3

Gustaf Ahdritz's avatar
Gustaf Ahdritz committed
4
5
source scripts/vars.sh

Gustaf Ahdritz's avatar
Gustaf Ahdritz committed
6
7
# Install Miniconda locally
rm -rf lib/conda
8
rm -f /tmp/Miniconda3-latest-Linux-x86_64.sh
Karl Leswing's avatar
Karl Leswing committed
9
10
wget -P /tmp \
    "${CONDA_INSTALL_URL}" \
Gustaf Ahdritz's avatar
Gustaf Ahdritz committed
11
12
13
14
    && bash /tmp/Miniconda3-latest-Linux-x86_64.sh -b -p lib/conda \
    && rm /tmp/Miniconda3-latest-Linux-x86_64.sh

# Grab conda-only packages
Karl Leswing's avatar
Karl Leswing committed
15
export PATH=lib/conda/bin:$PATH
16
lib/conda/bin/python3 -m pip install nvidia-pyindex
Karl Leswing's avatar
Karl Leswing committed
17
conda env create --name=${ENV_NAME} -f environment.yml
18
source scripts/activate_conda_env.sh
Marta's avatar
Marta committed
19

20
echo "Attempting to install FlashAttention"
Gustaf Ahdritz's avatar
Gustaf Ahdritz committed
21
22
23
24
25
26
git clone https://github.com/HazyResearch/flash-attention
CUR_DIR=$PWD
cd flash-attention
git checkout 5b838a8bef
python3 setup.py install
cd $CUR_DIR
27

28
29
30
31
32
echo "Attempting to download CUTLASS, required for Deepspeed Evoformer attention kernel"
git clone https://github.com/NVIDIA/cutlass.git
conda env config vars set CUTLASS_PATH=$PWD/cutlass
source scripts/activate_conda_env.sh

Gustaf Ahdritz's avatar
Gustaf Ahdritz committed
33
34
# Install DeepMind's OpenMM patch
OPENFOLD_DIR=$PWD
35
pushd lib/conda/envs/$ENV_NAME/lib/python3.9/site-packages/ \
Gustaf Ahdritz's avatar
Gustaf Ahdritz committed
36
37
38
39
    && patch -p0 < $OPENFOLD_DIR/lib/openmm.patch \
    && popd

# Download folding resources
40
wget --no-check-certificate -P openfold/resources \
Gustaf Ahdritz's avatar
Gustaf Ahdritz committed
41
42
    https://git.scicore.unibas.ch/schwede/openstructure/-/raw/7102c63615b64735c4941278d92b554ec94415f8/modules/mol/alg/src/stereo_chemical_props.txt

43
44
# Certain tests need access to this file
mkdir -p tests/test_data/alphafold/common
45
ln -rs openfold/resources/stereo_chemical_props.txt tests/test_data/alphafold/common
46

Gustaf Ahdritz's avatar
Gustaf Ahdritz committed
47
echo "Downloading OpenFold parameters..."
Gustaf Ahdritz's avatar
Gustaf Ahdritz committed
48
bash scripts/download_openfold_params.sh openfold/resources
Gustaf Ahdritz's avatar
Gustaf Ahdritz committed
49
50
51

echo "Downloading AlphaFold parameters..."
bash scripts/download_alphafold_params.sh openfold/resources
Gustaf Ahdritz's avatar
Gustaf Ahdritz committed
52
53
54

# Decompress test data
gunzip tests/test_data/sample_feats.pickle.gz