vllm.v1.core.sched.request_queue
¶
Classes:
-
FCFSRequestQueue–A first-come-first-served queue that supports deque operations.
-
PriorityRequestQueue–A priority queue that supports heap operations.
-
RequestQueue–Abstract base class for request queues.
-
SchedulingPolicy–Enum for scheduling policies.
Functions:
-
create_request_queue–Create request queue based on scheduling policy.
FCFSRequestQueue
¶
Bases: deque[Request], RequestQueue
A first-come-first-served queue that supports deque operations.
Methods:
-
__bool__–Check if queue has any requests.
-
__iter__–Iterate over the queue according to FCFS policy.
-
__len__–Get number of requests in queue.
-
add_request–Add a request to the queue according to FCFS policy.
-
peek_request–Peek at the next request in the queue without removing it.
-
pop_request–Pop a request from the queue according to FCFS policy.
-
prepend_request–Prepend a request to the front of the queue.
-
prepend_requests–Prepend all requests from another queue to the front of this
-
remove_request–Remove a specific request from the queue.
-
remove_requests–Remove multiple specific requests from the queue.
Source code in vllm/v1/core/sched/request_queue.py
__bool__()
¶
__iter__()
¶
__len__()
¶
add_request(request)
¶
peek_request()
¶
pop_request()
¶
prepend_request(request)
¶
prepend_requests(requests)
¶
Prepend all requests from another queue to the front of this queue.
Note: The requests will be prepended in reverse order of their
appearance in the requests queue.
Source code in vllm/v1/core/sched/request_queue.py
remove_request(request)
¶
remove_requests(requests)
¶
Remove multiple specific requests from the queue.
Source code in vllm/v1/core/sched/request_queue.py
PriorityRequestQueue
¶
Bases: RequestQueue
A priority queue that supports heap operations.
Respects the ordering defined in the Request class, where
requests with a smaller value of priority are processed first.
If multiple requests have the same priority, the one with the earlier
arrival_time is processed first.
Methods:
-
__bool__–Check if queue has any requests.
-
__iter__–Iterate over the queue according to priority policy.
-
__len__–Get number of requests in queue.
-
add_request–Add a request to the queue according to priority policy.
-
peek_request–Peek at the next request in the queue without removing it.
-
pop_request–Pop a request from the queue according to priority policy.
-
prepend_request–Add a request to the queue according to priority policy.
-
prepend_requests–Add all requests from another queue according to priority policy.
-
remove_request–Remove a specific request from the queue.
-
remove_requests–Remove multiple specific requests from the queue.
Source code in vllm/v1/core/sched/request_queue.py
__bool__()
¶
__iter__()
¶
__len__()
¶
add_request(request)
¶
peek_request()
¶
Peek at the next request in the queue without removing it.
pop_request()
¶
Pop a request from the queue according to priority policy.
prepend_request(request)
¶
Add a request to the queue according to priority policy.
Note: In a priority queue, there is no concept of prepending to the front. Requests are ordered by (priority, arrival_time).
Source code in vllm/v1/core/sched/request_queue.py
prepend_requests(requests)
¶
Add all requests from another queue according to priority policy.
Note: In a priority queue, there is no concept of prepending to the front. Requests are ordered by (priority, arrival_time).
Source code in vllm/v1/core/sched/request_queue.py
remove_request(request)
¶
remove_requests(requests)
¶
Remove multiple specific requests from the queue.
Source code in vllm/v1/core/sched/request_queue.py
RequestQueue
¶
Bases: ABC
Abstract base class for request queues.
Methods:
-
__bool__–Check if queue has any requests.
-
__iter__–Iterate over the queue according to the policy.
-
__len__–Get number of requests in queue.
-
add_request–Add a request to the queue according to the policy.
-
peek_request–Peek at the request at the front of the queue without removing it.
-
pop_request–Pop a request from the queue according to the policy.
-
prepend_request–Prepend a request to the front of the queue.
-
prepend_requests–Prepend all requests from another queue to the front of this
-
remove_request–Remove a specific request from the queue.
-
remove_requests–Remove multiple specific requests from the queue.
Source code in vllm/v1/core/sched/request_queue.py
__bool__()
abstractmethod
¶
__iter__()
abstractmethod
¶
__len__()
abstractmethod
¶
add_request(request)
abstractmethod
¶
peek_request()
abstractmethod
¶
pop_request()
abstractmethod
¶
prepend_request(request)
abstractmethod
¶
prepend_requests(requests)
abstractmethod
¶
remove_request(request)
abstractmethod
¶
SchedulingPolicy
¶
create_request_queue(policy)
¶
Create request queue based on scheduling policy.