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

[Hardware][POWERPC] Disable oneDNN path in vllm/model_executor/layers/utils.py for Powerpc (#27422)


Signed-off-by: default avatarAkash Kaothalkar <akash.kaothalkar@ibm.com>
Co-authored-by: default avatarAkash Kaothalkar <akash.kaothalkar@ibm.com>
parent 0552cfb1
...@@ -8,7 +8,7 @@ import torch ...@@ -8,7 +8,7 @@ import torch
from vllm import _custom_ops as ops from vllm import _custom_ops as ops
from vllm import envs from vllm import envs
from vllm.platforms import current_platform from vllm.platforms import CpuArchEnum, current_platform
from vllm.utils.torch_utils import direct_register_custom_op from vllm.utils.torch_utils import direct_register_custom_op
...@@ -178,7 +178,10 @@ def dispatch_cpu_unquantized_gemm( ...@@ -178,7 +178,10 @@ def dispatch_cpu_unquantized_gemm(
) )
if remove_weight: if remove_weight:
layer.weight = torch.nn.Parameter(torch.empty(0), requires_grad=False) layer.weight = torch.nn.Parameter(torch.empty(0), requires_grad=False)
elif ops._supports_onednn: elif (
ops._supports_onednn
and current_platform.get_cpu_architecture() != CpuArchEnum.POWERPC
):
origin_weight = layer.weight origin_weight = layer.weight
if remove_weight: if remove_weight:
layer.weight = torch.nn.Parameter(torch.empty(0), requires_grad=False) layer.weight = torch.nn.Parameter(torch.empty(0), requires_grad=False)
......
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