-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_train_and_eval.py
36 lines (29 loc) · 1.07 KB
/
run_train_and_eval.py
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
from final_model_config import *
import glob
import os
def mkdir_p(dir):
if not os.path.exists(dir):
os.mkdir(dir)
job_directory = "%s/.job" % os.getcwd()
out_directory = "%s/.out" % os.getcwd()
mkdir_p(job_directory)
mkdir_p(out_directory)
name = 'train_eval_' + Final_Config.NAME
job_file = os.path.join(job_directory, "%s.job" % name)
print(name)
with open(job_file,"w") as fh:
fh.writelines("#!/bin/bash\n")
fh.writelines("#SBATCH -o .out/%s.o\n" % name)
fh.writelines("#SBATCH --mem=200g\n")
fh.writelines("#SBATCH --nodes=1\n")
fh.writelines("#SBATCH --ntasks-per-node=1\n")
fh.writelines("#SBATCH --cpus-per-task=16\n")
fh.writelines("#SBATCH --partition=gpuA100x4\n")
fh.writelines("#SBATCH --gres=gpu:1\n")
fh.writelines("#SBATCH --account=bbou-delta-gpu\n")
fh.writelines("#SBATCH --time=06:00:00\n")
fh.writelines("### GPU options ###\n")
fh.writelines("#SBATCH --gpus-per-node=1\n")
fh.writelines("##SBATCH --gpu-bind=verbose\n")
fh.writelines("python train_and_eval.py")
os.system("sbatch %s" % job_file)