dynamo tracing perf: Guard slots: 51.76 -> 51.34 (#143060)

See #143056 for overall docs.

This PR: Add slots to Guard
Pull Request resolved: https://github.com/pytorch/pytorch/pull/143060
Approved by: https://github.com/jansel
ghstack dependencies: #143066, #143056, #143058, #143059
This commit is contained in:
Aaron Orenstein
2024-12-12 19:38:17 -08:00
committed by PyTorch MergeBot
parent e87f07d3b8
commit 52f31cc238

View File

@ -28,6 +28,7 @@ from typing import (
)
from torch.utils import _pytree as pytree
from torch.utils._backport_slots import dataclass_slots
from torch.utils._traceback import CapturedTraceback, format_frame
from torch.utils.weak import WeakTensorKeyDictionary
@ -169,6 +170,7 @@ class ShapeGuard(NamedTuple):
sloc: SLoc
@dataclass_slots
@dataclasses.dataclass
class Guard:
# originating_source is the source that called the make_guard method to