Signed-off-by: Pr0Wh1teGivee <calvin_zhu0210@outlook.com>
Signed-off-by: weichen <calvin_zhu0210@outlook.com>
This commit is contained in:
Pr0Wh1teGivee 2025-12-03 16:04:00 +08:00 committed by weichen
parent dd0e1224bc
commit db3e0a576e
3 changed files with 6 additions and 5 deletions

View File

@ -99,5 +99,6 @@ class TimeAndLengthScorer(NormalizedScorer):
]
super().__init__(dim_list)
def score(self, time: float, length: float) -> float:
return super().score(time, length)
def score(self, *dims: float) -> float:
assert len(dims) == 2
return super().score(*dims)

View File

@ -2,9 +2,9 @@
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
import time
from functools import total_ordering
from typing import Any
from vllm.v1.core.sched.policy.normalized_scorer import TimeAndLengthScorer
from typing import Optional, List, Any
TimeAndLengthScorer_Instance = None
@ -24,7 +24,7 @@ class WeightedScoreSorter:
self,
request_length: int,
request_arrival_time: float,
request_slo_requirement: Optional[List[Any]] = None,
request_slo_requirement: list[Any] | None = None,
):
self.request_length = request_length
self.request_arrival_time = request_arrival_time

View File

@ -221,7 +221,7 @@ class SJFRequestQueue(RequestQueue):
def add_request(self, request: Request) -> None:
"""Add a request to the queue according to SJF policy."""
assert request.prompt_token_ids is not None, "prompt_token_ids cannot be None for SJF scheduling."
assert request.prompt_token_ids is not None
heapq.heappush(
self._heap,
(