diff --git a/vllm/v1/engine/core.py b/vllm/v1/engine/core.py index 5a4e67a2dd78..174d96ec4377 100644 --- a/vllm/v1/engine/core.py +++ b/vllm/v1/engine/core.py @@ -22,6 +22,7 @@ from vllm.utils import (get_exception_traceback, resolve_obj_by_qualname, zmq_socket_ctx) from vllm.v1.core.kv_cache_utils import get_kv_cache_configs +from vllm.v1.core.scheduler import Scheduler as V1Scheduler from vllm.v1.core.scheduler import SchedulerOutput from vllm.v1.engine import (EngineCoreOutputs, EngineCoreRequest, EngineCoreRequestType, UtilityOutput) @@ -67,15 +68,21 @@ def __init__( # Setup scheduler. if isinstance(vllm_config.scheduler_config.scheduler_cls, str): + Scheduler = resolve_obj_by_qualname( + vllm_config.scheduler_config.scheduler_cls) + else: + Scheduler = vllm_config.scheduler_config.scheduler_cls + + # This warning can be removed once the V1 Scheduler interface is + # finalized and we can maintain support for scheduler classes that + # implement it + if Scheduler is not V1Scheduler: logger.warning( "Using configured V1 scheduler class %s. " "This scheduler interface is not public and " "compatibility may not be maintained.", vllm_config.scheduler_config.scheduler_cls) - Scheduler = resolve_obj_by_qualname( - vllm_config.scheduler_config.scheduler_cls) - else: - Scheduler = vllm_config.scheduler_config.scheduler_cls + self.scheduler = Scheduler( scheduler_config=vllm_config.scheduler_config, model_config=vllm_config.model_config,