pytorch/torch/_dynamo/variables
Animesh Jain 4308b8a28f [dynamo] Support torch.fx.traceback.annotate (#164678)
Builds on top of https://github.com/pytorch/pytorch/pull/163673 and https://github.com/pytorch/pytorch/pull/164174. This will be used in the followup PRs to apply regional inductor compilation.

The existing implementation let Dynamo trace into the `torch.fx.traceback.annotate`, but thats not what we want. We want Dynamo to essentially run the torch.fx.traceback.annotate function in eager, so that every Fx node created in Dynamo Fx graph has the custom meta node.

What does not work?
* We still have to set the context manager `torch.fx.traceback.preserve_node_meta()` in the user code because CI was unhappy. This can be fixed but with some perseverance.
* This does not work with graph breaks yet. But we can solve that problem, if needed, in a separate PR.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/164678
Approved by: https://github.com/SherlockNoMad, https://github.com/jansel, https://github.com/xmfan
2025-10-08 22:41:00 +00:00
..
__init__.py [dynamo] Support torch.fx.traceback.annotate (#164678) 2025-10-08 22:41:00 +00:00
base.py [dynamo][guards] More small guard optimizations (#159345) 2025-07-29 18:36:49 +00:00
builder.py [export] Preserve nn_module_stack for aliased nn modules (#164311) 2025-10-01 18:04:33 +00:00
builtin.py Pyrefly suppressions 7/n (#164913) 2025-10-08 07:27:17 +00:00
constant.py [dynamo, 3.14] support LOAD_CONST on slice, codegen LOAD_CONST slice instead of BINARY/STORE_SLICE (#163110) 2025-09-30 17:42:11 +00:00
ctx_manager.py [dynamo] Support torch.fx.traceback.annotate (#164678) 2025-10-08 22:41:00 +00:00
dicts.py Realize LazyVariableTracker before raising exception (#163350) 2025-09-19 19:25:17 +00:00
distributed.py Revert "Reapply "C++-accessible Placements via pybind11 (#163030)" (#164519)" 2025-10-07 19:46:17 +00:00
functions.py [dynamo, nested graph breaks] fix nested step graph break related issues (#162737) 2025-10-08 22:02:52 +00:00
higher_order_ops.py Revert "Enable all SIM rules except disabled ones (#164645)" 2025-10-05 19:32:21 +00:00
iter.py [dynamo, nested graph breaks] move cell codegen before side effects codegen (#160601) 2025-10-08 22:02:52 +00:00
lazy.py [dynamo] Avoid recompiling over unused objects (#156891) 2025-07-09 20:14:34 +00:00
lists.py [dynamo, 3.14] fix BUILD_TUPLE with 0 args (#163818) 2025-09-30 17:42:40 +00:00
misc.py [dynamo, nested graph breaks] move cell codegen before side effects codegen (#160601) 2025-10-08 22:02:52 +00:00
nn_module.py [dynamo] Inline nn module calls using __call__ methods (#164817) 2025-10-07 08:57:20 +00:00
optimizer.py [Dynamo] Don't guard data ptrs by default with mark_static_address (#162208) 2025-09-12 07:15:10 +00:00
script_object.py [dynamo] Replace unimplemented with unimplemented_v2 in torch/_dynamo/variables/script_object.py (#159343) 2025-08-01 21:30:41 +00:00
sdpa.py [Dynamo][Misc] Apply typing hints for codegen (#150289) 2025-04-04 14:26:22 +00:00
tensor.py [2/N] Simplify "in" operation for containers of a single item (#164323) 2025-10-01 05:39:11 +00:00
torch_function.py [dynamo] Be consistent with UserMethodVariable source (#160155) 2025-08-09 04:16:14 +00:00
torch.py [dynamo] Support torch.fx.traceback.annotate (#164678) 2025-10-08 22:41:00 +00:00
user_defined.py NamedTuple: Allow side effects for dynamic attributes (#161645) 2025-09-09 19:42:02 +00:00