Skip to content

Commit f54c655

Browse files
committed
Temp fix on amd vendor
1 parent 94d70b9 commit f54c655

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

backends/qualcomm/__init__.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import os
22

3-
from .scripts.download_qnn_sdk import install_qnn_sdk, is_linux_x86, QNN_ZIP_URL
3+
import cpuinfo
4+
import torch
45

6+
from .scripts.download_qnn_sdk import install_qnn_sdk, is_linux_x86, QNN_ZIP_URL
57

68
env_flag = os.getenv("EXECUTORCH_BUILDING_WHEEL", "0").lower()
79
# If users have preinstalled QNN_SDK_ROOT, we will use it.
@@ -27,3 +29,8 @@
2729
" export LD_LIBRARY_PATH="
2830
"$QNN_SDK_ROOT/lib/x86_64-linux-clang/:$LD_LIBRARY_PATH"
2931
)
32+
33+
info = cpuinfo.get_cpu_info()
34+
vendor = info.get("vendor_id_raw", "").lower()
35+
if "amd" in vendor:
36+
torch.backends.mkldnn.enabled = False

backends/qualcomm/scripts/build.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
set -e
88

99
pip install pydot
10+
pip install py-cpuinfo
1011

1112
# Check if running on macOS/Darwin
1213
if [[ "$(uname -s)" == "Darwin" ]]; then

0 commit comments

Comments
 (0)