From c7a8a463d39767795c92e11a1eeac36678882a67 Mon Sep 17 00:00:00 2001 From: Tony Kao Date: Thu, 9 Jan 2025 08:15:51 -0800 Subject: [PATCH] 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 --- torchx/runner/api.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/torchx/runner/api.py b/torchx/runner/api.py index 3e194a6c..cd66bd48 100644 --- a/torchx/runner/api.py +++ b/torchx/runner/api.py @@ -433,7 +433,11 @@ def dryrun( " Either a patch was built or no changes to workspace was detected." ) - sched._validate(app, scheduler, resolved_cfg) + with log_event( + "validate", + scheduler, + ): + sched._validate(app, scheduler, resolved_cfg) dryrun_info = sched.submit_dryrun(app, resolved_cfg) dryrun_info._scheduler = scheduler return dryrun_info