Skip to content

Commit

Permalink
#14406: Fix BW computation
Browse files Browse the repository at this point in the history
  • Loading branch information
Aswinmcw committed Nov 8, 2024
1 parent 3ba4c54 commit fefe768
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
9 changes: 5 additions & 4 deletions tests/ttnn/unit_tests/operations/ccl/perf/perf_csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def perf_report(file_path):

df = df.dropna(subset=["DEVICE ERISC KERNEL DURATION [ns]"])
df = df[df["OP TO OP LATENCY [ns]"] != 0]
df = df[df["TRACE ID"].notna() & (df["TRACE ID"] != "")]
df = df[df["METAL TRACE ID"].notna() & (df["METAL TRACE ID"] != "")]

def remove_keys_from_attributes(attributes):
attributes = attributes.replace(";", ",").replace("'", '"')
Expand Down Expand Up @@ -156,15 +156,15 @@ def calculate_bandwidth(row):
op_bw = (output_tensor_volume * (n_chips - 1) / n_chips) / longest_device_fw_time
link_bw = (output_tensor_volume * (n_chips - 1) / n_chips) / longest_erisc_fw_time
elif row["OP CODE"] == "ReduceScatter":
op_bw = (input_tensor_volume / n_chips) / longest_device_fw_time
link_bw = (input_tensor_volume * (n_chips - 1) / n_chips) / longest_erisc_fw_time
op_bw = input_tensor_volume / longest_device_fw_time
link_bw = input_tensor_volume / longest_erisc_fw_time
elif row["topology"] == "Linear":
if row["OP CODE"] == "AllGather":
op_bw = input_tensor_volume * n_chips / longest_device_fw_time
link_bw = input_tensor_volume * (n_chips - 1) / longest_erisc_fw_time
elif row["OP CODE"] == "ReduceScatter":
op_bw = input_tensor_volume / longest_device_fw_time
link_bw = input_tensor_volume * (n_chips - 1) / n_chips / longest_erisc_fw_time
link_bw = input_tensor_volume / longest_erisc_fw_time
return round(op_bw, 2), round(link_bw, 2)

for i, (group, group_df) in enumerate(grouped, start=1):
Expand Down Expand Up @@ -196,6 +196,7 @@ def calculate_bandwidth(row):
"output_mem_config": group_df["output_mem_config"].iloc[0] if "output_mem_config" in group_df else "",
"topology": group_df["topology"].iloc[0],
"Layout": group_df["Layout"].iloc[0] if "Layout" in group_df else "",
"Data Type": group_df["Data Type"].iloc[0] if "Data Type" in group_df else "",
}

for column in numeric_columns:
Expand Down
1 change: 0 additions & 1 deletion tests/ttnn/unit_tests/operations/ccl/perf/test_ccl_perf.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@ def test_all_gather_on_t3000(
"input_dtype",
[
ttnn.bfloat16,
# ttnn.bfloat8_b,
],
)
@pytest.mark.parametrize(
Expand Down

0 comments on commit fefe768

Please sign in to comment.