Skip to content

Commit df6fb14

Browse files
committed
Updates benchmarking CLI
1 parent 62598c8 commit df6fb14

3 files changed

Lines changed: 12 additions & 2 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "additive-manufacturing"
3-
version = "0.0.30"
3+
version = "0.0.31"
44
authors = [
55
{ name = "Peter Pak", email = "ppak10@gmail.com" },
66
]

src/am/benchmark/cli.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ def benchmark(
3232
num_runs: int = typer.Option(
3333
1, help="Number of benchmark runs (for error bar statistics)."
3434
),
35+
vllm_args: list[str] = typer.Option(
36+
[],
37+
"--vllm-arg",
38+
help="Extra argument forwarded to 'vllm serve' (repeatable, e.g. --vllm-arg='--max-model-len=8192').",
39+
),
3540
workspace_option: WorkspaceOption = None,
3641
num_proc: NumProc = 1,
3742
) -> None:
@@ -63,6 +68,7 @@ def benchmark(
6368
out_path=workspace_folder_path,
6469
proctor_url=proctor_url,
6570
proctor_model=proctor_model,
71+
vllm_extra_args=vllm_args or None,
6672
)
6773

6874
except Exception as e:

src/am/benchmark/llm/__init__.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ def benchmark_llm(
8585
out_path: Path | None = None,
8686
proctor_url: str | None = None,
8787
proctor_model: str = PROCTOR_MODEL,
88+
vllm_extra_args: list[str] | None = None,
8889
) -> list[dict]:
8990

9091
missing = [pkg for pkg in ("datasets",) if importlib.util.find_spec(pkg) is None]
@@ -147,7 +148,10 @@ def _with_proctor(runner, vision_runner, serve_model):
147148
else:
148149
from .server import managed_vllm_server
149150

150-
with managed_vllm_server(model, port=port) as (server_url, serve_model):
151+
with managed_vllm_server(model, port=port, extra_args=vllm_extra_args) as (
152+
server_url,
153+
serve_model,
154+
):
151155
runner = lambda questions, max_tokens: _run_openai_compatible(
152156
server_url, serve_model, questions, max_tokens
153157
)

0 commit comments

Comments
 (0)