Skip to content

[Unified Tree]fix compatibility bugs with eagle and unified l3 - #27655

Merged
hzh0425 merged 2 commits into
sgl-project:mainfrom
antgroup:fix_unified_tree_l3_eagle
Jun 10, 2026
Merged

hzh0425 merged 2 commits into
sgl-project:mainfrom
antgroup:fix_unified_tree_l3_eagle

Conversation

@huangtingwei9988

@huangtingwei9988 huangtingwei9988 commented Jun 9, 2026 •

Copy link
Copy Markdown
Collaborator

Motivation

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 #27194002211
Latest PR Test (Extra): ❌ Run #27194002065

@huangtingwei9988

Copy link
Copy Markdown
Collaborator Author

/tag-and-rerun-ci

@github-actions github-actions Bot added the run-ci CI: run the baseline test suite on this PR label Jun 9, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the prefetch_from_storage method in unified_radix_cache.py to pass the entire prefetch_key object instead of just prefetch_key.token_ids to the cache controller's prefetch method. Additionally, it introduces an is_eagle configuration option to CacheConfig and adds a unit test class TestUnifiedRadixCacheEagleHiCacheStorageKey to verify that L3 prefetching correctly utilizes the bigram radix key when Eagle is enabled. There are no review comments to address, and I have no feedback to provide.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@huangtingwei9988

Copy link
Copy Markdown
Collaborator Author

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

@github-actions

github-actions Bot commented Jun 9, 2026 •

Copy link
Copy Markdown
Contributor

Results for /rerun-test test/registered/radix_cache/unified_radix_tree/test_unified_radix_cache_kl_dsv4.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

@hzh0425

hzh0425 commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

/rerun-group radix_cache/unified_radix_tree

@hzh0425

hzh0425 commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

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

@github-actions

github-actions Bot commented Jun 9, 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

🚀 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

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

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

@github-actions

github-actions Bot commented Jun 9, 2026 •

Copy link
Copy Markdown
Contributor

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

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

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

@hzh0425

hzh0425 commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

All unified tree related ci has passed

image

@hzh0425
hzh0425 merged commit f101b28 into sgl-project:main Jun 10, 2026
198 of 214 checks passed
hzwzwzw added a commit to hzwzwzw/sglang that referenced this pull request Jul 2, 2026
…-project#601 and sgl-project#628

Merge target: d958a63 "Return bad request for malformed DSV4 tool
arguments (sgl-project#602)". Excludes b4de164 (sgl-project#601 "Fix DSV4 C128 state
mapping lifecycle") and f59f166 (sgl-project#628 "Sync clean SM90 FP8+FP4
MegaMoE from main") per user instruction.

Brings in 13 upstream commits including:
- 3e31718 [HiCache] DeepSeek-V4 host-mem L2 + NVMe/disk L3 (sgl-project#564)
- 6dddb6d Fix DSv4 draft extend replay forward batch (sgl-project#569)
- 9d212a9 add observability (sgl-project#570)
- 104a38d Bytedance/deepseek v4 fix draft extend padding (sgl-project#573)
- d958a63 Return bad request for malformed DSV4 tool arguments (sgl-project#602)
- 8 docker/codex build hardening commits

Conflict resolutions (all 8 files stability-critical, memory-related):

1. tree_component.py / full_component.py / swa_component.py / mamba_component.py
   -- commit_hicache_transfer signature: keep HEAD's typed
   (insert_result, pool_storage_result) kwargs. Callers in
   unified_radix_cache.py explicitly pass these; their **kw variant
   is strictly a superset but less safe.
   Also drop their side's manual `kw.get(...)` extraction in mamba
   PREFETCH branch since the params are now directly bound.

2. hybrid_cache_controller.py -- extra_host_mem_release_queues type
   annotation: keep HEAD's Queue[torch.Tensor] (more precise).

3. swa_memory_pool.py -- their side added a full duplicate
   SWATokenToKVPoolAllocator class inline in this file, but our fork
   moved the class to allocator/swa.py in an earlier refactor. Drop
   their duplicate; instead apply sgl-project#573's free_swa fix (guard against
   negative sentinels and out-of-range indices, expand page-aligned
   free) directly to allocator/swa.py where the class actually lives.

4. hybrid_pool_assembler.py:
   - kvcache.compress_state_pools indexing: keep either form (addition
     is commutative); use HEAD's ordering for local consistency.
   - C128 state pool registration: keep HEAD's explicit non-registration
     with the "C128 State pool intentionally not registered" comment.
     Our HEAD's upstream sgl-project#27293 deliberately opted out; their side (from
     before sgl-project#601) still registers it. Silently reintroducing the pool
     would regress the fix and pressure host memory.
   - attach_hybrid_pool_to_unified_cache body: keep HEAD's
     _select_strategy(...).build() dispatch (from upstream sgl-project#26295)
     over their 245-line inline if-elif chain. Our _DeepSeekV4Strategy
     already handles the deepseek_v4 stack; the strategy signature
     already accepts storage_backend / storage_extra_config /
     storage_prefetch_threshold.

5. unified_radix_cache.py (24 conflicts) -- keep HEAD wholesale:
   - HEAD has 10 methods theirs lacks (all from upstream sgl-project#26881,
     sgl-project#27285, sgl-project#27391, sgl-project#27489, sgl-project#27554, sgl-project#27655 L3 support + our PR sgl-project#27010
     port: prefetch_sync_thread, ack-driven sync, handle_prefetch_result,
     _drain_async_work, _finish_write_through_ack, etc.)
   - Their only extra method (terminate_prefetch(rid)) was deliberately
     removed by our PR sgl-project#27010 port.
   - HEAD's load_back_threshold=10 matches hi_mamba_radix_cache and
     hiradix_cache (theirs=256 was an inconsistent local tuning).
   - HEAD passes total_len to InsertResult (dataclass field exists) and
     priority to UnifiedTreeNode (LRU correctness).
   - HEAD's write_backup early-returns on written==0 (upstream sgl-project#27108
     safety fix); theirs drops the check.
   - HEAD's _drain_queue is blocking with qsize MIN-reduce (our PR
     sgl-project#27010's lockstep drain); theirs is old get_nowait+Empty pattern
     that would desync PP/TP.
   - sgl-project#564's L2/L3 additions in this file are functionally covered by
     upstream sgl-project#26881 (already in HEAD via ep_main). No net feature
     loss from taking HEAD.

Verified: AST parse OK for all 9 mem_cache files, compileall exit=0
on managers + mem_cache trees.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Chronostasys pushed a commit to MindLab-Research/sglang that referenced this pull request Aug 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run-ci CI: run the baseline test suite on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants