pytorch
5651006b - [aot_autograd] proper handling for when outputs are aliased but have identical size/stride/offset metadata (#100430)

Commit
1 year ago
[aot_autograd] proper handling for when outputs are aliased but have identical size/stride/offset metadata (#100430) Fixes https://github.com/pytorch/pytorch/issues/100348, see the discussion in the issue for details. The problem was that for code like this: ``` def f(x): out = ... return out, out.detach() ``` The `.detach()` would turn into a `.alias()`, and inductor turns `.alias()` calls into no-ops. Inductor would effectively see that the two graph outputs have the same metadata, and return `out, out`. cc @ngimel alternatively we could have inductor try to detect when it's not ok to make `.alias()` a no-op, but that would probably require some custom logic instead of making `.alias()` a decomposition. Pull Request resolved: https://github.com/pytorch/pytorch/pull/100430 Approved by: https://github.com/ngimel
Author
Committer
Parents
Loading