vllm / engines-kt pods: a C compiler for Triton, and a root-cause error tail

vLLM on the pod died with 'Engine core initialization failed. See root
cause above' — and the root cause was above the six-line tail the 503
carried. Neither core has a C compiler; Triton JIT-compiles vLLM's (and
SGLang's) kernels at run time and needs one. A <profile>.apt marker
keeps runtime apt packages in the image; vllm and engines-kt get gcc.
The worker's error now surfaces the lines that name an error first.
Co-Authored-By: 's avatarClaude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FKm7Z56iKjHgNkHc6VhWKz
parent 2315e84f
......@@ -275,7 +275,19 @@ def ensure_service(cfg, model_path: Optional[str] = None,
_services[svc_key] = {"proc": proc, "port": port, "url": url}
def _tail_msg():
joined = " | ".join(list(tail)[-6:]).strip()
# The last six lines of a vLLM crash are the wrapper's own traceback
# ("Engine core initialization failed. See root cause above.") — the
# root cause IS above, and on a pod this message is all anyone gets.
# Prefer the lines that name an error; fall back to a longer tail.
lines = [l.strip() for l in tail if l.strip()]
keyed = [l for l in lines if any(k in l for k in ("Error", "error:", "not found",
"No such", "CUDA", "Traceback"))]
chosen = (keyed[-8:] if keyed else []) + lines[-6:]
seen, out = set(), []
for l in chosen:
if l not in seen:
seen.add(l); out.append(l[:300])
joined = " | ".join(out)
return f". Last output: {joined}" if joined else ""
deadline = time.time() + ready_timeout
......
......@@ -38,10 +38,17 @@ COPY packaging/runpod/profiles/ /tmp/profiles/
# toolchain, for one). They are installed and purged inside this single layer, so
# a 1 GB toolchain never ends up in the shipped image.
RUN --mount=type=cache,target=/root/.cache/pip set -eux; \
deps=""; \
deps=""; keep=""; \
if [ -f "/tmp/profiles/${PROFILE}.build-deps" ]; then \
deps="$(grep -vE '^\s*(#|$)' /tmp/profiles/${PROFILE}.build-deps | tr '\n' ' ')"; \
apt-get update && apt-get install -y --no-install-recommends $deps; \
fi; \
if [ -f "/tmp/profiles/${PROFILE}.apt" ]; then \
# apt packages the capability needs AT RUN TIME and so are kept: a C
# compiler for Triton, which vLLM and SGLang JIT their kernels with.
keep="$(grep -vE '^\s*(#|$)' /tmp/profiles/${PROFILE}.apt | tr '\n' ' ')"; \
fi; \
if [ -n "$deps$keep" ]; then \
apt-get update && apt-get install -y --no-install-recommends $deps $keep; \
fi; \
python -m pip install --extra-index-url ${TORCH_INDEX} -r /tmp/profiles/${PROFILE}.txt; \
if [ -f "/tmp/profiles/${PROFILE}.light" ]; then \
......@@ -59,6 +66,7 @@ RUN --mount=type=cache,target=/root/.cache/pip set -eux; \
fi; \
if [ -n "$deps" ]; then \
apt-get purge -y $deps && apt-get autoremove -y; \
if [ -n "$keep" ]; then apt-get install -y --no-install-recommends $keep; fi; \
fi; \
rm -rf /tmp/profiles /var/lib/apt/lists/* /root/.cargo /root/.rustup
......
# Triton (SGLang's kernels) needs a C compiler at run time.
gcc
libc6-dev
# Triton JIT-compiles vLLM's kernels at run time and needs a C compiler for its
# launcher stubs; without one the engine core dies before it registers.
gcc
libc6-dev
......@@ -1264,3 +1264,16 @@ def test_a_pod_that_refuses_connections_is_dropped_and_the_request_retried(monke
assert b.generate_chat([{"role": "user", "content": "x"}]) == "hi"
assert [u.split("/")[2] for u in calls] == ["203.0.113.9:1", "203.0.113.10:1"]
assert pool.discarded == [("dead", "connection refused")] and dead not in pool.pods
def test_the_vllm_worker_reports_the_root_cause_not_the_wrapper_traceback():
"""On a pod the 503 body is all anyone gets, and it carried the last six
lines — vLLM's own "Engine core initialization failed. See root cause
above". The root cause IS above; surface it."""
from pathlib import Path
src = Path("codai/api/vllm_worker.py").read_text()
assert "keyed = " in src and '"Traceback"' in src
prof = Path("packaging/runpod/profiles")
for p in ("vllm", "engines-kt"):
assert "gcc" in (prof / f"{p}.apt").read_text(), f"{p}: Triton needs a C compiler"
assert ".apt" in Path("packaging/runpod/Dockerfile.capability").read_text()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment