Skip to content

Commit

Permalink
Fix node provenance tracking
Browse files Browse the repository at this point in the history
ghstack-source-id: b7a1ec16ccb3288063ba18087b71b6659635e489
Pull Request resolved: #95901
  • Loading branch information
Chillee committed Mar 2, 2023
1 parent 60c9497 commit f4078d6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions torch/_inductor/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,10 +238,14 @@ def get_fused_kernel_name(node_schedule):
def gather_origins(args, kwargs):
import itertools

from .ir import ComputedBuffer, IRNode
from . import ir

def is_unrealized_node(n):
return isinstance(n, IRNode) and not isinstance(n, ComputedBuffer)
if isinstance(n, ir.TensorBox):
return is_unrealized_node(n.data)
if isinstance(n, ir.StorageBox):
return is_unrealized_node(n.data)
return isinstance(n, ir.IRNode) and isinstance(n, ir.Pointwise)

kwarg_origins = [val.origins for val in kwargs.values() if is_unrealized_node(val)]
arg_origins = [arg.origins for arg in args if is_unrealized_node(arg)]
Expand Down

0 comments on commit f4078d6

Please sign in to comment.