[dynamo][compile-time] Cache whether a function is inlineable (#153192)

Pull Request resolved: https://github.com/pytorch/pytorch/pull/153192
Approved by: https://github.com/StrongerXi, https://github.com/jansel, https://github.com/williamwen42
ghstack dependencies: #153458
This commit is contained in:
Animesh Jain
2025-05-13 16:17:20 -07:00
committed by PyTorch MergeBot
parent e2ce17c6ef
commit 11c64b7cf8
4 changed files with 38 additions and 16 deletions

View File

@ -1372,6 +1372,7 @@ def clear_instruction_args(instructions):
inst.arg = None
@functools.lru_cache
def get_code_keys() -> list[str]:
# Python 3.11 changes to code keys are not fully documented.
# See https://github.com/python/cpython/blob/3.11/Objects/clinic/codeobject.c.h#L24