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
Hi all. We are trying to implement an in-place operator in torch_xla using pallas, and make it work with torch.compile. However, we found that XLA inserts extra copy instructions, hindering input-output aliasing.
In this example, the custom op is a simple elementwise +1 operation. The graph sent to XLA compiler correctly captures the buffer donation information:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Context: pytorch/xla#8385
Hi all. We are trying to implement an in-place operator in torch_xla using pallas, and make it work with
torch.compile
. However, we found that XLA inserts extra copy instructions, hindering input-output aliasing.In this example, the custom op is a simple elementwise +1 operation. The graph sent to XLA compiler correctly captures the buffer donation information:
Everything goes well before the pass
copy-insertion.after_adding_copies_to_resolve_interference
, where the copy operation is inserted:And in the previous pass, it does not contain the copy (and seems aliasing analysis is correct)
I am wondering how I can remove this copy instruction. Thanks!
Beta Was this translation helpful? Give feedback.
All reactions