[XLA:GPU] Do not autotune convolutions on ROCm if requiring determinism

PiperOrigin-RevId: 359800323
Change-Id: I4195beb7ae30c25010c7af4ffb7079e7ad3845a4
This commit is contained in:
George Karpenkov 2021-02-26 11:27:05 -08:00 committed by TensorFlower Gardener
parent 5d1280a19a
commit 58ddb638c0

View File

@ -747,12 +747,19 @@ GpuConvAlgorithmPicker::PickBestAlgorithmNoCacheRocm(
absl::Milliseconds(profile_result.elapsed_time_in_ms()));
}
}
const auto& best_result = absl::c_min_element(
profile_results,
[&](const AutotuneResult& lhs, const AutotuneResult& rhs) {
return tensorflow::proto_utils::FromDurationProto(lhs.run_time()) <
tensorflow::proto_utils::FromDurationProto(rhs.run_time());
});
auto best_result = profile_results.begin();
if (!RequireCudnnDeterminism() && !instr->parent()
->parent()
->config()
.debug_options()
.xla_gpu_deterministic_ops()) {
best_result = absl::c_min_element(
profile_results,
[&](const AutotuneResult& lhs, const AutotuneResult& rhs) {
return tensorflow::proto_utils::FromDurationProto(lhs.run_time()) <
tensorflow::proto_utils::FromDurationProto(rhs.run_time());
});
}
if (best_result != profile_results.end()) {
return *best_result;