Skip to content

Commit d72cf23

Browse files
basioli-kGoogle-ML-Automation
authored andcommitted
[XLA:CPU][bugfix] HLO benchmark runner waits for warmup execution to stop before starting timings
PiperOrigin-RevId: 738956951
1 parent f9926c7 commit d72cf23

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

xla/backends/cpu/benchmarks/hlo_benchmark_runner.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,10 @@ absl::Status RunHloBenchmark(benchmark::State& state,
136136
TF_ASSIGN_OR_RETURN(results[0], executable->ExecuteSharded(args_ptrs, device,
137137
execute_options));
138138

139+
for (const auto& result : results[0]) {
140+
CHECK_OK(result->GetReadyFuture().Await());
141+
}
142+
139143
// Benchmark executable.
140144
for (auto _ : state) {
141145
if (benchmark_options.num_executions == 1) {

0 commit comments

Comments
 (0)