Skip to content

Commit

Permalink
yapf reformat vllm/core
Browse files Browse the repository at this point in the history
  • Loading branch information
jberkhahn committed Aug 22, 2024
1 parent bd62063 commit 1fc1edc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
5 changes: 3 additions & 2 deletions vllm/block.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

DEFAULT_LAST_ACCESSED_TIME: float = -1


class PhysicalTokenBlock:
"""Represents the state of a block in the KV cache."""

Expand Down Expand Up @@ -59,8 +60,8 @@ def __getitem__(self, key):
return self._blocks[key]

def __iter__(self) -> Iterator[PhysicalTokenBlock]:
for i in range(len(self)):
yield self[i]
for i in range(len(self)):
yield self[i]

def __setitem__(self, key, value):
if isinstance(key, slice):
Expand Down
3 changes: 2 additions & 1 deletion vllm/core/block_manager_v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,8 @@ def _allocate_sequence(self, \
for logical_idx in range(num_prompt_blocks):
if (self.block_sliding_window is not None
and logical_idx >= self.block_sliding_window):
block = block_table[logical_idx % self.block_sliding_window]
block = block_table[logical_idx %
self.block_sliding_window]
# Set the reference counts of the token blocks.
block.ref_count = ref_count
elif not is_encoder_decoder and self.enable_caching:
Expand Down
3 changes: 2 additions & 1 deletion vllm/core/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,8 @@ def scheduler_running_outputs_builder():


def scheduled_seq_group_builder():
return ScheduledSequenceGroup(SequenceGroup("", [], -1), token_chunk_size=0)
return ScheduledSequenceGroup(SequenceGroup("", [], -1),
token_chunk_size=0)
# return ScheduledSequenceGroup(seq_group=None, token_chunk_size=0)


Expand Down

0 comments on commit 1fc1edc

Please sign in to comment.