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

FEAT: support scheduling-policy for vllm #2700

Merged
merged 1 commit into from
Dec 24, 2024
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
9 changes: 7 additions & 2 deletions xinference/model/llm/vllm/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ class VLLMModelConfig(TypedDict, total=False):
max_model_len: Optional[int]
limit_mm_per_prompt: Optional[Dict[str, int]]
guided_decoding_backend: Optional[str]
scheduling_policy: Optional[str]


class VLLMGenerateConfig(TypedDict, total=False):
Expand Down Expand Up @@ -247,7 +248,6 @@ def load(self):
multiprocessing.set_start_method("fork", force=True)

self._model_config = self._sanitize_model_config(self._model_config)

if self.lora_modules is None:
self.lora_requests = []
else:
Expand Down Expand Up @@ -330,7 +330,9 @@ def _sanitize_model_config(
model_config.setdefault("quantization", None)
model_config.setdefault("max_model_len", None)
model_config.setdefault("guided_decoding_backend", "outlines")

# Add scheduling policy if vLLM version is 0.6.3 or higher
if vllm.__version__ >= "0.6.3":
model_config.setdefault("scheduling_policy", "fcfs")
return model_config

@staticmethod
Expand Down Expand Up @@ -862,6 +864,9 @@ def _sanitize_model_config(
"image": 2, # default 2 images all chat
}
)
# Add scheduling policy if vLLM version is 0.6.3 or higher
if vllm.__version__ >= "0.6.3":
model_config.setdefault("scheduling_policy", "fcfs")

return model_config

Expand Down
Loading