"//tensorflow/compiler/xla:test",
"//tensorflow/compiler/xla:test_helpers",
"//tensorflow/compiler/xla:xla_data_proto",
+ "//tensorflow/compiler/xla/legacy_flags:debug_options_flags",
"//tensorflow/compiler/xla/service:hlo",
"//tensorflow/compiler/xla/service:hlo_matchers",
"//tensorflow/core:test",
#include <string>
+#include "tensorflow/compiler/xla/legacy_flags/debug_options_flags.h"
#include "tensorflow/compiler/xla/service/hlo_matchers.h"
#include "tensorflow/compiler/xla/service/hlo_module.h"
#include "tensorflow/compiler/xla/shape_util.h"
TF_ASSIGN_OR_RETURN(XlaComputation computation, b->Build());
const HloModuleProto& proto = computation.proto();
TF_ASSIGN_OR_RETURN(const auto& config,
- HloModule::CreateModuleConfigFromProto(proto));
+ HloModule::CreateModuleConfigFromProto(
+ proto, legacy_flags::GetDebugOptionsFromFlags()));
return HloModule::CreateFromProto(proto, config);
}
/* static */
StatusOr<HloModuleConfig> HloModule::CreateModuleConfigFromProto(
- const HloModuleProto& module) {
+ const HloModuleProto& module, const DebugOptions& debug_options) {
TF_RET_CHECK(module.has_program_shape())
<< "No program shape found in the proto";
const auto& program_shape = module.program_shape();
HloModuleConfig module_config(program_shape);
+ module_config.set_debug_options(debug_options);
// The module config is constructed with default layouts regardless of what is
// passed in via the ProgramShape. Set the layouts to the appropriate values.
// Creates and returns an HloModuleConfig with an appropriate program shape
// for the HLO module in the given proto.
static StatusOr<HloModuleConfig> CreateModuleConfigFromProto(
- const HloModuleProto& module);
+ const HloModuleProto& module, const DebugOptions& debug_options);
// Outlines the given expression from the given computation.
// instructions_to_outline contains the instructions that form the expression.
// Creates an HloModule from the given proto.
StatusOr<std::unique_ptr<HloModule>> HloProtoToModule(
const HloProto& proto, const DebugOptions& debug_options) {
- TF_ASSIGN_OR_RETURN(
- HloModuleConfig config,
- HloModule::CreateModuleConfigFromProto(proto.hlo_module()));
- config.set_debug_options(debug_options);
+ TF_ASSIGN_OR_RETURN(HloModuleConfig config,
+ HloModule::CreateModuleConfigFromProto(proto.hlo_module(),
+ debug_options));
TF_ASSIGN_OR_RETURN(auto module,
HloModule::CreateFromProto(proto.hlo_module(), config));
return std::move(module);