[PGO] log missing sources in allowlist (#164881)

Summary:
- logs missing dynamic sources
- emits MLHub insight only on size mismatch recompiles

Test Plan: test_pgo

Differential Revision: D84098898

Pull Request resolved: https://github.com/pytorch/pytorch/pull/164881
Approved by: https://github.com/bobrenjc93
This commit is contained in:
Pian Pawakapan
2025-10-09 04:39:07 +00:00
committed by PyTorch MergeBot
parent 7b691546d2
commit 1f73b96668
3 changed files with 62 additions and 18 deletions

View File

@ -123,7 +123,11 @@ from .guards import (
)
from .hooks import Hooks
from .output_graph import DynamoTracerOutput, OutputGraphCommon
from .pgo import log_frame_dynamic_whitelist, put_code_state
from .pgo import (
_log_size_mismatch_recompile,
log_frame_dynamic_whitelist,
put_code_state,
)
from .replay_record import ExecutionRecord
from .resume_execution import TORCH_DYNAMO_RESUME_IN_PREFIX
from .symbolic_convert import (
@ -1591,6 +1595,8 @@ def _compile(
and output_graph.has_outputs()
):
log_frame_dynamic_whitelist(code)
if recompile_reason and "size mismatch at index" in recompile_reason:
_log_size_mismatch_recompile()
return guarded_code
except Exception as e: