mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 12:20:52 +01:00
Fix circular imports (#151939)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/151939 Approved by: https://github.com/jamesjwu
This commit is contained in:
parent
13339ce086
commit
cd021d048e
|
|
@ -35,7 +35,6 @@ from torch._dynamo.utils import (
|
|||
)
|
||||
from torch._environment import is_fbcode
|
||||
from torch._logging._internal import trace_structured_artifact
|
||||
from torch.compiler._cache import CacheArtifactManager, CacheArtifactType
|
||||
|
||||
|
||||
if TYPE_CHECKING:
|
||||
|
|
@ -591,6 +590,8 @@ def get_code_state() -> defaultdict[CodeId, CodeState]:
|
|||
_INIT_CODE_STATE = copy.deepcopy(_CODE_STATE)
|
||||
return _CODE_STATE
|
||||
|
||||
from torch.compiler._cache import CacheArtifactManager, CacheArtifactType
|
||||
|
||||
# Attempt local
|
||||
path = code_state_path(cache_key)
|
||||
if path is not None and os.path.exists(path):
|
||||
|
|
@ -712,6 +713,8 @@ def put_local_code_state(cache_key: str) -> None:
|
|||
|
||||
pickled_code = pickle.dumps(_CODE_STATE)
|
||||
|
||||
from torch.compiler._cache import CacheArtifactManager, CacheArtifactType
|
||||
|
||||
CacheArtifactManager.record_artifact(
|
||||
CacheArtifactType.PGO, cache_key, pickled_code
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user