Skip to content

Commit

Permalink
add a list for ops to be added
Browse files Browse the repository at this point in the history
Differential Revision: D61002938

Pull Request resolved: pytorch#4624
  • Loading branch information
cccclai authored Aug 13, 2024
1 parent e71fa03 commit 2117c1a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
4 changes: 4 additions & 0 deletions backends/qualcomm/partition/common_defs.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
exir_ops.edge.aten.copy.default,
]

to_be_implemented_operator = [
exir_ops.edge.aten.where.default,
]

allow_list_operator = [
_operator.getitem,
]
12 changes: 11 additions & 1 deletion backends/qualcomm/partition/qnn_partitioner.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@
from torch.fx.passes.infra.partitioner import Partition
from torch.fx.passes.operator_support import OperatorSupportBase

from .common_defs import allow_list_operator, not_supported_operator
from .common_defs import (
allow_list_operator,
not_supported_operator,
to_be_implemented_operator,
)


class QnnOperatorSupport(OperatorSupportBase):
Expand Down Expand Up @@ -62,6 +66,12 @@ def is_node_supported(self, _, node: torch.fx.Node) -> bool:
if node.op != "call_function" or node.target in not_supported_operator:
return False

if node.target in to_be_implemented_operator:
print(
f"[QNN Partitioner Op Support]: {node.target.__name__} | Skipped, this op can be supported, please report an issue in https://github.com/pytorch/executorch/issues"
)
return False

if node.target in allow_list_operator:
return True

Expand Down

0 comments on commit 2117c1a

Please sign in to comment.