fix(docker): /abort_requests abort-all fix + cu13 image variant#317
Conversation
…y internal ids The bundled /abort_requests endpoint (merged in vllm-project#296) populated request_ids from output_processor.request_states (internal ids) but called engine.abort() with the default internal=False, so they were treated as external, matched nothing, and POST /abort_requests {} silently aborted no requests under default request-id randomization. Abort the all-in-flight list as internal. Mirrors vllm-project/vllm#47173. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: aoshen02 <aoshen@inferact.ai>
There was a problem hiding this comment.
Code Review
This pull request updates the vllm.patch file to refine the request abort logic in the dev RLHF API router, separating the handling of external (user-supplied) request IDs from internal request IDs. The review feedback highlights a potential issue where passing an empty list of request IDs could accidentally trigger a mass-cancellation of all active requests, and suggests explicitly checking for None to safely handle empty lists as a no-op.
| + if request_ids: | ||
| + # Body ids are external (user-supplied) request ids. | ||
| + await engine.abort(request_ids) | ||
| + else: | ||
| + # The dev RL server runs AsyncLLM; abort everything it is tracking. | ||
| + # request_states is keyed by internal ids, so abort as internal. | ||
| + from vllm.v1.engine.async_llm import AsyncLLM | ||
| + | ||
| + assert isinstance(engine, AsyncLLM) | ||
| + request_ids = list(engine.output_processor.request_states.keys()) | ||
| + await engine.abort(request_ids, internal=True) |
There was a problem hiding this comment.
If a client explicitly passes an empty list of request IDs (e.g., {"request_ids": []}), the current logic falls into the else block and aborts all active requests. This can lead to accidental mass-cancellations.
Checking request_ids is None specifically for the "abort all" behavior, and elif request_ids for specific aborts, ensures that an empty list is safely treated as a no-op.
+ if request_ids is None:
+ # The dev RL server runs AsyncLLM; abort everything it is tracking.
+ # request_states is keyed by internal ids, so abort as internal.
+ from vllm.v1.engine.async_llm import AsyncLLM
+
+ assert isinstance(engine, AsyncLLM)
+ request_ids = list(engine.output_processor.request_states.keys())
+ await engine.abort(request_ids, internal=True)
+ elif request_ids:
+ # Body ids are external (user-supplied) request ids.
+ await engine.abort(request_ids)
Match the sibling dev endpoints and the Rust frontend (400 on malformed JSON) instead of silently treating it as empty. Mirrors vllm-project/vllm#47173. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: aoshen02 <aoshen@inferact.ai>
The /abort_requests patch enumerated request_states (child internal ids only), so with n>1 the ParentRequest entry leaked. Include parent_requests keys in the abort-all set. Mirrors vllm PR #47173. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: aoshen02 <aoshen@inferact.ai>
Port the cu13 build support from vllm-project#307: ENABLE_CUDA_13 branches the apt dev headers, cublas header, TransformerEngine (source-built for cu13), TMS_CUDA_MAJOR auto-detect, and the cudnn pin. justfile gains a build-cu13 target and a VARIANT-prefixed manifest. actor_group preloads the cu13 TMS .so. Also switch the vLLM patch apply to --allow-empty so the build survives once the patch is emptied upstream. Excludes vllm-project#307's NCCL_CUMEM_ENABLE default flip (0->1) and the glm5.2 scripts by request. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: aoshen02 <aoshen@inferact.ai>
| ARG PATCH_VERSION=latest | ||
| ARG MEGATRON_COMMIT=1dcf0dafa884ad52ffb243625717a3471643e087 | ||
|
|
||
| ARG ENABLE_CUDA_13=0 |
There was a problem hiding this comment.
Scope note: this PR title only mentions abort fix, but commit 60b9ccf adds the full cu13 variant. Please expand the PR description (or split) so reviewers don't miss half the diff.
What
Fix the bundled vLLM
/abort_requestsendpoint indocker/patch/latest/vllm.patchso that abort-all actually aborts, and add a cu13 Docker image variant (partial port of #307).The bug
The endpoint (added in #296) handles an empty/missing
request_idsby enumeratingengine.output_processor.request_states.keys()and callingengine.abort(request_ids).But
request_statesis keyed by internal request ids, whileEngineClient.abort()defaults tointernal=False(treats ids as external, resolving them through the external→internal map). Under the default request-id randomization (internal = f"{external}-{8 random}"), the internal ids are not external keys, so the lookup matches nothing —POST /abort_requests {}returns 200 while aborting nothing.This was flagged by Codex on the upstream endpoint PR (vllm-project/vllm#47173, review r3516626381); the same code shipped here in the docker patch.
The fix
Abort the all-in-flight list as internal (
internal=True); keep external semantics for explicitly-passedrequest_ids. Also includeparent_requestskeys (parallel-sampling parents) and return 400 on malformed JSON. Mirrors vllm-project/vllm#47173.cu13 image variant
Partial port from #307 — excludes the NCCL_CUMEM default flip and glm5.2 scripts:
ENABLE_CUDA_13build arg: cu13 dev headers, TE from source, skip cu12 cudnn pinjust build-cu13+cu13-*tags viajust manifest cu13 ...TMS_CUDA_MAJORauto-detect from torch's CUDA versiongit apply --allow-emptyso builds survive once the vllm patch is emptied upstreamactor_group: preloadtorch_memory_saver_hook_mode_preload_cu13.abi3.soTesting
api_router.pyhunk applies cleanly to a pristine vLLM (git apply --check).AI assistance
Drafted with AI assistance (Claude); reviewed by a human before submission.