-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
30 lines (23 loc) · 881 Bytes
/
setup.sh
File metadata and controls
30 lines (23 loc) · 881 Bytes
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
#!/bin/bash
## This is intended for an offline compute node scheduled in an interactive bash session
## Hence no sbatch here
## Notes about (preliminary) uv setup on this cluster:
## ensure ~/.local/bin is in PATH env (check ~/.bashrc),
## otherwise uv isn't found
export PATH="$HOME/.local/bin:$PATH"
export CC=$(which gcc)
export CXX=$(which g++)
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# in case system-wide python default version too old
# (remove as needed)
if [ ! -d "$SCRIPT_DIR/.venv" ]; then
uv venv --python 3.12 "$SCRIPT_DIR/.venv"
fi
source "$SCRIPT_DIR/.venv/bin/activate"
module load cuda/12.4.0
export CUDA_HOME=$(dirname $(dirname $(which nvcc)))
export OMP_NUM_THREADS=$(($(nproc)/2))
# local disk for compile cache
LOCAL_DISK=/tmp/$USER
mkdir -p $LOCAL_DISK/torch_extensions
export TORCH_EXTENSIONS_DIR=$LOCAL_DISK/torch_extensions