pytorch/torch/_dynamo/variables
Will Feng d52b9ba6a8 [torch.compile + selective checkpoint] Attach context_fn to the checkpointed graph module, fixing flaky tests (#112672)
torch.compile + SAC unit test is causing adjacent unit tests to be flaky due to its modification of shared singleton object. This PR attaches the checkpoint context fn to the checkpointed GraphModule, and look it up during execution, avoiding the need to make the higher-order op stateful.

Specifically, we attach the `context_fn` to the checkpointed GraphModule. These two will be gc'ed at the same time, so it satisfies the lifetime requirement.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/112672
Approved by: https://github.com/wanchaol
2023-11-16 01:34:52 +00:00
..
__init__.py [dynamo] Add LazyVariableTracker (#111306) 2023-11-07 19:55:19 +00:00
base.py [dynamo] Refactor OrderedDict to dict (#113234) 2023-11-08 09:27:08 +00:00
builder.py Revert "Support tensors as Dict keys (#111196)" 2023-11-15 23:08:00 +00:00
builtin.py Revert "Support tensors as Dict keys (#111196)" 2023-11-15 23:08:00 +00:00
constant.py [dynamo] Remove VariableTracker.propagate (#111726) 2023-11-07 19:55:19 +00:00
ctx_manager.py [contextlib] Wrapping a function with set_grad_enabled will consume its global mutation (#113359) 2023-11-09 19:16:20 +00:00
dicts.py Revert "Support tensors as Dict keys (#111196)" 2023-11-15 23:08:00 +00:00
distributed.py Make FakeProcessGroup traceable (#113314) 2023-11-10 16:03:38 +00:00
functions.py Revert "Support tensors as Dict keys (#111196)" 2023-11-15 23:08:00 +00:00
higher_order_ops.py [torch.compile + selective checkpoint] Attach context_fn to the checkpointed graph module, fixing flaky tests (#112672) 2023-11-16 01:34:52 +00:00
iter.py [dynamo] Remove VariableTracker.add_options (#111725) 2023-11-07 19:55:19 +00:00
lazy.py [dynamo] Remove VariableTracker.propagate (#111726) 2023-11-07 19:55:19 +00:00
lists.py [dynamo] Remove VariableTracker.propagate (#111726) 2023-11-07 19:55:19 +00:00
misc.py Revert "Support tensors as Dict keys (#111196)" 2023-11-15 23:08:00 +00:00
nn_module.py [dynamo] Remove VariableTracker.propagate (#111726) 2023-11-07 19:55:19 +00:00
optimizer.py [dynamo] Eagerly install guards (#111415) 2023-11-07 19:55:19 +00:00
tensor.py Revert "[easy]Remove specialized value (#112252)" 2023-11-15 23:02:49 +00:00
torch_function.py [dynamo] Eagerly install guards (#111415) 2023-11-07 19:55:19 +00:00
torch.py graph break on out= ops with noncontiguous out args (#113267) 2023-11-15 19:55:47 +00:00
user_defined.py Revert "Support tensors as Dict keys (#111196)" 2023-11-15 23:08:00 +00:00