Functionalization in PyTorch

· January 16, 2025

Functionalization in PyTorch: Everything You Wanted To Know – compiler – PyTorch Developer Mailing List

Over a year old, but a very in depth breakdown from Brian Hirsh of how AOTAutograd functionlizes – e.g. removes mutations from – various graphs, what that enables, and what kind of edge cases exist. Inductor as a backend can handle mutation, but many other situations (including export!) can’t. It got bumped up because of a question on exactly that!

torch.export uses functionalization. In particular, when you export for inference, you’ll get out a functionalized ATen graph!