Skip to content

Commit 48955c1

Browse files
bigPYJ1151GWS0428
authored andcommitted
[CI/Build][CPU][Bugfix] Fix CPU CI (vllm-project#12150)
Signed-off-by: jiang1.li <[email protected]>
1 parent ac9be1a commit 48955c1

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

.buildkite/run-cpu-test.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,6 @@ function cpu_tests() {
8383
tests/lora/test_qwen2vl.py"
8484
}
8585

86-
# All of CPU tests are expected to be finished less than 25 mins.
86+
# All of CPU tests are expected to be finished less than 40 mins.
8787
export -f cpu_tests
88-
timeout 30m bash -c "cpu_tests $CORE_RANGE $NUMA_NODE"
88+
timeout 40m bash -c "cpu_tests $CORE_RANGE $NUMA_NODE"

vllm/model_executor/layers/activation.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,10 @@ class FatreluAndMul(CustomOp):
3030
def __init__(self, threshold: float = 0.):
3131
super().__init__()
3232
self.threshold = threshold
33-
if current_platform.is_cuda_alike() or current_platform.is_cpu():
33+
if current_platform.is_cuda_alike():
3434
self.op = torch.ops._C.fatrelu_and_mul
35+
elif current_platform.is_cpu():
36+
self._forward_method = self.forward_native
3537

3638
def forward_native(self, x: torch.Tensor) -> torch.Tensor:
3739
d = x.shape[-1] // 2
@@ -100,11 +102,13 @@ class MulAndSilu(CustomOp):
100102

101103
def __init__(self):
102104
super().__init__()
103-
if current_platform.is_cuda_alike() or current_platform.is_cpu():
105+
if current_platform.is_cuda_alike():
104106
self.op = torch.ops._C.mul_and_silu
105107
elif current_platform.is_xpu():
106108
from vllm._ipex_ops import ipex_ops
107109
self.op = ipex_ops.silu_and_mul
110+
elif current_platform.is_cpu():
111+
self._forward_method = self.forward_native
108112

109113
def forward_native(self, x: torch.Tensor) -> torch.Tensor:
110114
"""PyTorch-native implementation equivalent to forward()."""

0 commit comments

Comments
 (0)