Skip to content

[Spec] Polish FutureMap after #25879: rename callback, async guard, cleanup#25962

Merged
hnyls2002 merged 35 commits into
mainfrom
lsyin/spec-publish-polish
May 21, 2026
Merged

[Spec] Polish FutureMap after #25879: rename callback, async guard, cleanup#25962
hnyls2002 merged 35 commits into
mainfrom
lsyin/spec-publish-polish

Conversation

@hnyls2002
Copy link
Copy Markdown
Collaborator

@hnyls2002 hnyls2002 commented May 21, 2026

Stacked on #25879. Strictly polish — no behavior change.

  • rename on_verify_complete kwarg → on_publish (disambiguate from on_verify_complete_cpu method)
  • type-hint FutureMap.stash payload as Union[torch.Tensor, EagleDraftInput]
  • drop duplicate if batch.is_spec_v2 gate around resolve_seq_lens_cpu; let it self-gate on spec_info.future_indices
  • drop cuda-specific type annotation on publish_ready (lazy via get_device_module(device).Event(), hip/cuda-agnostic)
  • expand # DP idle comment in stash to keep the original 'why early-return' reasoning
  • async-assert (batch.seq_lens > 0).all() after resolve_future: catches a -future_indices.indices sentinel slipping through if publish_ready fencing or buf indexing is wrong
  • trim polish comments to one-liners

hnyls2002 and others added 28 commits May 20, 2026 18:02
Copy link
Copy Markdown
Contributor

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

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 refines the overlap scheduling and speculative decoding logic to improve robustness and device-agnosticism. Key updates include replacing the sentinel value for seq_lens with None to ensure safer batch filtering and merging, and renaming on_verify_complete to on_publish for better clarity. Additionally, the publish_ready event is now initialized lazily to support different hardware backends, and the stash method includes a guard for empty indices to handle data-parallel idle ranks. I have no feedback to provide.

Base automatically changed from lsyin/draft-prefix-lens to main May 21, 2026 08:51
hnyls2002 added 3 commits May 21, 2026 01:55
…lish

# Conflicts:
#	python/sglang/srt/managers/overlap_utils.py
#	python/sglang/srt/managers/scheduler.py
#	python/sglang/srt/speculative/eagle_worker_v2.py
#	python/sglang/srt/speculative/multi_layer_eagle_worker_v2.py
@hnyls2002 hnyls2002 changed the title [Spec] Polish on top of #25879: rename publish callback, None sentinel [Spec] Polish FutureMap after #25879: rename callback, async guard, cleanup May 21, 2026
@hnyls2002 hnyls2002 merged commit c9a0e55 into main May 21, 2026
94 of 151 checks passed
@hnyls2002 hnyls2002 deleted the lsyin/spec-publish-polish branch May 21, 2026 20:56
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.

1 participant