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

fix: Assign the initial value of occupying_slots to the value of requested_slots #2730

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions changes/2730.fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
When the session is in the PENDING, PREPARING state, assign the initial value to 'requested_slots' to know 'occupying_slots'.
1 change: 1 addition & 0 deletions src/ai/backend/manager/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -1273,6 +1273,7 @@ async def _enqueue() -> None:

session_data["environ"] = environ
session_data["requested_slots"] = session_requested_slots
session_data["occupying_slots"] = session_requested_slots
Copy link
Member

@fregataa fregataa Aug 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will double the value of sessions.occupying_slots because the value of actual allocated resource is added to this in finalize_running().
We should update the finalize_running() or change this code.

session = SessionRow(**session_data)
kernels = [KernelRow(**kernel) for kernel in kernel_data]
db_sess.add(session)
Expand Down