-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
Hello,I was wondering if MagPy supports graph breaking. After reviewing the code, I noticed that each frame can have multiple cached_graphs. Additionally, in the dynamic control flow section of the paper, it is mentioned that "MAGPY will cut the user program before the dynamic jump and run this jump eagerly."
However, when I tested MagPy with a simple example involving a print statement and a tensor condition, Dynamo breaks the graph and compiles multiple graphs, but MagPy raises an error. Here is the test case:
import torch
from frontend.compile import compile
def builtin_function(x):
if x.sum() > 10:
x = x * 2
else:
x = x / 2
return x
x = torch.randn(1024)
compiled = compile(builtin_function)
y = compiled(x)And another example:
class Example(torch.nn.Module):
def __init__(self):
super(Example, self).__init__()
self.conv = torch.nn.Conv2d(3, 3, 3)
self.relu = torch.nn.ReLU()
def forward(self, x):
x = self.conv(x)
print(x)
x = self.relu(x)
return xAre there any examples where MagPy performs graph breaking and compiles multiple graphs, caching them? Thank you!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels