From 95c08921381d55107026d6e064a9f356e455c143 Mon Sep 17 00:00:00 2001 From: Henning Becker Date: Fri, 8 Nov 2024 09:10:16 -0800 Subject: [PATCH] Make TritonSupportTest surface sanitizer issues TritonSupportTest relies on a death test for some of its assertion because Triton doesn't allow graceful error handling for some of the cases we want to test. This death test also used to succeed when the code under test triggered a santizer violation. So this change makes it fail on those sanitizer violations and will be surface those in the log. Ideally we would tightly control in which code path each death test terminates, but unfortunately most of them don't have indicative error message. Some just call `std::abort` without an error message. Some just die in accessing an empty `std::optional`, etc. So the best we can do is make sure that we detect sanitizer errors and report these as test failures. PiperOrigin-RevId: 694523531 --- xla/service/gpu/fusions/triton/triton_support_test.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xla/service/gpu/fusions/triton/triton_support_test.cc b/xla/service/gpu/fusions/triton/triton_support_test.cc index 3f926c70ef182..7a337ab24ec28 100644 --- a/xla/service/gpu/fusions/triton/triton_support_test.cc +++ b/xla/service/gpu/fusions/triton/triton_support_test.cc @@ -217,7 +217,10 @@ class TritonSupportTest : public TritonSupportTestBase { try { run_triton_codegen().IgnoreError(); } catch (...) { abort(); }, - ""); + // It's not possible to find stable matching patterns for all + // aborting code paths that occur here, so we at least make sure + // that we don't interpret sanitizer errors as success. + ::testing::Not(::testing::HasSubstr("Sanitizer:"))); } else { EXPECT_THAT(run_triton_codegen(), Not(IsOk()));