Skip to content

Commit e627bf8

Browse files
committed
Fix log flooding
1 parent c6f2eb6 commit e627bf8

1 file changed

Lines changed: 11 additions & 5 deletions

File tree

vllm_fl/dispatch/backends/vendor/kunlunxin/patches/patch_fla_utils.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff 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+
)

0 commit comments

Comments
 (0)