forked from NAG-DevOps/speed-hpc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
lambdal-singularity.sh
executable file
·51 lines (37 loc) · 1.58 KB
/
lambdal-singularity.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/encs/bin/bash
# Serguei Mokhov
# SLURM-based job invocation script
# Singulairy container for Lambda Labs Software Stack
##
## Job scheduler options
##
#SBATCH --job-name=lambdal ## Give the job a name
#SBATCH --mail-type=ALL ## Receive all email type notifications
#SBATCH --chdir=./ ## Use currect directory as working directory (default)
## Any partition, usually on the command line that has GPUs
##SBATCH --partition=pg ## Use the GPU partition (specify here or at command line wirh -p option)
#SBATCH --gpus=1 ## How many GPUs (currently limit is set 2 max for Speed 5 and 17)
#SBATCH --mem=20G ## Assign memory
#SBATCH --export=ALL,hv=8 ## Export all environment variables and set a value for the hv variable
##
## Job to run
##
echo "$0 : about to run gcs-lambdalabs-singularity on Speed..."
date
env
# time will simply measure and print runtime
# sigularity run -- running the image
# then whatever script you need to run inside the container
SINGULARITY=/encs/pkg/singularity-3.10.4/root/bin/singularity
# bind mount the current directory, the user's speed-scratch
# directory, nettemp
# Note: $HOME, /tmp, /proc, /sys, /dev are bound by default
#
SINGULARITY_BIND=$PWD:/speed-pwd,/speed-scratch/$USER:/my-speed-scratch,/nettemp
echo "Singularity will bind mount: $SINGULARITY_BIND for user: $USER"
time \
srun $SINGULARITY run --nv /speed-scratch/nag-public/gcs-lambdalabs-stack.sif \
/usr/bin/python3 -c 'import torch; print(torch.rand(5, 5).cuda()); print(\"I love Lambda Stack!\")'
echo "$0 : Done!"
date
# EOF