diff --git a/vllm_ascend/ops/rotary_embedding.py b/vllm_ascend/ops/rotary_embedding.py index 64dbb67cb6..3b75c9e462 100644 --- a/vllm_ascend/ops/rotary_embedding.py +++ b/vllm_ascend/ops/rotary_embedding.py @@ -288,7 +288,7 @@ def mrope_forward( import torch_npu mrope_section = [0, 0, 0] if positions.ndim == 1 else self.mrope_section - query, key = torch_npu.npu_mrope(positions, + query, key = torch_npu.npu_mrope(positions.clone().detach().contiguous(), query.contiguous(), key.contiguous(), self.cos_sin_cache.contiguous(),