Repository navigation
[Feat] hicache: Add opt-in legacy Mooncake cache fallback - #44844
Draft
alphabetc1 wants to merge 8 commits into
Draft
alphabetc1 wants to merge 8 commits into
alphabetc1 wants to merge 8 commits into
Conversation
Two SGLang instances sharing one Mooncake store with the same model but different --kv-cache-dtype could reuse the wrong cache bytes. Compose the logical device dtype into Mooncake tenant_id instead of prefixing object keys, and require mooncake-transfer-engine>=0.3.12. Co-authored-by: Teng Ma <[email protected]>
Preserve per-rank SSD offload directories alongside the shared tenant-aware setup helper. Adapt the dtype regression fixture to the current storage host-pool format interface. Validation: all 42 Mooncake CPU unit tests and pre-commit checks on the six PR files passed. Live Mooncake and GPU integration tests were not run. Signed-off-by: Teng Ma <[email protected]>
Reuse the existing Mooncake setup and tenant compatibility paths instead of refactoring KV and embedding initialization. Keep the shared logical-dtype config field and a single tenant composition helper. Consolidate dtype regressions into the existing tenant test fixture and shorten the documentation. Validation: 38 Mooncake CPU unit tests and pre-commit on all five PR files passed. Live Mooncake and GPU tests were not run. Signed-off-by: Teng Ma <[email protected]>
3 of 4 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
Moving Mooncake KV objects into dtype-specific tenants in #38362 makes existing, compatible cache objects cold. Add an opt-in migration path that reads verified legacy data on a confirmed miss and promotes it into the new tenant.
Draft; depends on #38362. This branch is based on its head (
9e81b5ed5b54e45ff68cff36bbacca5ab25da0c8). The diff against main currently includes that prerequisite; the new fallback is in the final feature commit. Rebase after #38362 merges.Modifications
legacy_fallback.pycompatibility module. The option is off by default and requires matching stored dtype, host layout, page size, and an explicitverified_compatible=trueoperator attestation. Operators must verify the remaining representation/model/parallelism parameters and stop all legacy writers; unknown or mixed-format namespaces cannot be migrated safely.clear()to avoid restoring invalidated objects in that backend instance. Remove the option before restarting if those objects must remain invalidated.Accuracy Tests
ctypesbuffer writes, primary-hit precedence, confirmed-miss gating, mixed batches, malformed declarations, missing/wrong-size/evicted legacy objects, multi-buffer scatter, and promotion/error handling.sglang.__init__eager runtime imports using a namespace-package bootstrap; the compatibility implementation and CI registry were loaded normally. Mooncake clients are mocks.test_mooncake*.pysuite could not collect in the local macOS environment becausepybase64is missing. These integration tests still require execution in the normal CPU CI environment.Speed Tests and Profiling
Not run. The disabled mode creates no legacy client or additional RPC. Enabled migration adds a legacy bytes read, a CPU copy, and best-effort per-object promotion; it is intended for temporary warmup.
Checklist
CI States
Latest PR Test (Base): ❌ Run #38998199547
Latest PR Test (Extra): ❌ Run #38998199533
Latest PR Test (AMD ROCm 10): ❌ Run #38998199349