Skip to content

Commit ff6fe7a

Browse files
committed
Fix vLLM server startup: conditional /models dir, capture logs
- Only use --download-dir /models if the path exists (Modal volume). On GitHub runners, fall back to HF cache default. - Capture server stdout/stderr to a log file instead of DEVNULL. - Include server log in result on startup failure for debugging.
1 parent 4c84d44 commit ff6fe7a

File tree

1 file changed

+21
-5
lines changed

1 file changed

+21
-5
lines changed

src/libkernelbot/run_eval.py

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -958,13 +958,22 @@ def _start_vllm_server(
958958
"--model", model_name,
959959
"--tensor-parallel-size", str(tensor_parallel),
960960
"--port", str(port),
961-
"--download-dir", "/models",
962-
] + vllm_args
961+
]
962+
963+
# Only use /models if it exists (Modal volume), otherwise let vLLM use HF cache default
964+
if os.path.isdir("/models"):
965+
cmd += ["--download-dir", "/models"]
966+
967+
cmd += vllm_args
968+
969+
# Capture stderr to a log file for debugging server startup failures
970+
log_path = os.path.join(tempfile.gettempdir(), "vllm_server.log")
971+
log_file = open(log_path, "w") # noqa: SIM115
963972

964973
return subprocess.Popen(
965974
cmd,
966-
stdout=subprocess.DEVNULL,
967-
stderr=subprocess.DEVNULL,
975+
stdout=log_file,
976+
stderr=log_file,
968977
)
969978

970979

@@ -1181,9 +1190,16 @@ def run_model_benchmark(config: dict) -> FullResult: # noqa: C901
11811190
stderr = ""
11821191
try:
11831192
server_proc.kill()
1184-
_, stderr = server_proc.communicate(timeout=10)
1193+
server_proc.wait(timeout=10)
11851194
except Exception:
11861195
pass
1196+
# Read server log for debugging
1197+
log_path = os.path.join(tempfile.gettempdir(), "vllm_server.log")
1198+
try:
1199+
with open(log_path) as f:
1200+
stderr = f.read()
1201+
except OSError:
1202+
pass
11871203
run = RunResult(
11881204
success=False, passed=False,
11891205
command="vllm server startup",

0 commit comments

Comments
 (0)