Skip to content

Commit

Permalink
torchx - profile scheduler validate call (pytorch#972)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Tony Kao authored and facebook-github-bot committed Dec 2, 2024
1 parent 648913c commit 122cc26
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions torchx/runner/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -404,10 +404,11 @@ def dryrun(
role.env[tracker_config_env_var_name(name)] = config

cfg = cfg or dict()
runcfg = json.dumps(cfg) if cfg else None
with log_event(
"dryrun",
scheduler,
runcfg=json.dumps(cfg) if cfg else None,
runcfg=runcfg,
workspace=workspace,
):
sched = self._scheduler(scheduler)
Expand All @@ -433,7 +434,13 @@ def dryrun(
" Either a patch was built or no changes to workspace was detected."
)

sched._validate(app, scheduler)
with log_event(
"validate",
scheduler,
runcfg=runcfg,
workspace=workspace,
):
sched._validate(app, scheduler)
dryrun_info = sched.submit_dryrun(app, resolved_cfg)
dryrun_info._scheduler = scheduler
return dryrun_info
Expand Down

0 comments on commit 122cc26

Please sign in to comment.