forked from TL-System/plato
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_workloads
executable file
·45 lines (43 loc) · 1.55 KB
/
run_workloads
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
#!/usr/bin/env python
"""
Test running a lot of selected configs.
"""
import subprocess
import time
import os
if __name__ == '__main__':
for t in [
'configs/MNIST/fedavg_async_lenet5',
'configs/MNIST/fedavg_cross_silo_lenet5',
# 'configs/MNIST/fedavg_lenet5_mindspore',
'configs/MNIST/fedavg_lenet5_noniid',
# 'configs/MNIST/fedavg_lenet5_tensorflow',
'configs/MNIST/fedavg_lenet5',
'configs/MNIST/fedprox_lenet5',
# 'configs/MNIST/mistnet_pretrain_lenet5_mindspore',
# 'configs/MNIST/mistnet_lenet5_mindspore',
'configs/MNIST/mistnet_pretrain_lenet5',
'configs/MNIST/mistnet_lenet5',
'.github/workflows/configs/fedavg_yolov5',
'.github/workflows/configs/mistnet_yolov5',
]:
print(f"Running config: {t}.yml")
log_root = '.log'
log_folder = os.path.join(log_root,
t.replace("/", "__").replace(".", ""))
log_name = time.strftime("%Y_%m_%d__%H_%M_%S.txt", time.localtime())
try:
os.mkdir(log_root)
except FileExistsError:
pass
try:
os.mkdir(log_folder)
except FileExistsError:
pass
with open(os.path.join(log_folder, log_name), 'a',
encoding='utf-8') as fp:
fp.write(f'{t}\n\n')
fp.flush()
subprocess.call(['./run', f'--config={t}.yml'],
stdout=fp,
stderr=fp)