Skip to content

Commit f531d89

Browse files
committed
Add bandwidth metric
1 parent 03d2fd1 commit f531d89

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

benchmark/kvbench/test/sequential_custom_traffic_perftest.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,19 +300,31 @@ def run(
300300
else:
301301
tp_latencies_ms.append((max(ends) - min(starts)) * 1e3)
302302

303+
mean_bw = 0
304+
for rank in tp.senders_ranks():
305+
rank_start = tp_starts_by_ranks[rank][i]
306+
rank_end = tp_ends_by_ranks[rank][i]
307+
if not rank_start or not rank_end:
308+
raise ValueError(f"Rank {rank} has no start or end time, but participated in TP, this is not normal.")
309+
mean_bw += tp.total_src_size(rank)*1e-9 / (rank_end - rank_start)
310+
311+
mean_bw /= len(tp.senders_ranks())
312+
303313
if self.my_rank == 0:
304314
headers = [
305315
"Transfer size (GB)",
306316
"Latency (ms)",
307317
"Isolated Latency (ms)",
308318
"Num Senders",
319+
"Mean BW (GB/s)", # Bandwidth
309320
]
310321
data = [
311322
[
312323
tp_sizes_gb[i],
313324
tp_latencies_ms[i],
314325
isolated_tp_latencies_ms[i],
315326
len(tp.senders_ranks()),
327+
mean_bw,
316328
]
317329
for i, tp in enumerate(self.traffic_patterns)
318330
]
@@ -332,6 +344,7 @@ def run(
332344
"latency": tp_latencies_ms[i],
333345
"isolated_latency": isolated_tp_latencies_ms[i],
334346
"num_senders": len(tp.senders_ranks()),
347+
"mean_bw": mean_bw,
335348
"min_start_ts": min(
336349
filter(
337350
None,

0 commit comments

Comments
 (0)