1 /* Copyright 2020 The TensorFlow Authors. All Rights Reserved. 2 3 Licensed under the Apache License, Version 2.0 (the "License"); 4 you may not use this file except in compliance with the License. 5 You may obtain a copy of the License at 6 7 http://www.apache.org/licenses/LICENSE-2.0 8 9 Unless required by applicable law or agreed to in writing, software 10 distributed under the License is distributed on an "AS IS" BASIS, 11 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 See the License for the specific language governing permissions and 13 limitations under the License. 14 ==============================================================================*/ 15 #ifndef TENSORFLOW_CORE_TPU_KERNELS_TPU_COMPILE_OP_OPTIONS_H_ 16 #define TENSORFLOW_CORE_TPU_KERNELS_TPU_COMPILE_OP_OPTIONS_H_ 17 18 #include <string> 19 20 namespace tensorflow { 21 namespace internal { 22 23 // Setter and getter that determine how TPUCompile responds to cancelled 24 // compilation. By default this is true, meaning cancelled compilation will 25 // abort the process, since that's the only mechanism we have available. 26 // 27 // Setting this to false allows the process to remain alive, and should only be 28 // used in tests. 29 void SetTpuCompilationCancellationTerminatesProcess(bool b); 30 bool TpuCompilationCancellationTerminatesProcess(); 31 32 // Setter and getter that determine whether TPU compilation failure will cause 33 // chips to close. By default this is true, it is suitable for training. For 34 // inference, we never want servers to die and thus chips will keep alive. 35 // See b/109873767. 36 void SetTpuCompilationFailureClosesChips(bool value); 37 bool TpuCompilationFailureClosesChips(); 38 39 } // namespace internal 40 } // namespace tensorflow 41 42 #endif // TENSORFLOW_CORE_TPU_KERNELS_TPU_COMPILE_OP_OPTIONS_H_ 43