Skip to content

Commit

Permalink
#9956: Fix non-trace device ops
Browse files Browse the repository at this point in the history
  • Loading branch information
mo-tenstorrent committed Oct 29, 2024
1 parent c4350df commit d1f1e2c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tt_metal/tools/profiler/process_ops_logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,15 +328,19 @@ def append_device_data(ops, traceReplays, logFolder):
for analysis, data in deviceOp["device_time"].items():
for sample in data:
sample["duration_ns"] = sample["duration_cycles"] * 1000 / freq

traceOps = {}

# Tag trace ops with a UID
for device in devicesOps:
for deviceOp in devicesOps[device]:
if "trace_runtime_id" in deviceOp.keys():
deviceOp["global_call_count"] = (
deviceOp["global_call_count"] | deviceOp["trace_runtime_id"] << 16
)
traceOps[deviceOp["global_call_count"]] = deviceOp
else:
# Update host reported device op with device populated version
ops[deviceOp["global_call_count"]] = deviceOp
return devicesOps, traceOps


Expand Down Expand Up @@ -539,7 +543,7 @@ def row_compare(row):
if row > ((1 << 16) - 1):
ret = traceOps[row]["tracy_time"]
else:
ret = ops[row]["tracy_time"]
ret = ops[row]["host_time"]["ns_since_start"]
ret = int(ret)
return ret

Expand Down

0 comments on commit d1f1e2c

Please sign in to comment.