From e6d811dd13a0ad81a1efc67c97d8812e823db5a7 Mon Sep 17 00:00:00 2001 From: jianyizh Date: Tue, 20 Aug 2024 15:26:09 +0800 Subject: [PATCH] [XPU] fallback to native implementation for xpu custom op (#7670) --- vllm/model_executor/custom_op.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vllm/model_executor/custom_op.py b/vllm/model_executor/custom_op.py index 51f3ef5d..49247cd5 100644 --- a/vllm/model_executor/custom_op.py +++ b/vllm/model_executor/custom_op.py @@ -30,7 +30,9 @@ class CustomOp(nn.Module): return self.forward_cuda(*args, **kwargs) def forward_xpu(self, *args, **kwargs): - raise NotImplementedError + # By default, we assume that XPU ops are compatible with the + # PyTorch-native implementation. + return self.forward_native(*args, **kwargs) def forward_cpu(self, *args, **kwargs): # By default, we assume that CPU ops are compatible with CUDA ops.