From 5a391f5c6e2b7a51486844bed6c21d35e4c51a4b Mon Sep 17 00:00:00 2001 From: "Edward Z. Yang (Meta Employee)" Date: Mon, 23 Oct 2023 09:27:51 -0700 Subject: [PATCH] Don't suppress original error message for data-dependent value (#111596) Summary: Signed-off-by: Edward Z. Yang X-link: https://github.com/pytorch/pytorch/pull/111596 Approved by: https://github.com/suo Reviewed By: izaitsevfb, jeanschmidt Differential Revision: D50543638 Pulled By: ezyang fbshipit-source-id: ab0732906e5892eac6e67cbb0fedd6ba1bc567d9 --- userbenchmark/dynamo/dynamobench/_dynamo/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/userbenchmark/dynamo/dynamobench/_dynamo/utils.py b/userbenchmark/dynamo/dynamobench/_dynamo/utils.py index 20fb250d00..0bb0d2e79a 100644 --- a/userbenchmark/dynamo/dynamobench/_dynamo/utils.py +++ b/userbenchmark/dynamo/dynamobench/_dynamo/utils.py @@ -1428,9 +1428,9 @@ def visit(n: torch.fx.Node): raise UserError( # noqa: TRY200 UserErrorType.CONSTRAINT_VIOLATION, "Tried to use data-dependent value in the subsequent computation. " - "This can happen when we encounter unbounded dynamic value that is unknown during tracing time." + "This can happen when we encounter unbounded dynamic value that is unknown during tracing time. " "You will need to explicitly give hint to the compiler. Please take a look at " - "constrain_as_value OR constrain_as_size APIs", + f"constrain_as_value OR constrain_as_size APIs. {cause}", case_name="constrain_as_size_example", ) elif isinstance(cause, torch.utils._sympy.value_ranges.ValueRangeError):