Skip to content

Commit 68ae8df

Browse files
committed
wip
1 parent af93e7d commit 68ae8df

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

thunder/core/update_aliases.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,15 @@ def insert_alias_updates(computation_trace: Trace, alias_tensor_indices: list[li
174174
out_tensors = set(map(variableify, filter(lambda p: isinstance(p, TensorProxy), bsym.flat_proxy_outs)))
175175
encountered.update(in_tensors)
176176
group = set(reduce(set.union, filter(lambda g: any(g.intersection(in_tensors)), view_groups), set()))
177-
if not group or not (views_encountered := group.intersection(encountered)):
178-
# If group is empty, this is a view creation with operands that are not involved in any inplace ops.
177+
views_encountered = group.intersection(encountered)
178+
179+
if _is_inplace_op(bsym):
180+
# Super-hacky workaround to insert fusion break because nvFuser doesn't support mutation on intermediates
181+
# See https://github.com/Lightning-AI/lightning-thunder/issues/2768#issuecomment-3581908434
182+
views_encountered = in_tensors
183+
184+
if not views_encountered:
185+
# This is a view creation with operands that are not involved in any inplace ops.
179186
bsyms.append(bsym)
180187
continue
181188

0 commit comments

Comments
 (0)