pytorch/torch/_functorch
Simon Fan fae6f6c9ca [aot] fix deepcopying of aot bwd containing real tensors (#153999)
Previously when we lower backward AOT due to symints, the post grad passes would leave the bw_module in a non-runnable state. This caused issues when compiled autograd tried to trace at runtime. So we had inductor operate on a deepcopy of bw_module.

But with https://github.com/pytorch/pytorch/issues/153993, we see that deepcopying real tensors will fail under fake mode due to the device type mismatch between the fake tensors ("meta" device) and the real tensor. So by disabling fake mode, we avoid these errors. This change is a strict improvement over current, but it does reveal that this deepcopy can theoretically cause OOMs.

FIXES https://github.com/pytorch/pytorch/issues/153993

Pull Request resolved: https://github.com/pytorch/pytorch/pull/153999
Approved by: https://github.com/jamesjwu, https://github.com/bdhirsh
2025-05-21 23:30:02 +00:00
..
_activation_checkpointing [pytorch] Remove numpy dependency from Knapsack Evaluator (#150825) 2025-04-10 17:07:03 +00:00
_aot_autograd [aot] fix deepcopying of aot bwd containing real tensors (#153999) 2025-05-21 23:30:02 +00:00
__init__.py
aot_autograd.py [compile-time traces] Profile large missing gaps in compile time (#151256) 2025-05-13 14:44:51 +00:00
apis.py [BE] typing for decorators (#144161) 2025-01-04 16:40:09 +00:00
autograd_function.py Introduce unsafe way to mark functions as cacheable (#151603) 2025-04-21 17:37:38 +00:00
batch_norm_replacement.py remove allow-untyped-defs for torch/_functorch/batch_norm_replacement.py (#143438) 2024-12-18 09:01:06 +00:00
benchmark_utils.py
compile_utils.py
compilers.py Remove unused Python variables in torch/[_-a]* (#133492) 2024-12-12 17:39:14 +00:00
config.py [precompile] Add BundledAOTAutogradCacheEntry (#152840) 2025-05-21 18:08:42 +00:00
deprecated.py PEP585 update - torch/_functorch (#145139) 2025-01-19 07:06:10 +00:00
eager_transforms.py Render Example: and not Example:: in docs (#153978) 2025-05-21 01:03:26 +00:00
functional_call.py PEP585 update - torch/_functorch (#145139) 2025-01-19 07:06:10 +00:00
fx_minifier.py PEP585 update - torch/_functorch (#145139) 2025-01-19 07:06:10 +00:00
make_functional.py PEP585 update - torch/_functorch (#145139) 2025-01-19 07:06:10 +00:00
partitioners.py Revert "[3/n][Optimus][Auto-AC] Support float8_e4m3fn quantization type and set scaling as the default (#153802)" 2025-05-21 17:20:31 +00:00
pyfunctorch.py [dynamo] Guard serialization for FUNCTORCH_STACK_MATCH (#152616) 2025-05-05 18:05:56 +00:00
python_key.py
pytree_hacks.py
top_operators_github_usage.py [BE]: Apply ruff PERF403 to use dict comprehensions more often (#149257) 2025-03-18 00:46:07 +00:00
utils.py PEP585 update - torch/_functorch (#145139) 2025-01-19 07:06:10 +00:00
vmap.py [dynamo] Support functools.partial variables through inspect.signature (#146339) 2025-02-04 04:39:39 +00:00