File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
backends/apple/mps/partition Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change 9
9
import torch
10
10
from executorch .backends .apple .mps .mps_preprocess import MPSBackend
11
11
from executorch .backends .apple .mps .operators .node_visitor import get_node_visitors
12
+ from executorch .backends .apple .mps .utils .mps_utils import is_parameter
12
13
from executorch .exir .backend .backend_details import CompileSpec
13
14
from executorch .exir .backend .canonical_partitioners .pattern_op_partitioner import (
14
15
generate_partitions_from_list_of_nodes ,
30
31
class MPSOperatorSupport (OperatorSupportBase ):
31
32
def __init__ (self , edge_program : torch .export .ExportedProgram , compiler_specs ):
32
33
self .node_visitors = get_node_visitors (edge_program )
34
+ self .edge_program = edge_program
33
35
34
36
def is_node_supported (self , submodules , node : torch .fx .Node ) -> bool :
37
+ # Parameters are supported if any of their users are supported
38
+ if is_parameter (self .edge_program , node ):
39
+ return any (
40
+ self .is_node_supported (submodules , user ) for user in node .users .keys ()
41
+ )
42
+
35
43
if node .op != "call_function" :
36
44
return False
37
45
You can’t perform that action at this time.
0 commit comments