From c4e601c73c2a2652ff7200d9f120efb7bde20faa Mon Sep 17 00:00:00 2001 From: Netanel Haber <58652339+netanel-haber@users.noreply.github.com> Date: Fri, 17 Apr 2026 02:22:05 +0300 Subject: [PATCH] Bugfix: Parakeet: `.conv.pointwise/depthwise_conv1/2.bias weigths` can exist even if `convolution_bias=False` (#40007) Signed-off-by: Netanel Haber <58652339+netanel-haber@users.noreply.github.com> --- vllm/model_executor/models/parakeet.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/vllm/model_executor/models/parakeet.py b/vllm/model_executor/models/parakeet.py index 40539cafb31..5671ba05c56 100644 --- a/vllm/model_executor/models/parakeet.py +++ b/vllm/model_executor/models/parakeet.py @@ -99,6 +99,8 @@ class ProjectedParakeet(nn.Module): if target is None: target = buffers_dict.get(target_name) if target is None: + if self._can_skip_missing_named_param(target_name): + continue raise ValueError(f"Unknown weight: {name}") weight_loader = getattr(target, "weight_loader", default_weight_loader) with torch.no_grad(): @@ -107,6 +109,27 @@ class ProjectedParakeet(nn.Module): return loaded_params + def _can_skip_missing_named_param(self, target_name: str) -> bool: + if self.config.convolution_bias: + return False + + # In transformers v5 (not v4), `convolution_bias=False` is + # propagated from parakeet config. If `False`, torch.conv1d will + # *skip registering the param*, thus it will be missing in the + # module's named params. *If* you happen to also have the bias + # tensors in the weights, it will cause a mismatch between the + # weights and the params. + # This allows us to have `convolution_bias=False` in the sound config, + # but still allow for the weights to exist. + + return target_name.endswith( + ( + ".conv.pointwise_conv1.bias", + ".conv.depthwise_conv.bias", + ".conv.pointwise_conv2.bias", + ) + ) + EPSILON = 1e-5 LOG_ZERO_GUARD_VALUE = 2**-24