Skip to content

Commit

Permalink
finish
Browse files Browse the repository at this point in the history
Signed-off-by: youkaichao <[email protected]>
  • Loading branch information
youkaichao committed Nov 21, 2024
1 parent f5ee6c2 commit 00595e5
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 14 deletions.
2 changes: 1 addition & 1 deletion vllm/executor/gpu_executor.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Any, Callable, Dict, List, Optional, Set, Tuple, Type, Union
from typing import Any, Dict, List, Optional, Set, Tuple, Union

from vllm.executor.executor_base import ExecutorAsyncBase, ExecutorBase
from vllm.logger import init_logger
Expand Down
3 changes: 1 addition & 2 deletions vllm/executor/ray_hpu_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
import os
from collections import defaultdict
from itertools import islice, repeat
from typing import (TYPE_CHECKING, Any, Callable, Dict, List, Optional, Tuple,
Type)
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple

import msgspec

Expand Down
2 changes: 1 addition & 1 deletion vllm/executor/xpu_executor.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Callable, List, Optional, Tuple, Type, Union
from typing import List, Optional, Union

from vllm.executor.executor_base import ExecutorAsyncBase
from vllm.executor.gpu_executor import GPUExecutor
Expand Down
4 changes: 2 additions & 2 deletions vllm/platforms/cuda.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import os
from functools import lru_cache, wraps
from typing import Callable, List, Tuple, TypeVar
from typing import TYPE_CHECKING, Callable, List, Tuple, TypeVar

import pynvml
import torch
Expand All @@ -15,7 +15,7 @@
from vllm.logger import init_logger

from .interface import DeviceCapability, Platform, PlatformEnum
from typing import TYPE_CHECKING

if TYPE_CHECKING:
from vllm.config import VllmConfig
else:
Expand Down
4 changes: 3 additions & 1 deletion vllm/platforms/hpu.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
from typing import TYPE_CHECKING

import torch

from .interface import Platform, PlatformEnum, _Backend
from typing import TYPE_CHECKING

if TYPE_CHECKING:
from vllm.config import VllmConfig
else:
Expand Down
7 changes: 5 additions & 2 deletions vllm/platforms/neuron.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from .interface import Platform, PlatformEnum
from typing import TYPE_CHECKING

from .interface import Platform, PlatformEnum

if TYPE_CHECKING:
from vllm.config import VllmConfig
else:
Expand All @@ -18,4 +20,5 @@ def get_device_name(cls, device_id: int = 0) -> str:
def check_and_update_config(cls, vllm_config: VllmConfig) -> None:
parallel_config = vllm_config.parallel_config
if parallel_config.worker_cls == "auto":
parallel_config.worker_cls = "vllm.worker.neuron_worker.NeuronWorker"
parallel_config.worker_cls = \
"vllm.worker.neuron_worker.NeuronWorker"
6 changes: 4 additions & 2 deletions vllm/platforms/openvino.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
from typing import TYPE_CHECKING

import torch

import vllm.envs as envs
from vllm.logger import init_logger

from .interface import Platform, PlatformEnum, _Backend

from typing import TYPE_CHECKING
if TYPE_CHECKING:
from vllm.config import VllmConfig
else:
Expand Down Expand Up @@ -53,4 +54,5 @@ def check_and_update_config(cls, vllm_config: VllmConfig) -> None:
), "OpenVINOExecutor only supports single CPU socket currently."

if parallel_config.worker_cls == "auto":
parallel_config.worker_cls = "vllm.worker.openvino_worker.OpenVINOWorker"
parallel_config.worker_cls = \
"vllm.worker.openvino_worker.OpenVINOWorker"
3 changes: 2 additions & 1 deletion vllm/platforms/rocm.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import os
from functools import lru_cache
from typing import TYPE_CHECKING

import torch

from vllm.logger import init_logger

from .interface import DeviceCapability, Platform, PlatformEnum, _Backend
from typing import TYPE_CHECKING

if TYPE_CHECKING:
from vllm.config import VllmConfig
else:
Expand Down
6 changes: 4 additions & 2 deletions vllm/platforms/tpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,14 @@ def check_and_update_config(cls, vllm_config: VllmConfig) -> None:
if compilation_config.backend == "":
compilation_config.backend = "openxla"

assert vllm_config.speculative_config is None, "TPU does not support speculative decoding"
assert vllm_config.speculative_config is None, \
"TPU does not support speculative decoding"

parallel_config = vllm_config.parallel_config
scheduler_config = vllm_config.scheduler_config
if parallel_config.worker_cls == "auto":
if scheduler_config.is_multi_step:
parallel_config.worker_cls = "vllm.worker.multi_step_tpu_worker.MultiStepTPUWorker"
parallel_config.worker_cls = \
"vllm.worker.multi_step_tpu_worker.MultiStepTPUWorker"
else:
parallel_config.worker_cls = "vllm.worker.tpu_worker.TPUWorker"

0 comments on commit 00595e5

Please sign in to comment.