Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions vllm/v1/worker/gpu/pp_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,10 @@ def broadcast_drafts(
return
with torch.cuda.stream(self.broadcast_stream):
self.broadcast_stream.wait_stream(self.main_stream)
# idx_mapping is a temporary allocation on the main stream and read here
# on broadcast_stream; without record_stream, the caching allocator may
# reuse its memory before the gather executes.
input_batch.idx_mapping.record_stream(self.broadcast_stream)
send = draft_tokens[input_batch.idx_mapping].contiguous()
torch.distributed.broadcast(
send, src=self.last_rank, group=self.broadcast_group
Expand Down
Loading