[Log] Update to log once (#46511)
Signed-off-by: yewentao256 <zhyanwentao@126.com> Co-authored-by: TJian <tunjian.tan@embeddedllm.com>
This commit is contained in:
@@ -154,7 +154,7 @@ class CpuPlatform(Platform):
|
|||||||
parallel_config.worker_cls = "vllm.v1.worker.cpu_worker.CPUWorker"
|
parallel_config.worker_cls = "vllm.v1.worker.cpu_worker.CPUWorker"
|
||||||
# Disable DBO
|
# Disable DBO
|
||||||
if parallel_config.enable_dbo:
|
if parallel_config.enable_dbo:
|
||||||
logger.warning("Dual-Batch Overlap is not supported on CPU, disabled.")
|
logger.warning_once("Dual-Batch Overlap is not supported on CPU, disabled.")
|
||||||
parallel_config.enable_dbo = False
|
parallel_config.enable_dbo = False
|
||||||
|
|
||||||
if torch.cpu._is_amx_tile_supported() and (
|
if torch.cpu._is_amx_tile_supported() and (
|
||||||
@@ -166,7 +166,7 @@ class CpuPlatform(Platform):
|
|||||||
):
|
):
|
||||||
cache_config.enable_prefix_caching = False
|
cache_config.enable_prefix_caching = False
|
||||||
scheduler_config.enable_chunked_prefill = False
|
scheduler_config.enable_chunked_prefill = False
|
||||||
logger.warning(
|
logger.warning_once(
|
||||||
"Disabled unsupported prefix caching and chunked prefill "
|
"Disabled unsupported prefix caching and chunked prefill "
|
||||||
"for linear attention on AMX CPU platforms."
|
"for linear attention on AMX CPU platforms."
|
||||||
)
|
)
|
||||||
@@ -309,7 +309,7 @@ class CpuPlatform(Platform):
|
|||||||
)
|
)
|
||||||
|
|
||||||
if model_config is not None and model_config.use_mla:
|
if model_config is not None and model_config.use_mla:
|
||||||
logger.info(
|
logger.info_once(
|
||||||
"MLA is enabled on a non-GPU platform; forcing chunked "
|
"MLA is enabled on a non-GPU platform; forcing chunked "
|
||||||
"prefill and prefix caching to be disabled."
|
"prefill and prefix caching to be disabled."
|
||||||
)
|
)
|
||||||
@@ -431,13 +431,13 @@ class CpuPlatform(Platform):
|
|||||||
try:
|
try:
|
||||||
import vllm._C # noqa: F401
|
import vllm._C # noqa: F401
|
||||||
except ImportError as e:
|
except ImportError as e:
|
||||||
logger.warning("Failed to import from vllm._C: %r", e)
|
logger.warning_once("Failed to import from vllm._C: %r", e)
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
import vllm._C_AVX512 # noqa: F401
|
import vllm._C_AVX512 # noqa: F401
|
||||||
except ImportError as e:
|
except ImportError as e:
|
||||||
if ignored_msg not in e.msg:
|
if ignored_msg not in e.msg:
|
||||||
logger.warning(
|
logger.warning_once(
|
||||||
"Failed to import from vllm._C_AVX512: %r", e
|
"Failed to import from vllm._C_AVX512: %r", e
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
@@ -445,12 +445,12 @@ class CpuPlatform(Platform):
|
|||||||
import vllm._C_AVX2 # noqa: F401
|
import vllm._C_AVX2 # noqa: F401
|
||||||
except ImportError as e:
|
except ImportError as e:
|
||||||
if ignored_msg not in e.msg:
|
if ignored_msg not in e.msg:
|
||||||
logger.warning("Failed to import from vllm._C_AVX2: %r", e)
|
logger.warning_once("Failed to import from vllm._C_AVX2: %r", e)
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
import vllm._C # noqa: F401
|
import vllm._C # noqa: F401
|
||||||
except ImportError as e:
|
except ImportError as e:
|
||||||
logger.warning("Failed to import from vllm._C: %r", e)
|
logger.warning_once("Failed to import from vllm._C: %r", e)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def pack_kv_cache(
|
def pack_kv_cache(
|
||||||
|
|||||||
@@ -220,15 +220,17 @@ class CudaPlatformBase(Platform):
|
|||||||
try:
|
try:
|
||||||
import vllm._C_stable_libtorch # noqa: F401
|
import vllm._C_stable_libtorch # noqa: F401
|
||||||
except ImportError as e:
|
except ImportError as e:
|
||||||
logger.warning("Failed to import from vllm._C_stable_libtorch: %r", e)
|
logger.warning_once("Failed to import from vllm._C_stable_libtorch: %r", e)
|
||||||
try:
|
try:
|
||||||
import vllm._moe_C_stable_libtorch # noqa: F401
|
import vllm._moe_C_stable_libtorch # noqa: F401
|
||||||
except ImportError as e:
|
except ImportError as e:
|
||||||
logger.warning("Failed to import from vllm._moe_C_stable_libtorch: %r", e)
|
logger.warning_once(
|
||||||
|
"Failed to import from vllm._moe_C_stable_libtorch: %r", e
|
||||||
|
)
|
||||||
try:
|
try:
|
||||||
import vllm._qutlass_C # noqa: F401
|
import vllm._qutlass_C # noqa: F401
|
||||||
except ImportError as e:
|
except ImportError as e:
|
||||||
logger.warning("Failed to import from vllm._qutlass_C: %r", e)
|
logger.warning_once("Failed to import from vllm._qutlass_C: %r", e)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def supported_dtypes(self) -> list[torch.dtype]:
|
def supported_dtypes(self) -> list[torch.dtype]:
|
||||||
@@ -291,7 +293,7 @@ class CudaPlatformBase(Platform):
|
|||||||
# kernel with limited pinned memory support for CUDA.
|
# kernel with limited pinned memory support for CUDA.
|
||||||
version = _get_wsl_kernel_version()
|
version = _get_wsl_kernel_version()
|
||||||
if version is None or version < (4, 19, 121):
|
if version is None or version < (4, 19, 121):
|
||||||
logger.warning(
|
logger.warning_once(
|
||||||
"Using 'pin_memory=False' as WSL is detected and the "
|
"Using 'pin_memory=False' as WSL is detected and the "
|
||||||
"WSL2 kernel version is below 4.19.121. This may slow "
|
"WSL2 kernel version is below 4.19.121. This may slow "
|
||||||
"down performance. Please run `wsl --update`."
|
"down performance. Please run `wsl --update`."
|
||||||
@@ -320,7 +322,7 @@ class CudaPlatformBase(Platform):
|
|||||||
and scheduler_config.is_multimodal_model
|
and scheduler_config.is_multimodal_model
|
||||||
and not scheduler_config.disable_chunked_mm_input
|
and not scheduler_config.disable_chunked_mm_input
|
||||||
):
|
):
|
||||||
logger.warning(
|
logger.warning_once(
|
||||||
"Forcing --disable_chunked_mm_input for models "
|
"Forcing --disable_chunked_mm_input for models "
|
||||||
"with multimodal-bidirectional attention."
|
"with multimodal-bidirectional attention."
|
||||||
)
|
)
|
||||||
@@ -331,7 +333,7 @@ class CudaPlatformBase(Platform):
|
|||||||
and vllm_config.offload_config.uva.cpu_offload_gb > 0
|
and vllm_config.offload_config.uva.cpu_offload_gb > 0
|
||||||
and bool(vllm_config.compilation_config.cudagraph_mode)
|
and bool(vllm_config.compilation_config.cudagraph_mode)
|
||||||
):
|
):
|
||||||
logger.warning(
|
logger.warning_once(
|
||||||
"--cpu-offload-gb is enabled with CUDA graphs on WSL2. "
|
"--cpu-offload-gb is enabled with CUDA graphs on WSL2. "
|
||||||
"This combination requires pinned (page-locked) memory "
|
"This combination requires pinned (page-locked) memory "
|
||||||
"allocations. WARNING: Windows (WDDM) enforces a hard "
|
"allocations. WARNING: Windows (WDDM) enforces a hard "
|
||||||
|
|||||||
@@ -355,7 +355,7 @@ class Platform:
|
|||||||
try:
|
try:
|
||||||
import vllm._C # noqa: F401
|
import vllm._C # noqa: F401
|
||||||
except ImportError as e:
|
except ImportError as e:
|
||||||
logger.warning("Failed to import from vllm._C: %r", e)
|
logger.warning_once("Failed to import from vllm._C: %r", e)
|
||||||
with contextlib.suppress(ImportError):
|
with contextlib.suppress(ImportError):
|
||||||
import vllm._moe_C_stable_libtorch # noqa: F401
|
import vllm._moe_C_stable_libtorch # noqa: F401
|
||||||
|
|
||||||
@@ -859,7 +859,7 @@ class Platform:
|
|||||||
# Pinned memory support under WSL depends on the vendor and driver
|
# Pinned memory support under WSL depends on the vendor and driver
|
||||||
# version. Conservative default: return False. Platform subclasses
|
# version. Conservative default: return False. Platform subclasses
|
||||||
# that can verify support (e.g. CudaPlatformBase) override this.
|
# that can verify support (e.g. CudaPlatformBase) override this.
|
||||||
logger.warning(
|
logger.warning_once(
|
||||||
"Using 'pin_memory=False' as WSL is detected. "
|
"Using 'pin_memory=False' as WSL is detected. "
|
||||||
"This may slow down performance."
|
"This may slow down performance."
|
||||||
)
|
)
|
||||||
@@ -1003,7 +1003,7 @@ class Platform:
|
|||||||
if attr is not None:
|
if attr is not None:
|
||||||
return attr
|
return attr
|
||||||
|
|
||||||
logger.warning(
|
logger.warning_once(
|
||||||
"Current platform %s does not have '%s' attribute.",
|
"Current platform %s does not have '%s' attribute.",
|
||||||
self.device_type,
|
self.device_type,
|
||||||
key,
|
key,
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ class XPUPlatform(Platform):
|
|||||||
from vllm.v1.attention.backends.utils import set_kv_cache_layout
|
from vllm.v1.attention.backends.utils import set_kv_cache_layout
|
||||||
|
|
||||||
set_kv_cache_layout("NHD")
|
set_kv_cache_layout("NHD")
|
||||||
logger.info(
|
logger.info_once(
|
||||||
"Setting VLLM_KV_CACHE_LAYOUT to 'NHD' for XPU; "
|
"Setting VLLM_KV_CACHE_LAYOUT to 'NHD' for XPU; "
|
||||||
"only NHD layout is supported by XPU attention kernels."
|
"only NHD layout is supported by XPU attention kernels."
|
||||||
)
|
)
|
||||||
@@ -91,7 +91,7 @@ class XPUPlatform(Platform):
|
|||||||
f"with use_mla: {attn_selector_config.use_mla}"
|
f"with use_mla: {attn_selector_config.use_mla}"
|
||||||
)
|
)
|
||||||
|
|
||||||
logger.info("Using Flash Attention backend.")
|
logger.info_once("Using Flash Attention backend.")
|
||||||
return AttentionBackendEnum.FLASH_ATTN.get_path()
|
return AttentionBackendEnum.FLASH_ATTN.get_path()
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@@ -193,13 +193,13 @@ class XPUPlatform(Platform):
|
|||||||
|
|
||||||
if not supports_xpu_graph():
|
if not supports_xpu_graph():
|
||||||
compilation_config.cudagraph_mode = CUDAGraphMode.NONE
|
compilation_config.cudagraph_mode = CUDAGraphMode.NONE
|
||||||
logger.warning(
|
logger.warning_once(
|
||||||
"XPU Graph is not supported in the current PyTorch version, "
|
"XPU Graph is not supported in the current PyTorch version, "
|
||||||
"disabling cudagraph_mode."
|
"disabling cudagraph_mode."
|
||||||
)
|
)
|
||||||
elif not envs.VLLM_XPU_ENABLE_XPU_GRAPH:
|
elif not envs.VLLM_XPU_ENABLE_XPU_GRAPH:
|
||||||
compilation_config.cudagraph_mode = CUDAGraphMode.NONE
|
compilation_config.cudagraph_mode = CUDAGraphMode.NONE
|
||||||
logger.warning(
|
logger.warning_once(
|
||||||
"XPU Graph is disabled by environment variable, "
|
"XPU Graph is disabled by environment variable, "
|
||||||
"please set VLLM_XPU_ENABLE_XPU_GRAPH=1 to enable it."
|
"please set VLLM_XPU_ENABLE_XPU_GRAPH=1 to enable it."
|
||||||
)
|
)
|
||||||
@@ -218,7 +218,7 @@ class XPUPlatform(Platform):
|
|||||||
if compilation_config.mode != CompilationMode.NONE:
|
if compilation_config.mode != CompilationMode.NONE:
|
||||||
for flag, feature_name in fusion_passes_to_disable.items():
|
for flag, feature_name in fusion_passes_to_disable.items():
|
||||||
if getattr(pass_config, flag):
|
if getattr(pass_config, flag):
|
||||||
logger.warning(
|
logger.warning_once(
|
||||||
"Feature %r is not yet supported on XPU and will be disabled.",
|
"Feature %r is not yet supported on XPU and will be disabled.",
|
||||||
feature_name,
|
feature_name,
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user