Spaces:
Sleeping
Sleeping
Delete multiproc.py
Browse files- multiproc.py +0 -23
multiproc.py
DELETED
@@ -1,23 +0,0 @@
|
|
1 |
-
import time
|
2 |
-
import torch
|
3 |
-
import sys
|
4 |
-
import subprocess
|
5 |
-
|
6 |
-
argslist = list(sys.argv)[1:]
|
7 |
-
num_gpus = torch.cuda.device_count()
|
8 |
-
argslist.append('--n_gpus={}'.format(num_gpus))
|
9 |
-
workers = []
|
10 |
-
job_id = time.strftime("%Y_%m_%d-%H%M%S")
|
11 |
-
argslist.append("--group_name=group_{}".format(job_id))
|
12 |
-
|
13 |
-
for i in range(num_gpus):
|
14 |
-
argslist.append('--rank={}'.format(i))
|
15 |
-
stdout = None if i == 0 else open("logs/{}_GPU_{}.log".format(job_id, i),
|
16 |
-
"w")
|
17 |
-
print(argslist)
|
18 |
-
p = subprocess.Popen([str(sys.executable)]+argslist, stdout=stdout)
|
19 |
-
workers.append(p)
|
20 |
-
argslist = argslist[:-1]
|
21 |
-
|
22 |
-
for p in workers:
|
23 |
-
p.wait()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|