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

reduce logic block #435

Merged
merged 1 commit into from
Sep 20, 2023
Merged
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
4 changes: 2 additions & 2 deletions lmdeploy/pytorch_poc/paging/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,15 +139,15 @@ def _to_running(msg: SchedulerMessage):
if self.block_manager.can_append_slot(session):
msg_length = len(msg.token_ids)
block_size = self.cache_config.block_size
session.append_tokens(msg_length + 1, block_size)
session.append_tokens(msg_length, block_size)
self.block_manager.append_slot(session)
enable_running = True
else:
if self.block_manager.can_allocate(session):
# update logical blocks of session
msg_length = len(msg.token_ids)
block_size = self.cache_config.block_size
session.append_tokens(msg_length + 1, block_size)
session.append_tokens(msg_length, block_size)

# allocate session memory
self.block_manager.allocate(session)
Expand Down