From b7d698f08d909ec03623a1aa6032c45f73de2d09 Mon Sep 17 00:00:00 2001 From: "A. Unique TensorFlower" Date: Mon, 29 Sep 2025 11:15:33 -0700 Subject: [PATCH] Creating UI options for trace mode when capturing profiles using sampling mode PiperOrigin-RevId: 812867750 --- tsl/profiler/protobuf/BUILD | 7 +++++++ tsl/profiler/protobuf/profiler_options.proto | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/tsl/profiler/protobuf/BUILD b/tsl/profiler/protobuf/BUILD index f127cb1f3..153d705b1 100644 --- a/tsl/profiler/protobuf/BUILD +++ b/tsl/profiler/protobuf/BUILD @@ -3,6 +3,7 @@ # Placeholder: load py_proto_library load("@xla//xla/tsl:tsl.bzl", "internal_visibility") load("@xla//xla/tsl/platform:build_config.bzl", "tf_proto_library") +load("//tools/build_defs/js/jspb_proto_library:rules.bzl", "jspb_proto_library") # copybara:uncomment package(default_applicable_licenses = ["//tensorflow:license"]) @@ -37,6 +38,12 @@ tf_proto_library( visibility = ["//visibility:public"], ) +jspb_proto_library( + name = "profiler_options_jspb_proto", + visibility = ["//visibility:public"], + deps = [":profiler_options_proto"], +) + tf_proto_library( name = "profiler_service_monitor_result_proto", srcs = ["profiler_service_monitor_result.proto"], diff --git a/tsl/profiler/protobuf/profiler_options.proto b/tsl/profiler/protobuf/profiler_options.proto index 04c46af2d..7e66b0938 100644 --- a/tsl/profiler/protobuf/profiler_options.proto +++ b/tsl/profiler/protobuf/profiler_options.proto @@ -84,6 +84,13 @@ message ProfileOptions { } } + enum TraceMode { + TRACE_ONLY_HOST = 0; + TRACE_ONLY_XLA = 1; + TRACE_COMPUTE = 2; + TRACE_COMPUTE_AND_SYNC = 3; + } + // Advanced configuration for the profiler contains a map of config name to // config value. It gives the flexibility to pass any configuration to the // profiler. eg: