Skip to content

feat(server): detect stalled engines and support model-card lookup - #3692

Open
Jaeyeong-CHOI wants to merge 3 commits into
lablup:mainfrom
Jaeyeong-CHOI:feat/server-3633
Open

Jaeyeong-CHOI wants to merge 3 commits into
lablup:mainfrom
Jaeyeong-CHOI:feat/server-3633

Conversation

@Jaeyeong-CHOI

@Jaeyeong-CHOI Jaeyeong-CHOI commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Add opt-in stalled-engine health checks and OpenAI model-card lookup

Addresses #3633. A loaded, idle server still returns the b10621 health response. Both server CLIs accept --stall-timeout (or MLXCEL_STALL_TIMEOUT); when enabled, a scheduler that has work but stops stepping returns 503 Engine stalled. New arrivals cannot postpone the deadline. The next step or idle transition restores readiness.

The /models/{id} and /v1/models/{id} routes look up the same cards as the inventory, including side models and IDs with slashes. An unknown ID returns the OpenAI model_not_found envelope. Router mode looks up visible cards without loading the model; the existing /models/sse endpoint retains its meaning.

On Spark1, we served Qwen3-0.6B weights with the published mistralai/Mistral-7B-Instruct-v0.3 chat template. On the unpatched binary, both a later system message and a user turn immediately after a tool result returned HTTP 400 from /v1/chat/completions. With the patch, both returned 200. /apply-template confirmed the later system text, tool result, follow-up text and call ID survived. This tests the Mistral template, not Mistral model weights. The shared renderer probes before folding either order. The Mistral Small 3.2 template already renders later system turns and does not accept tool turns at all.

No output-parser change: upstream removes leading CR/LF after reasoning/tool blocks. With Qwen3-0.6B-4bit, raw output contained a closing think tag and two newlines before “First”, while parsed JSON and SSE content both started with “First”.

Validation on DGX Spark1

On commit fc876f905, the CUDA build, Clippy with warnings denied, formatting and 232 focused tests passed (4 template tests ignored). Live Qwen serving returned 200 for health and chat. The isolated unpatched binary returned 404 for the listed alias lab/Qwen3-0.6B on both lookup routes; the patched binary returned 200 with the listed card and the expected JSON error for a missing ID. The stall/recovery sequence was tested at the HTTP handler, not by hanging a live GPU.

The full CUDA gate on that commit found one patch regression: the runtime-settings schema omitted the new startup field. The follow-up commit classifies it as a read-only integer and updates the 119-field invariant. The other two gate failures, mlx_test_guard_coverage and step3p7_parity, reproduced separately on the isolated unpatched checkout.

On the final commit, 8d6a74698 (tree 867ea22a133ccc5fc18fd7ee0d4c50334e58efa0, matched on Spark1), formatting and all 14 CUDA runtime-settings tests passed, including the schema invariant and field fixture. A separate catalog check found English and Korean labels for all 142 fixture fields and sub-fields. The full CUDA gate was rerun on this exact commit: 18,647 passed, 2 failed, 540 ignored. Both failures matched the unpatched baseline: mlx_test_guard_coverage reported the same missing guard and step3p7_parity failed the same padded-prefill assertion. No new failure was observed. Live smoke was not rerun after the settings-only changes.

Upstream comparison: the branch is based on a8eb71599; a local merge-tree check against upstream 97b63a2e8 found no conflicts. The hypothetical merge tree was not built or tested.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant