Skip to content

Commit

Permalink
#9956: Sort correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
mo-tenstorrent committed Oct 28, 2024
1 parent 0f2877f commit c4350df
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
6 changes: 4 additions & 2 deletions models/experimental/functional_unet/tests/test_unet_trace.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ def test_unet_trace(
l1_input_tensor = ttnn.reshard(input_tensor, ttnn_model.input_sharded_memory_config, l1_input_tensor)
ttnn.execute_trace(device, tid, cq_id=0, blocking=False)
outputs.append(output_tensor.cpu(blocking=False))
ttnn.DumpDeviceProfiler(device)
ttnn.synchronize_device(device)
end = time.time()
logger.info(f"Average model performance={iterations * batch / (end-start) : .2f} fps")
Expand Down Expand Up @@ -207,13 +208,14 @@ def test_unet_trace_2cq(

ttnn.execute_trace(device, tid, cq_id=0, blocking=False)
outputs.append(output_tensor.cpu(blocking=False))

ttnn.DumpDeviceProfiler(device)

ttnn.synchronize_device(device)
end = time.time()
logger.info(f"Average model time={1000.0 * (end-start) / iterations : .2f} ms")
logger.info(f"Average model performance={iterations * batch / (end-start) : .2f} fps")

ttnn.DumpDeviceProfiler(device)

logger.info(f"Running sanity check against reference model output")
check_pcc_conv(torch_output_tensor, outputs[-1], UNET_FULL_MODEL_PCC)

Expand Down
11 changes: 3 additions & 8 deletions tt_metal/tools/profiler/process_ops_logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,13 +221,8 @@ def device_ops_compare(op):


def device_log_ops_compare(op):
if (
"timeseries" in op
and len(op["timeseries"]) > 0
and len(op["timeseries"][0]) > 0
and "run_host_id" in op["timeseries"][0][0]
):
return int(op["timeseries"][0][0]["run_host_id"])
if "timeseries" in op and len(op["timeseries"]) > 0 and len(op["timeseries"][0]) > 1:
return int(op["timeseries"][0][1])
else:
return 0

Expand Down Expand Up @@ -316,7 +311,7 @@ def append_device_data(ops, traceReplays, logFolder):
assert (
False
), f"Device data mismatch: Expected {len(deviceOps[device])} but received {len(deviceOpsTime)} ops on device {device}"
for deviceOp, deviceOpTime in zip(deviceOps[device], deviceOpsTime):
for deviceOp, deviceOpTime in zip(devicesOps[device], deviceOpsTime):
cores = set()
for timeID, ts, statData, risc, core in deviceOpTime["timeseries"]:
if "zone_name" in timeID.keys() and "FW" in timeID["zone_name"]:
Expand Down

0 comments on commit c4350df

Please sign in to comment.