-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathrun_gpflow.sh
More file actions
executable file
·56 lines (56 loc) · 1.61 KB
/
run_gpflow.sh
File metadata and controls
executable file
·56 lines (56 loc) · 1.61 KB
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
52
53
54
55
56
#!/bin/bash
# Input $1: Specify cpu/gpu/arm
if [[ "$1" == "gpu" ]]
then
module load cuda/12.0.1
# Create & Activate python environment
if [ ! -d "gpflow_gpu_env" ]; then
python -m venv gpflow_gpu_env
fi
source gpflow_gpu_env/bin/activate
# Install gpflow if not already installed
if ! python -c "import gpflow"; then
pip install --no-cache-dir -r requirements_gpu.txt
fi
# Run on GPU
export XLA_FLAGS=--xla_gpu_cuda_data_dir=$CUDA_HOME
python execute.py --use-gpu
elif [[ "$1" == "cpu" ]]
then
module load python/3.10.16
# Create & Activate python environment
if [ ! -d "gpflow_cpu_env" ]; then
python -m venv gpflow_cpu_env
fi
source gpflow_cpu_env/bin/activate
# Install gpflow if not already installed
if ! python -c "import gpflow"; then
pip install --no-cache-dir -r requirements_cpu.txt
# manually install GPflow
git clone https://github.com/GPflow/GPflow.git
cd GPflow
git checkout v2.10.0
git apply ../gpflow_mkl.patch
pip install -e .
cd ..
fi
# Run on CPU
python execute.py
elif [[ "$1" == "arm" ]]
then
spack load python@3.10
# Create & Activate python environment
if [ ! -d "gpflow_arm_env" ]; then
python -m venv gpflow_arm_env
fi
source gpflow_arm_env/bin/activate
# Install gpflow if not already installed
if ! python -c "import gpflow"; then
pip install --no-cache-dir -r requirements_gpu.txt
fi
# Run on ARM
python execute.py
else
echo "Please specify input parameter: cpu/gpu/arm"
exit 1
fi