Skip to content

Commit 122cc26

Browse files
Tony Kaofacebook-github-bot
authored andcommitted
torchx - profile scheduler validate call (#972)
Summary: track torchx scheduler validate() call. Will capture elapse time and whether validation failed. There is no behavior impact to torchx users as this change only add logging for monitoring purpose verified scuba log has the validate record: https://fburl.com/scuba/pytorch_elastic_tsm_log/jza7f33n Differential Revision: D66166216
1 parent 648913c commit 122cc26

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

torchx/runner/api.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -404,10 +404,11 @@ def dryrun(
404404
role.env[tracker_config_env_var_name(name)] = config
405405

406406
cfg = cfg or dict()
407+
runcfg = json.dumps(cfg) if cfg else None
407408
with log_event(
408409
"dryrun",
409410
scheduler,
410-
runcfg=json.dumps(cfg) if cfg else None,
411+
runcfg=runcfg,
411412
workspace=workspace,
412413
):
413414
sched = self._scheduler(scheduler)
@@ -433,7 +434,13 @@ def dryrun(
433434
" Either a patch was built or no changes to workspace was detected."
434435
)
435436

436-
sched._validate(app, scheduler)
437+
with log_event(
438+
"validate",
439+
scheduler,
440+
runcfg=runcfg,
441+
workspace=workspace,
442+
):
443+
sched._validate(app, scheduler)
437444
dryrun_info = sched.submit_dryrun(app, resolved_cfg)
438445
dryrun_info._scheduler = scheduler
439446
return dryrun_info

0 commit comments

Comments
 (0)