Skip to content

Commit 43acee5

Browse files
authored
Add check for QNN_SDK_ROOT in hadamard pass (pytorch#21815)
Differential Revision: D115881389 Pull Request resolved: pytorch#21815
1 parent 5249a13 commit 43acee5

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎backends/qualcomm/_passes/recompose_hadamard.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#
44
# This source code is licensed under the BSD-style license found in the
55
# LICENSE file in the root directory of this source tree.
6+
import os
67
from operator import attrgetter
78

89
import torch
@@ -156,7 +157,7 @@ def _is_hadamard_transform(self, graph_module, node):
156157
def call(self, graph_module: torch.fx.GraphModule):
157158
# HadamardTransform is only supported by QNN 2.47+. On older SDKs skip the
158159
# rewrite so the op keeps its normal lowering path.
159-
if is_qnn_sdk_version_less_than("2.47"):
160+
if not os.environ.get("QNN_SDK_ROOT") or is_qnn_sdk_version_less_than("2.47"):
160161
return PassResult(graph_module, False)
161162

162163
graph = graph_module.graph

0 commit comments

Comments
 (0)