[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>
This commit is contained in:
co-authored by
Harry Mellor
parent
eb7e894432
commit
8c1d1c2974
@@ -218,7 +218,7 @@ def get_fi_ar_workspace(
|
||||
f"with backend={backend}"
|
||||
)
|
||||
else:
|
||||
logger.warning_once(
|
||||
logger.error_once(
|
||||
"Failed to initialize FlashInfer Allreduce norm fusion workspace "
|
||||
f"with backend={backend}"
|
||||
)
|
||||
@@ -292,7 +292,7 @@ def get_fi_ar_quant_workspace(
|
||||
f"fusion workspace with backend={backend}"
|
||||
)
|
||||
else:
|
||||
logger.warning_once(
|
||||
logger.error_once(
|
||||
"Failed to initialize FlashInfer Allreduce norm quantization "
|
||||
f"fusion workspace with backend={backend}"
|
||||
)
|
||||
|
||||
@@ -90,6 +90,12 @@ def _print_warning_once(logger: Logger, msg: str, *args: Hashable) -> None:
|
||||
logger.warning(msg, *args, stacklevel=3)
|
||||
|
||||
|
||||
@lru_cache
|
||||
def _print_error_once(logger: Logger, msg: str, *args: Hashable) -> None:
|
||||
# Set the stacklevel to 3 to print the original caller's line info
|
||||
logger.error(msg, *args, stacklevel=3)
|
||||
|
||||
|
||||
LogScope = Literal["process", "global", "local"]
|
||||
|
||||
|
||||
@@ -144,12 +150,22 @@ class _VllmLogger(Logger):
|
||||
return
|
||||
_print_warning_once(self, msg, *args)
|
||||
|
||||
def error_once(self, msg: str, *args: Hashable, scope: LogScope = "local") -> None:
|
||||
"""
|
||||
As [`error`][logging.Logger.error], but subsequent calls with
|
||||
the same message are silently dropped.
|
||||
"""
|
||||
if not _should_log_with_scope(scope):
|
||||
return
|
||||
_print_error_once(self, msg, *args)
|
||||
|
||||
|
||||
# Pre-defined methods mapping to avoid repeated dictionary creation
|
||||
_METHODS_TO_PATCH = {
|
||||
"debug_once": _VllmLogger.debug_once,
|
||||
"info_once": _VllmLogger.info_once,
|
||||
"warning_once": _VllmLogger.warning_once,
|
||||
"error_once": _VllmLogger.error_once,
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user