PyTorch Functionalization in PyTorch Everything you need to know

Properties
authors Brian Hirsh
year 2023
url https://dev-discuss.pytorch.org/t/functionalization-in-pytorch-everything-you-wanted-to-know/965

Given a program/function of PyTorch operators, functionalization will return a new function, that:
1. Has the same semantics as the old function
2. Has no mutations in it

Exposed in functorch API.

Functionalization operates at the level of our ATen API.

Why?
- Compilers don't like mutations: Graph partitioning is harder if nodes have side effects, etc.

Notes:
- PyTorch Functionalization