Get desktop application:
View/edit binary Protocol Buffers messages
////////////////////////////////////////////////////////////////////////////// ProfileAnalysis service provide entry point for profiling TPU and for serving profiled data to TensorBoard through GRPC //////////////////////////////////////////////////////////////////////////////
Enumerate existing sessions and return available profile tools.
Auxiliary error_message.
If success, the returned sessions information are stored here.
Retrieve specific tool's data for specific session.
The place where we will read profile data. We will normally use MODEL_DIR/plugins/profile as the repository root.
Which host the data is associated. if empty, data from all hosts are aggregated.
Which tool
Tool's specific parameters. e.g. TraceViewer's viewport etc
Auxiliary error_message.
Output format. e.g. "json" or "proto" or "blob"
TODO(jiesun): figure out whether to put bytes or oneof tool specific proto.
Starts a profiling session, blocks until it completes. TPUProfileAnalysis service delegate this to TPUProfiler service. Populate the profiled data in repository, then return status to caller.
The place where we will dump profile data. We will normally use MODEL_DIR/plugins/profile as the repository root.
host or host:port, port will be ignored.
Auxiliary error_message.
Whether all hosts had returned a empty trace.
The ProfilerService service retrieves performance information about the programs running on connected devices over a period of time.
Gets a snapshot of an ongoing profiling session.
Optional. Suffix for the snapshot directory sandboxed inside repository_root. E.g. "window_001". If empty, defaults to emit_xpace=true behavior. using the timestamp folder.
Collects profiling data and returns user-friendly metrics.
Next-ID: 4
Duration for which to profile between each update.
Indicates the level at which we want to monitor. Currently, two levels are supported: Level 1: An ultra lightweight mode that captures only some utilization metrics. Level 2: More verbose than level 1. Collects utilization metrics, device information, step time information, etc. Do not use this option if the TPU host is being very heavily used.
True to display timestamp in monitoring result.
Next-ID: 11
Properly formatted string data that can be directly returned back to user.
A collection of monitoring results for each field show in data.
Starts a profiling session, blocks until it completes, and returns data.
Starts a continuous profiling session.
(message has no fields)
Stops an ongoing continuous profiling session.
(message has no fields)
(message has no fields)
Signal to terminate the Profile rpc for a on-going profiling session, The Profile rpc will return successfully and prematurely without timeout. This is used by programmatic mode to end the session in workers.
Which session id to terminate.
(message has no fields)
Next ID: 16
Used in: ,
Some default value of option are not proto3 default value. Use this version to determine if we should use default option value instead of proto3 default value.
Device type to profile/trace: (version >= 1) DeviceType::UNSPECIFIED: All registered device profiler will be enabled. DeviceType::CPU: only CPU will be profiled. DeviceType::GPU: only CPU/GPU will be profiled. DeviceType::TPU: only CPU/TPU will be profiled. DeviceType::PLUGGABLE_DEVICE: only CPU/pluggable devices with profilers will be profiled.
We don't collect the dataset ops by default for better trace-viewer scalability. The caller can manually set this field to include the ops.
Levels of host tracing: (version >= 1) - Level 0 is used to disable host traces. - Level 1 enables tracing of only user instrumented (or default) TraceMe, this is the default. - Level 2 enables tracing of all level 1 TraceMe(s) and instrumented high level program execution details (expensive TF ops, XLA ops, etc). - Level 3 enables tracing of all level 2 TraceMe(s) and more verbose (low-level) program execution details (cheap TF ops, etc).
Levels of device tracing: (version >= 1) - Level 0 is used to disable device traces. - Level 1 is used to enable device traces. - More levels might be defined for specific device for controlling the verbosity of the trace.
Whether enable python function calls tracing. Runtime overhead ensues if enabled. Default off. (version >= 1)
Whether serialize hlo_proto when XLA is used. (version >= 1)
The local profiler starts profiling at this Unix timestamp in nanoseconds.
The local profiler collects `duration_ms` milliseconds of data. If the value is 0, profiling continues until interrupted.
Directory to save profile data to. No-op when empty.
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: advanced_configuration { key: "tpu_trace_mode" value: { int64_value: 2 } }
Identifier of the profiling session. This will be used as the subdirectory under the repository path. If not set, the current timestamp will be used.
If set, this hostname will be used to name the profile file.
AdvancedConfigValue represents the configuration value, it can be one of the following types: string, bool, int64, depending upon the config type.
Used in:
Used in:
Used in:
Filter mask for TraceMe events. If the traceme_filter_mask is set, a TraceMe event will be recorded if it passes the filter. Only lowest 32 bits of the mask are used. The higher 32 bits are reserved and won't be applied if set.
Next-ID: 10
Used as request type in: ProfilerService.Profile, ProfilerService.StartContinuousProfiling
Used as field type in:
In future, the caller will be able to customize when profiling starts and stops. For now, it collects `duration_ms` milliseconds worth of data.
The maximum number of events to return. By default (value 0), return all events.
Required profiling tools name such as "input_pipeline_analyzer" etc
Specifies the requirement for each tools.
Optional profiling options that control how a TF session will be profiled.
The place where we will dump profile data. We will normally use MODEL_DIR/plugins/profile/ as the repository root.
The user provided profile session identifier.
The hostname of system where the profile should happen. We use it as identifier in part of our output filename.
If true, the response will contain the XSpace in the response.
In future, the caller will indicate which TF session is being profiled, and only data relating to that program will be returned. For now, we assume all activity during the profiling period is relevant.
Next-ID: 9
Used as response type in: ProfilerService.GetSnapshot, ProfilerService.Profile
Data payload for each required tools.
When we write profiling data directly to repository directory, we need a way to figure out whether the captured trace is empty.
The XSpace proto containing the raw profiling data (e.g. pre-analysis). This field is only populated if ProfileRequest.emit_xspace is true.
Used in:
Which tool data is available for consumption.
Used in:
The file name which this data is associated (e.g. "input_pipeline.json", "cluster_xxx.memory_viewer.json").
The data payload (likely json) for the specific tool.
Used in:
Type of profiling responses.
Percentage of time when device is idle.
TPU matrix unit utilization percentage.
Average step time in millisecond.
Minimum step time in millisecond.
Maximum step time in millisecond.
Average infeed percentage.
Minimum infeed percentage.
Maximum infeed percentage.
Represents the different types of responses from the profiling service.
Used in:
No result is returned from the profiling service.
Only device utilization is available.
Both device utilization and device idle time are available.
Device utilization, device idle time, step time, and infeed percentage are all available.
Options for remote profiler session manager. Next ID: 6
Options for each local profiler.
List of servers to profile. Supported formats: host:port.
Unix timestamp of when the session was started.
Maximum time (in milliseconds) a profiling session manager waits for all profilers to finish after issuing gRPC request. If value is 0, session continues until interrupted. Otherwise, value must be greater than profiler_options.duration_ms.
Start of profiling is delayed by this much (in milliseconds).
Used in:
Required formats for the tool, it should be one of "json", "proto", "raw" etc. If not specified (backward compatible), use default format, i.e. most tools use json format.
Whether save the result directly to repository or pass it back to caller. Default to false for backward compatibilities.