Skip to content

Commit f68273d

Browse files
authored
[BugFix] Add compatibility guard for unsupported CLI params on Ascend NPU (vllm-project#10602)
## What this PR does Add silent reset handling in `_fix_incompatible_config` for four upstream CLI parameters that are incompatible with Ascend NPU: | Parameter | Config Section | Reset Value | Reason | |-----------|---------------|-------------|--------| | `--calculate-kv-scales` | Cache Config | `False` | Deprecated upstream; not supported on Ascend | | `--compilation-config.use_inductor_graph_partition` | Compilation Config | `False` | Ascend forces `use_inductor=False`, making this irrelevant | ## User-facing change Users who pass `--calculate-kv-scales`, `--compilation-config '{"use_inductor_graph_partition": true}'` on Ascend NPU will now see a warning log and the parameter will be silently reset to its safe default, rather than potentially causing errors or undefined behavior. ## How was this patch tested - Code review of the `_fix_incompatible_config` method to verify the pattern matches existing silent-reset entries. - vLLM version: v0.22.1 - vLLM main: vllm-project/vllm@967c5c3 --------- Signed-off-by: underfituu <hzhucong@163.com>
1 parent f6a737c commit f68273d

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

vllm_ascend/platform.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1049,6 +1049,13 @@ def _fix_incompatible_config(vllm_config: VllmConfig) -> None:
10491049
)
10501050
vllm_config.cache_config.cpu_kvcache_space_bytes = None
10511051

1052+
if getattr(vllm_config.cache_config, "calculate_kv_scales", False):
1053+
logger.warning(
1054+
"Parameter is not supported on Ascend NPU. "
1055+
"parameter=calculate_kv_scales, action: resetting to False."
1056+
)
1057+
vllm_config.cache_config.calculate_kv_scales = False
1058+
10521059
# ==================== 3. MultiModal Config ====================
10531060
multimodal_config = getattr(model_config, "multimodal_config", None) if model_config else None
10541061
if multimodal_config:
@@ -1224,6 +1231,15 @@ def _fix_incompatible_config(vllm_config: VllmConfig) -> None:
12241231
)
12251232
vllm_config.parallel_config.ubatch_size = 0
12261233

1234+
# ==================== 10. Compilation Config ====================
1235+
if vllm_config.compilation_config:
1236+
if getattr(vllm_config.compilation_config, "use_inductor_graph_partition", False):
1237+
logger.warning(
1238+
"Parameter is not supported on Ascend NPU (use_inductor is False). "
1239+
"parameter=use_inductor_graph_partition, action: resetting to False."
1240+
)
1241+
vllm_config.compilation_config.use_inductor_graph_partition = False
1242+
12271243
@classmethod
12281244
def use_custom_op_collectives(cls) -> bool:
12291245
return True

0 commit comments

Comments
 (0)