Interactively explore what torch.compile does to your code!

torch.compile dynamically translates your python code into modified bytecode, and it is rather difficult to precisely understand what the modified bytecode does.

To help (me) understand what torch.compile does to the original code, I created a jupyter notebook together with a bytecode decompiler depyf. And it supports you to interactively explore what torch.compile does to your code!

Some screenshots:

You can see guarding conditions:

You can see compiled code:

You can see compiled subgraph:

You can see other referenced functions, like resume functions:

Explore anything you like!

9 Likes