From a1cec7e4420c8720cc48acdbcf61873425288188 Mon Sep 17 00:00:00 2001 From: Henry Tan Date: Wed, 22 Jul 2020 10:14:51 -0700 Subject: [PATCH] Code refactoring and cleanup. PiperOrigin-RevId: 322600036 Change-Id: I27a79a6da45b40f1562c38d0f670bf007b458803 --- tensorflow/core/tpu/kernels/tpu_compile_op_common.cc | 4 +++- tensorflow/core/tpu/kernels/tpu_util.h | 3 --- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/tensorflow/core/tpu/kernels/tpu_compile_op_common.cc b/tensorflow/core/tpu/kernels/tpu_compile_op_common.cc index 43143e5d618..a24aa4cd665 100644 --- a/tensorflow/core/tpu/kernels/tpu_compile_op_common.cc +++ b/tensorflow/core/tpu/kernels/tpu_compile_op_common.cc @@ -390,10 +390,12 @@ Status TpuCompileOpKernelCommon::CompileTFFunctionToHlo( << " seconds to give time for TPUCompileOp to finished."; env->SleepForMicroseconds(kSleepSeconds * 1000000); if (done->load()) { - // If the TPUCompileOp has finished, then terminate peacefully. + // If the TpuCompileOp has finished, then terminate peacefully. return; } + LOG(ERROR) << "Aborting process due to cancelled TpuCompileOp. This " + << "termination is to ensure a consistent state."; std::exit(42); } diff --git a/tensorflow/core/tpu/kernels/tpu_util.h b/tensorflow/core/tpu/kernels/tpu_util.h index 90eef621b95..579fbdf5e85 100644 --- a/tensorflow/core/tpu/kernels/tpu_util.h +++ b/tensorflow/core/tpu/kernels/tpu_util.h @@ -54,9 +54,6 @@ Status DynamicShapesToTensorShapes(const OpInputList& dynamic_shapes, std::vector* shapes); Status DynamicShapesToTensorShapes(const InputList& dynamic_shapes, std::vector* shapes); - -// A callback called on exit. -void LogAndExit(int code); } // namespace tpu } // namespace tensorflow