Skip to content

[Unified Cache][4/N]: Add Mooncake backend for external linker - #37205

Merged
hzh0425 merged 5 commits into
sgl-project:mainfrom
hzh0425:external-linker-mooncake-backend
Sep 1, 2026
Merged

hzh0425 merged 5 commits into
sgl-project:mainfrom
hzh0425:external-linker-mooncake-backend

Conversation

@huangtingwei9988

@huangtingwei9988 huangtingwei9988 commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

Motivation

This is the fourth PR split from #35687.

  • Add Mooncake backend for external linker

Previous splits: #37091 and #37098 and #37151

Modifications

Accuracy Tests

Speed Tests and Profiling

Checklist

Review and Merge Process

  1. Ping Merge Oncalls to start the process. See the PR Merge Process.
  2. Get approvals from CODEOWNERS and other reviewers.
  3. Trigger CI tests with comments or contact authorized users to do so.
    • Common commands include /tag-and-rerun-ci, /tag-run-ci-label, /rerun-failed-ci
  4. After green CI and required approvals, ask Merge Oncalls or people with Write permission to merge the PR.

CI States

Latest PR Test (Base): 🚫 Run #33383052227
Latest PR Test (Extra): ✅ Run #33383051768
Latest PR Test (AMD ROCm 7.2): ❌ Run #33383052171

Co-authored-by: hzh0425 <hzh0425@apache.org>
@github-actions github-actions Bot added the hicache Hierarchical Caching for SGLang label Aug 31, 2026
@huangtingwei9988

Copy link
Copy Markdown
Collaborator Author

/tag-and-rerun-ci

@huangtingwei9988

Copy link
Copy Markdown
Collaborator Author

/rerun-test test/registered/unit/mem_cache/test_unified_cache_linker.py

@huangtingwei9988

Copy link
Copy Markdown
Collaborator Author

/rerun-group radix_cache/unified_radix_tree

@github-actions

github-actions Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Results for /rerun-test test/registered/unit/mem_cache/test_unified_cache_linker.py:

🚀 ubuntu-latest (1 test): ✅ View workflow run

cd test/ && python3 registered/unit/mem_cache/test_unified_cache_linker.py

@github-actions

github-actions Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Results for /rerun-group radix_cache/unified_radix_tree:

🚀 4-gpu-h100 (4 tests): ✅ View workflow run

cd test/ && python3 registered/radix_cache/unified_radix_tree/test_unified_radix_cache_hicache_pp_kl.py
cd test/ && python3 registered/radix_cache/unified_radix_tree/test_unified_radix_cache_kl_cp.py
cd test/ && python3 registered/radix_cache/unified_radix_tree/test_unified_radix_cache_kl_dsv4.py
cd test/ && python3 registered/radix_cache/unified_radix_tree/test_unified_radix_cache_kl_mamba.py

🚀 4-gpu-b200 (1 test): ✅ View workflow run

cd test/ && python3 registered/radix_cache/unified_radix_tree/test_unified_radix_cache_kl_dcp.py

🚀 8-gpu-h200 (3 tests): ✅ View workflow run

cd test/ && python3 registered/radix_cache/unified_radix_tree/test_unified_radix_cache_kl_dsv4_pp.py
cd test/ && python3 registered/radix_cache/unified_radix_tree/test_unified_radix_cache_kl_glm52.py
cd test/ && python3 registered/radix_cache/unified_radix_tree/test_unified_radix_cache_kl_mimo.py

🚀 2-gpu-h100 (2 tests): ✅ View workflow run

cd test/ && python3 registered/radix_cache/unified_radix_tree/test_unified_radix_cache_kl_full.py
cd test/ && python3 registered/radix_cache/unified_radix_tree/test_unified_radix_cache_kl_swa.py

🚀 1-gpu-h100 (1 test): ✅ View workflow run

cd test/ && python3 registered/radix_cache/unified_radix_tree/test_unified_radix_cache_kl_hybrid_bitexact.py

@hzh0425

hzh0425 commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

/rerun-group hicache

@github-actions

github-actions Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Results for /rerun-group hicache:

🚀 1-gpu-h100 (2 tests): ✅ View workflow run

cd test/ && python3 registered/hicache/test_hicache_spec_file_storage.py
cd test/ && python3 registered/hicache/test_hicache_variants.py

🚀 2-gpu-h100 (5 tests): ✅ View workflow run

cd test/ && python3 registered/hicache/test_hicache_spec_mooncake_storage.py
cd test/ && python3 registered/hicache/test_hicache_storage_3fs_backend.py
cd test/ && python3 registered/hicache/test_hicache_storage_file_backend.py
cd test/ && python3 registered/hicache/test_hicache_storage_mooncake_backend.py
cd test/ && python3 registered/hicache/test_hicache_storage_runtime_attach_detach.py

🚀 1-gpu-5090 (1 test): ✅ View workflow run

cd test/ && python3 registered/hicache/test_hicache_storage.py

🚀 4-gpu-h100 (2 tests): ✅ View workflow run

cd test/ && python3 registered/hicache/test_pp_with_hicache.py
cd test/ && python3 registered/hicache/test_qwen35_hicache.py

registered/hicache/test_hicache_storage_umbp_backend.py: test/registered/hicache/test_hicache_storage_umbp_backend.py is registered for AMD (suite nightly-amd-8-gpu-mi35x-deepseek-v4-flash), not for CUDA or CPU; rerun-test.yml has no AMD job. Rerun it with /rerun-failed-ci, or dispatch the AMD workflow manually.

@huangtingwei9988

Copy link
Copy Markdown
Collaborator Author

/rerun-test test/registered/unit/mem_cache/test_mooncake_direct_linker.py

@huangtingwei9988

Copy link
Copy Markdown
Collaborator Author

/rerun-group radix_cache/unified_radix_tree

@github-actions

github-actions Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Results for /rerun-test test/registered/unit/mem_cache/test_mooncake_direct_linker.py:

🚀 ubuntu-latest (1 test): ✅ View workflow run

cd test/ && python3 registered/unit/mem_cache/test_mooncake_direct_linker.py

@github-actions

github-actions Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Results for /rerun-group radix_cache/unified_radix_tree:

🚀 4-gpu-h100 (4 tests): ✅ View workflow run

cd test/ && python3 registered/radix_cache/unified_radix_tree/test_unified_radix_cache_hicache_pp_kl.py
cd test/ && python3 registered/radix_cache/unified_radix_tree/test_unified_radix_cache_kl_cp.py
cd test/ && python3 registered/radix_cache/unified_radix_tree/test_unified_radix_cache_kl_dsv4.py
cd test/ && python3 registered/radix_cache/unified_radix_tree/test_unified_radix_cache_kl_mamba.py

🚀 4-gpu-b200 (1 test): ✅ View workflow run

cd test/ && python3 registered/radix_cache/unified_radix_tree/test_unified_radix_cache_kl_dcp.py

🚀 8-gpu-h200 (3 tests): ✅ View workflow run

cd test/ && python3 registered/radix_cache/unified_radix_tree/test_unified_radix_cache_kl_dsv4_pp.py
cd test/ && python3 registered/radix_cache/unified_radix_tree/test_unified_radix_cache_kl_glm52.py
cd test/ && python3 registered/radix_cache/unified_radix_tree/test_unified_radix_cache_kl_mimo.py

🚀 2-gpu-h100 (2 tests): ✅ View workflow run

cd test/ && python3 registered/radix_cache/unified_radix_tree/test_unified_radix_cache_kl_full.py
cd test/ && python3 registered/radix_cache/unified_radix_tree/test_unified_radix_cache_kl_swa.py

🚀 1-gpu-h100 (1 test): ✅ View workflow run

cd test/ && python3 registered/radix_cache/unified_radix_tree/test_unified_radix_cache_kl_hybrid_bitexact.py

@huangtingwei9988

Copy link
Copy Markdown
Collaborator Author

/rerun-failed-ci

@hzh0425

hzh0425 commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

/rerun-test registered/radix_cache/unified_radix_tree/test_unified_radix_cache_kl_dsv4.py test_unified_radix_cache_kl_dsv4_pp.py

@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Results for /rerun-test registered/radix_cache/unified_radix_tree/test_unified_radix_cache_kl_dsv4.py test_unified_radix_cache_kl_dsv4_pp.py:

🚀 4-gpu-h100 (1 test): ✅ View workflow run

cd test/ && python3 registered/radix_cache/unified_radix_tree/test_unified_radix_cache_kl_dsv4.py

🚀 8-gpu-h200 (1 test): ✅ View workflow run

cd test/ && python3 registered/radix_cache/unified_radix_tree/test_unified_radix_cache_kl_dsv4_pp.py

@hzh0425
hzh0425 merged commit b21000a into sgl-project:main Sep 1, 2026
282 of 351 checks passed
Leoyzen added a commit to Leoyzen/sglang that referenced this pull request Sep 2, 2026
Wires the Mooncake direct external linker (PR sgl-project#37205 backend, sgl-project#37307
translator passthrough) into the serving stack as an opt-in direct-L3
mode for UnifiedRadixCache, with no host cache tier:

- server_args: --enable-unified-cache-external-linker (default FALSE,
  runtime stays off unless explicitly enabled) +
  --unified-cache-external-linker-backend {mooncake}.
- arg_groups/hicache_hook: mutual-exclusion guard against
  --enable-hierarchical-cache and --hicache-storage-backend; linker mode
  skips hicache normalization entirely.
- registry: route to _create_unified_radix_cache under the flag and
  attach MooncakeDirectLinker via init_cache_linker, registering its
  layer-done counter with the kv cache and tp worker.
- scheduler: consolidate aborted-request cache-state release into
  _release_aborted_request (fires for hicache storage or the external
  linker); poll linker events, and gate NO_TOKEN / hicache-consumer
  batch behavior under the linker flag.
- kv_cache_builder: forward attn_cp_rank / attn_cp_size into
  CacheInitParams (consumed by the storage config suffix).
- kv_cache_configurator: keep the DSA indexer-K cache under the linker.
- full_component: honor the PREPARE phase of
  ExternalLinkerLoadPhase (return the transfer unmodified; assert
  COMMIT after it).
- tests: MooncakeTestServices lifecycle helper, DSV4-Flash and GLM-5.2
  direct-linker KL E2E suites (registered as extra-b CUDA CI), plus the
  unit-test fixtures for the new scheduler/registry fields.

Applied cleanly over the local branch (no textual conflicts; scheduler
abort consolidation coexists with the local chunked-prefill abort
re-dispatch and fail-soft changes).  Default-off runtime behavior is
preserved per the port-but-don't-switch decision.

(cherry picked from commit d2ade53,
PR sgl-project#37381)
StevenChenSE pushed a commit to StevenChenSE/sglang that referenced this pull request Sep 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants