Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
2 changes: 1 addition & 1 deletion examples/offline_inference/data_parallel.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
from time import sleep

from vllm import LLM, SamplingParams
from vllm.utils import get_open_port
from vllm.utils.network_utils import get_open_port


def parse_args():
Expand Down
2 changes: 1 addition & 1 deletion examples/offline_inference/rlhf.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
from transformers import AutoModelForCausalLM

from vllm import LLM, SamplingParams
from vllm.utils import get_ip, get_open_port
from vllm.utils.network_utils import get_ip, get_open_port


class MyLLM(LLM):
Expand Down
2 changes: 1 addition & 1 deletion tests/distributed/test_multi_node_assignment.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from vllm import initialize_ray_cluster
from vllm.config import ParallelConfig
from vllm.executor.ray_utils import _wait_until_pg_removed
from vllm.utils import get_ip
from vllm.utils.network_utils import get_ip

VLLM_MULTI_NODE = os.getenv("VLLM_MULTI_NODE", "0") == "1"

Expand Down
2 changes: 1 addition & 1 deletion tests/distributed/test_node_count.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

from vllm.distributed.parallel_state import _node_count
from vllm.distributed.utils import StatelessProcessGroup
from vllm.utils import get_ip, get_open_port
from vllm.utils.network_utils import get_ip, get_open_port

if __name__ == "__main__":
dist.init_process_group(backend="gloo")
Expand Down
2 changes: 1 addition & 1 deletion tests/distributed/test_same_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

from vllm.distributed.parallel_state import in_the_same_node_as
from vllm.distributed.utils import StatelessProcessGroup
from vllm.utils import get_ip, get_open_port
from vllm.utils.network_utils import get_ip, get_open_port

if __name__ == "__main__":
dist.init_process_group(backend="gloo")
Expand Down
3 changes: 2 additions & 1 deletion tests/distributed/test_shm_broadcast.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@

from vllm.distributed.device_communicators.shm_broadcast import MessageQueue
from vllm.distributed.utils import StatelessProcessGroup
from vllm.utils import get_open_port, update_environment_variables
from vllm.utils import update_environment_variables
from vllm.utils.network_utils import get_open_port


def get_arrays(n: int, seed: int = 0) -> list[np.ndarray]:
Expand Down
6 changes: 2 additions & 4 deletions tests/distributed/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@
import vllm.envs as envs
from vllm.distributed.device_communicators.pynccl import PyNcclCommunicator
from vllm.distributed.utils import StatelessProcessGroup
from vllm.utils import (
get_open_port,
update_environment_variables,
)
from vllm.utils import update_environment_variables
from vllm.utils.network_utils import get_open_port
from vllm.utils.torch_utils import cuda_device_count_stateless

from ..utils import multi_gpu_test
Expand Down
2 changes: 1 addition & 1 deletion tests/entrypoints/openai/test_shutdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import openai
import pytest

from ...utils import get_open_port
from vllm.utils.network_utils import get_open_port

MODEL_NAME = "hmellor/tiny-random-LlamaForCausalLM"

Expand Down
2 changes: 1 addition & 1 deletion tests/kernels/moe/modular_kernel_tools/parallel_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

from vllm.config import VllmConfig, set_current_vllm_config
from vllm.distributed import init_distributed_environment, initialize_model_parallel
from vllm.utils import get_open_port
from vllm.utils.network_utils import get_open_port

## Parallel Processes Utils

Expand Down
3 changes: 2 additions & 1 deletion tests/kernels/moe/parallel_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
from torch.multiprocessing import spawn # pyright: ignore[reportPrivateImportUsage]
from typing_extensions import ParamSpec

from vllm.utils import get_open_port, has_deep_ep
from vllm.utils import has_deep_ep
from vllm.utils.network_utils import get_open_port

if has_deep_ep():
from vllm.model_executor.layers.fused_moe.deepep_ht_prepare_finalize import (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from vllm.distributed import cleanup_dist_env_and_memory
from vllm.model_executor.model_loader import tensorizer as tensorizer_mod
from vllm.model_executor.model_loader.tensorizer import TensorizerConfig
from vllm.utils import get_distributed_init_method, get_ip, get_open_port
from vllm.utils.network_utils import get_distributed_init_method, get_ip, get_open_port
from vllm.v1.executor.abstract import UniProcExecutor
from vllm.v1.worker.worker_base import WorkerWrapperBase

Expand Down
3 changes: 2 additions & 1 deletion tests/models/test_vision.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
run_dp_sharded_vision_model,
)
from vllm.platforms import current_platform
from vllm.utils import get_open_port, update_environment_variables
from vllm.utils import update_environment_variables
from vllm.utils.network_utils import get_open_port

pytestmark = pytest.mark.cpu_test

Expand Down
2 changes: 1 addition & 1 deletion tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@
from vllm.transformers_utils.tokenizer import get_tokenizer
from vllm.utils import (
FlexibleArgumentParser,
get_open_port,
)
from vllm.utils.mem_constants import GB_bytes
from vllm.utils.network_utils import get_open_port
from vllm.utils.torch_utils import cuda_device_count_stateless

if current_platform.is_rocm():
Expand Down
16 changes: 9 additions & 7 deletions tests/utils_/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,6 @@
from vllm.utils import (
FlexibleArgumentParser,
bind_kv_cache,
get_open_port,
get_tcp_uri,
join_host_port,
make_zmq_path,
make_zmq_socket,
split_host_port,
split_zmq_path,
unique_filepath,
)
from vllm.utils.hashing import sha256
Expand All @@ -40,6 +33,15 @@
is_lossless_cast,
)
from vllm.utils.mem_utils import MemorySnapshot, memory_profiling
from vllm.utils.network_utils import (
get_open_port,
get_tcp_uri,
join_host_port,
make_zmq_path,
make_zmq_socket,
split_host_port,
split_zmq_path,
)
from ..utils import create_new_process_for_each_test, flat_product


Expand Down
2 changes: 1 addition & 1 deletion vllm/config/parallel.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
vllm_is_batch_invariant,
)
from vllm.platforms import current_platform
from vllm.utils import get_open_ports_list
from vllm.utils.network_utils import get_open_ports_list
from vllm.utils.torch_utils import cuda_device_count_stateless

if TYPE_CHECKING:
Expand Down
2 changes: 1 addition & 1 deletion vllm/distributed/device_communicators/shm_broadcast.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import vllm.envs as envs
from vllm.distributed.utils import StatelessProcessGroup, sched_yield
from vllm.logger import init_logger
from vllm.utils import (
from vllm.utils.network_utils import (
get_ip,
get_open_port,
get_open_zmq_ipc_path,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
from vllm.forward_context import ForwardContext
from vllm.logger import init_logger
from vllm.platforms import current_platform
from vllm.utils import make_zmq_path, make_zmq_socket
from vllm.utils.network_utils import make_zmq_path, make_zmq_socket
from vllm.v1.attention.backends.utils import get_kv_cache_layout
from vllm.v1.core.sched.output import SchedulerOutput

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
from vllm.distributed.kv_transfer.kv_connector.v1.p2p.tensor_memory_pool import ( # noqa: E501
TensorMemoryPool,
)
from vllm.utils import get_ip
from vllm.utils.network_utils import get_ip
from vllm.utils.torch_utils import current_stream

logger = logging.getLogger(__name__)
Expand Down
2 changes: 1 addition & 1 deletion vllm/distributed/kv_transfer/kv_pipe/mooncake_pipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from vllm.config.kv_transfer import KVTransferConfig
from vllm.distributed.kv_transfer.kv_pipe.base import KVPipeBase
from vllm.logger import init_logger
from vllm.utils import join_host_port, make_zmq_path, split_host_port
from vllm.utils.network_utils import join_host_port, make_zmq_path, split_host_port

logger = init_logger(__name__)
NONE_INT = -150886311
Expand Down
4 changes: 1 addition & 3 deletions vllm/distributed/parallel_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,8 @@
)
from vllm.distributed.utils import StatelessProcessGroup
from vllm.logger import init_logger
from vllm.utils import (
get_distributed_init_method,
)
from vllm.utils.import_utils import resolve_obj_by_qualname
from vllm.utils.network_utils import get_distributed_init_method
from vllm.utils.torch_utils import (
direct_register_custom_op,
supports_custom_op,
Expand Down
2 changes: 1 addition & 1 deletion vllm/distributed/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

import vllm.envs as envs
from vllm.logger import init_logger
from vllm.utils import get_tcp_uri
from vllm.utils.network_utils import get_tcp_uri
from vllm.utils.torch_utils import is_torch_equal_or_newer

logger = init_logger(__name__)
Expand Down
3 changes: 2 additions & 1 deletion vllm/engine/arg_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,9 @@
maybe_override_with_speculators,
)
from vllm.transformers_utils.utils import check_gguf_file
from vllm.utils import FlexibleArgumentParser, get_ip, is_in_ray_actor
from vllm.utils import FlexibleArgumentParser, is_in_ray_actor
from vllm.utils.mem_constants import GiB_bytes
from vllm.utils.network_utils import get_ip
from vllm.v1.sample.logits_processor import LogitsProcessor

if TYPE_CHECKING:
Expand Down
2 changes: 1 addition & 1 deletion vllm/entrypoints/cli/serve.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
from vllm.utils import (
FlexibleArgumentParser,
decorate_logs,
get_tcp_uri,
set_process_title,
)
from vllm.utils.network_utils import get_tcp_uri
from vllm.v1.engine.core import EngineCoreProc
from vllm.v1.engine.utils import CoreEngineProcManager, launch_core_engines
from vllm.v1.executor.abstract import Executor
Expand Down
2 changes: 1 addition & 1 deletion vllm/entrypoints/launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
)
from vllm.entrypoints.ssl import SSLCertRefresher
from vllm.logger import init_logger
from vllm.utils import find_process_using_port
from vllm.utils.network_utils import find_process_using_port
from vllm.v1.engine.exceptions import EngineDeadError, EngineGenerateError

logger = init_logger(__name__)
Expand Down
2 changes: 1 addition & 1 deletion vllm/entrypoints/openai/api_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,9 @@
Device,
FlexibleArgumentParser,
decorate_logs,
is_valid_ipv6_address,
set_ulimit,
)
from vllm.utils.network_utils import is_valid_ipv6_address
from vllm.v1.engine.exceptions import EngineDeadError
from vllm.v1.metrics.prometheus import get_prometheus_registry
from vllm.version import __version__ as VLLM_VERSION
Expand Down
4 changes: 2 additions & 2 deletions vllm/executor/ray_distributed_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
from vllm.platforms import current_platform
from vllm.ray.ray_env import get_env_vars_to_copy
from vllm.sequence import ExecuteModelRequest
from vllm.utils import (
from vllm.utils.asyncio import make_async
from vllm.utils.network_utils import (
get_distributed_init_method,
get_ip,
get_open_port,
)
from vllm.utils.asyncio import make_async
from vllm.v1.outputs import SamplerOutput

if ray is not None:
Expand Down
2 changes: 1 addition & 1 deletion vllm/executor/ray_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from vllm.logger import init_logger
from vllm.platforms import current_platform
from vllm.sequence import ExecuteModelRequest, IntermediateTensors
from vllm.utils import get_ip
from vllm.utils.network_utils import get_ip
from vllm.v1.outputs import AsyncModelRunnerOutput
from vllm.v1.worker.worker_base import WorkerWrapperBase

Expand Down
3 changes: 2 additions & 1 deletion vllm/executor/uniproc_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
import vllm.envs as envs
from vllm.executor.executor_base import ExecutorBase
from vllm.logger import init_logger
from vllm.utils import get_distributed_init_method, get_ip, get_open_port, run_method
from vllm.utils import run_method
from vllm.utils.network_utils import get_distributed_init_method, get_ip, get_open_port
from vllm.v1.engine import ReconfigureDistributedRequest, ReconfigureRankType
from vllm.v1.outputs import AsyncModelRunnerOutput
from vllm.v1.worker.worker_base import WorkerWrapperBase
Expand Down
Loading