[dynamo] Convert invalid args into graph breaks (#121784)

Pull Request resolved: https://github.com/pytorch/pytorch/pull/121784
Approved by: https://github.com/yanboliang
This commit is contained in:
Jason Ansel
2024-03-14 20:30:49 -07:00
committed by PyTorch MergeBot
parent fc33bbf827
commit 5a2b4fc8f0
51 changed files with 5 additions and 2 deletions

View File

@ -1255,8 +1255,8 @@ class TestFxToOnnxFakeTensorWithOnnxRuntime(onnx_test_common._TestONNXRuntime):
model_type=pytorch_test_common.TorchModelType.TORCH_EXPORT_EXPORTEDPROGRAM,
)
@pytorch_test_common.xfail_dynamic_fx_test(
error_message=" Failed running call_function <built-in function scaled_dot_product_attention>",
reason="dynamo does not support it.",
error_message="NOT_IMPLEMENTED : Could not find an implementation for Trilu(14) node",
reason="Need to check Trilu node in the ONNX graph",
model_type=pytorch_test_common.TorchModelType.TORCH_NN_MODULE,
)
@pytorch_test_common.xfail_if_model_type_is_not_exportedprogram(

View File

@ -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: