From aa0143e55dfce8064fa6449f8453ef0ae13592d6 Mon Sep 17 00:00:00 2001 From: Qiu Date: Thu, 12 Mar 2026 11:56:04 +0800 Subject: [PATCH] refactor: add a check before layer_sharding logging (#7186) ### What this PR does / why we need it? We should only display this log message when layer_sharding is enabled. - vLLM version: v0.16.0 - vLLM main: https://github.com/vllm-project/vllm/commit/4034c3d32e30d01639459edd3ab486f56993876d Signed-off-by: QiuChunshuo --- vllm_ascend/ascend_config.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/vllm_ascend/ascend_config.py b/vllm_ascend/ascend_config.py index 03a40763..27095936 100644 --- a/vllm_ascend/ascend_config.py +++ b/vllm_ascend/ascend_config.py @@ -52,11 +52,12 @@ class AscendConfig: self.dump_config_path = additional_config.get("dump_config_path", None) self._construct_weight_prefetch_config(additional_config) self.layer_sharding = additional_config.get("layer_sharding", None) - logger.info_once( - f"Linear layer sharding enabled with config: {self.layer_sharding}. " - "Note: This feature works optimally with FLASHCOMM2 and DSA-CP enabled; " - "using it without these features may result in significant performance degradation." - ) + if self.layer_sharding: + logger.info_once( + f"Linear layer sharding enabled with config: {self.layer_sharding}. " + "Note: This feature works optimally with FLASHCOMM2 and DSA-CP enabled; " + "using it without these features may result in significant performance degradation." + ) self.enable_shared_expert_dp = ( additional_config.get("enable_shared_expert_dp", False)