pytorch/torch/_dynamo/variables
Ryan Guo f14247d5aa [dynamo] Accurately identify mutated cells captured by multiple functions (#138632)
This patch changes `mutated_closure_cell_contents: Set[str]` to
`mutated_closure_cell_ids: Set[int]` so that Dynamo can more accurately
identify closure cells across different instances of
`UserFunctionVariable`. This prevents Dynamo from mistakenly treat a
cell as immutable, despite it'll be mutated when referenced as closure
cell from another function.

More context in
https://github.com/pytorch/pytorch/issues/138112#issuecomment-2420580779.

Fixes #138112.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/138632
Approved by: https://github.com/jansel
ghstack dependencies: #138639
2024-10-26 02:17:07 +00:00
..
__init__.py Add host-side Triton TMA support to Dynamo (#137677) 2024-10-16 02:18:48 +00:00
base.py [dynamo] Simplify creation of VariableTrackers (#135714) 2024-10-18 09:36:46 +00:00
builder.py Fix lru_cache where config is used (#134235) 2024-10-24 10:43:34 +00:00
builtin.py [dynamo] Replace __str__ with __repr__ in some places (#136316) 2024-10-21 19:50:38 +00:00
constant.py [dynamo] Replace __str__ with __repr__ in some places (#136316) 2024-10-21 19:50:38 +00:00
ctx_manager.py [Dynamo] Trace enter/exit of TorchFunctionModes (#135422) (#137114) 2024-10-09 02:29:40 +00:00
dicts.py Avoid calling realize() on LazyVariableTracker on reconstruct (#138495) 2024-10-25 19:01:15 +00:00
distributed.py [compiled autograd] tls access helpers (#138061) 2024-10-22 08:03:52 +00:00
functions.py [dynamo] Accurately identify mutated cells captured by multiple functions (#138632) 2024-10-26 02:17:07 +00:00
higher_order_ops.py [Dynamo] Improve args in higher_order_ops [1/N] (#138799) 2024-10-25 13:55:41 +00:00
iter.py [dynamo] Simplify creation of VariableTrackers (#135714) 2024-10-18 09:36:46 +00:00
lazy.py [dynamo] Replace __str__ with __repr__ in some places (#136316) 2024-10-21 19:50:38 +00:00
lists.py [dynamo] Simplify creation of VariableTrackers (#135714) 2024-10-18 09:36:46 +00:00
misc.py [compiled autograd] tls access helpers (#138061) 2024-10-22 08:03:52 +00:00
nn_module.py [dynamo][modules] Support overridden __call__ on nn modules (#138619) 2024-10-24 03:49:26 +00:00
optimizer.py [dynamo] Simplify creation of VariableTrackers (#135714) 2024-10-18 09:36:46 +00:00
script_object.py Add basic mypy annotations to dynamo (#132415) 2024-08-04 18:43:36 +00:00
sdpa.py [dynamo] Simplify creation of VariableTrackers (#135714) 2024-10-18 09:36:46 +00:00
tensor.py Have as_tensor always return a float64 tensor in dynamo (#138598) 2024-10-24 20:50:28 +00:00
torch_function.py [dynamo] Simplify creation of VariableTrackers (#135714) 2024-10-18 09:36:46 +00:00
torch.py [dynamo] Simplify creation of VariableTrackers (#135714) 2024-10-18 09:36:46 +00:00
user_defined.py [dynamo] Replace __str__ with __repr__ in some places (#136316) 2024-10-21 19:50:38 +00:00