mirror of
https://git.datalinker.icu/vllm-project/vllm.git
synced 2026-06-05 11:29:09 +08:00
[Hardware][CPU][PowerPC]Disable torch.compile() in toptopk sampling (#26987)
Signed-off-by: Akash Kaothalkar <akash.kaothalkar@ibm.com> Co-authored-by: Akash Kaothalkar <akash.kaothalkar@ibm.com>
This commit is contained in:
parent
76f0d05bc6
commit
f7d318de2b
@ -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
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user