[dynamo] improved graph break messages for some common graph break sites [1/N] (#146525)

Pull Request resolved: https://github.com/pytorch/pytorch/pull/146525
Approved by: https://github.com/jansel
This commit is contained in:
William Wen
2025-02-19 11:46:13 -08:00
committed by PyTorch MergeBot
parent 1e94c7aaa4
commit 16e202a38e
18 changed files with 841 additions and 166 deletions

View File

@ -1772,8 +1772,12 @@ def forward(self, x_1):
self.assertExpectedInline(
next(iter(counters["graph_break"].keys())).replace(";", "\n"),
"""\
dynamic shape operator: _torch_testing.numpy_nonzero.default
to enable, set torch._dynamo.config.capture_dynamic_output_shape_ops = True""",
Dynamic shape operator
Explanation: Operator `_torch_testing.numpy_nonzero.default`'s output shape depends on input Tensor data.
Hint: Enable tracing of dynamic shape operators with `torch._dynamo.config.capture_dynamic_output_shape_ops = True`
Developer debug context: _torch_testing.numpy_nonzero.default
""",
)
# pre-existing problem: torch.compile(dynamic=True) will, by default,