Skip to content

fix(ds4): isolate auxiliary-stream events across CUDA graphs - #102

Merged
lukealonso merged 1 commit into
dev/fathomless-firmamentfrom
codex/ff-ds4-cudagraph-event-lifetime-20260717
Jul 17, 2026
Merged

fix(ds4): isolate auxiliary-stream events across CUDA graphs#102
lukealonso merged 1 commit into
dev/fathomless-firmamentfrom
codex/ff-ds4-cudagraph-event-lifetime-20260717

Conversation

@voipmonitor

Copy link
Copy Markdown

Problem

DS4 sparse attention reuses auxiliary streams for indexer and post-GEMM work. CUDA events from one graph capture could be recycled or overwritten while another captured graph still referenced them. The resulting cross-graph aliasing produced races/corruption; globally disabling overlap avoided the race but regressed MTP and DSpark performance.

Fix

  • Add capture-scoped event leases and retain them for the graph lifetime.
  • Separate the inner-indexer and post-GEMM event pools.
  • Give eager execution private reusable leases without leaking capture events.
  • Restore safe B12X/FlashInfer post-GEMM overlap.
  • Keep the B12X MHC auxiliary reconstruction path synchronized through the same ownership model.

This is a clean current-FF extraction from the experimental #88 history. It intentionally excludes unrelated helper-script, custom-allreduce, and DSpark capacity-controller changes.

Validation

  • python -m pytest -q tests/models/deepseek_v4/test_attention_stream_events.py tests/test_multi_stream_utils.py
  • Result: 8 passed
  • ruff check, ruff format --check, and git diff --check

@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@voipmonitor, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 59 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 86560a1b-780e-4928-ba8b-8fbf4903e7f1

📥 Commits

Reviewing files that changed from the base of the PR and between e4879e1 and dc16464.

📒 Files selected for processing (10)
  • tests/models/deepseek_v4/test_attention_stream_events.py
  • tests/test_multi_stream_utils.py
  • vllm/compilation/breakable_cudagraph.py
  • vllm/compilation/cuda_graph.py
  • vllm/models/deepseek_v4/attention.py
  • vllm/models/deepseek_v4/nvidia/b12x.py
  • vllm/models/deepseek_v4/nvidia/flashinfer_sparse.py
  • vllm/models/deepseek_v4/nvidia/model.py
  • vllm/utils/multi_stream_utils.py
  • vllm/v1/worker/gpu/cudagraph_utils.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/ff-ds4-cudagraph-event-lifetime-20260717

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

2 participants