Skip to content
Closed
Changes from all commits
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
7 changes: 7 additions & 0 deletions vllm/v1/spec_decode/llm_base_proposer.py
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,13 @@ def propose(
# copy inputs to buffer for cudagraph
self.input_ids[:batch_size] = input_ids
self.hidden_states[:batch_size] = hidden_states

# Wait for the `input_ids` write to finish on device before constructing
# attention metadata or launching downstream kernels. Synchronizing the
# current stream blocks the CPU minimally, avoiding an expensive
# global torch.accelerator.synchronize().
torch.accelerator.current_stream().synchronize()

if self.supports_mm_inputs:
self.inputs_embeds[:batch_size] = self.model.embed_input_ids(input_ids)

Expand Down
Loading