[Bug][Quantization] Fix humming is_layer_skipped for compressed-tensors "re:" ignore entries (#48507)
Signed-off-by: Zhongdongming Dai <zhongdongmin@nvidia.com>
This commit is contained in:
@@ -217,8 +217,17 @@ class HummingConfig(QuantizationConfig):
|
||||
if hasattr(self, "hf_to_vllm_mapper"):
|
||||
ignored_layers = self.hf_to_vllm_mapper.apply_list(ignored_layers)
|
||||
|
||||
if any(module_name in prefix for module_name in ignored_layers):
|
||||
return True
|
||||
for module_name in ignored_layers:
|
||||
# compressed-tensors style entries may be regex patterns prefixed
|
||||
# with "re:" (e.g. "re:vision_tower.*"). These must be regex-matched;
|
||||
# plain substring matching never matches the literal "re:..." string,
|
||||
# so ignored layers get silently quantized. Non-"re:" entries keep the
|
||||
# existing substring behavior (e.g. bitsandbytes modules_to_not_convert).
|
||||
if module_name.startswith("re:"):
|
||||
if re.match(module_name[3:], prefix):
|
||||
return True
|
||||
elif module_name in prefix:
|
||||
return True
|
||||
if "lm_head" in prefix:
|
||||
return True
|
||||
|
||||
|
||||
Reference in New Issue
Block a user