From 47956196d99166fe9083beb2a52fd2e6c90b2011 Mon Sep 17 00:00:00 2001 From: PyTorch MergeBot Date: Thu, 9 Oct 2025 22:38:45 +0000 Subject: [PATCH] Revert "Call internal log_compilation_event if it exists (#164855)" This reverts commit 98a081a24c22072362dc536afd39a469e28939d4. Reverted https://github.com/pytorch/pytorch/pull/164855 on behalf of https://github.com/albanD due to We should not land this kind of code in core ([comment](https://github.com/pytorch/pytorch/pull/164855#issuecomment-3387692988)) --- torch/_utils_internal.py | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/torch/_utils_internal.py b/torch/_utils_internal.py index d632b9977838..37bb1837871a 100644 --- a/torch/_utils_internal.py +++ b/torch/_utils_internal.py @@ -13,13 +13,6 @@ import torch from torch._strobelight.compile_time_profiler import StrobelightCompileTimeProfiler -try: - from pt2_internal import ( # type: ignore[import-not-found] - log_compilation_event as internal_log_compilation_event, - ) -except ImportError: - internal_log_compilation_event = None - _T = TypeVar("_T") _P = ParamSpec("_P") @@ -135,10 +128,7 @@ def add_mlhub_insight(category: str, insight: str, insight_description: str): def log_compilation_event(metrics): - if internal_log_compilation_event: - internal_log_compilation_event(vars(metrics)) - else: - log.info("%s", metrics) + log.info("%s", metrics) def upload_graph(graph):