Skip to content

fix(docker): /abort_requests abort-all fix + cu13 image variant#317

Merged
CalvinXKY merged 4 commits into
vllm-project:mainfrom
aoshen02:fix/abort-requests-internal-id
Jul 3, 2026
Merged

fix(docker): /abort_requests abort-all fix + cu13 image variant#317
CalvinXKY merged 4 commits into
vllm-project:mainfrom
aoshen02:fix/abort-requests-internal-id

Conversation

@aoshen02

@aoshen02 aoshen02 commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

What

Fix the bundled vLLM /abort_requests endpoint in docker/patch/latest/vllm.patch so 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_ids by enumerating engine.output_processor.request_states.keys() and calling engine.abort(request_ids).

But request_states is keyed by internal request ids, while EngineClient.abort() defaults to internal=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-passed request_ids. Also include parent_requests keys (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_13 build arg: cu13 dev headers, TE from source, skip cu12 cudnn pin
  • just build-cu13 + cu13-* tags via just manifest cu13 ...
  • TMS_CUDA_MAJOR auto-detect from torch's CUDA version
  • git apply --allow-empty so builds survive once the vllm patch is emptied upstream
  • actor_group: preload torch_memory_saver_hook_mode_preload_cu13.abi3.so

Testing

  • Verified the patched api_router.py hunk applies cleanly to a pristine vLLM (git apply --check).
  • The other patch sections (core.py, all2all_utils.py, disagg/protocol.py) are untouched.
  • Full image build / runtime abort behaviour: via CI (Buildkite #430).

AI assistance

Drafted with AI assistance (Claude); reviewed by a human before submission.

…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>
@read-the-docs-community

read-the-docs-community Bot commented Jul 3, 2026

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +80 to +90
+ 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)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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)

aoshen02 and others added 3 commits July 3, 2026 00:37
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>
Comment thread docker/Dockerfile
ARG PATCH_VERSION=latest
ARG MEGATRON_COMMIT=1dcf0dafa884ad52ffb243625717a3471643e087

ARG ENABLE_CUDA_13=0

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@CalvinXKY CalvinXKY changed the title fix(docker): abort-all in /abort_requests vLLM patch must abort by internal ids fix(docker): /abort_requests abort-all fix + cu13 image variant Jul 3, 2026
@CalvinXKY CalvinXKY merged commit 8d1f4cc into vllm-project:main Jul 3, 2026
3 checks passed
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.

2 participants