Skip to content

Commit cddaed7

Browse files
committed
update mig tests
Signed-off-by: Xin He (SW-GPU) <[email protected]>
1 parent 4080006 commit cddaed7

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

tests/integration/defs/test_e2e.py

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -588,15 +588,17 @@ def parse_benchmark_output(self, output):
588588
throughput = line.split(":")[1].strip()
589589
result['throughput'] = throughput
590590
except (IndexError, ValueError) as e:
591-
print(f"Failed to parse throughput from line: {line}. Error: {e}")
592-
pass
591+
print(
592+
f"Failed to parse throughput from line: {line}. Error: {e}"
593+
)
593594
elif 'total latency' in line.lower() and 'ms' in line.lower():
594595
try:
595596
latency = line.split(":")[1].strip()
596597
result['latency'] = latency
597598
except (IndexError, ValueError) as e:
598-
print(f"Failed to parse latency from line: {line}. Error: {e}")
599-
pass
599+
print(
600+
f"Failed to parse latency from line: {line}. Error: {e}"
601+
)
600602

601603
return result
602604

@@ -660,22 +662,25 @@ def test_trtllm_bench_mig_launch(llm_root, llm_venv, model_name, model_subdir,
660662
)
661663
print("-" * 60)
662664

663-
for idx, val in enumerate(concurrency_list):
664665
for idx, val in enumerate(concurrency_list):
665666
metrics = results.get(val)
666667
if not isinstance(metrics, dict):
667-
pytest.fail(f"Unexpected benchmark result type for concurrency {val}: {type(metrics)}")
668+
pytest.fail(
669+
f"Unexpected benchmark result type for concurrency {val}: {type(metrics)}"
670+
)
668671
try:
669672
throughput = float(metrics.get('throughput', 0))
670673
latency = float(metrics.get('latency', 0))
671674
num_requests = int(metrics.get('num_requests', 0))
672675
except (ValueError, TypeError) as e:
673-
pytest.fail(f"Failed to parse benchmark results for concurrency {val}: {e}")
676+
pytest.fail(
677+
f"Failed to parse benchmark results for concurrency {val}: {e}")
674678
assert throughput > 0, f"Throughput is 0 for concurrency {val}"
675679
assert latency > 0, f"Latency is 0 for concurrency {val}"
676680
print(f"{val:<15} {throughput:<15} {latency:<15} {num_requests:<15}")
677681
if idx > 0:
678-
prev_throughput = float(results[concurrency_list[idx - 1]].get('throughput', 0))
682+
prev_throughput = float(results[concurrency_list[idx - 1]].get(
683+
'throughput', 0))
679684
assert throughput > prev_throughput * 1.3, f"Throughput is not increasing for concurrency {concurrency_list[idx]}"
680685

681686

0 commit comments

Comments
 (0)