Skip to content

Commit 4c1b60b

Browse files
Merge pull request #3 from prehensilecode/update-for-2.2.2
Update for 2.2.2
2 parents ecf01b7 + a955185 commit 4c1b60b

File tree

3 files changed

+207
-139
lines changed

3 files changed

+207
-139
lines changed

Singularity.def

+16-8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Bootstrap: docker
2-
From: nvidia/cuda:11.0-cudnn8-runtime-ubuntu18.04
2+
From: nvidia/cuda:11.1.1-cudnn8-runtime-ubuntu18.04
33
Stage: spython-base
44

55
%files
@@ -25,7 +25,7 @@ Stage: spython-base
2525
apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
2626
build-essential \
2727
cmake \
28-
cuda-command-line-tools-11-0 \
28+
cuda-command-line-tools-11-1 \
2929
git \
3030
hmmer \
3131
kalign \
@@ -55,29 +55,37 @@ PATH="/opt/conda/bin:$PATH"
5555
conda update -qy conda \
5656
&& conda install -y -c conda-forge \
5757
openmm=7.5.1 \
58-
cudatoolkit==11.0.3 \
58+
cudatoolkit==11.1.1 \
5959
pdbfixer \
6060
pip \
6161
python=3.7
6262

63+
### /bin/cp -r . /app/alphafold
64+
6365
wget -q -P /app/alphafold/alphafold/common/ \
6466
https://git.scicore.unibas.ch/schwede/openstructure/-/raw/7102c63615b64735c4941278d92b554ec94415f8/modules/mol/alg/src/stereo_chemical_props.txt
6567

6668
# Install pip packages.
69+
# N.B. The URL specifies the list of jaxlib releases. The URL in alphafold release 2.2.2 is incorrect
70+
# as it specifies the non-CUDA releases.
6771
pip3 install --upgrade pip \
6872
&& pip3 install -r /app/alphafold/requirements.txt \
69-
&& pip3 install --upgrade jax jaxlib==0.1.69+cuda110 -f \
70-
https://storage.googleapis.com/jax-releases/jax_releases.html
73+
&& pip3 install --upgrade jax==0.2.14 jaxlib==0.1.69+cuda111 -f \
74+
https://storage.googleapis.com/jax-releases/jax_cuda_releases.html
7175

7276
# Apply OpenMM patch.
7377
cd /opt/conda/lib/python3.7/site-packages
7478
patch -p0 < /app/alphafold/docker/openmm.patch
7579

80+
# Add SETUID bit to the ldconfig binary so that non-root users can run it.
81+
chmod u+s /sbin/ldconfig.real
82+
7683
%environment
7784
export PATH="/opt/conda/bin:$PATH"
7885
%runscript
7986
cd /app/alphafold
87+
ldconfig
8088
exec python /app/alphafold/run_alphafold.py "$@"
81-
%startscript
82-
cd /app/alphafold
83-
exec python /app/alphafold/run_alphafold.py "$@"
89+
# %startscript
90+
# cd /app/alphafold
91+
# exec python /app/alphafold/run_alphafold.py "$@"

example_slurm_job.sh

+33-20
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,45 @@
11
#!/bin/bash
2-
#SBATCH --partition=gpu
3-
#SBATCH --time=2:00:00
4-
#SBATCH --gres=gpu:1
2+
#SBATCH -p gpu
3+
#SBATCH --time=18:00:00
4+
#SBATCH --gpus=4
55
#SBATCH --cpus-per-gpu=12
6-
#SBATCH --mem-per-gpu=30G
6+
#SBATCH --mem=140G
77

8-
module load alphafold
8+
module load alphafold/2.2.2
9+
module load python/gcc/3.10
910

10-
# the alphafold modulefile should define:
11-
# * ALPHAFOLD_DIR -- install location AlphaFold
12-
# * ALPHAFOLD_DATADIR -- the DOWLOAD_DIR set in scripts/download_all_data.sh
11+
### Check values of some environment variables
12+
echo SLURM_JOB_GPUS=$SLURM_JOB_GPUS
13+
echo ALPHAFOLD_DIR=$ALPHAFOLD_DIR
14+
echo ALPHAFOLD_DATADIR=$ALPHAFOLD_DATADIR
1315

14-
# Run AlphaFold; default is to use GPUs, i.e. "--use_gpu"
15-
python3 ${ALPHAFOLD_DIR}/singularity/run_singularity.py \
16-
--fasta_paths=T1050.fasta \
17-
--max_template_date=2020-05-14 \
18-
--preset=reduced_dbs
16+
###
17+
### README This runs AlphaFold 2.2.2 on the T1050.fasta file
18+
###
1919

20-
# AlphaFold should use all GPU devices available to the job.
20+
# AlphaFold should use all GPU devices available to the job by default.
2121
# To explicitly specify use of GPUs, and the GPU devices to use, add
2222
# --use_gpu --gpu_devices=${SLURM_JOB_GPUS}
23-
23+
#
2424
# To run the CASP14 evaluation, use:
25-
# --preset=casp14
26-
27-
# To benchmark, running multiple JAX model evaluations:
25+
# --model_preset=monomer_casp14
26+
#
27+
# To benchmark, running multiple JAX model evaluations (NB this
28+
# significantly increases run time):
2829
# --benchmark
2930

30-
# Copy all output from AlphaFold back to directory where "sbatch" command was issued
31-
cp -R $TMPDIR $SLURM_SUBMIT_DIR
31+
# Run AlphaFold; default is to use GPUs, i.e. "--use_gpu" can be omitted.
32+
python3 ${ALPHAFOLD_DIR}/singularity/run_singularity.py \
33+
--use_gpu --gpu_devices=${SLURM_JOB_GPUS} \
34+
--data_dir=${ALPHAFOLD_DATADIR} \
35+
--fasta_paths=T1050.fasta \
36+
--max_template_date=2020-05-14 \
37+
--model_preset=monomer_casp14 \
38+
--benchmark
39+
40+
echo INFO: AlphaFold returned $?
41+
42+
### Copy Alphafold output back to directory where "sbatch" command was issued.
43+
mkdir $SLURM_SUBMIT_DIR/Output-$SLURM_JOB_ID
44+
cp -R $TMPDIR $SLURM_SUBMIT_DIR/Output-$SLURM_JOB_ID
3245

0 commit comments

Comments
 (0)