mirror of
https://git.datalinker.icu/vllm-project/vllm.git
synced 2025-12-21 17:25:01 +08:00
[Hardware][POWERPC] Disable oneDNN path in vllm/model_executor/layers/utils.py for Powerpc (#27422)
Signed-off-by: Akash Kaothalkar <akash.kaothalkar@ibm.com> Co-authored-by: Akash Kaothalkar <akash.kaothalkar@ibm.com>
This commit is contained in:
parent
0552cfb195
commit
f417746ad7
@ -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(
|
|||||||
)
|
)
|
||||||
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)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user