Minor changes on dumping utils.
PiperOrigin-RevId: 363030369
Change-Id: I25e51ff142d6b25410eb388e83fc8f360a87a7ae
diff --git a/tensorflow/compiler/xla/service/dump.cc b/tensorflow/compiler/xla/service/dump.cc
index 6cf176d..1c061fb 100644
--- a/tensorflow/compiler/xla/service/dump.cc
+++ b/tensorflow/compiler/xla/service/dump.cc
@@ -356,11 +356,12 @@
return module_id_to_step_number[module.unique_id()]++;
}
+} // namespace
+
// Get a timestamp which we can use as a filename prefix specific to this
// module.
-string TimestampFor(const HloModule& module,
- const DebugOptions& debug_options) {
- if (!debug_options.xla_dump_include_timestamp()) {
+string TimestampFor(const HloModule& module) {
+ if (!module.config().debug_options().xla_dump_include_timestamp()) {
return "";
}
tensorflow::mutex_lock lock(mu);
@@ -369,12 +370,6 @@
return std::to_string(timestamp_emplace.first->second);
}
-string TimestampFor(const HloModule& module) {
- return TimestampFor(module, module.config().debug_options());
-}
-
-} // namespace
-
string FilenameFor(const HloModule& module, string_view prefix,
string_view suffix) {
return StrFormat("%s%smodule_%04d.%s", prefix, prefix.empty() ? "" : ".",
@@ -424,19 +419,14 @@
}
}
-void DumpHloModuleIfEnabled(const HloModule& module, string_view name,
- const DebugOptions& debug_options) {
- CanonicalDebugOptions opts(debug_options);
+void DumpHloModuleIfEnabled(const HloModule& module, string_view name) {
+ CanonicalDebugOptions opts(module.config().debug_options());
if (opts.should_dump_module(module.name())) {
DumpHloModuleImpl(module, /*buffer_assn=*/nullptr, /*profile=*/nullptr,
- TimestampFor(module, debug_options), name, opts);
+ TimestampFor(module), name, opts);
}
}
-void DumpHloModuleIfEnabled(const HloModule& module, string_view name) {
- DumpHloModuleIfEnabled(module, name, module.config().debug_options());
-}
-
void DumpHloModuleIfEnabled(const HloModule& module,
const BufferAssignment& buffer_assn,
string_view name) {
diff --git a/tensorflow/compiler/xla/service/dump.h b/tensorflow/compiler/xla/service/dump.h
index 0818156..34befcd 100644
--- a/tensorflow/compiler/xla/service/dump.h
+++ b/tensorflow/compiler/xla/service/dump.h
@@ -33,6 +33,10 @@
class HloExecutionProfile;
class HloSnapshot;
+// Get a timestamp which we can use as a filename prefix specific to this
+// module.
+string TimestampFor(const HloModule& module);
+
// Create the filename we will use to dump in DumpToFileInDir.
string FilenameFor(const HloModule& module, absl::string_view prefix,
absl::string_view suffix);
@@ -69,9 +73,6 @@
void DumpHloModuleIfEnabled(const HloModule& module,
const HloExecutionProfile& profile,
absl::string_view name);
-// Checks provided debug_options instead of the one from module's config.
-void DumpHloModuleIfEnabled(const HloModule& module, absl::string_view name,
- const DebugOptions& debug_options);
// Dumps the given HLO module after running one HLO pass and before running
// another, if that's enabled. Returns the full file paths of all dumps of the