tensorflow / profiler

A profiling and performance analysis tool for TensorFlow

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

What are pid and tid in profile json file ?

whatdhack opened this issue · comments

Hi, wondering if anyone can shed light on what exactly are the pid and tid in a TF profile json file ? In an all CPU environment (e.g. no GPUs) , do pid and tid correspond to a process and a pthread respectively ? If so, how are they then mapped to the cores of a multi-core CPU ?

pid and tid are defined to be the process ID and thread ID by the Catapult trace event format:
https://docs.google.com/document/d/1CvAClvFfyA5R-PhYUmn5OOQtYMH4h6I0nSsKchNAySU/preview

In the TF profiler, TID is a platform-dependent logical thread id returned by tensorflow::Env::GetCurrentThreadId():
https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/platform/env.h

In the TF profiler, PID does not correspond to any actual process. There is an arbitrary PID assigned to all CPU threads and one PID for each GPU.

The mapping to physical cores in a multi-core CPU is not captured.