Add more details to the invoke call trace.
It is always useful information to know if the TPU invoke is Async or not, and if the GPU invoke on the old path or new path. This can make it obvious in the perfetto trace. PiperOrigin-RevId: 517162515
This commit is contained in:
parent
3b66ac0623
commit
a9e956baa1
|
@ -141,7 +141,7 @@ InferenceCalculatorGlAdvancedImpl::GpuInferenceRunner::Process(
|
|||
}
|
||||
// Run inference.
|
||||
{
|
||||
MEDIAPIPE_PROFILING(GPU_TASK_INVOKE, cc);
|
||||
MEDIAPIPE_PROFILING(GPU_TASK_INVOKE_ADVANCED, cc);
|
||||
return tflite_gpu_runner_->Invoke();
|
||||
}
|
||||
}));
|
||||
|
|
|
@ -136,6 +136,8 @@ message GraphTrace {
|
|||
GPU_TASK_INVOKE = 16;
|
||||
TPU_TASK_INVOKE = 17;
|
||||
CPU_TASK_INVOKE = 18;
|
||||
GPU_TASK_INVOKE_ADVANCED = 19;
|
||||
TPU_TASK_INVOKE_ASYNC = 20;
|
||||
}
|
||||
|
||||
// The timing for one packet set being processed at one caclulator node.
|
||||
|
|
|
@ -112,6 +112,10 @@ struct TraceEvent {
|
|||
static constexpr EventType GPU_TASK_INVOKE = GraphTrace::GPU_TASK_INVOKE;
|
||||
static constexpr EventType TPU_TASK_INVOKE = GraphTrace::TPU_TASK_INVOKE;
|
||||
static constexpr EventType CPU_TASK_INVOKE = GraphTrace::CPU_TASK_INVOKE;
|
||||
static constexpr EventType GPU_TASK_INVOKE_ADVANCED =
|
||||
GraphTrace::GPU_TASK_INVOKE_ADVANCED;
|
||||
static constexpr EventType TPU_TASK_INVOKE_ASYNC =
|
||||
GraphTrace::TPU_TASK_INVOKE_ASYNC;
|
||||
};
|
||||
|
||||
// Packet trace log buffer.
|
||||
|
|
|
@ -57,7 +57,6 @@ struct hash<mediapipe::TaskId> {
|
|||
namespace mediapipe {
|
||||
|
||||
namespace {
|
||||
|
||||
void BasicTraceEventTypes(TraceEventRegistry* result) {
|
||||
// The initializer arguments below are: event_type, description,
|
||||
// is_packet_event, is_stream_event, id_event_data.
|
||||
|
@ -84,6 +83,15 @@ void BasicTraceEventTypes(TraceEventRegistry* result) {
|
|||
"A time measured by GPU clock and by CPU clock.", true, false},
|
||||
{TraceEvent::PACKET_QUEUED, "An input queue size when a packet arrives.",
|
||||
true, true, false},
|
||||
|
||||
{TraceEvent::GPU_TASK_INVOKE, "CPU timing for initiating a GPU task."},
|
||||
{TraceEvent::TPU_TASK_INVOKE, "CPU timing for initiating a TPU task."},
|
||||
{TraceEvent::CPU_TASK_INVOKE, "CPU timing for initiating a CPU task."},
|
||||
{TraceEvent::GPU_TASK_INVOKE_ADVANCED,
|
||||
"CPU timing for initiating a GPU task bypassing the TFLite "
|
||||
"interpreter."},
|
||||
{TraceEvent::TPU_TASK_INVOKE_ASYNC,
|
||||
"CPU timing for async initiation of a TPU task."},
|
||||
};
|
||||
for (const TraceEventType& t : basic_types) {
|
||||
(*result)[t.event_type()] = t;
|
||||
|
|
Loading…
Reference in New Issue
Block a user