Commit c5ac5cf7 authored by zhuwenwen's avatar zhuwenwen
Browse files

back to forward_native

parent 424fa81f
......@@ -85,10 +85,10 @@ class SiluAndMul(CustomOp):
@staticmethod
def forward_native(x: torch.Tensor) -> torch.Tensor:
"""PyTorch-native implementation equivalent to forward()."""
if not torch.compiler.is_compiling() and envs.VLLM_USE_OPT_OP:
return self.forward_cuda(x)
else:
d = x.shape[-1] // 2
# if not torch.compiler.is_compiling() and envs.VLLM_USE_OPT_OP:
# return self.forward_cuda(x)
# else:
d = x.shape[-1] // 2
return F.silu(x[..., :d]) * x[..., d:]
def forward_cuda(self, x: torch.Tensor) -> torch.Tensor:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment