From 9555929e1383d31109dce349169d6ad083ff2e41 Mon Sep 17 00:00:00 2001 From: Lee Nau Date: Mon, 29 Sep 2025 12:07:29 -0700 Subject: [PATCH] [Bugfix] Use correct key "ignore" for config.json non-quantized layers (#25706) Signed-off-by: Lee Nau Signed-off-by: yewentao256 --- vllm/model_executor/layers/quantization/modelopt.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/vllm/model_executor/layers/quantization/modelopt.py b/vllm/model_executor/layers/quantization/modelopt.py index 0be43da00b533..20704439eaa9d 100644 --- a/vllm/model_executor/layers/quantization/modelopt.py +++ b/vllm/model_executor/layers/quantization/modelopt.py @@ -138,13 +138,15 @@ class ModelOptFp8Config(QuantizationConfig): if not quant_method: raise ValueError("Missing 'quant_algo' in quantization config") kv_cache_quant_method = quant_config.get("kv_cache_quant_algo") + # "exclude_modules" is the key in the legacy hf_quant_config.json exclude_modules = quant_config.get("exclude_modules") else: # Compressed-tensors style format: # {"quant_algo": "...", "quant_method": "modelopt"} quant_method = config.get("quant_algo", "") kv_cache_quant_method = config.get("kv_cache_quant_algo") - exclude_modules = config.get("exclude_modules") + # "ignore" is the key in config.json + exclude_modules = config.get("ignore") if quant_method not in QUANT_ALGOS: raise ValueError( @@ -723,6 +725,7 @@ class ModelOptNvFp4Config(QuantizationConfig): raise ValueError(f"group_size must be an integer, got " f"{type(group_size_raw)}") from None + # "exclude_modules" is the key in the legacy hf_quant_config.json exclude_modules = quant_config.get("exclude_modules", []) if not isinstance(exclude_modules, list): raise ValueError(f"exclude_modules must be a list, got " @@ -756,7 +759,8 @@ class ModelOptNvFp4Config(QuantizationConfig): raise ValueError(f"group_size must be an integer, got " f"{type(group_size_raw)}") from None - exclude_modules = config.get("exclude_modules", []) + # "ignore" is the key in config.json + exclude_modules = config.get("ignore", []) if not isinstance(exclude_modules, list): raise ValueError(f"exclude_modules must be a list, got " f"{type(exclude_modules)}")