Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
mfylcek committed Oct 25, 2024
1 parent 9762512 commit e8dfc9e
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions vllm/worker/hpu_model_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -1007,8 +1007,12 @@ def _prepare_decode(

max_idx = max(block_list)
max_blocks = max(max_idx + 1, len(block_list))
block_bucket_size = find_bucket(max_blocks, self.bucketing_global_state.decode_block_bucket_cfg)
block_bucket_size = min(block_bucket_size, self.cache_config.num_gpu_blocks)
block_bucket_size = find_bucket(
max_blocks, self.bucketing_global_state.decode_block_bucket_cfg
)
block_bucket_size = min(
block_bucket_size, self.cache_config.num_gpu_blocks
)

block_mapping = [None] * block_bucket_size
block_usage = [None] * block_bucket_size
Expand All @@ -1030,7 +1034,7 @@ def _prepare_decode(
for bt, sl in zip(block_tables, slot_mapping):
if bt:
block_usage[bt[-1]] = sl[-1] % self.block_size + 1
block_usage = [u if u is not None else 1 for u in block_usage]
block_usage = [u if u is not None else 1 for u in block_usage]

block_list = pad_list(block_list, block_bucket_size, _PAD_BLOCK_ID)
block_groups = pad_list(block_mapping, block_bucket_size,
Expand Down

0 comments on commit e8dfc9e

Please sign in to comment.