Unverified Commit e97c46a9 authored by Martin Hickey's avatar Martin Hickey Committed by GitHub
Browse files

[BugFix]: Fix local mypy issues (#34739)


Signed-off-by: default avatarMartin Hickey <martin.hickey@ie.ibm.com>
Co-authored-by: default avatarHarry Mellor <19981378+hmellor@users.noreply.github.com>
parent 7291d1b2
...@@ -935,6 +935,10 @@ class NixlConnectorWorker: ...@@ -935,6 +935,10 @@ class NixlConnectorWorker:
] ]
if rsv_cores_for_kv: if rsv_cores_for_kv:
if not hasattr(os, "sched_setaffinity"):
raise NotImplementedError(
"os.sched_setaffinity is not available on this platform"
)
os.sched_setaffinity(0, rsv_cores_for_kv) os.sched_setaffinity(0, rsv_cores_for_kv)
# support for oot platform which can't register nixl memory # support for oot platform which can't register nixl memory
......
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
# https://github.com/lm-sys/FastChat/blob/168ccc29d3f7edc50823016105c024fe2282732a/fastchat/protocol/openai_api_protocol.py # https://github.com/lm-sys/FastChat/blob/168ccc29d3f7edc50823016105c024fe2282732a/fastchat/protocol/openai_api_protocol.py
import json import json
import time import time
from dataclasses import replace
from typing import Annotated, Any, ClassVar, Literal from typing import Annotated, Any, ClassVar, Literal
import torch import torch
...@@ -16,6 +15,7 @@ from openai.types.chat.chat_completion_message import Annotation as OpenAIAnnota ...@@ -16,6 +15,7 @@ from openai.types.chat.chat_completion_message import Annotation as OpenAIAnnota
from pydantic import Field, model_validator from pydantic import Field, model_validator
from vllm.config import ModelConfig from vllm.config import ModelConfig
from vllm.config.utils import replace
from vllm.entrypoints.chat_utils import ( from vllm.entrypoints.chat_utils import (
ChatCompletionMessageParam, ChatCompletionMessageParam,
ChatTemplateContentFormatOption, ChatTemplateContentFormatOption,
......
...@@ -5,13 +5,13 @@ ...@@ -5,13 +5,13 @@
# https://github.com/lm-sys/FastChat/blob/168ccc29d3f7edc50823016105c024fe2282732a/fastchat/protocol/openai_api_protocol.py # https://github.com/lm-sys/FastChat/blob/168ccc29d3f7edc50823016105c024fe2282732a/fastchat/protocol/openai_api_protocol.py
import json import json
import time import time
from dataclasses import replace
from typing import Annotated, Any, Literal from typing import Annotated, Any, Literal
import torch import torch
from pydantic import Field, model_validator from pydantic import Field, model_validator
from vllm.config import ModelConfig from vllm.config import ModelConfig
from vllm.config.utils import replace
from vllm.entrypoints.openai.engine.protocol import ( from vllm.entrypoints.openai.engine.protocol import (
AnyResponseFormat, AnyResponseFormat,
LegacyStructuralTagResponseFormat, LegacyStructuralTagResponseFormat,
......
...@@ -337,7 +337,9 @@ class ResponsesRequest(OpenAIBaseModel): ...@@ -337,7 +337,9 @@ class ResponsesRequest(OpenAIBaseModel):
and response_format.schema_ is not None and response_format.schema_ is not None
): ):
structured_outputs = StructuredOutputsParams( structured_outputs = StructuredOutputsParams(
json=response_format.schema_ json=response_format.schema_ # type: ignore[call-arg]
# --follow-imports skip hides the class definition but also hides
# multiple third party conflicts, so best of both evils
) )
stop = self.stop if self.stop else [] stop = self.stop if self.stop else []
......
...@@ -8,7 +8,6 @@ from collections import deque ...@@ -8,7 +8,6 @@ from collections import deque
from collections.abc import AsyncGenerator, AsyncIterator, Callable, Sequence from collections.abc import AsyncGenerator, AsyncIterator, Callable, Sequence
from contextlib import AsyncExitStack from contextlib import AsyncExitStack
from copy import copy from copy import copy
from dataclasses import replace
from http import HTTPStatus from http import HTTPStatus
from typing import Final from typing import Final
...@@ -40,6 +39,7 @@ from openai_harmony import Message as OpenAIHarmonyMessage ...@@ -40,6 +39,7 @@ from openai_harmony import Message as OpenAIHarmonyMessage
from pydantic import TypeAdapter from pydantic import TypeAdapter
from vllm import envs from vllm import envs
from vllm.config.utils import replace
from vllm.engine.protocol import EngineClient from vllm.engine.protocol import EngineClient
from vllm.entrypoints.chat_utils import ( from vllm.entrypoints.chat_utils import (
ChatCompletionMessageParam, ChatCompletionMessageParam,
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
"""Sampling parameters for text generation.""" """Sampling parameters for text generation."""
import copy import copy
import json import json as json_mod
from dataclasses import field from dataclasses import field
from enum import Enum, IntEnum from enum import Enum, IntEnum
from functools import cached_property from functools import cached_property
...@@ -791,7 +791,7 @@ class SamplingParams( ...@@ -791,7 +791,7 @@ class SamplingParams(
skip_guidance = False skip_guidance = False
if so_params.json: if so_params.json:
if isinstance(so_params.json, str): if isinstance(so_params.json, str):
schema = json.loads(so_params.json) schema = json_mod.loads(so_params.json)
else: else:
schema = so_params.json schema = so_params.json
skip_guidance = has_guidance_unsupported_json_features(schema) skip_guidance = has_guidance_unsupported_json_features(schema)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment