Skip to content

Commit

Permalink
Make TritonSupportTest surface sanitizer issues
Browse files Browse the repository at this point in the history
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
  • Loading branch information
beckerhe authored and Google-ML-Automation committed Nov 8, 2024
1 parent 151c19d commit 95c0892
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion xla/service/gpu/fusions/triton/triton_support_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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()));
Expand Down

0 comments on commit 95c0892

Please sign in to comment.