Repository navigation
[Feat] sgl-router: Add opt-in decode cache affinity - #44516
Open
rudrakshkarpe wants to merge 1 commit into
Open
rudrakshkarpe wants to merge 1 commit into
rudrakshkarpe wants to merge 1 commit into
Conversation
Signed-off-by: rudrakshkarpe <rudraksh.karpe@gmail.com>
3 of 5 tasks
This branch has not been deployed
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.
Motivation
Decode workers can reuse cached prefixes, but bucket-first routing currently rejects
cache_awareon decode groups. A repeated request can therefore go to a cold decode worker even when an eligible worker already holds the prefix.This implements the decode-selection part of the decode-aware pairing item in #43699, related to #43098 and #25760.
Modifications
cache_awarewithpreferorbalancedaffinity. The default remains power-of-two.The README includes the bucket configuration. Prefill selection and engine transfer behavior are unchanged.
Accuracy Tests
Added policy regressions for tier changes, eviction, admission, stale load, partial-page thresholds, cache-salt/LoRA isolation, and missing cache signals. An HTTP PD test checks selection within the prefill's version group and preserves the shared bootstrap room.
Passed locally on macOS arm64:
The tokenizer parity tests require external fixtures and were excluded. No model accuracy or GPU serving run was performed.
Speed Tests and Profiling
Added a paired CPU lookup benchmark on the same tree, with half the owners on GPU and half on host memory. Apple M4 Pro, Rust 1.92.0 release build, 20 samples, 1s warmup, 2s measurement:
These measure tree lookup cost, excluding token hashing and dispatch. The additional walk distinguishes GPU residency from host-backed prefixes. Reduced KV transfer and TTFT still need a real PD serving benchmark; this PR makes no claim about those gains.
Checklist
@hzh0425 @sherlockwu, could you review the tier-selection behavior and single-rank scope for the decode-aware pairing work?
CI States
Latest PR Test (Base): ✅ Run #38765013308
Latest PR Test (Extra): ❌ Run #38765012969
Latest PR Test (AMD ROCm 10): ➖ No AMD PR run found for this commit.