pytorch/torch/_dynamo
zhxchen17 ffd58293f7 [dynamo] Guard serialization for FUNCTORCH_STACK_MATCH (#152616)
Make Functorch interpreters serializable most of the time, so that we can save the guards on functorch states.

## Test Cases:

0. torch.compile() without functorch layers present. Guard should fail with any layer being pushed.
1. torch.compile() nested in vmap.
2. torch.compile() nested in grad.
3. torch.compile() nested in jvp + vmap
4. torch.compile() nested functionalize
5. torch.compile() nested in vmap + grad

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

Pull Request resolved: https://github.com/pytorch/pytorch/pull/152616
Approved by: https://github.com/zou3519
ghstack dependencies: #152615
2025-05-05 18:05:56 +00:00
..
backends Revert "[aot autograd][logging] Profile large missing gaps in compile time tracing (#151256)" 2025-04-21 18:49:23 +00:00
polyfills Gracefully handle optree less than minimum version, part 2 (#151257) 2025-04-15 13:08:26 +00:00
repro Replace all random is_fbcode imports to environment (#151283) 2025-04-15 19:42:58 +00:00
variables Add infra to run CPython tests under Dynamo (#150787) 2025-05-05 17:20:14 +00:00
__init__.py [dynamo] context manager/decorator for dynamo config patching during tracing (#150586) 2025-04-23 09:12:13 +00:00
_trace_wrapped_higher_order_op.py Document dynamo (#146736) 2025-02-13 00:02:21 +00:00
bytecode_analysis.py Remove code for Python < 3.9 (#147097) 2025-02-14 03:22:49 +00:00
bytecode_transformation.py [dynamo] show stack above dynamo in graph break user tracebacks (#148401) 2025-03-09 07:37:38 +00:00
cache_size.py Migrate from Tuple -> tuple in torch/_dynamo (#144261) 2025-01-10 07:45:57 +00:00
callback.py cleanup JK for duplicate pt2 compile callbacks prevention (#148704) 2025-04-11 15:17:06 +00:00
code_context.py Document dynamo (#146736) 2025-02-13 00:02:21 +00:00
codegen.py [dynamo] reconstruct functions decorated in the compiled region properly (#150645) 2025-04-08 17:32:46 +00:00
compiled_autograd.py [ca] hide unused scalar int sizes from dynamo (#151962) 2025-05-01 21:59:55 +00:00
comptime.py [BE][PYFMT] migrate PYFMT for torch._dynamo to ruff format (#144549) 2025-02-28 03:03:53 +00:00
config.py add basic unit tests and noop config (#152036) 2025-04-24 17:57:54 +00:00
convert_frame.py [dynamo] context manager/decorator for dynamo config patching during tracing (#150586) 2025-04-23 09:12:13 +00:00
create_parameter_op.py PEP585 update - torch/_dynamo (#145105) 2025-01-18 20:47:11 +00:00
current_scope_id.py Document dynamo (#146736) 2025-02-13 00:02:21 +00:00
debug_utils.py [BE] Migrate dtype_abbrs into one location (#152229) 2025-04-28 03:52:47 +00:00
decorators.py [dynamo] context manager/decorator for dynamo config patching during tracing (#150586) 2025-04-23 09:12:13 +00:00
device_interface.py Add methods for checking Triton availability to the device interface (#152529) 2025-05-05 00:55:53 +00:00
distributed.py Document dynamo (#146736) 2025-02-13 00:02:21 +00:00
eval_frame.py [export] set is_exporting() for strict (#151833) 2025-05-01 02:00:19 +00:00
exc.py Super tiny fix typo (#149109) 2025-03-23 03:02:53 +00:00
external_utils.py [ca] mark scalar int sizes as dynamic via tensor wrapping (#151731) 2025-05-01 21:59:49 +00:00
funcname_cache.py gracefully handle tokenize.TokenError in funcname parser. Adds support for non-Python source (#148737) 2025-03-11 19:49:28 +00:00
graph_break_hints.py [dynamo] unimplemented -> unimplemented_v2 in variables/builder.py (#151044) 2025-04-11 09:07:01 +00:00
graph_deduplication.py [invoke_subgraph] Unpacked operands (#152547) 2025-05-02 05:44:46 +00:00
graph_region_tracker.py [Hierarchical Compile] Fix small bug (#151293) 2025-04-22 05:13:07 +00:00
graph_utils.py [Hierarchical Compile] Add cycle detection to graph region expansion (#150305) 2025-04-01 20:54:18 +00:00
guards.py [dynamo] Guard serialization for FUNCTORCH_STACK_MATCH (#152616) 2025-05-05 18:05:56 +00:00
hooks.py [dynamo] Allow guards to be dropped with custom filter functions. (#150936) 2025-04-11 03:06:34 +00:00
logging.py Revert "Use the device interface for detecting Triton availability (#139171)" 2025-03-11 18:49:21 +00:00
metrics_context.py [logging] Fix duration logging for dynamo_compile (#151749) 2025-04-22 03:29:13 +00:00
mutation_guard.py Add functionality for installing free variables (#151134) 2025-04-24 17:57:54 +00:00
output_graph.py [dynamo] Guard serialization for FUNCTORCH_STACK_MATCH (#152616) 2025-05-05 18:05:56 +00:00
pgo.py Make PGO code state not sensitive to file path by hashing file content when the file is available. (#152628) 2025-05-02 17:11:21 +00:00
profiler.py Document dynamo (#146736) 2025-02-13 00:02:21 +00:00
replay_record.py Document dynamo (#146736) 2025-02-13 00:02:21 +00:00
resume_execution.py [BE][PYFMT] migrate PYFMT for torch._dynamo to ruff format (#144549) 2025-02-28 03:03:53 +00:00
side_effects.py [dynamo] Support Tensor subclass that has dynamic attributes or calls Parameter.__torch_function__ (#149482) 2025-04-02 20:56:43 +00:00
source.py [dynamo] Add guard serialization for tensor matches. (#151318) 2025-04-25 14:16:23 +00:00
symbolic_convert.py [Dynamo] Use LazyVariableTracker in base VT (#151847) 2025-04-23 18:18:01 +00:00
tensor_version_op.py Document dynamo (#146736) 2025-02-13 00:02:21 +00:00
test_case.py Add infra to run CPython tests under Dynamo (#150787) 2025-05-05 17:20:14 +00:00
test_dont_skip_tracing_functions.py [dynamo] context manager/decorator for dynamo config patching during tracing (#150586) 2025-04-23 09:12:13 +00:00
test_minifier_common.py Document dynamo (#146736) 2025-02-13 00:02:21 +00:00
testing.py Propagate callable parameter types using ParamSpec (#142306) (#151014) 2025-04-13 20:38:11 +00:00
trace_rules.py [CUDAGraph Trees] support memory allocation on side stream (#152472) 2025-05-02 04:26:35 +00:00
types.py [dynamo] Use sentinel value for guard filter. (#151131) 2025-04-12 15:29:57 +00:00
utils.py [dynamo] context manager/decorator for dynamo config patching during tracing (#150586) 2025-04-23 09:12:13 +00:00