Skip to content

Commit

Permalink
fix: init_executor has been wrapped into func
Browse files Browse the repository at this point in the history
  • Loading branch information
wangzyphysics committed May 28, 2024
1 parent e65147b commit ba1e85f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion dpgen2/entrypoint/submit.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def make_concurrent_learning_op(
upload_python_packages: Optional[List[os.PathLike]] = None,
valid_data: Optional[S3Artifact] = None,
):
expl_mode = run_explore_config.pop("mode", "default")
expl_mode = run_explore_config.get("mode", "default")
if train_style in ("dp", "dp-dist"):
prep_run_train_op = PrepRunDPTrain(
"prep-run-dp-train",
Expand Down
11 changes: 5 additions & 6 deletions dpgen2/superop/caly_evo_step.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,18 +137,19 @@ def _caly_evo_step(
run_config: dict = normalize_step_dict({}),
upload_python_packages: Optional[List[os.PathLike]] = None,
):
print("run_config. = == = = =", run_config)
prep_config = deepcopy(prep_config)
run_config = deepcopy(run_config)
prep_template_config = prep_config.pop("template_config")
run_template_config = run_config.pop("template_config")
prep_executor = init_executor(prep_config.pop("executor"))
run_executor = init_executor(run_config.pop("executor"))
prep_executor = prep_config.pop("executor")
run_executor = run_config.pop("executor")
template_slice_config = run_config.pop("template_slice_config", {})
expl_mode = run_config.pop("mode", "default")

def wise_executor(expl_mode, origin_executor):
if expl_mode == "default":
return origin_executor
return init_executor(origin_executor)
elif expl_mode == "debug":
return None
else:
Expand Down Expand Up @@ -216,9 +217,7 @@ def wise_executor(expl_mode, origin_executor):
caly_evo_step_steps.inputs.parameters["iter_num"],
caly_evo_step_steps.inputs.parameters["cnt_num"],
),
executor=wise_executor(
expl_mode, prep_executor
), # cpu is enough to run calypso.x, default step config is c2m4
executor=wise_executor(expl_mode, prep_executor),
**run_config,
)
caly_evo_step_steps.add(prep_dp_optim)
Expand Down

0 comments on commit ba1e85f

Please sign in to comment.