1 /* Copyright 2018 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 16 #include "tensorflow/compiler/xla/service/despecializer.h" 17 18 #include "tensorflow/compiler/xla/service/bfloat16_normalization.h" 19 #include "tensorflow/compiler/xla/service/defuser.h" 20 #include "tensorflow/compiler/xla/service/hlo_memory_scheduler.h" 21 22 namespace xla { 23 Despecializer()24Despecializer::Despecializer() : pipeline_("despecializer") { 25 // TODO(b/70588125): Also deal with window reversal in a fast way. 26 pipeline_.AddPass<HloDescheduler>(); 27 pipeline_.AddPass<ControlDepRemover>(); 28 pipeline_.AddPass<Defuser>(); 29 pipeline_.AddPass<BFloat16MixedPrecisionRemoval>(); 30 } 31 Run(HloModule * module,const absl::flat_hash_set<absl::string_view> & execution_threads)32StatusOr<bool> Despecializer::Run( 33 HloModule* module, 34 const absl::flat_hash_set<absl::string_view>& execution_threads) { 35 return pipeline_.Run(module, execution_threads); 36 } 37 38 } // namespace xla 39