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
Fixed retain/release related test failures, caused by the change of swift (#12)
calling convention, where arguments are passed in as @guaranteed (+0) instead of
@owned (+1).
As such, the changes to the TFPartition pass are:
1. When sinking a special instruction foo(%x) (tf_send, tf_receive,
tf_get_scalar_or_die) below tensor end point, where %x is a tensor handle, make
sure we keep a strong_retain in its original inst position, and sink I along
with a strong_release below tensor end point.
Example code snippet:
%x = ...
foo(%x)
...
<tensor end point>
strong_release %x
The transformed code after sinking foo(%x) is:
%x = ...
strong_retain %x
...
<tensor end point>
foo(%x)
strong_release %x
strong_release %x
2. When removing a copy marker inst (tf_send, tf_receive) from the host code,
add a strong_retain to balance the refcount.
Example code snippet:
%x = ...
%y = tf_send(%x)
strong_release %y
strong_release %x
The transformed code after sinking foo(%x) is:
%x = ...
strong_retain %x
strong_release %x
strong_release %x
3. Also addressed Richard's code formatting suggestions in a previous PR.
0 commit comments