Skip to content

Commit 6ffa703

Browse files
committed
Refactor: extract _init_vendor_device for vendor-specific early patches
1 parent 79396bd commit 6ffa703

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

vllm_fl/__init__.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,17 @@ def _patch_custom_ops():
9494
register_op_schemas()
9595

9696

97+
def _init_vendor_device():
98+
"""Vendor-specific device initialization patches."""
99+
from vllm_fl.utils import DeviceInfo
100+
if DeviceInfo().vendor_name == "kunlunxin":
101+
from vllm_fl.dispatch.backends.vendor.kunlunxin.patches.patch_fla_utils import _patch_xpu_get_device
102+
_patch_xpu_get_device()
103+
104+
97105
def register():
98106
"""Register the FL platform."""
99-
from vllm_fl.dispatch.backends.vendor.kunlunxin.patches.patch_fla_utils import _patch_xpu_get_device
100-
_patch_xpu_get_device()
107+
_init_vendor_device()
101108

102109
_patch_custom_ops()
103110
_patch_flash_attn_import()

0 commit comments

Comments
 (0)