Skip to content

Commit c6a48a8

Browse files
committed
Try to use one executor per job
Signed-off-by: Fabrice Normandin <[email protected]>
1 parent 797ce9e commit c6a48a8

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

project/launch_xm.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# IDEA: Replacement for the --multirun option of Hydra.
22
# from hydra.main import # noqa
33

4+
import copy
45
import datetime as dt
56
import logging
67
import os
@@ -14,8 +15,6 @@
1415
from hydra.core.override_parser.overrides_parser import OverridesParser
1516
from xmanager import xm
1617

17-
from project.conftest import command_line_overrides # noqa
18-
1918
# TODO: Look into Fiddle
2019

2120
# note: port is from the *local* SSH config entry for mila / compute nodes
@@ -57,8 +56,8 @@ async def main(_):
5756

5857
workdir = pathlib.Path(f"$SCRATCH/xm-slurm-examples/{experiment.experiment_id}")
5958

60-
# Step 4: Schedule train job
61-
train_executor = xm_slurm.Slurm(
59+
# Step 3: Schedule test job
60+
executor = xm_slurm.Slurm(
6261
requirements=xm_slurm.JobRequirements(
6362
CPU=1,
6463
RAM=1.0 * xm.GiB,
@@ -68,9 +67,12 @@ async def main(_):
6867
),
6968
time=dt.timedelta(hours=1),
7069
)
70+
train_executor = copy.deepcopy(executor)
71+
test_executor = copy.deepcopy(executor)
72+
7173
test_job = xm.Job(
7274
executable=test_executable,
73-
executor=train_executor,
75+
executor=test_executor,
7476
args=["-x", "-v", "--gen-missing"],
7577
)
7678
train_job = xm.Job(

0 commit comments

Comments
 (0)