[inductor] Fix error in debug_str_extra (#134747)

Pull Request resolved: https://github.com/pytorch/pytorch/pull/134747
Approved by: https://github.com/Skylion007, https://github.com/shunting314
This commit is contained in:
Jason Ansel 2024-08-28 21:47:29 -07:00 committed by PyTorch MergeBot
parent 43e1df64f8
commit 202e5cc87d

View File

@ -1044,10 +1044,10 @@ class FusedSchedulerNode(BaseSchedulerNode):
for i, node in enumerate(self.snodes)
]
node = self.snodes[0].node
assert node is not None
device = node.get_device()
if ir.is_triton(device):
lines.extend(debug_triton_code(self))
if node is not None:
device = node.get_device()
if ir.is_triton(device):
lines.extend(debug_triton_code(self))
return textwrap.indent("\n".join(lines).rstrip(), " ")