Skip to content

Commit a2d6eb5

Browse files
author
chibu
committed
readd default scenarios
1 parent 3b0d86c commit a2d6eb5

File tree

5 files changed

+16
-8
lines changed

5 files changed

+16
-8
lines changed

examples/guidellm_example.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313
target="http://localhost:8000/v1",
1414
data_type="emulated",
1515
max_seconds=30,
16-
#data="prompt_tokens=512,generated_tokens=256,output_tokens=256",
17-
data="prompt_tokens=128,generated_tokens=128,output_tokens=128",
16+
#config = "benchmarking_32k",
17+
data="prompt_tokens=128,output_tokens=128",
1818
branch = "update_guidellm",
19-
#vllm_kwargs={"enable-chunked-prefill": True}
19+
vllm_kwargs={"enable-chunked-prefill": True}
2020
)
2121

2222
task.execute_remotely("remote-upgrade-default")

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
version="0.1.0",
88
author="NM MLR",
99
description="Automation tools",
10-
#url="https://github.com/neuralmagic/research",
10+
url="https://github.com/neuralmagic/research",
1111
package_dir={"": "src"},
1212
packages=find_packages(
1313
"src", include=["automation", "automation.*"], exclude=["*.__pycache__.*"]

src/automation/configs.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
#DEFAULT_OUTPUT_URI = "gs://neuralmagic-clearml"
44
DEFAULT_OUTPUT_URI = "http://10.128.20.60:8081"
55
DEFAULT_RESEARCH_BRANCH = "main"
6+
DEFAULT_GUIDELLM_SCENARIO = "rag"

src/automation/tasks/scripts/guidellm_script.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from automation.utils import resolve_model_id, cast_args, kill_process_tree
55
from automation.vllm import start_vllm_server
66
from pyhocon import ConfigFactory
7+
from automation.configs import DEFAULT_GUIDELLM_SCENARIO
78

89
def main():
910
task = Task.current_task()
@@ -63,8 +64,11 @@ def clean_hocon_value(v):
6364

6465
from pathlib import Path
6566
from guidellm.benchmark.scenario import GenerativeTextScenario, get_builtin_scenarios
66-
filepath = Path(os.path.join(".", "src", "automation", "standards", "benchmarking", "rag.json"))
67-
current_scenario = GenerativeTextScenario.from_file(filepath, dict(guidellm_args))
67+
if len(get_builtin_scenarios()) > 0:
68+
current_scenario = GenerativeTextScenario.from_builtin(DEFAULT_GUIDELLM_SCENARIO, dict(guidellm_args))
69+
else:
70+
filepath = Path(os.path.join(".", "src", "automation", "standards", "benchmarking", f"{DEFAULT_GUIDELLM_SCENARIO}.json"))
71+
current_scenario = GenerativeTextScenario.from_file(filepath, dict(guidellm_args))
6872
print(current_scenario.model_fields)
6973
# Start vLLM server
7074
server_process, server_initialized, server_log = start_vllm_server(

src/automation/vllm/server.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,15 @@ def start_vllm_server(
5555
subprocess_env[k] = str(v)
5656
else:
5757
if v == True or v == "True":
58-
v = "true"
59-
server_command.extend([f"--{k}", str(v)])
58+
server_command.append(f"--{k}")
59+
else:
60+
server_command.extend([f"--{k}", str(v)])
61+
6062

6163
server_log_file_name = f"{SERVER_LOG_PREFIX}_{task.id}.txt"
6264
server_log_file = open(server_log_file_name, "w")
6365
print("Server command:", " ".join(server_command))
66+
print(f"VLLM logs are located at: {server_log_file} in {os.getcwd()}")
6467
server_process = subprocess.Popen(server_command, stdout=server_log_file, stderr=server_log_file, shell=False, env=subprocess_env)
6568

6669
delay = 5

0 commit comments

Comments
 (0)