[Static Runtime] Make per-op latency readable by FAI-PEP (#64315)
authorMike Iovine <mikeiovine@fb.com>
Wed, 1 Sep 2021 21:19:21 +0000 (14:19 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Wed, 1 Sep 2021 21:34:22 +0000 (14:34 -0700)
commit4aad366111f88010c9e4027d054da2fe357e1bfe
treeeaf2fc841c14f2156749cd520d7375126dd695d1
parent86c96542914bf9b3dfda0c7f6373fd13b48c6b97
[Static Runtime] Make per-op latency readable by FAI-PEP (#64315)

Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/64315

Add a new flag `generate_ai_pep_output` to `StaticRuntime::benchmark`. If set, produces per-op-kind average total latency in milliseconds in a JSON format recognized by [Facebook AI performance evaluation platform (FAI-PEP)](https://github.com/facebook/FAI-PEP).

This is useful for observing the impact of changes that make a big difference for a specific op, but do not affect the overall SR latency by more than a few percent.

Reviewed By: hlu1

Differential Revision: D30679352

fbshipit-source-id: c847fa6ea20774aaf1e7949b11db4421d1f70b7e
torch/csrc/jit/runtime/static/impl.cpp
torch/csrc/jit/runtime/static/impl.h