feat(vllm): support KV-transfer connectors with external store reset on refit - #3530
Open
aoshen02 wants to merge 1 commit into
Open
feat(vllm): support KV-transfer connectors with external store reset on refit#3530aoshen02 wants to merge 1 commit into
aoshen02 wants to merge 1 commit into
Conversation
…on refit vllm_kwargs.kv_transfer_config now works on both engine paths: the async engine converts the dict to KVTransferConfig (AsyncEngineArgs has no dict coercion; sync vllm.LLM already coerces). All four prefix-cache reset sites (reset_prefix_cache/sleep, sync and async) pass reset_connector=True so a configured external KV store (e.g. MooncakeStoreConnector) is wiped on every refit — KV blocks computed with stale weights are never served. Without a connector this is an upstream-documented no-op. All sites run at step boundaries after rollout drain, satisfying the connector's no-in-flight-transfer contract. Co-authored-by: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: aoshen02 <aoshen@inferact.ai>
Author
|
/ok to test 12617de |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Enables vLLM KV-transfer connectors (e.g.
MooncakeStoreConnector) for rollout, with the RL-correct hard reset of the external KV store on every weight refit. Two small changes, no new config schema:vllm_kwargs.kv_transfer_configalready reaches the sync engine (vllm.LLMconverts dict →KVTransferConfig), butAsyncEngineArgshas no dict coercion —_create_enginenow converts it explicitly, mirroring the existingcompilation_configworkaround.reset_prefix_cache/sleep, sync and async) now passreset_connector=True. This cascades toconnector.reset_cache()(for Mooncake: a globalremove_all(force=True)on the master), so KV blocks computed with the previous policy weights are never served after a refit. Without a connector configured,reset_connector=Trueis an upstream-documented no-op (scheduler.pyreset_connector_cache: "No connector attached -> nothing to reset, treat as success").All reset sites run at step boundaries after rollout drain, satisfying the Mooncake store scheduler's no-in-flight-transfer contract. Multiple replicas resetting the same master is idempotent. The pinned vllm==0.25.1 contains everything needed (
MooncakeStoreConnectorsince v0.22, reset cascade since v0.23); no vLLM patch and no new dependency (mooncake-transfer-engineis already a hard dep and shipsmooncake_master).Usage
This is unrelated to
data_plane.backend=mooncake_cpu(TransferQueue transport for rollout data, not KV cache).Testing
GPU e2e on GB200 (1 node, 2 GPUs, colocated GRPO, Qwen3-0.6B, 2 steps, sync engine, local
mooncake_master):KVTransferConfig(kv_connector='MooncakeStoreConnector', kv_role='kv_both')— the override lands as a typed config."Mooncake store reset via remove_all succeeded"in engine logs (scheduler + worker side, both replicas, each step boundary).max(train/gen_kl_error)=0.00075 < 0.002,probs_ratio_clamped_{min,max}within [0.79, 1.21].Lint:
pre-commit(ruff, ruff-format) andpyrefly check(0 errors) pass on the touched files.Duplicate-work check
No existing PR or issue in NVIDIA-NeMo/RL touches
kv_transfer_config/ KV connectors. All current mooncake-related PRs (#2439, #2935, #3501) are TransferQueue data-plane transport, a different layer.AI assistance disclosure
This PR was authored with AI assistance (Claude). Every changed line was reviewed by @aoshen02, and the e2e validation above was run on real hardware.