mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-07 12:21:27 +01:00
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/26677 This diff adds OpProfile proto into ProfDAGProtos to support storing operation cost. During performance estimation idx, net_name, type, and exec_time will be stored in this proto. Test Plan: ``` buck test caffe2/caffe2/fb/net_transforms/tests/:stats_collector_test buck test caffe2/caffe2/fb/net_transforms/tests/:perf_estimator_test buck run caffe2/caffe2/fb/distribute/snntest/cogwheel/:cogwheel_snntest_offline_training_simple_online_training ``` Reviewed By: heslami Differential Revision: D17533791 fbshipit-source-id: a339c8eadcac891aa631daaf64522b69876b5045
70 lines
2.1 KiB
Protocol Buffer
70 lines
2.1 KiB
Protocol Buffer
syntax = "proto2";
|
|
|
|
package caffe2;
|
|
|
|
// A few notes about the Caffe2's protobuffer convention:
|
|
// (1) Most objects are registered by their types, such as operators and nets.
|
|
// For these, we have a string-type field "type" for registration purposes.
|
|
// (2) We do not use extension because that used to create quite some conflicts
|
|
// in Caffe's protobuf design.
|
|
// (3) We have not used any proto3 specific features, such as Any or Map. This
|
|
// is mainly for backward compatibility purposes but we may consider using
|
|
// those in the future.
|
|
|
|
// A two number summary for a value. It also has count for restoring.
|
|
message TwoNumberStatsProto {
|
|
optional float mean = 1;
|
|
optional float stddev = 2;
|
|
optional int64 count = 3;
|
|
}
|
|
|
|
// Blob profiling information. Profile for a blob is created every time
|
|
// a node outputs to the blob.
|
|
message BlobProfile {
|
|
// Name of the blob (corresponds to OperatorDef.output).
|
|
optional string name = 1; // required
|
|
|
|
// Profiling statistics.
|
|
optional TwoNumberStatsProto bytes_used = 3;
|
|
}
|
|
|
|
// Protobuf format to serialize profiler data.
|
|
message ProfDAGProto {
|
|
// The name for the operator
|
|
required string name = 1;
|
|
// The mean execution time
|
|
required float mean = 2;
|
|
// The standard deviation
|
|
required float stddev = 3;
|
|
|
|
// New field to represent the numbers above, and with count.
|
|
optional TwoNumberStatsProto execution_time = 4;
|
|
|
|
// Blob profiles that this node outputs.
|
|
repeated BlobProfile output_profile = 5;
|
|
|
|
// The extra_info from the operator device option.
|
|
repeated string extra_info = 7;
|
|
|
|
}
|
|
|
|
// Operator profiling information.
|
|
//
|
|
// Note: The indices for elements of 'stats' and the indices of
|
|
// 'output_profile' inside each 'stats' are assumed to match the
|
|
// indices of 'op' elements of a corresponding NetDef and the 'output'
|
|
// indices within each 'op'.
|
|
message ProfDAGProtos {
|
|
repeated ProfDAGProto stats = 1;
|
|
optional string net_name = 2;
|
|
repeated OpProfile ops_stats = 3;
|
|
}
|
|
|
|
// Represents specification of an operation cost.
|
|
message OpProfile {
|
|
optional string idx = 1;
|
|
optional string net_name = 2;
|
|
optional string type = 3;
|
|
optional float exec_time_secs = 4;
|
|
}
|