Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
KuilongCui committed Nov 6, 2024
1 parent 44ce254 commit afe85bf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions llumnix/backends/vllm/migration_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,12 @@
import torch
from func_timeout import func_set_timeout, FunctionTimedOut

import cupy
from cupy.cuda import nccl
import ray
import ray.util.collective as col
from ray.util.collective.collective_group import nccl_util

from vllm.worker.cache_engine import CacheEngine
from llumnix.internal_config import MigrationConfig
from llumnix.backends.migration_backend_interface import MigrationBackendBase, CacheMigrationBackend
Expand Down Expand Up @@ -143,9 +147,6 @@ def try_import_gloo():
class RayColMigrationBackend(CacheMigrationBackend):
def __init__(self, migration_config: MigrationConfig, cache_engine: CacheEngine, local_rank,
scheduling_strategy, is_driver_worker, gpu_cache) -> None:
# pylint: disable=C0415
import cupy

self.migration_config = migration_config
self.cache_engine = cache_engine
self.backend = migration_config.migration_backend
Expand All @@ -169,6 +170,7 @@ def __init__(self, migration_config: MigrationConfig, cache_engine: CacheEngine,
try_import_gloo()
self.cache_device = "cpu"
else:
nccl_util.TORCH_NCCL_DTYPE_MAP[torch.bfloat16] = nccl.NCCL_FLOAT16
self.cache_device = torch.device(f"cuda:{self.local_rank}")

pin_memory = (self.backend == 'gloo')
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e_test/test_e2e.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def generate_launch_command(result_filename: str = "", launch_ray_cluster: bool
disable_init_instance_by_manager, disable_fixed_node_init_instance = parse_launch_mode(launch_mode)
command = (
f"RAY_DEDUP_LOGS=0 HEAD_NODE_IP={HEAD_NODE_IP} HEAD_NODE=1 "
f"nohup python -m llumnix.entrypoints.vllm.api_server "
f"nohup python -u -m llumnix.entrypoints.vllm.api_server "
f"--host {ip} "
f"--port {port} "
f"{'--disable-init-instance-by-manager ' if disable_init_instance_by_manager else ''}"
Expand Down

0 comments on commit afe85bf

Please sign in to comment.