You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I want to know whether magpy support side effect function like print. Dynamo will break the graph when meeting print. I write a simple demo to test magpy, but it seems that magpy do not support print.
The test demo is:
(<built-in function print>, [tensor([-1.2829, 2.9794, -3.1826, ..., 0.3809, 0.3648, -0.0356])], {}) <class 'NotImplementedError'>
Traceback (most recent call last):
File "/root/shw/graph_capture/MAGPY/MagPy/examples/magpy_test_builtin_functions.py", line 14, in <module>
y = compiled(x)
File "/root/shw/graph_capture/MAGPY/MagPy/frontend/compile.py", line 77, in _fn
raise e
File "/root/shw/graph_capture/MAGPY/MagPy/frontend/compile.py", line 74, in _fn
return fn(*args, **kwargs)
File "/root/shw/graph_capture/MAGPY/MagPy/examples/magpy_test_builtin_functions.py", line 7, in builtin_function
print(x)
File "/root/shw/graph_capture/MAGPY/MagPy/examples/magpy_test_builtin_functions.py", line 7, in builtin_function
print(x)
File "/root/shw/graph_capture/MAGPY/MagPy/frontend/tracer.py", line 58, in trace_func
raise e
File "/root/shw/graph_capture/MAGPY/MagPy/frontend/tracer.py", line 34, in trace_func
record(frame, frame_id)
File "/root/shw/graph_capture/MAGPY/MagPy/frontend/guard_tracker.py", line 2827, in record
trackers[-1].record(frame, frame_id)
File "/root/shw/graph_capture/MAGPY/MagPy/frontend/guard_tracker.py", line 979, in record
raise e
File "/root/shw/graph_capture/MAGPY/MagPy/frontend/guard_tracker.py", line 974, in record
getattr(self, inst.opname)(inst)
File "/root/shw/graph_capture/MAGPY/MagPy/frontend/guard_tracker.py", line 2318, in CALL_FUNCTION
self.call_function(func, args, kwargs)
File "/root/shw/graph_capture/MAGPY/MagPy/frontend/guard_tracker.py", line 1996, in call_function
raise NotImplementedError(func, args, kwargs)
NotImplementedError: (<built-in function print>, [tensor([-1.2829, 2.9794, -3.1826, ..., 0.3809, 0.3648, -0.0356])], {})
There's no graph and guard function output.
The text was updated successfully, but these errors were encountered:
This error indicates that MagPy detects print has side effect, and throws an error to generate graph break. But the handling of graph break in the middle of user code is not very stable.
You can try this flag to fall back to pure pytorch execution without compilation when MagPy meets some problem
Hello, I want to know whether magpy support side effect function like print. Dynamo will break the graph when meeting print. I write a simple demo to test magpy, but it seems that magpy do not support print.
The test demo is:
And the output is:
There's no graph and guard function output.
The text was updated successfully, but these errors were encountered: