From e4e5ac61747dcb2748e724ce70352cddede1f37b Mon Sep 17 00:00:00 2001 From: xie_zhongtao Date: Tue, 27 Jan 2026 10:18:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20self.head=5Fdim=20?= =?UTF-8?q?=E4=B8=BA=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vllm-llama-head_dim.patch | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 vllm-llama-head_dim.patch diff --git a/vllm-llama-head_dim.patch b/vllm-llama-head_dim.patch new file mode 100644 index 0000000..4aed769 --- /dev/null +++ b/vllm-llama-head_dim.patch @@ -0,0 +1,13 @@ +--- lib64/python3/dist-packages/vllm/model_executor/models/llama.py ++++ lib64/python3/dist-packages/vllm/model_executor/models/llama.py +@@ -128,8 +128,8 @@ + assert tp_size % self.total_num_kv_heads == 0 + self.num_kv_heads = max(1, self.total_num_kv_heads // tp_size) + # MistralConfig has an optional head_dim introduced by Mistral-Nemo +- self.head_dim = getattr(config, "head_dim", +- self.hidden_size // self.total_num_heads) ++ def_head_dim = self.hidden_size // self.total_num_heads ++ self.head_dim = getattr(config, "head_dim", def_head_dim) or def_head_dim + # Phi models introduced a partial_rotary_factor parameter in the config + partial_rotary_factor = getattr(config, "partial_rotary_factor", 1) + self.rotary_dim = int(partial_rotary_factor * self.head_dim)