mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-07 12:21:27 +01:00
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/75046 Merge the code needed for dynamic+ltc integration from the staging branch to the master branch. Test Plan: Unit test ``` pytest test_extract_compiled_graph ``` test thru dynamo ``` LTC_TS_CUDA=1 time python torchbench.py --speedup-ltc -dcuda --nvfuser --randomize-input --only <model name> ``` Reviewed By: alanwaketan Differential Revision: D35300646 Pulled By: shunting314 fbshipit-source-id: 09ed20d3bb8ef80e4b93ba87ea3356a07d2dccdb (cherry picked from commit 2b56771cdfd2cfa825c65ee9fd42338fb372fb32)
14 lines
379 B
Python
14 lines
379 B
Python
import torch._C._lazy
|
|
|
|
def reset():
|
|
"""Resets all metric counters."""
|
|
torch._C._lazy._reset_metrics()
|
|
|
|
def counter_names():
|
|
"""Retrieves all the currently active counter names."""
|
|
return torch._C._lazy._counter_names()
|
|
|
|
def counter_value(name: str):
|
|
"""Return the value of the counter with the speficied name"""
|
|
return torch._C._lazy._counter_value(name)
|