Skip to content

Commit 379d70d

Browse files
Tony Kaofacebook-github-bot
Tony Kao
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 5ad30fe commit 379d70d

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
@@ -402,10 +402,11 @@ def dryrun(
402402
role.env[tracker_config_env_var_name(name)] = config
403403

404404
cfg = cfg or dict()
405+
runcfg = json.dumps(cfg) if cfg else None
405406
with log_event(
406407
"dryrun",
407408
scheduler,
408-
runcfg=json.dumps(cfg) if cfg else None,
409+
runcfg=runcfg,
409410
workspace=workspace,
410411
):
411412
sched = self._scheduler(scheduler)
@@ -431,7 +432,13 @@ def dryrun(
431432
" Either a patch was built or no changes to workspace was detected."
432433
)
433434

434-
sched._validate(app, scheduler)
435+
with log_event(
436+
"validate",
437+
scheduler,
438+
runcfg=runcfg,
439+
workspace=workspace,
440+
):
441+
sched._validate(app, scheduler)
435442
dryrun_info = sched.submit_dryrun(app, resolved_cfg)
436443
dryrun_info._scheduler = scheduler
437444
return dryrun_info

0 commit comments

Comments
 (0)