[GG] fix DCP packed A2A buffer lifetime during graph prewarm - #130
Merged
Conversation
📝 WalkthroughWalkthroughThe DCP A2A buffer path now treats vLLM cudagraph capture as capture-active alongside CUDA stream capture. Tests verify prewarmed buffer reuse before stream capture and confirm eager buffers remain unretained. ChangesA2A capture buffer retention
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
This was referenced Jul 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Root cause
The existing graph-buffer fix retains exact-shape tensors only when
torch.cuda.is_current_stream_capturing()is true. vLLM performs an eager descriptor prewarm before entering the innertorch.cuda.graphcontext, so the first retained allocation still comes from the shared graph pool during capture.For DCP sizes unsupported by the B12X PCIe pool, notably virtual TP6 with DCP3 or DCP6, NCCL graph nodes retain these staging addresses. The shared pool can recycle an address while later FULL descriptors are captured, producing intermittent Xid 31 illegal reads. Two preserved failures occurred at FULL graph 12/16 for MTP0 on rank 0 and 15/16 for MTP3 on rank 4; the Python frame where the asynchronous fault surfaced differed, but both NCCL watchdogs reported the same illegal-access class.
The outer
vllm_cudagraph_capture_scopealready spans descriptor prewarm and capture. Treating that scope as graph setup allocates each exact-shape pair before the inner CUDA graph pool is active.Scope
This does not change transport selection, tensor contents, CUDA graph sizes, or steady-state execution. It only advances allocation and extends the lifetime of buffers that were already intended to remain graph-owned.
Measured overhead on TP6/DCP3 was about 10-20 MiB per GPU of graph memory. KV capacity was unchanged.
Validation
3 passed, 38 deselectedfor the packed A2A capture/prewarm/eager ownership tests.Summary by CodeRabbit