Skip to content
This repository was archived by the owner on Sep 4, 2025. It is now read-only.

Commit e497b8a

Browse files
authored
[Misc] Skip loading extra bias for Qwen2-MOE GPTQ models (vllm-project#8329)
1 parent 94144e7 commit e497b8a

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

vllm/model_executor/models/qwen2_moe.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,8 @@ def load_weights(self, weights: Iterable[Tuple[str, torch.Tensor]]):
469469
continue
470470
name = name.replace(weight_name, param_name)
471471
# Skip loading extra bias for GPTQ models.
472-
if name.endswith(".bias") and name not in params_dict:
472+
if ((name.endswith(".bias") or name.endswith("_bias"))
473+
and name not in params_dict):
473474
continue
474475
# Skip layers on other devices.
475476
if is_pp_missing_parameter(name, self):
@@ -490,6 +491,10 @@ def load_weights(self, weights: Iterable[Tuple[str, torch.Tensor]]):
490491
# Skip layers on other devices.
491492
if is_pp_missing_parameter(name, self):
492493
continue
494+
# Skip loading extra bias for GPTQ models.
495+
if ((name.endswith(".bias") or name.endswith("_bias"))
496+
and name not in params_dict):
497+
continue
493498
param = params_dict[name]
494499
weight_loader = param.weight_loader
495500
weight_loader(param,
@@ -500,7 +505,8 @@ def load_weights(self, weights: Iterable[Tuple[str, torch.Tensor]]):
500505
break
501506
else:
502507
# Skip loading extra bias for GPTQ models.
503-
if name.endswith(".bias") and name not in params_dict:
508+
if ((name.endswith(".bias") or name.endswith("_bias"))
509+
and name not in params_dict):
504510
continue
505511
# Skip layers on other devices.
506512
if is_pp_missing_parameter(name, self):

0 commit comments

Comments
 (0)