[Misc] Log FlashInfer allreduce workspace init failure as error (#55127)
Signed-off-by: NickLucche <nicolo.lucchesi@mistral.ai> Co-authored-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
Nicolò Lucchesi committed
Sep 11, 2026 at 11:35 UTC
8c1d1c2974ee42757ee2e93cc898932edfd9d265
2 files changed
+18
-2
vllm/distributed/device_communicators/flashinfer_all_reduce.py
+2
-2
@@ -218,7 +218,7 @@ def get_fi_ar_workspace(
218
f"with backend={backend}"
219
)
220
else:
221
- logger.warning_once(
221
+ logger.error_once(
222
"Failed to initialize FlashInfer Allreduce norm fusion workspace "
223
f"with backend={backend}"
224
)
@@ -292,7 +292,7 @@ def get_fi_ar_quant_workspace(
292
f"fusion workspace with backend={backend}"
293
)
294
else:
295
- logger.warning_once(
295
+ logger.error_once(
296
"Failed to initialize FlashInfer Allreduce norm quantization "
297
f"fusion workspace with backend={backend}"
298
)
vllm/logger.py
+16
@@ -90,6 +90,12 @@ def _print_warning_once(logger: Logger, msg: str, *args: Hashable) -> None:
90
logger.warning(msg, *args, stacklevel=3)
91
92
93
+@lru_cache
94
+def _print_error_once(logger: Logger, msg: str, *args: Hashable) -> None:
95
+ # Set the stacklevel to 3 to print the original caller's line info
96
+ logger.error(msg, *args, stacklevel=3)
97
+
98
+
99
LogScope = Literal["process", "global", "local"]
100
101
@@ -144,12 +150,22 @@ class _VllmLogger(Logger):
150
return
151
_print_warning_once(self, msg, *args)
152
153
+ def error_once(self, msg: str, *args: Hashable, scope: LogScope = "local") -> None:
154
+ """
155
+ As [`error`][logging.Logger.error], but subsequent calls with
156
+ the same message are silently dropped.
157
+ """
158
+ if not _should_log_with_scope(scope):
159
+ return
160
+ _print_error_once(self, msg, *args)
161
+
162
163
# Pre-defined methods mapping to avoid repeated dictionary creation
164
_METHODS_TO_PATCH = {
165
"debug_once": _VllmLogger.debug_once,
166
"info_once": _VllmLogger.info_once,
167
"warning_once": _VllmLogger.warning_once,
168
+ "error_once": _VllmLogger.error_once,
169
}
170
171