Unverified Commit f7d318de authored by Akash kaothalkar's avatar Akash kaothalkar Committed by GitHub
Browse files

[Hardware][CPU][PowerPC]Disable torch.compile() in toptopk sampling (#26987)


Signed-off-by: default avatarAkash Kaothalkar <akash.kaothalkar@ibm.com>
Co-authored-by: default avatarAkash Kaothalkar <akash.kaothalkar@ibm.com>
parent 76f0d05b
...@@ -65,7 +65,11 @@ class TopKTopPSampler(nn.Module): ...@@ -65,7 +65,11 @@ class TopKTopPSampler(nn.Module):
) )
self.forward = self.forward_native self.forward = self.forward_native
elif current_platform.is_cpu(): elif current_platform.is_cpu():
if current_platform.get_cpu_architecture() == CpuArchEnum.RISCV: arch = current_platform.get_cpu_architecture()
# Fall back to native implementation for POWERPC and RISCV.
# On PowerPC argmax produces incorrect output with torch.compile.
# PR: https://github.com/vllm-project/vllm/pull/26987
if arch in (CpuArchEnum.RISCV, CpuArchEnum.POWERPC):
self.forward = self.forward_native self.forward = self.forward_native
else: else:
self.forward = self.forward_cpu self.forward = self.forward_cpu
......
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