| 112 | }; |
| 113 | |
| 114 | StatusOr<std::unique_ptr<LocalExecutable>> CompileExecutable( |
| 115 | const HloSnapshot& module, LocalClient* client) { |
| 116 | XlaComputation computation(module.hlo().hlo_module()); |
| 117 | std::vector<Shape> argument_layouts; |
| 118 | argument_layouts.reserve( |
| 119 | computation.proto().host_program_shape().parameters_size()); |
| 120 | std::vector<const Shape*> argument_layout_ptrs; |
| 121 | for (const ShapeProto& param : |
| 122 | computation.proto().host_program_shape().parameters()) { |
| 123 | argument_layouts.push_back(Shape(param)); |
| 124 | argument_layout_ptrs.push_back(&argument_layouts.back()); |
| 125 | } |
| 126 | ExecutableBuildOptions exec_build_options; |
| 127 | *exec_build_options.mutable_debug_options() = GetDebugOptionsFromFlags(); |
| 128 | TF_ASSIGN_OR_RETURN( |
| 129 | auto executables, |
| 130 | client->Compile(computation, argument_layout_ptrs, exec_build_options)); |
| 131 | TF_RET_CHECK(executables.size() == 1); |
| 132 | return std::move(executables[0]); |
| 133 | } |
| 134 | |
| 135 | absl::optional<Shape> GetXfeedShape(bool is_infeed, |
| 136 | const HloModuleProto& module, |
no test coverage detected