Revert "[inductor] Add typing to _inductor/ir.py (#149958)"

This reverts commit 529e0357c6c4e74f8cd32c29198c5f1c9f6e329d.

Reverted https://github.com/pytorch/pytorch/pull/149958 on behalf of https://github.com/malfet due to Looks like it broke inductor_torchbind tests, due to more graphbreaks, see b0fbbef136/1 ([comment](https://github.com/pytorch/pytorch/pull/149958#issuecomment-2949583209))
This commit is contained in:
PyTorch MergeBot
2025-06-06 15:19:16 +00:00
parent b0fbbef136
commit 7e4c097b07
33 changed files with 708 additions and 1056 deletions

View File

@ -974,7 +974,7 @@ def get_first_incompatible_cudagraph_node(
if (
not torch._inductor.config.graph_partition
and isinstance(node.target, torch._ops.OpOverload)
and torch._C.Tag.cudagraph_unsafe in node.target.tags # type: ignore[attr-defined]
and torch._C.Tag.cudagraph_unsafe in node.target.tags
):
# skip cudagraph if a cudagraph_unsafe op is detected.
# graph_partition helps by spliting on this cudagraph_unsafe
@ -2277,7 +2277,7 @@ def is_output_of_multi_outputs_template(
return (
isinstance(input_buf, ir.MultiOutput)
and len(input_buf.inputs) == 1
and is_multi_outputs_template(input_buf.inputs[0]) # type: ignore[arg-type]
and is_multi_outputs_template(input_buf.inputs[0])
)
@ -3102,7 +3102,7 @@ def is_cudagraph_unsafe_op(node: Operation) -> bool:
if (
isinstance(node.op_overload, torch._ops.OpOverload)
and torch._C.Tag.cudagraph_unsafe in node.op_overload.tags # type: ignore[attr-defined]
and torch._C.Tag.cudagraph_unsafe in node.op_overload.tags
):
return True