Files
vLLM/examples/disaggregated/kv_load_failure_recovery_offline
Wentao Ye ea0e501bb1 [KV Connector] Remove compat support for pre-v0.12.0 constructor signatures without KVCacheConfig (#39832)
The v0.12.0 release contained initial support for HMA in KV Connectors. As part
of these changes, a KVCacheConfig argument was added to KV connector
constructors. Backwards compatibility support for out-of-tree connectors was
included in this change, with a very prominent warning. See #25712 and #27887.

Since the warning has been around for over 5 months, we can safely remove
the support of it.

Signed-off-by: yewentao256 <zhyanwentao@126.com>
2026-05-09 23:39:46 +00:00
..

KV Load Failure Recovery Test

This example builds upon the example_connector example in examples/disaggregated.

It demonstrates vLLM's ability to recover from KV load failures in both synchronous and asynchronous loading modes. The goal is to verify that vLLM correctly identifies invalid KV blocks, reschedules the affected requests, and ensures successful and consistent output.

Files

  • prefill_example.py – performs the prefill stage and saves KV data (same as in example_connector).

  • decode_example.py – performs the decode stage. Accepts:

    • --simulate-failure: simulates KV load failure using a custom connector.
    • --async-load: enables asynchronous KV loading mode.
  • load_recovery_example_connector.py – defines LoadRecoveryExampleConnector, a subclass of ExampleConnector, that simulates missing or corrupted external KV blocks by failing to load blocks for the first decode request.

  • run.sh – orchestrates the test: runs the prefill stage, then three decode stages:

    1. Normal decode (baseline).
    2. Decode with simulated sync KV load failure.
    3. Decode with simulated async KV load failure.

    Finally, it compares the output of the baseline with the recovered outputs to verify correctness.

How It Works

  • The test dynamically loads LoadRecoveryExampleConnector via KVTransferConfig.kv_connector_module_path, enabling controlled simulation of load failures without modifying the original connector.
  • The decode stages that simulate failure are expected to trigger recovery logic in vLLM, resulting in the same output as the baseline decode.
  • If recovery fails, the script prints a unified diff of the output mismatch and exits with error.

Usage

./run.sh