Skip to content
Merged
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
13 changes: 9 additions & 4 deletions python/sglang/srt/layers/dp_attention.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@
GroupCoordinator,
tensor_model_parallel_all_reduce,
)
from sglang.srt.distributed.device_communicators.custom_all_reduce_v2 import (
CustomAllReduceV2,
)
from sglang.srt.distributed.device_communicators.pynccl_allocator import (
use_symmetric_memory,
)
Expand All @@ -40,7 +37,15 @@
get_spec,
get_stream,
)
from sglang.srt.utils import get_bool_env_var, is_cpu, is_hip
from sglang.srt.utils import get_bool_env_var, is_cpu, is_hip, is_xpu

if is_xpu():
# custom_all_reduce_v2 imports tvm_ffi, absent on XPU; isinstance(x, ()) is False.
CustomAllReduceV2 = ()
else:
from sglang.srt.distributed.device_communicators.custom_all_reduce_v2 import (
CustomAllReduceV2,
)

if TYPE_CHECKING:
from sglang.srt.configs.model_config import ModelConfig
Expand Down
Loading