Skip to content

fix: graceful degradation when EAGLE draft pool fails to register with Mooncake standalone storage - #29035

Open
HyeonjeCho wants to merge 3 commits into
sgl-project:mainfrom
HyeonjeCho:fix/eagle-mooncake-l3-ssd-crash
Open

HyeonjeCho wants to merge 3 commits into
sgl-project:mainfrom
HyeonjeCho:fix/eagle-mooncake-l3-ssd-crash

Conversation

@HyeonjeCho

@HyeonjeCho HyeonjeCho commented Jun 23, 2026

Copy link
Copy Markdown

Motivation

Fixes #28873

When using EAGLE speculative decoding with Mooncake L3 storage in standalone (dummy client) mode, the server crashes during startup. The draft host pool is allocated with the default allocator (mmap) instead of MooncakeHostTensorAllocator, causing register_buffer() to fail with error code -1 because the buffer is outside Mooncake's shared memory segment.

Modifications

Wrap the register_mem_host_pool_v2() call in _maybe_register_draft_with_storage() with a try/except. On failure, log a warning and return early so that draft_page_get_func and draft_page_set_func remain None.

This disables draft L3 (SSD offload) while keeping:

  • Draft L2 (host DRAM): fully functional (uses mem_pool_host_draft directly, independent of storage backend)
  • Target model L2/L3: fully functional (target pool uses MooncakeHostTensorAllocator correctly)

Accuracy Tests

Not applicable — no changes to model forward code.

Speed Tests and Profiling

Not applicable — no changes to inference kernels. The fix only affects startup behavior.

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

…h Mooncake standalone storage

When using EAGLE speculative decoding with Mooncake L3 storage in
standalone (dummy client) mode, the server crashes during startup because
the draft host pool is allocated with the default allocator (mmap) instead
of MooncakeHostTensorAllocator. This causes register_buffer() to fail with
error code -1, since the buffer is outside Mooncake's shared memory segment.

Wrap the register_mem_host_pool_v2() call in _maybe_register_draft_with_storage()
with a try/except. On failure, log a warning and return early so that
draft_page_get_func and draft_page_set_func remain None. This disables
draft L3 (SSD offload) while keeping draft L2 (host DRAM) and target L2/L3
fully functional.

@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 wraps the registration of the draft memory host pool in a try-except block to gracefully handle registration failures with Mooncake Store, falling back to L2 cache. The reviewer suggests catching Exception instead of only RuntimeError to ensure all potential exceptions from C++ bindings are caught, preventing startup failures.

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.

Comment thread python/sglang/srt/managers/cache_controller.py Outdated
Add test_draft_l3_graceful_degradation.py covering:
- Mooncake register_mem_host_pool_v2() failure keeps draft funcs None
- Any exception type (not just RuntimeError) is caught
- Successful registration sets v2 funcs correctly
- Non-mooncake backends remain unaffected
@stmatengss stmatengss self-assigned this Jun 28, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

An extra unit test is unnecessary.

@stmatengss

Copy link
Copy Markdown
Collaborator

Motivation

Fixes #28873

When using EAGLE speculative decoding with Mooncake L3 storage in standalone (dummy client) mode, the server crashes during startup. The draft host pool is allocated with the default allocator (mmap) instead of MooncakeHostTensorAllocator, causing register_buffer() to fail with error code -1 because the buffer is outside Mooncake's shared memory segment.

Modifications

Wrap the register_mem_host_pool_v2() call in _maybe_register_draft_with_storage() with a try/except. On failure, log a warning and return early so that draft_page_get_func and draft_page_set_func remain None.

This disables draft L3 (SSD offload) while keeping:

  • Draft L2 (host DRAM): fully functional (uses mem_pool_host_draft directly, independent of storage backend)
  • Target model L2/L3: fully functional (target pool uses MooncakeHostTensorAllocator correctly)

Accuracy Tests

Not applicable — no changes to model forward code.

Speed Tests and Profiling

Not applicable — no changes to inference kernels. The fix only affects startup behavior.

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

This issue likely stems from the dummy client's lack of draft model offloading support in standalone mode. MooncakeHostTensorAllocator could be a potential solution.

@huangtingwei9988

Copy link
Copy Markdown
Collaborator

Thanks for pointing out the issue. Because the draft didn't specify an allocator type, an inconsistent allocator was used, causing an error when registering the buffer. I have now fixed this problem. #29823

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] EAGLE speculative decoding crashes with Mooncake L3 HiCache in standalone client mode (v0.5.13 regression)

3 participants