Generalize topology graph and device type.
PiperOrigin-RevId: 336800957 Change-Id: I74418d685e0c23794caf513b997da046c60707e9
This commit is contained in:
parent
d33ae4ffe8
commit
66c99931b6
@ -48,6 +48,7 @@ PodStatsSequence ConvertOpStatsToPodStatsSequence(const OpStats& op_stats,
|
||||
|
||||
PodViewerDatabase ConvertOpStatsToPodViewer(const OpStats& op_stats) {
|
||||
PodViewerDatabase database;
|
||||
database.set_device_type(op_stats.run_environment().device_type());
|
||||
PodStatsDatabase pod_stats = ConvertOpStatsToPodStats(op_stats);
|
||||
database.mutable_step_breakdown_events()->Swap(
|
||||
pod_stats.mutable_step_breakdown_events());
|
||||
|
@ -125,6 +125,13 @@ TEST(OpStatsToPodViewer, Diagnostics) {
|
||||
EXPECT_EQ(kErrorIncompleteStep, pod_viewer_db.diagnostics().warnings(0));
|
||||
}
|
||||
|
||||
TEST(OpStatsToPodViewer, DeviceType) {
|
||||
OpStats op_stats;
|
||||
op_stats.mutable_run_environment()->set_device_type("GPU");
|
||||
PodViewerDatabase pod_viewer_db = ConvertOpStatsToPodViewer(op_stats);
|
||||
EXPECT_EQ("GPU", pod_viewer_db.device_type());
|
||||
}
|
||||
|
||||
} // namespace
|
||||
} // namespace profiler
|
||||
} // namespace tensorflow
|
||||
|
@ -82,7 +82,6 @@ tf_proto_library(
|
||||
protodeps = [
|
||||
":diagnostics_proto",
|
||||
":pod_stats_proto",
|
||||
":op_stats_proto",
|
||||
],
|
||||
visibility = [":friends"],
|
||||
)
|
||||
|
@ -5,7 +5,6 @@ syntax = "proto3";
|
||||
package tensorflow.profiler;
|
||||
|
||||
import "tensorflow/core/profiler/protobuf/diagnostics.proto";
|
||||
import "tensorflow/core/profiler/protobuf/op_stats.proto";
|
||||
import "tensorflow/core/profiler/protobuf/pod_stats.proto";
|
||||
|
||||
// Describes the replica groups in a cross replica op (e.g., all-reduce and
|
||||
@ -82,31 +81,45 @@ message ChannelInfo {
|
||||
reserved 2, 3, 10;
|
||||
}
|
||||
|
||||
// Run environment of the job.
|
||||
message PodViewerRunEnvironment {
|
||||
// The type of TPU used.
|
||||
string tpu_type = 1;
|
||||
// Pod system topology.
|
||||
SystemTopology topology = 2;
|
||||
}
|
||||
|
||||
message PodViewerSummary {
|
||||
repeated string warnings = 1;
|
||||
}
|
||||
|
||||
// Next ID: 10
|
||||
// Next ID: 8
|
||||
// Topology graph draws all the cores in the system in a 2-D rectangle or
|
||||
// 3-D cube. It is hierarchically grouped by host, chip and core.
|
||||
message PodViewerTopology {
|
||||
// Number of cores in the x dimension of the rectangle/cube.
|
||||
int32 x_dimension = 1;
|
||||
// Number of cores in the y dimension of the rectangle/cube.
|
||||
int32 y_dimension = 2;
|
||||
// Number of cores in the z dimension of the cube.
|
||||
int32 z_dimension = 3;
|
||||
// Number of cores in the x dimension of each host.
|
||||
int32 host_x_stride = 4;
|
||||
// Number of cores in the y dimension of each host.
|
||||
int32 host_y_stride = 5;
|
||||
// Number of cores in the z dimension of each host.
|
||||
int32 host_z_stride = 6;
|
||||
// Number of cores per chip.
|
||||
int32 num_cores_per_chip = 7;
|
||||
}
|
||||
|
||||
// Next ID: 12
|
||||
// A database of pod viewer records.
|
||||
message PodViewerDatabase {
|
||||
// The type of device used.
|
||||
string device_type = 10;
|
||||
// Pod level stats for each step.
|
||||
PodStatsSequence pod_stats_sequence = 3;
|
||||
// Job run environment, including number of hosts used, device type, etc.
|
||||
PodViewerRunEnvironment run_environment = 6;
|
||||
// Top level summary of pod viewer.
|
||||
PodViewerSummary summary = 7;
|
||||
// Error and warning messages for diagnosing profiling issues.
|
||||
Diagnostics diagnostics = 8;
|
||||
// A map from event type number to event name string for step breakdown.
|
||||
repeated StepBreakdownEvents step_breakdown_events = 9;
|
||||
// Info to draw the topology graph.
|
||||
PodViewerTopology topology = 11;
|
||||
|
||||
reserved 1, 2, 4, 5;
|
||||
reserved 1, 2, 4, 5, 6;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user