Skip to content

Commit 17e2fdb

Browse files
committed
Fix NIXL bench output parsing in case of noisy output
1 parent c2f709f commit 17e2fdb

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

src/cloudai/workloads/common/nixl.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,13 @@ def extract_nixlbench_data(stdout_file: Path) -> pd.DataFrame:
127127
continue
128128
parts = line.split()
129129
if header_present and (len(parts) == 6 or len(parts) == 10):
130+
try:
131+
int(parts[0]) # block size
132+
int(parts[1]) # batch size
133+
except ValueError:
134+
# doesn't look like a data line, skip
135+
continue
136+
130137
if len(parts) == 6:
131138
data.append([parts[0], parts[1], parts[2], parts[-1]])
132139
else:

tests/report_generation_strategy/test_nixl_bench_report.py

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,41 @@ def test_nixl_bench_report_parsing(tmp_path: Path, sample: str, exp_latency: lis
7575
assert df["bw_gb_sec"].tolist() == exp_bw
7676

7777

78+
def test_nixlbench_report_parsing__noisy_output(tmp_path: Path):
79+
sample = """
80+
----------------------------------------------------------------------------------------------------------------------------------------------------------------
81+
82+
Block Size (B) Batch Size B/W (GB/Sec) Avg Lat. (us) Avg Prep (us) P99 Prep (us) Avg Post (us) P99 Post (us) Avg Tx (us) P99 Tx (us)
83+
----------------------------------------------------------------------------------------------------------------------------------------------------------------
84+
[1757492049.543051] [ptyche0321:627036:0] +--------------------------------+---------------------------------------------------------+
85+
[1757492049.543052] [ptyche0321:627036:0] | ucp_context_0 intra-node cfg#2 | active message by ucp_am_send*(egr) from host memory |
86+
[1757492049.543053] [ptyche0321:627036:0] +--------------------------------+-------------------------------------+-------------------+
87+
[1757492049.543053] [ptyche0321:627036:0] | 0..8184 | short | tcp/enP6p3s0f1np1 |
88+
[1757492049.543053] [ptyche0321:627036:0] | 8185..inf | multi-frag copy-in | tcp/enP6p3s0f1np1 |
89+
[1757492049.543054] [ptyche0321:627036:0] +--------------------------------+-------------------------------------+-------------------+
90+
4096 1 0.198413 20.6 13.0 13.0 10.6 16.0 10.1 14.0
91+
8192 1 0.381410 21.5 9.0 9.0 10.9 17.0 10.6 15.0
92+
16384 1 0.786957 20.8 7.0 7.0 10.5 15.0 10.3 16.0
93+
32768 1 1.580617 20.7 8.0 8.0 10.6 13.0 10.1 15.0
94+
65536 1 3.151882 20.8 6.0 6.0 10.5 16.0 10.3 15.0
95+
131072 1 6.133162 21.4 6.0 6.0 10.9 14.0 10.5 16.0
96+
262144 1 12.458916 21.0 12.0 12.0 10.6 16.0 10.4 15.0
97+
524288 1 24.594299 21.3 7.0 7.0 10.8 15.0 10.5 14.0
98+
1048576 1 49.639065 21.1 6.0 6.0 10.6 16.0 10.5 13.0
99+
2097152 1 90.493545 23.2 6.0 6.0 12.0 40.0 11.0 13.0
100+
4194304 1 184.397175 22.7 6.0 6.0 11.5 38.0 11.1 19.0
101+
8388608 1 367.256639 22.8 6.0 6.0 10.8 39.0 11.9 22.0
102+
16777216 1 681.912650 24.6 5.0 5.0 11.4 40.0 13.1 17.0
103+
33554432 1 1205.204798 27.8 6.0 6.0 11.3 40.0 16.3 18.0
104+
67108864 1 1636.801561 41.0 5.0 5.0 11.7 36.0 29.2 38.0
105+
[1757492049.615857] [ptyche0321:627915:0] | 8177..inf | multi-frag copy-in | tcp/enP6p3s0f1np1 |
106+
[1757492049.615862] [ptyche0321:627915:0] +--------------------------------+-------------------------------------------------------+-------------------+
107+
"""
108+
(tmp_path / "stdout.txt").write_text(sample)
109+
df = extract_nixlbench_data(tmp_path / "stdout.txt")
110+
assert df.shape == (15, 4)
111+
112+
78113
class TestWasRunSuccessful:
79114
def test_no_file(self, nixl_tr: TestRun):
80115
assert not nixl_tr.test.test_definition.was_run_successful(nixl_tr).is_successful

0 commit comments

Comments
 (0)