File tree Expand file tree Collapse file tree
vllm_fl/dispatch/backends/vendor/kunlunxin/patches Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -92,13 +92,19 @@ def _patch_xpu_get_device():
9292
9393 Prevents torch.xpu.get_device_name crash in vllm.model_executor.layers.fla.ops.utils,
9494 which calls get_device_name at module level when Triton reports backend as 'xpu'.
95+
96+ NOTE: Must NOT call get_platform_name() here — it accesses current_platform which
97+ is not yet initialized during platform resolve, causing infinite recursion and log
98+ flooding. Use PlatformFL.vendor_name (class attribute, resolved at class definition
99+ time) as a safe static check at this stage.
95100 """
101+ from vllm_fl .platform import PlatformFL
102+ if PlatformFL .vendor_name != "kunlunxin" :
103+ return
96104 try :
97- from vllm_fl .dispatch .config .utils import get_platform_name
98- if get_platform_name () != "kunlunxin" :
99- return
100105 ensure_fla_compat ()
101106 except Exception as e :
102107 import logging
103- logger = logging .getLogger (__name__ )
104- logger .warning ("Failed to apply XPU get_device_name patch: %s" , e )
108+ logging .getLogger (__name__ ).warning (
109+ "Failed to apply XPU get_device_name patch: %s" , e
110+ )
You can’t perform that action at this time.
0 commit comments