mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-07 12:21:27 +01:00
This adds some utilities for conveniently working with fast combined CapturedTraceback from Python. The main goal of these utilities is to make it easier for people to use CapturedTraceback as a drop-in replacement for `traceback.extract_stack`, which is 20x slower than CapturedTraceback. I port symbolic shapes to use the new CapturedTraceback code, to validate that the APIs work and are useful. Signed-off-by: Edward Z. Yang <ezyang@meta.com> Pull Request resolved: https://github.com/pytorch/pytorch/pull/107358 Approved by: https://github.com/zdevito, https://github.com/albanD ghstack dependencies: #107438
16 lines
716 B
Python
16 lines
716 B
Python
# Top level logging module for torch logging
|
|
# Design doc: https://docs.google.com/document/d/1ZRfTWKa8eaPq1AxaiHrq4ASTPouzzlPiuquSBEJYwS8/edit#
|
|
# Simple setup for onboarding (see above doc for more detail):
|
|
# 1. register any top-level log qualified name for your module in torch._logging._registrations (see there for examples)
|
|
# 2. register any artifacts (<artifact_name> below) in torch._logging._registrations
|
|
# a. call getArtifactLogger(__name__, <artifact_name>) at your logging site instead of the standard logger to log your artifact
|
|
import torch._logging._registrations
|
|
from ._internal import (
|
|
_init_logs,
|
|
DEFAULT_LOGGING,
|
|
getArtifactLogger,
|
|
LazyString,
|
|
set_logs,
|
|
warning_once,
|
|
)
|