Skip to content

Commit 2b30afa

Browse files
authored
Use hidden_size_per_head as head_size fallback (vllm-project#24221)
Signed-off-by: nopperl <[email protected]>
1 parent eafa8dc commit 2b30afa

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

vllm/config/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1426,6 +1426,11 @@ def get_head_size(self) -> int:
14261426
if getattr(self.hf_text_config, "head_dim", None) is not None:
14271427
return self.hf_text_config.head_dim
14281428

1429+
# NOTE: Some models (such as PLaMo2.1) use `hidden_size_per_head`
1430+
if getattr(self.hf_text_config, "hidden_size_per_head",
1431+
None) is not None:
1432+
return self.hf_text_config.hidden_size_per_head
1433+
14291434
# FIXME(woosuk): This may not be true for all models.
14301435
return (self.hf_text_config.hidden_size //
14311436
self.hf_text_config.num_attention_heads)

0 commit comments

Comments
 (0)