← Back to Pull requests

fix(coordinator/kv-nixl): no do_remote_prefill without prefill remote_block_ids #4181

Open
unknown opened this pull request with 423 lines diff across 5 files
View on GitHub
unknown unknown commented on Nov 11, 2026 08:23 UTC
Author

What type of PR is this?
<!--
Add one of the following kinds:
/kind bug
/kind cleanup
/kind documentation
/kind feature
/kind flake
/kind performance
/kind release
/kind test

Optionally add one or more of the following kinds if applicable:
/kind deprecation
-->
/kind bug

What this PR does / why we need it:
When the coordinator runs a full prefill → decode pipeline with the kv-nixl connector and the prefill response carries no kv_transfer_params, the decode request still goes out with {"do_remote_decode": false, "do_remote_prefill": true} and no remote_block_ids. vLLM's NIXL scheduler reads do_remote_prefill as "pull KV from a remote prefiller", allocates blocks for it, then finds nothing to pull and trips assert num_external_tokens == 0. The assertion fires inside the EngineCore scheduling loop, where it is fatal: the engine process exits, every in-flight request on that decode pod fails, and the pod restarts and reloads the model.

This path is not an edge case. prefill.go treats a prefill response without kv_transfer_params as a degraded but acceptable outcome: it logs prefill returned no kv_transfer_params; decode will recompute the prompt and continues.
The comment there names the most common cause:
https://github.com/llm-d/llm-d-router/blob/82202afe27434aa2a03c361c035de56f92166315/pkg/coordinator/steps/prefill.go#L124-L132

So the default configuration plus a slightly older prefill pool, which should cost one extra prompt computation on decode, instead crashes a decode pod on every request. A pipeline with no prefill step and kv-nixl configured reaches the same path.

Reproduction

Environment: one RTX 3090 Ti, vllm/vllm-openai:v0.31.0 (ships nixl 1.4.1) serving Qwen3-0.6B with NixlConnector in the kv_both role; the coordinator built from upstream/main with kv_connector: kv-nixl and gateway.address pointing straight at vLLM.
The pipeline runs decode alone: with no prefill step KVTransferParams is empty, which is the same state a prefill response without kv_transfer_params leaves behind, so the decode request carries the same {"do_remote_decode": false, "do_remote_prefill": true} body on one GPU without a prefill pool.

One ordinary chat completions request through the coordinator:

  • The client receives 500 {"error":{"message":"EngineCore encountered an issue. See stack trace (above) for the root cause.","type":"InternalServerError"}}.

  • The vLLM log shows, in order, assert num_external_tokens == 0, AssertionError, EngineCore encountered a fatal error, EngineDeadError.

  • About 3 seconds later /health no longer connects and the container has exited. A single request is enough.
  • Controls: the same request sent directly to vLLM without kv_transfer_params returns 200, ruling out the model and the environment. Repeating the steps with the fixed coordinator returns 200, /health stays 200, and the container keeps running.

    Which issue(s) this PR fixes:
    <!--
    *Automatically closes linked issue when PR is merged.
    Usage: Fixes #<issue number>, or Fixes (paste link of issue).
    -->
    Fixes #

    Release note _(write NONE if no user-facing change)_:
    ``release-note
    NONE
    ``

    Diff: 423 lines (+317 / -106) across 5 files Reviewer: blacksoxx Review duration: 16522m
    All Vouch review confidence checks passed
    Residual risk 0.27 = Change Risk (0.50) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.50 · 423 lines diff across 5 files
    0.50
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    46%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.362
    Shallow Review Depth shallow_review_depth
    0.344
    Ai Authored ai_authored
    0.050
    Real PR Conversation Timeline
    1 comments
    "Review active on #4181"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 46.7% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 50% (MEDIUM) · Higher = larger blast radius
    50%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 46.7% · Lower = rushed or shallow review
    46.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 26.7% · Safe to merge
    26.7%