From 779d6b051fd9bedbc27121a5343edfffd012bd21 Mon Sep 17 00:00:00 2001 From: Jade Zheng Date: Wed, 7 May 2025 16:04:00 +0800 Subject: [PATCH] fix: correct method call for setting cos sin cache This change ensures proper functionality for longer sequences by correctly invoking the _set_cos_sin_cache method with self as the first argument. Signed-off-by: Jade Zheng --- vllm_ascend/ops/rotary_embedding.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vllm_ascend/ops/rotary_embedding.py b/vllm_ascend/ops/rotary_embedding.py index 0dbe9405b1..0c2a00afb6 100644 --- a/vllm_ascend/ops/rotary_embedding.py +++ b/vllm_ascend/ops/rotary_embedding.py @@ -82,7 +82,7 @@ def native_rope_deepseek_forward(self, offsets: Optional[torch.Tensor] = None, max_seq_len: Optional[int] = None): if max_seq_len is not None and max_seq_len > self.max_seq_len: - self._set_cos_sin_cache(max_seq_len, query.device, query.dtype) + _set_cos_sin_cache(self, max_seq_len, query.device, query.dtype) if len(key.shape) == 2: key = key[:, None, :] # Note: we implement the non neox_style method with shuffle the last dim and neox style