pytorch
e4fae884 - Change compiler to use Load/Stores, then transform to SSA (#21101)

Commit
5 years ago
Change compiler to use Load/Stores, then transform to SSA (#21101) Summary: This changes our compiler so it first emits Loads & Stores, and then transforms the graph to SSA in a follow up pass. When a variable is set, we emit a prim::Store, and when a variable is referenced, we emit a prim::Load. ``` a = 1 print(a) ``` becomes: ``` %a.1 : int = prim::Constant[value=1]() prim::Store[name="a"](%a.1) %a : int = prim::Load[name="a"]() prim::Print(%a) ``` In the follow up pass, convertToSSA, the values are turned into SSA form with the Loads & Stores removed. This change will enable breaks and continues because you can transform the graph with the variable naming information still intact. There are still some remaining jitter and edge cases issues that I have to look through, but I think is still ready for eview. Pull Request resolved: https://github.com/pytorch/pytorch/pull/21101 Differential Revision: D15723353 Pulled By: eellison fbshipit-source-id: 3269934d4bc24ddaf3a87fdd20620b0f954d83d0
Author
Elias Ellison
Parents
Loading