Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Yard1 committed Jul 18, 2024
1 parent dd897db commit ebf4794
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions vllm/core/block/block_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,8 +346,8 @@ def get_num_blocks_touched_by_append_slots(
num_token_ids = len(token_ids) + num_lookahead_slots
first_chunk_size = self._block_size - (self._num_full_slots %
self._block_size)
num_token_blocks = (
1 + math.ceil(num_token_ids - first_chunk_size / self._block_size))
num_token_blocks = (1 + math.ceil(
(num_token_ids - first_chunk_size) / self._block_size))
return num_token_blocks

def _chunk_token_blocks_for_append(
Expand All @@ -359,6 +359,7 @@ def _chunk_token_blocks_for_append(
"""
first_chunk_size = self._block_size - (self._num_full_slots %
self._block_size)
token_blocks = [token_ids[:first_chunk_size]] + list(
token_blocks = [token_ids[:first_chunk_size]]
token_blocks.extend(
chunk_list(token_ids[first_chunk_size:], self._block_size))
return token_blocks

0 comments on commit ebf4794

Please sign in to comment.