Revert "[Perf] Reduce MLA CPU overheads in V1 (#14384)" (#14471)

This commit is contained in:
Tyler Michael Smith
2025-03-07 22:18:53 -08:00
committed by GitHub
parent 333681408f
commit ca7a2d5f28
2 changed files with 6 additions and 18 deletions
@@ -161,13 +161,8 @@ class RotaryEmbedding(CustomOp):
) -> Tuple[torch.Tensor, torch.Tensor]:
from vllm import _custom_ops as ops
# __setattr__ in nn.Module (called by `self.cos_sin_cache = ...`)
# is expensive, so avoid calling it if possible
if self.cos_sin_cache.device != query.device or \
self.cos_sin_cache.dtype != query.dtype:
self.cos_sin_cache = self.cos_sin_cache.to(query.device,
dtype=query.dtype)
self.cos_sin_cache = self.cos_sin_cache.to(query.device,
dtype=query.dtype)
# ops.rotary_embedding()/batched_rotary_embedding()
# are in-place operations that update the query and key tensors.
if offsets is not None: