Repository navigation
server: fix token counting API crash on sleep - #29309
Conversation
|
Hello, reproduced the crash on master, a SIGSEGV on the first count request after sleep with and without mmproj, and the new test fails there too. With the fix, /chat/completions/input_tokens, /v1/chat/completions/input_tokens, /responses/input_tokens, /v1/responses/input_tokens and /v1/messages/count_tokens all wake the server and return the right count, and test_sleep.py passes. Nit: the three local aliases are not needed, reading ctx_server.vocab, ctx_server.mctx and ctx_server.init_opt inline after create_response() would keep it shorter. |
|
@ServeurpersoCom Thank you for your kind suggestion! I have refined it. |
ServeurpersoCom
left a comment
There was a problem hiding this comment.
LGTM, re-tested the updated version: every count route wakes the server without crashing and test_sleep.py passes.
|
cc @ngxson |
Conflicts resolved by hand, keeping the fork's functionality: - allreduce.cu: our mixed-runtime collective kept; upstream's HIP enablement and CUDA_CHECK cleanup applied, #else stub comment taken from upstream. - llama-context.cpp/.h: upstream's per-graph-type gf_res_prev and gf_res_prev_active (ggml-org#28549, CUDA graph for MTP draft) around our ubatch phase profiler; expert heatmap/hotstore members kept. - server-context.cpp/.h: upstream's handle_count_tokens signature (ggml-org#29309) with our reject_unknown_model guard. - fattn-common.cuh: our GGML_CUDA_FATTN_LAUNCH_PROFILE log kept. qwen4exp.cpp auto-merged: our MTP head kept, upstream hc ops and sparse FA in (PR ggml-org#28243 still unmerged upstream, so MTP stays ours). Validation (greedy, temp 0 / top_k 1 / seed 42, hash of reasoning+content): - Qwen3.8-27B 4-GPU MTP: byte-identical to the old build on all prompts. - Qwen3.8-Flash 4-GPU MTP: 1 of 3 identical, 2 diverge late. Cause is the fused hc_pre_gated/hc_post ops from ggml-org#28901 (different rounding order); still diverges with GGML_CUDA_DISABLE_FUSION=1. test-backend-ops passes DSV4_HC_PRE/POST on CUDA0, CUDA1, V100_CUDA0, V100_CUDA1. Perplexity (docs corpus, 24x1024): 5.4967 +/- 0.127 old, 5.4707 +/- 0.126 new. Generation speed unchanged on both models. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* server: wake up sleeping server correctly * server: wake up sleeping server correctly (local aliases removed) (cherry picked from commit 42916d8)
* server: wake up sleeping server correctly * server: wake up sleeping server correctly (local aliases removed)
* server: wake up sleeping server correctly * server: wake up sleeping server correctly (local aliases removed) (cherry picked from commit 42916d8)
Overview
Fixed #29188
Fixed that if the server was in a sleeping state, the token counting endpoint read
ctx_server.vocabwithout waking up correctly.Additional information
Add
test_sleep.pyto ensure that the endpoint can successfully wake up a server that is in sleep mode.Requirements