Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions vllm_ascend/ops/rotary_embedding.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
from vllm.model_executor.layers.rotary_embedding import (
DeepseekScalingRotaryEmbedding, MRotaryEmbedding, RotaryEmbedding,
YaRNScalingRotaryEmbedding)
from vllm.platforms import CpuArchEnum

from vllm_ascend.platform import NPUPlatform
from vllm_ascend.utils import (AscendDeviceType, enable_custom_op,
Expand Down Expand Up @@ -408,10 +407,7 @@ def forward_oot(
query: torch.Tensor,
key: torch.Tensor,
):
# TODO: This judgment will be removed once the mrope precision issue is fixed
if self.mrope_section != [
16, 24, 24
] or NPUPlatform.get_cpu_architecture() == CpuArchEnum.X86:
if self.mrope_section != [16, 24, 24]:
return super().forward_oot(positions, query, key)

import torch_npu
Expand All @@ -426,7 +422,7 @@ def forward_oot(
self.cos_sin_cache = self.cos_sin_cache.to( # type: ignore
query.dtype) # type: ignore

query, key = torch_npu.npu_mrope(positions,
query, key = torch_npu.npu_mrope(positions.contiguous(),
query.contiguous(),
key.contiguous(),
self.cos_sin_cache.contiguous(),
Expand Down
Loading