Skip to content

Commit 5d6be47

Browse files
mcr229facebook-github-bot
authored andcommitted
always partition used static attr
Summary: For supported_operators that use static data, the data should always be partitioned along with that operator. This is required for adding addmm into supported_operator set because it allows us to partition in the weight and bias data. Differential Revision: D49129705 fbshipit-source-id: dfd200221e42408128ec429c16672c2919a2ba72
1 parent 7e35117 commit 5d6be47

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

backends/xnnpack/partition/xnnpack_partitioner.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,11 @@ def check_constraint(node, ep) -> bool:
109109
return _OP_SUPPORT_CONSTRAINTS.get(node.target, lambda node, ep: True)(node, ep)
110110

111111
def is_node_supported(self, submodules, node: torch.fx.Node) -> bool:
112+
# Parameters are supported if any of there users are supported
113+
if is_param_node(self.ep, node):
114+
return any(
115+
self.is_node_supported(submodules, user) for user in node.users.keys()
116+
)
112117
# TODO - other ops?
113118
if node.op != "call_function":
114119
return False

0 commit comments

Comments
 (0)