Skip to content

Commit 24c6ea9

Browse files
fix: e2e & unit with main merged
1 parent f3887a0 commit 24c6ea9

File tree

8 files changed

+25
-13
lines changed

8 files changed

+25
-13
lines changed

src/guidellm/benchmark/scenario.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ class Config:
9898
] = None
9999
max_seconds: Optional[PositiveFloat] = None
100100
max_requests: Optional[PositiveInt] = None
101+
max_error: Optional[PositiveFloat] = None
101102
warmup_percent: Annotated[Optional[float], Field(gt=0, le=1)] = None
102103
cooldown_percent: Annotated[Optional[float], Field(gt=0, le=1)] = None
103104
output_sampling: Optional[NonNegativeInt] = None

tests/e2e/test_basic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def server():
1616
Pytest fixture to start and stop the server for the entire module
1717
using the TestServer class.
1818
"""
19-
server = VllmSimServer(port=8000, model="databricks/dolly-v2-12b")
19+
server = VllmSimServer(port=8000, model="databricks/dolly-v2-12b", mode="echo")
2020
try:
2121
server.start()
2222
yield server # Yield the URL for tests to use

tests/e2e/test_interrupted.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def server():
1717
Pytest fixture to start and stop the server for the entire module
1818
using the TestServer class.
1919
"""
20-
server = VllmSimServer(port=8000, model="databricks/dolly-v2-12b")
20+
server = VllmSimServer(port=8000, model="databricks/dolly-v2-12b", mode="echo")
2121
try:
2222
server.start()
2323
yield server # Yield the URL for tests to use
@@ -43,19 +43,21 @@ def test_interrupted_report(server: VllmSimServer):
4343
--output-path {report_path}
4444
"""
4545
logger.info(f"Client command: {command}")
46-
process = subprocess.Popen(["/bin/bash", "-c", command], # noqa: S603
47-
stdout=subprocess.PIPE,
48-
stderr=subprocess.PIPE,
49-
text=True)
46+
process = subprocess.Popen( # noqa: S603
47+
["/bin/bash", "-c", command],
48+
stdout=subprocess.PIPE,
49+
stderr=subprocess.PIPE,
50+
text=True,
51+
)
5052
logger.info("Waiting for client to start...")
5153
time.sleep(10)
5254
server.stop()
5355

5456
try:
5557
logger.info("Fetching client output")
5658
stdout, stderr = process.communicate()
57-
logger.info(f"Client stdout:\n{stdout}")
58-
logger.info(f"Client stderr:\n{stderr}")
59+
logger.trace(f"Client stdout:\n{stdout}")
60+
logger.trace(f"Client stderr:\n{stderr}")
5961

6062
assert report_path.exists()
6163
with report_path.open("r") as f:

tests/e2e/vllm_sim_server.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import subprocess
22
import time
3+
from pathlib import Path
34
from typing import Optional
45

56
import pytest
@@ -42,6 +43,14 @@ def __init__(
4243
self.health_url = f"{self.server_url}/health"
4344
self.app_script = "./bin/llm-d-inference-sim"
4445
self.process: Optional[subprocess.Popen] = None
46+
if not Path(self.app_script).exists():
47+
message = (
48+
"The vLLM simulator binary is required for E2E tests, but is missing.\n"
49+
"To build it and enable E2E tests, please run:\n"
50+
"docker build . -f tests/e2e/vllm-sim.Dockerfile -o type=local,dest=./"
51+
)
52+
logger.warning(message)
53+
pytest.skip("vLLM simlator binary missing", allow_module_level=True)
4554

4655
def get_cli_parameters(self) -> list[str]:
4756
parameters = ["--port", f"{self.port}", "--model", self.model]

tests/unit/entrypoints/assets/benchmarks_stripped.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

tests/unit/entrypoints/assets/benchmarks_stripped.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ benchmarks:
2525
type_: synchronous
2626
max_number:
2727
max_duration: 30
28+
max_error:
2829
warmup_number:
2930
warmup_duration:
3031
cooldown_number:
@@ -47,6 +48,7 @@ benchmarks:
4748
request_start_time_targeted_delay_avg: 0.6319856542222043
4849
request_time_delay_avg: 0.00029866238857837433
4950
request_time_avg: 0.6370967195389119
51+
error_rate: 0.0
5052
worker:
5153
type_: generative_requests_worker
5254
backend_type: openai_http

tests/unit/entrypoints/assets/benchmarks_stripped_output.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Benchmarks Metadata:
55
Duration:30.2 seconds
66
Profile:type=sweep, strategies=['synchronous', 'throughput', 'constant', 'constant', 'constant', 'constant', 'constant', 'constant', 'constant', 'constant'],
77
max_concurrency=None
8-
Args:max_number=None, max_duration=30.0, warmup_number=None, warmup_duration=None, cooldown_number=None, cooldown_duration=None
8+
Args:max_number=None, max_duration=30.0, max_error=None, warmup_number=None, warmup_duration=None, cooldown_number=None, cooldown_duration=None
99
Worker:type_='generative_requests_worker' backend_type='openai_http' backend_target='example_target' backend_model='example_model' backend_info={'max_output_tokens': 16384,
1010
'timeout': 300, 'http2': True, 'authorization': False, 'organization': None, 'project': None, 'text_completions_path': '/v1/completions', 'chat_completions_path':
1111
'/v1/chat/completions'}
@@ -18,7 +18,7 @@ Benchmarks Info:
1818
Metadata |||| Requests Made ||| Prompt Tok/Req ||| Output Tok/Req ||| Prompt Tok Total||| Output Tok Total ||
1919
Benchmark| Start Time| End Time| Duration (s)| Comp| Inc| Err| Comp| Inc| Err| Comp| Inc| Err| Comp| Inc| Err| Comp| Inc| Err
2020
-----------|-----------|---------|-------------|------|-----|-----|------|------|----|-------|-----|-----|-------|-----|-----|-------|------|------
21-
synchronous| 16:59:28| 16:59:58| 30.0| 46| 1| 0| 257.1| 256.0| 0.0| 128.0| 0.0| 0.0| 11827| 256| 0| 5888| 0| 0
21+
synchronous| 20:59:28| 20:59:58| 30.0| 46| 1| 0| 257.1| 256.0| 0.0| 128.0| 0.0| 0.0| 11827| 256| 0| 5888| 0| 0
2222
===================================================================================================================================================
2323

2424

tests/unit/preprocess/test_dataset.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,6 @@ def test_process_dataset_non_empty(
133133
mock_save_to_file,
134134
tokenizer_mock,
135135
):
136-
from guidellm.preprocess.dataset import process_dataset
137-
138136
mock_dataset = [{"prompt": "Hello"}, {"prompt": "How are you?"}]
139137
mock_load_dataset.return_value = (mock_dataset, {"prompt_column": "prompt"})
140138
mock_check_processor.return_value = tokenizer_mock

0 commit comments

Comments
 (0)