Skip to content

Commit

Permalink
Check TRT err msg more granularly
Browse files Browse the repository at this point in the history
  • Loading branch information
kthui committed Apr 29, 2023
1 parent 23172b2 commit 38f5bc1
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions qa/L0_trt_error_propagation/trt_error_propagation_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,23 @@ def test_invalid_trt_model(self):
with self.assertRaises(InferenceServerException) as cm:
self.__triton.load_model("invalid_plan_file")
err_msg = str(cm.exception)
self.assertIn("Internal: unable to create TensorRT engine", err_msg,
"Caught an unexpected exception")
# "[err_msg]" -> "[triton_err_msg]: [backend_err_msg]: [trt_err_msg]"
backend_err_msg = "Internal: unable to create TensorRT engine: "
self.assertIn(
"Error Code 4: Internal Error (Engine deserialization failed.)",
err_msg,
"Detailed error message not propagated back to triton client")
backend_err_msg, err_msg,
"Cannot find the expected error message from TensorRT backend")
triton_err_msg, trt_err_msg = err_msg.split(backend_err_msg)
for triton_err_msg_part in [
"load failed for model", "version 1 is at UNAVAILABLE state: "
]:
self.assertIn(
triton_err_msg_part, triton_err_msg,
"Cannot find an expected part of error message from Triton")
for trt_err_msg_part in ["Error Code ", "Internal Error "]:
self.assertIn(
trt_err_msg_part, trt_err_msg,
"Cannot find an expected part of error message from TensorRT framework"
)

def test_invalid_trt_model_autocomplete(self):
with self.assertRaises(InferenceServerException) as cm:
Expand Down

0 comments on commit 38f5bc1

Please sign in to comment.