Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions backends/apple/mps/partition/mps_partitioner.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import torch
from executorch.backends.apple.mps.mps_preprocess import MPSBackend
from executorch.backends.apple.mps.operators.node_visitor import get_node_visitors
from executorch.backends.apple.mps.utils.mps_utils import is_parameter
from executorch.backends.transforms import get_shape
from executorch.exir.backend.backend_details import CompileSpec
from executorch.exir.backend.canonical_partitioners.pattern_op_partitioner import (
Expand Down Expand Up @@ -43,12 +42,6 @@ def __init__(self, edge_program: torch.export.ExportedProgram, compiler_specs):
self.edge_program = edge_program

def is_node_supported(self, submodules, node: torch.fx.Node) -> bool:
# Parameters are supported if any of their users are supported
if is_parameter(self.edge_program, node):
return any(
self.is_node_supported(submodules, user) for user in node.users.keys()
)

if node.op != "call_function":
return False

Expand Down Expand Up @@ -132,6 +125,7 @@ def partition(self, edge_program: ExportedProgram) -> PartitionResult:
partitions = self.generate_partitions(edge_program=edge_program)
if self.check_partitions(partitions):
self.tag_nodes(partitions)
# Tag constant data that are used by the supported ops in MPS backend.
tag_constant_data(edge_program)
x = PartitionResult(
tagged_exported_program=edge_program, partition_tags=self.partition_tags
Expand Down