| diff --git a/plugin/xprof/protobuf/BUILD b/plugin/xprof/protobuf/BUILD |
| --- a/plugin/xprof/protobuf/BUILD |
| +++ b/plugin/xprof/protobuf/BUILD |
| @@ -1,7 +1,6 @@ |
| # Description: |
| # Protobufs used by TensorBoard profile plugin. |
| |
| -load("@com_google_protobuf//:protobuf.bzl", "py_proto_library") |
| load("@xla//xla/tsl/platform:build_config.bzl", xprof_proto_library = "tf_proto_library") |
| |
| package( |
| diff --git a/xprof/convert/hlo_to_tools_data.cc b/xprof/convert/hlo_to_tools_data.cc |
| --- a/xprof/convert/hlo_to_tools_data.cc |
| +++ b/xprof/convert/hlo_to_tools_data.cc |
| @@ -62,7 +62,7 @@ absl::StatusOr<std::string> ConvertHloProtoToMemoryViewer( |
| |
| std::string json_output; |
| tsl::protobuf::util::JsonPrintOptions options; |
| - options.always_print_primitive_fields = true; |
| + options.always_print_fields_with_no_presence = true; |
| auto encoded_status = tsl::protobuf::util::MessageToJsonString( |
| result_or.value(), &json_output, options); |
| if (!encoded_status.ok()) { |
| diff --git a/xprof/convert/xplane_to_memory_profile.cc b/xprof/convert/xplane_to_memory_profile.cc |
| --- a/xprof/convert/xplane_to_memory_profile.cc |
| +++ b/xprof/convert/xplane_to_memory_profile.cc |
| @@ -533,7 +533,7 @@ template <typename Proto> |
| absl::Status ConvertProtoToJson(const Proto& proto_output, |
| std::string* json_output) { |
| tsl::protobuf::util::JsonPrintOptions json_options; |
| - json_options.always_print_primitive_fields = true; |
| + json_options.always_print_fields_with_no_presence = true; |
| auto status = tsl::protobuf::util::MessageToJsonString( |
| proto_output, json_output, json_options); |
| if (!status.ok()) { |
| diff --git a/xprof/convert/xplane_to_tools_data.cc b/xprof/convert/xplane_to_tools_data.cc |
| --- a/xprof/convert/xplane_to_tools_data.cc |
| +++ b/xprof/convert/xplane_to_tools_data.cc |
| @@ -248,7 +248,7 @@ absl::StatusOr<std::string> ConvertMultiXSpacesToPodViewer( |
| |
| std::string json_output; |
| tsl::protobuf::util::JsonPrintOptions opts; |
| - opts.always_print_primitive_fields = true; |
| + opts.always_print_fields_with_no_presence = true; |
| auto encode_status = tsl::protobuf::util::MessageToJsonString( |
| ConvertOpStatsToPodViewer(combined_op_stats), &json_output, opts); |
| if (!encode_status.ok()) { |
| @@ -325,7 +325,7 @@ absl::StatusOr<std::string> ConvertMultiXSpacesToOpProfileViewer( |
| profile); |
| std::string json_output; |
| tsl::protobuf::util::JsonPrintOptions opts; |
| - opts.always_print_primitive_fields = true; |
| + opts.always_print_fields_with_no_presence = true; |
| |
| auto encode_status = |
| tsl::protobuf::util::MessageToJsonString(profile, &json_output, opts); |
| diff --git a/xprof/convert/trace_viewer/trace_events.cc b/xprof/convert/trace_viewer/trace_events.cc |
| --- a/xprof/convert/trace_viewer/trace_events.cc |
| +++ b/xprof/convert/trace_viewer/trace_events.cc |
| @@ -38,9 +38,7 @@ limitations under the License. |
| #include "xla/tsl/platform/env.h" |
| #include "xla/tsl/platform/errors.h" |
| #include "xla/tsl/platform/file_system.h" |
| -#include "xla/tsl/platform/macros.h" |
| #include "xla/tsl/profiler/utils/timespan.h" |
| -#include "xla/tsl/platform/types.h" |
| #include "xprof/convert/trace_viewer/trace_events_filter_interface.h" |
| #include "xprof/convert/trace_viewer/trace_events_util.h" |
| #include "xprof/convert/trace_viewer/trace_viewer_visibility.h" |
| @@ -49,7 +47,6 @@ limitations under the License. |
| |
| namespace tensorflow { |
| namespace profiler { |
| -using tsl::kint64max; |
| |
| namespace { |
| |
| @@ -137,7 +134,7 @@ std::pair<uint64_t, uint64_t> GetLevelBoundsForDuration(uint64_t duration_ps) { |
| for (; i < NumLevels(); ++i) { |
| if (duration_ps > kLayerResolutions[i]) { |
| if (i == 0) { |
| - return std::make_pair(kLayerResolutions[i], kint64max); |
| + return std::make_pair(kLayerResolutions[i], std::numeric_limits<int64_t>::max()); |
| } else { |
| return std::make_pair(kLayerResolutions[i], kLayerResolutions[i - 1]); |
| } |