[precompile][ez] Inline type definition for dynamo cache entry. (#164580)

Summary: as title. DynamoCaptureOutput in package.py is not actively used in other files. Inline it to reduce confusion.

Test Plan: CI

Differential Revision: D83846957

Pull Request resolved: https://github.com/pytorch/pytorch/pull/164580
Approved by: https://github.com/dolpm
This commit is contained in:
Zhengxu Chen
2025-10-06 16:00:59 +00:00
committed by PyTorch MergeBot
parent 1f9614cef8
commit 4bd1505f84

View File

@ -151,17 +151,7 @@ class SourceInfo:
@dataclasses.dataclass
class DynamoCaptureOutput:
"""
Core information generated from Dynamo for fullgraph=True.
"""
guarded_codes: list[_GuardedCodeCacheEntry]
backend_ids: list[_BackendId]
@dataclasses.dataclass
class _DynamoCodeCacheEntry(DynamoCaptureOutput):
class _DynamoCodeCacheEntry:
"""
Contains the serializable information associated with a single code object
in dynamo. To restore an execution of compiled code, we will need the following
@ -185,7 +175,9 @@ class _DynamoCodeCacheEntry(DynamoCaptureOutput):
python_code: SerializedCode
python_module: str
function_names: list[_FunctionId]
guarded_codes: list[_GuardedCodeCacheEntry]
import_sources: dict[str, str]
backend_ids: list[_BackendId]
code_source: Optional[str]
install_to_global: bool
has_compile_id: bool = False