forked from paulfchristiano/amplification
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathgenerate_jobs.py
80 lines (79 loc) · 3.22 KB
/
generate_jobs.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
from itertools import product
#xargs -I % zsh -c "%"
environment = "tslurm"
exclude = "guppy9"
with open("jobs.txt", "w") as outfile:
for (supervised, universal, learning_rate, task) in \
product([True], [True], ["1e-5"], ['graph', 'sum', 'iter', 'eval', 'equals']):
if task == "sum":
learning_rate = "1e-5"
# ['graph', 'sum', 'iter', 'eval', 'equals']
# for min_clauses in ["1", "2", "8"]:
job_name = (
task + "_big" + ("_universal" if universal else "") +
("_supervised"
if supervised else "") + ("_" + learning_rate
if learning_rate != "1e-5" else "")
# + ("_" + min_clauses) + "_long")
)
cmd = []
cmd += ["exp.py"]
# cmd += ["--async"]
if exclude:
cmd += ["--exclude " + exclude]
if supervised:
cmd += ["--n_gpus 1"]
else:
cmd += ["--n_gpus 2"]
cmd += ["--days 2"]
cmd += [job_name, "amplification", environment, "amplification/run.py"]
cmd += ["--task.name " + task]
# cmd += ["--train.num_steps 400000"]
# cmd += ["--train.warmup_time 20"]
if universal:
cmd += ["--model.joint.universal_transformer t"]
if supervised:
cmd += ["--train.supervised t"]
if learning_rate != "1e-5":
cmd += ["--model.joint.learning_rate " + learning_rate]
# cmd += ["--task.min_clauses " + min_clauses]
# cmd += ["--train.num_steps 10"]
depth = 12
answer_depth = 6
nh = 512
cmd += [
"""--model.answerer.depth {} --model.answerer.answer_depth {} --model.answerer.nh {}""".
format(depth, answer_depth, nh)
]
outfile.write(" ".join(cmd) + "\n")
# print("sleep 10h")
# depth = 6
# answer_depth = 3
# nh = 512
# for nh in [512, 768, 1024]:
# cmd = (
# """exp.py --n_gpus 2 gpu_memory_universal amplification tslurm amplification/run.py --task.name eval --train.num_steps 10 --model.joint.universal_transformer t """
# +
# """--model.answerer.depth {} --model.answerer.answer_depth {} --model.answerer.nh {}""".
# format(depth, answer_depth, nh))
# print(cmd)
# depth = 6
# answer_depth = 3
# nh = 512
# for depth in range(6, 12):
# cmd = (
# """exp.py --n_gpus 2 gpu_memory_universal amplification tslurm amplification/run.py --task.name eval --train.num_steps 10 --model.joint.universal_transformer t """
# +
# """--model.answerer.depth {} --model.answerer.answer_depth {} --model.answerer.nh {}""".
# format(depth, answer_depth, nh))
# print(cmd)
# depth = 6
# answer_depth = 3
# nh = 512
# for answer_depth in range(3, 6):
# cmd = (
# """exp.py --n_gpus 2 gpu_memory_universal amplification tslurm amplification/run.py --task.name eval --train.num_steps 10 --model.joint.universal_transformer t """
# +
# """--model.answerer.depth {} --model.answerer.answer_depth {} --model.answerer.nh {}""".
# format(depth, answer_depth, nh))
# print(cmd)