Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bugfix] We have fixed the bug that occurred when using FlashInfer as the backend in vLLM Speculative Decoding. #5412

Closed
wants to merge 6 commits into from
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
10 changes: 8 additions & 2 deletions vllm/worker/model_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,9 +395,15 @@ def _prepare_model_input(
block_table = block_table[
-curr_sliding_window_blocks:]
if self.attn_backend.get_name() == "flashinfer":
paged_kv_indices.extend(block_table)
# flashinfer wrong indexing bug fix
block_table_bound = seq_data.get_len(
) // self.block_size + 1 if seq_data.get_len(
) % self.block_size != 0 else seq_data.get_len(
) // self.block_size
paged_kv_indices.extend(
block_table[:block_table_bound])
paged_kv_indptr.append(paged_kv_indptr[-1] +
len(block_table))
block_table_bound)
last_page_len = seq_data.get_len(
) % self.block_size
if last_page_len == 0:
Expand Down
Loading