mirror of
https://git.datalinker.icu/vllm-project/vllm.git
synced 2025-12-13 18:35:00 +08:00
[CI/Build][Bugfix] Fix Qwen2.5 tests in CPU CI via fallback silu_and_mul to torch native implementation (#22145)
Signed-off-by: jiang1.li <jiang1.li@intel.com>
This commit is contained in:
parent
6d98843b31
commit
b5dfb94fa0
@ -65,11 +65,13 @@ class SiluAndMul(CustomOp):
|
|||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
if current_platform.is_cuda_alike() or current_platform.is_cpu():
|
if current_platform.is_cuda_alike():
|
||||||
self.op = torch.ops._C.silu_and_mul
|
self.op = torch.ops._C.silu_and_mul
|
||||||
elif current_platform.is_xpu():
|
elif current_platform.is_xpu():
|
||||||
from vllm._ipex_ops import ipex_ops
|
from vllm._ipex_ops import ipex_ops
|
||||||
self.op = ipex_ops.silu_and_mul
|
self.op = ipex_ops.silu_and_mul
|
||||||
|
elif current_platform.is_cpu():
|
||||||
|
self._forward_method = self.forward_native
|
||||||
|
|
||||||
def forward_native(self, x: torch.Tensor) -> torch.Tensor:
|
def forward_native(self, x: torch.Tensor) -> torch.Tensor:
|
||||||
"""PyTorch-native implementation equivalent to forward()."""
|
"""PyTorch-native implementation equivalent to forward()."""
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user