Skip to content

Commit

Permalink
[Bugfix] Fix KV head calculation for MPT models when using GQA (vllm-…
Browse files Browse the repository at this point in the history
  • Loading branch information
bfontain authored and jimpang committed Jul 24, 2024
1 parent e00c6d4 commit a16cecd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion vllm/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,11 @@ def get_total_num_kv_heads(self) -> int:
return 1

# For DBRX and MPT
if self.hf_config.model_type in ["dbrx", "mpt"]:
if self.hf_config.model_type == "mpt":
if "kv_n_heads" in self.hf_config.attn_config:
return self.hf_config.attn_config["kv_n_heads"]
return self.hf_config.num_attention_heads
if self.hf_config.model_type == "dbrx":
return getattr(self.hf_config.attn_config, "kv_n_heads",
self.hf_config.num_attention_heads)

Expand Down

0 comments on commit a16cecd

Please sign in to comment.