Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
import torch.multiprocessing as mp
from typing_extensions import ParamSpec

from sglang.srt.cuda_vmm_utils import _gpu_fabric_clique
from sglang.srt.distributed.device_communicators.cuda_wrapper import CudaRTLibrary
from sglang.srt.distributed.parallel_state import in_the_same_node_as
from sglang.srt.environ import envs as sglang_envs
from sglang.srt.utils import is_cuda, is_hip, is_musa
from sglang.srt.utils.cuda_vmm_utils import _gpu_fabric_clique

logger = logging.getLogger(__name__)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,16 @@
IPCManager,
custom_all_reduce,
)
from sglang.srt.cuda_vmm_utils import (
VmmGraphInputManager,
compute_graph_capture_bases,
is_vmm_pointer,
)
from sglang.srt.distributed.parallel_state import in_the_same_node_as
from sglang.srt.environ import envs
from sglang.srt.model_executor.runner_backend_utils.tc_piecewise_cuda_graph import (
is_in_tc_piecewise_cuda_graph,
)
from sglang.srt.utils.cuda_vmm_utils import (
VmmGraphInputManager,
compute_graph_capture_bases,
is_vmm_pointer,
)

from .configs.custom_all_reduce_v2 import (
get_all_reduce_config,
Expand Down
2 changes: 1 addition & 1 deletion python/sglang/srt/layers/moe/dwdp/layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import torch

from sglang.srt.cuda_vmm_utils import align_down, align_up
from sglang.srt.utils.cuda_vmm_utils import align_down, align_up

# one (start, end_capped) expert range per peer DWDP rank
PeerRanges = List[Tuple[int, int]]
Expand Down
2 changes: 1 addition & 1 deletion python/sglang/srt/layers/moe/dwdp/page_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

from cuda.bindings import driver as cuda

from sglang.srt.cuda_vmm_utils import (
from sglang.srt.utils.cuda_vmm_utils import (
VmmReservation,
align_up,
check_drv,
Expand Down
12 changes: 6 additions & 6 deletions python/sglang/srt/layers/moe/dwdp/transport.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@
import torch.distributed as dist
from cuda.bindings import driver as cuda

from sglang.srt.cuda_vmm_utils import (
from sglang.srt.layers.moe.dwdp.layout import (
DwdpExpertLayout,
LayerWeightSpecs,
MnnvlHandleSet,
)
from sglang.srt.utils.cuda_vmm_utils import (
VmmReservation,
align_down,
align_up,
Expand All @@ -23,11 +28,6 @@
make_device_allocation_prop,
tensor_from_pointer,
)
from sglang.srt.layers.moe.dwdp.layout import (
DwdpExpertLayout,
LayerWeightSpecs,
MnnvlHandleSet,
)

logger = logging.getLogger(__name__)

Expand Down
12 changes: 6 additions & 6 deletions python/sglang/srt/layers/moe/dwdp/weight_buffer.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@

import torch

from sglang.srt.cuda_vmm_utils import (
VmmReservation,
get_device_granularity,
make_device_allocation_prop,
tensor_from_pointer,
)
from sglang.srt.layers.moe.dwdp.layout import (
EdgeInfo,
LayerWeightSpecs,
MnnvlHandleSet,
PageAlignedLayout,
)
from sglang.srt.layers.moe.dwdp.page_pool import PagePool, compute_slot_sizes
from sglang.srt.utils.cuda_vmm_utils import (
VmmReservation,
get_device_granularity,
make_device_allocation_prop,
tensor_from_pointer,
)

logger = logging.getLogger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion python/sglang/srt/mem_cache/kv_vmm_backing.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import torch

from sglang.srt.cuda_vmm_utils import (
from sglang.srt.utils.cuda_vmm_utils import (
BumpArenaStub,
VmmReservation,
align_up,
Expand Down
2 changes: 1 addition & 1 deletion python/sglang/srt/model_executor/runner_utils/pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@

import torch

from sglang.srt.cuda_vmm_utils import BumpArenaStub
from sglang.srt.environ import envs
from sglang.srt.runtime_context import get_resources
from sglang.srt.utils import is_cuda
from sglang.srt.utils.cuda_vmm_utils import BumpArenaStub

logger = logging.getLogger(__name__)
_active_graph_pool_user: Optional[str] = None
Expand Down
2 changes: 1 addition & 1 deletion python/sglang/srt/multimodal/transport/memory_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def align_up(value: int, alignment: int) -> int:
def _driver_modules():
from cuda.bindings import driver as cuda

from sglang.srt.cuda_vmm_utils import check_drv
from sglang.srt.utils.cuda_vmm_utils import check_drv

return cuda, check_drv

Expand Down
32 changes: 16 additions & 16 deletions python/sglang/srt/utils/cuda_vmm_transport_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,6 @@

import torch

from sglang.srt.cuda_vmm_utils import (
_FD_SEND_TIMEOUT_S,
VmmReservation,
_get_cuda_driver,
_recv_fd,
_send_fd,
align_up,
allocation_handle_type_name,
check_drv,
get_allocation_granularity,
get_device_allocation_handle_type,
import_and_map_alloc,
make_device_allocation_prop,
release_mappings,
tensor_from_pointer,
)
from sglang.srt.managers.schedule_batch import (
Modality,
MultimodalDataItem,
Expand All @@ -42,6 +26,22 @@
CudaIpcTensorTransportProxy,
get_mm_feature_pool_size_per_worker,
)
from sglang.srt.utils.cuda_vmm_utils import (
_FD_SEND_TIMEOUT_S,
VmmReservation,
_get_cuda_driver,
_recv_fd,
_send_fd,
align_up,
allocation_handle_type_name,
check_drv,
get_allocation_granularity,
get_device_allocation_handle_type,
import_and_map_alloc,
make_device_allocation_prop,
release_mappings,
tensor_from_pointer,
)

logger = logging.getLogger(__name__)

Expand Down
4 changes: 2 additions & 2 deletions test/registered/unit/test_cuda_vmm_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
from cuda.bindings import driver as drv

from sglang.kernels.jit.utils import cache_once
from sglang.srt import cuda_vmm_utils
from sglang.srt.cuda_vmm_utils import (
from sglang.srt.utils import cuda_vmm_utils
from sglang.srt.utils.cuda_vmm_utils import (
check_drv,
exchange_posix_fds,
export_shareable_handles,
Expand Down
Loading