From 5a6d0dc7ce92d69a780cb764efb8e94e24553d62 Mon Sep 17 00:00:00 2001 From: "Jason Ansel (Meta Employee)" Date: Sun, 17 Mar 2024 17:59:22 -0700 Subject: [PATCH] Convert invalid args into graph breaks (#121784) Summary: X-link: https://github.com/pytorch/pytorch/pull/121784 Approved by: https://github.com/yanboliang Reviewed By: jeanschmidt Differential Revision: D54970023 Pulled By: jansel fbshipit-source-id: 79c188aeb2a86189b45a6c56de31ac9d9bd6a318 --- userbenchmark/dynamo/dynamobench/_dynamo/utils.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/userbenchmark/dynamo/dynamobench/_dynamo/utils.py b/userbenchmark/dynamo/dynamobench/_dynamo/utils.py index 1974eb0b36..92cb80bb44 100644 --- a/userbenchmark/dynamo/dynamobench/_dynamo/utils.py +++ b/userbenchmark/dynamo/dynamobench/_dynamo/utils.py @@ -1729,6 +1729,9 @@ def get_fake_value(node, tx, allow_non_graph_fake=False): ) elif isinstance(cause, ValueRangeError): raise UserError(UserErrorType.CONSTRAINT_VIOLATION, e.args[0]) from e + elif isinstance(cause, TypeError) and "argument" in str(cause): + unimplemented(f"TypeError {node.target}: {cause}") + raise TorchRuntimeError(str(e)).with_traceback(e.__traceback__) from None if not allow_non_graph_fake: