Commit 157e5ca0 authored by Kai Zhang's avatar Kai Zhang Committed by Facebook GitHub Bot
Browse files

Log Runner usage

Summary:
As titled.
The logs will be stored in scuba_caffe2_pytorch_usage_stats and can be queried like
```
WITH events AS (
    SELECT
        DISTINCT workflow_run_id,
        REGEXP_EXTRACT(event, 'D2 (https://github.com/facebookresearch/d2go/commit/465cdb842513eb910aa20fcedea1d2edd15dc7b7)Go.Runner\.([a-zA-Z0-9_]*)', 1)
            AS runner_name,
        ds
    FROM scuba_caffe2_pytorch_usage_stats
    WHERE
        ds BETWEEN '$START_DATE$' AND '$END_DATE$'
        AND event LIKE '%D2 (https://github.com/facebookresearch/d2go/commit/465cdb842513eb910aa20fcedea1d2edd15dc7b7)Go.Runner%'
        AND flow_is_test = 0
        AND flow_is_local_run = 0
        AND workflow_run_id > 0

)
SELECT
    COUNT(1) AS total_runs,
    runner_name,
    ds
FROM events
GROUP BY
    ds, runner_name
ORDER BY
    total_runs DESC
```

Reviewed By: colin2328

Differential Revision: D26032225

fbshipit-source-id: ab1e06f3b1af200baf530506be9b3894ddf77126
parent b80f2ff5
......@@ -144,6 +144,10 @@ def default_scale_quantization_configs(cfg, new_world_size):
class BaseRunner(object):
def __init__(self):
identifier = f"D2Go.Runner.{self.__class__.__name__}"
torch._C._log_api_usage_once(identifier)
def _initialize(self, cfg):
""" Runner should be initialized in the sub-process in ddp setting """
if getattr(self, "_has_initialized", False):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment