lightning-thunder
lightning-thunder copied to clipboard
multiple in-place ops to func's arg tensors that are a view of another
Looks good to me, I wonder if we want a note about aliases as args?
def f(a, b):
return a.exp_().sin_() + b.exp_().sin_()
a = torch.randn(5, 5)
f(a, a)
Originally posted by @t-vi in https://github.com/Lightning-AI/lightning-thunder/pull/723#pullrequestreview-2165267499
rel: #657
cc @apaz-cli
What's the reliable way in PyTorch to determine if two tensors are each other's aliases?
At cache retrieval time can we quickly find which input tensors are aliased to each other, specialize traces on that and add this information to TensorProxies to be used in transforms?