From 76289441b7e5b2f02f2f8a2d64d886b3209b72ac Mon Sep 17 00:00:00 2001 From: Adrian Kuegel Date: Tue, 19 Nov 2024 04:13:12 -0800 Subject: [PATCH] [XLA:GPU] Don't capture a string_view for SlowOperationAlarm. This was not caught because the string_view is only used for logging if autotuning takes too long. PiperOrigin-RevId: 697960535 --- xla/service/gpu/autotuning/conv_algorithm_picker.cc | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/xla/service/gpu/autotuning/conv_algorithm_picker.cc b/xla/service/gpu/autotuning/conv_algorithm_picker.cc index ab061423e3fed..8210c89114fc1 100644 --- a/xla/service/gpu/autotuning/conv_algorithm_picker.cc +++ b/xla/service/gpu/autotuning/conv_algorithm_picker.cc @@ -592,11 +592,10 @@ absl::StatusOr GpuConvAlgorithmPicker::AutotuneOneConvRunner( se::dnn::ProfileResult profile_result; VLOG(4) << "Trying algorithm " << alg.ToString() << " for " << instr_str; - SlowOperationAlarm alarm(absl::Seconds(1), [&] { - return absl::StrFormat( - "Trying algorithm %s for conv %s is taking a while...", alg.ToString(), - instr_str); - }); + SlowOperationAlarm alarm( + absl::Seconds(1), + absl::StrFormat("Trying algorithm %s for conv %s is taking a while...", + alg.ToString(), instr_str)); std::optional workspace_size = runner->ToAlgorithmDesc().workspace_size();