Skip to content

Commit

Permalink
lint errors
Browse files Browse the repository at this point in the history
Signed-off-by: lucast2021 <[email protected]>
  • Loading branch information
lucast2021 committed Dec 21, 2024
1 parent 9ae48cd commit 7ec7593
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions vllm/executor/ray_gpu_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import os
from collections import defaultdict
from itertools import islice, repeat
from typing import TYPE_CHECKING, Any, DefaultDict, Dict, List, Optional, Tuple, Union
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple, Union

import msgspec

Expand Down Expand Up @@ -53,8 +53,9 @@ def _init_executor(self) -> None:
"VLLM_USE_RAY_COMPILED_DAG=1")

assert self.uses_ray
placement_group: Optional["PlacementGroup"] = self.parallel_config.placement_group

placement_group: Optional[PlacementGroup] = (
self.parallel_config.placement_group
)
# Disable Ray usage stats collection.
ray_usage = os.environ.get("RAY_USAGE_STATS_ENABLED", "0")
if ray_usage != "1":
Expand Down Expand Up @@ -205,9 +206,10 @@ def sort_by_driver_then_worker_ip(worker):
worker_node_and_gpu_ids.append(
ray.get(worker.get_node_and_gpu_ids.remote()) \
) # type: ignore

node_workers = defaultdict[str, list[int]](list) # node id -> list of worker ranks
node_gpus = defaultdict[str, list[Union[int, str]]](list) # node id -> list of gpu ids
# node id -> list of worker ranks
node_workers = defaultdict[str, list[int]](list)
# node id -> list of gpu ids
node_gpus = defaultdict[str, list[Union[int, str]]](list)

for i, (node_id, gpu_ids) in enumerate(worker_node_and_gpu_ids):
node_workers[node_id].append(i)
Expand Down

0 comments on commit 7ec7593

Please sign in to comment.