[BugFix] Require kv producer for layer sharding (#8563)

### What this PR does / why we need it?

This PR introduce stricter Ascend `additional_config.layer_sharding`
validation to the 0.18 release branch so it is only accepted on
PD-disaggregated P nodes with `kv_role="kv_producer"`.


### Does this PR introduce _any_ user-facing change?

No.

### How was this patch tested?

E2E test

---------

Signed-off-by: chenchuw886 <chenchuw@huawei.com>
Co-authored-by: chenchuw886 <chenchuw@huawei.com>
This commit is contained in:
Frank Chen
2026-04-23 16:06:53 +08:00
committed by GitHub
parent 4a254ba59a
commit a4ba82e138
4 changed files with 9 additions and 7 deletions

View File

@@ -241,7 +241,7 @@ class NPUPlatform(Platform):
return
kv_transfer_config = vllm_config.kv_transfer_config
if kv_transfer_config is not None and kv_transfer_config.kv_role != "kv_producer":
if kv_transfer_config is None or kv_transfer_config.kv_role != "kv_producer":
raise ValueError(
"additional_config.layer_sharding is only supported on P nodes "
"(kv_role='kv_producer') when KV transfer is enabled."