pytorch/torch/csrc/dynamo
zhxchen17 ddee927f31 [precompile] Add low level C API to load precompiled dynamo code on functions. (#155329)
While loading deserialized dynamo states back from disk, precompile will need a direct way to access ExtraState and populate guarded bytecode as cache entries.

This diff adds two API at code level to load precompiled guard + bytecode entries.
1. _load_precompile_entry() will append an entry to a precompile entry list per code object. This precompile entry will be looked up before normal compiled entries.
2. _reset_precompile_entries() will clean up all the installed existing entries. This is useful to prevent a case where user call loading multiple times and explode the number of entries on the list.

Differential Revision: [D76083247](https://our.internmc.facebook.com/intern/diff/D76083247/)

Pull Request resolved: https://github.com/pytorch/pytorch/pull/155329
Approved by: https://github.com/jamesjwu, https://github.com/jansel
2025-06-10 16:13:38 +00:00
..
cache_entry.cpp
cache_entry.h
compiled_autograd.cpp [1/N] Use internal linkage in torch/csrc C++ files. (#150930) 2025-04-11 02:19:31 +00:00
compiled_autograd.h [ca] introduce RuntimeState to support c++ hooks via graph breaks (#149987) 2025-03-27 05:05:34 +00:00
cpp_shim.cpp
cpp_shim.h
cpython_defs.c
cpython_defs.h
cpython_includes.h
debug_macros.h Remove code for Python < 3.9 (#147181) 2025-02-15 06:43:26 +00:00
eval_frame_cpp.cpp [1/N] Use internal linkage in torch/csrc C++ files. (#150930) 2025-04-11 02:19:31 +00:00
eval_frame_cpp.h [dynamo] expose code execution strategy to python (#148020) 2025-02-28 21:59:12 +00:00
eval_frame.c [dynamo] support Python 3.13t (#149549) 2025-03-20 09:49:27 +00:00
eval_frame.h [dynamo] replace hardcoded eval frame control flags skip_code_recursive_flag/cache_limit_hit_flag (#146355) 2025-02-18 21:37:12 +00:00
extra_state.cpp [precompile] Add low level C API to load precompiled dynamo code on functions. (#155329) 2025-06-10 16:13:38 +00:00
extra_state.h [precompile] Add low level C API to load precompiled dynamo code on functions. (#155329) 2025-06-10 16:13:38 +00:00
framelocals_mapping.cpp [dynamo] refactor dynamo__custom_eval_frame to C++, refactor SKIP_CODE[_RECURSIVE] (#145603) 2025-02-18 21:37:12 +00:00
framelocals_mapping.h [dynamo] refactor dynamo__custom_eval_frame to C++, refactor SKIP_CODE[_RECURSIVE] (#145603) 2025-02-18 21:37:12 +00:00
guards.cpp [inductor][dynamo] Include operator name in size/stride/alignment assertion (#152353) 2025-06-03 19:21:15 +00:00
guards.h [dynamo] Add guard serialization for tensor matches. (#151318) 2025-04-25 14:16:23 +00:00
init.cpp [precompile] Add low level C API to load precompiled dynamo code on functions. (#155329) 2025-06-10 16:13:38 +00:00
init.h
python_compiled_autograd.cpp [ca] mark scalar int sizes as dynamic via tensor wrapping (#151731) 2025-05-08 15:12:08 +00:00
python_compiled_autograd.h
utils.cpp [1/N] Use internal linkage in torch/csrc C++ files. (#150930) 2025-04-11 02:19:31 +00:00
utils.h Revert "[dynamo] save/restore system random state more carefully (#145750)" 2025-01-28 20:51:07 +00:00