From 251307db9d080c6309d4ca1bed5e64457c15c3ba Mon Sep 17 00:00:00 2001 From: Darshan Sanghani Date: Mon, 24 Mar 2025 14:01:27 -0700 Subject: [PATCH] Ensure the process id to thread id to node id index is maintained. (#200) Summary: Currently this map is not set since __ROOT_THREAD__ is not a valid node anymore. We can safely read thr pid and tid against a node id and store in this map. Reviewed By: shengfukevin Differential Revision: D71565563 --- et_replay/execution_trace.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/et_replay/execution_trace.py b/et_replay/execution_trace.py index d8eec397..8e24aa2a 100644 --- a/et_replay/execution_trace.py +++ b/et_replay/execution_trace.py @@ -357,8 +357,8 @@ def __init__(self, json): input_tensors = self.nodes[id].get_input_tensors() output_tensors = self.nodes[id].get_output_tensors() - # track the various process and threads we have - if x["name"] == "__ROOT_THREAD__": + # track annonation to get thread ids of root nodes + if x["name"] == "[pytorch|profiler|execution_trace|thread]": tid = self.nodes[id].tid self.proc_group[pid][tid] = id