Skip to content

Commit bf6acbe

Browse files
committed
update
1 parent 8bc504a commit bf6acbe

9 files changed

+804
-21
lines changed

bench_all.py

+14-14
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,24 @@
55
seeds.append(random.randint(0, 100))
66

77
seeds = [22, 92, 54, 86, 41]
8-
8+
seeds = [22]
99
config_paths = [
1010
"sample_configs/paper_image_cloud_configs.yaml",
1111
"sample_configs/paper_text_tabular_cloud_configs.yaml",
1212
"sample_configs/paper_text_cloud_configs.yaml",
13-
]
14-
frameworks = [
15-
# "AutoGluon_best_master",
16-
# "autokeras_master",
17-
"ablation_base",
18-
"ablation_greedy_soup",
19-
"ablation_gradient_clip",
20-
"ablation_warmup_steps",
21-
# "ablation_cosine_decay",
22-
# "ablation_weight_decay",
23-
# "ablation_lr_decay",
24-
25-
]
13+
14+
frameworks = ['AutoGluon_best_master', 'ablation_base', 'ablation_add_greedy', 'ablation_add_grad_clip', 'ablation_add_warmup_steps', 'ablation_add_cosine_decay', 'ablation_add_weight_decay', 'ablation_add_lr_decay', 'AutoGluon_del_greedy', 'AutoGluon_del_grad_clip', 'AutoGluon_del_warmup_steps', 'AutoGluon_del_cosine_decay', 'AutoGluon_del_weight_decay', 'AutoGluon_del_lr_decay']
15+
16+
#frameworks = [
17+
# "ablation_base",
18+
# "ablation_greedy_soup",
19+
# "ablation_gradient_clip",
20+
# "ablation_warmup_steps",
21+
# "ablation_cosine_decay",
22+
# "ablation_weight_decay",
23+
# "ablation_lr_decay",
24+
# "autokeras_master",
25+
#]
2626
constraints = [
2727
"g4_12x"
2828
]

sample_configs/bench_all.py

+80
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
import random
2+
n_experiments = 5
3+
seeds = []
4+
for i in range(n_experiments):
5+
seeds.append(random.randint(0, 100))
6+
7+
seeds = [22, 92, 54, 86, 41]
8+
seeds = [22]
9+
config_paths = [
10+
"sample_configs/paper_image_cloud_configs.yaml",
11+
"sample_configs/paper_text_tabular_cloud_configs.yaml",
12+
"sample_configs/paper_text_cloud_configs.yaml",
13+
<<<<<<< HEAD
14+
=======
15+
]
16+
frameworks = [
17+
# "AutoGluon_best_master",
18+
# "autokeras_master",
19+
"ablation_base",
20+
"ablation_greedy_soup",
21+
"ablation_gradient_clip",
22+
"ablation_warmup_steps",
23+
# "ablation_cosine_decay",
24+
# "ablation_weight_decay",
25+
# "ablation_lr_decay",
26+
27+
>>>>>>> 8bc504afe4a26167224ad4740a87db9844e25494
28+
]
29+
frameworks = ['AutoGluon_best_master', 'ablation_base', 'ablation_add_greedy', 'ablation_add_grad_clip', 'ablation_add_warmup_steps', 'ablation_add_cosine_decay', 'ablation_add_weight_decay', 'ablation_add_lr_decay', 'AutoGluon_del_greedy', 'AutoGluon_del_grad_clip', 'AutoGluon_del_warmup_steps', 'AutoGluon_del_cosine_decay', 'AutoGluon_del_weight_decay', 'AutoGluon_del_lr_decay']
30+
31+
#frameworks = [
32+
# "ablation_base",
33+
# "ablation_greedy_soup",
34+
# "ablation_gradient_clip",
35+
# "ablation_warmup_steps",
36+
# "ablation_cosine_decay",
37+
# "ablation_weight_decay",
38+
# "ablation_lr_decay",
39+
# "autokeras_master",
40+
#]
41+
constraints = [
42+
"g4_12x"
43+
]
44+
# module = "autokeras"
45+
module = "multimodal"
46+
47+
import yaml
48+
import os
49+
import subprocess
50+
51+
config_root = "./temp_configs"
52+
os.makedirs(config_root, exist_ok=True)
53+
54+
for seed in seeds:
55+
print("Seed: ", seed)
56+
for constraint in constraints:
57+
os.makedirs(f"{config_root}/{constraint}", exist_ok=True)
58+
for framework in frameworks:
59+
# for shot in fs:
60+
config_dir = f"{config_root}/{constraint}/{framework}"
61+
os.makedirs(config_dir, exist_ok=True)
62+
63+
for config_path in config_paths:
64+
with open(config_path, "r") as f:
65+
configs = yaml.safe_load(f)
66+
if constraint == "g4_12x":
67+
configs["cdk_context"]["PREFIX"] = f"{configs['cdk_context']['PREFIX']}-multi"
68+
configs["constraint"] = constraint
69+
configs["framework"] = framework
70+
configs["module"] = module
71+
configs["seed"] = seed
72+
# configs["custom_dataloader"]["shot"] = shot
73+
configs["benchmark_name"] = f"{configs['benchmark_name']}-{seed}"
74+
new_config_path = os.path.join(config_dir, os.path.basename(config_path))
75+
with open(new_config_path, "w") as new_f:
76+
yaml.dump(configs, new_f)
77+
print("Running config: ", new_config_path)
78+
command = ["agbench", "run", new_config_path]
79+
subprocess.run(command)
80+

sample_configs/dataloaders/paper_text_datasets.yaml

+1-2
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,12 @@ base: &base
6363

6464

6565
financial_news:
66+
<<: *base
6667
url: s3://zs-models/datasets/financial_news/{lang}/{split}.csv
6768
splits:
6869
- train
6970
langs:
7071
- en
71-
metric: accuracy
72-
problem_type: classification
7372

7473
MLDoc-11000:
7574
<<: *base

0 commit comments

Comments
 (0)