Skip to content

Commit eba236c

Browse files
huiyujie0105facebook-github-bot
authored andcommitted
add not decomposition into vulkan_partition
Differential Revision: D58900868
1 parent a88f2f1 commit eba236c

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

backends/vulkan/partitioner/vulkan_partitioner.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# pyre-strict
88

99
import logging
10-
from typing import Any, Dict, final, List, Mapping, Optional
10+
from typing import Any, Callable, Dict, final, List, Mapping, Optional, Tuple
1111

1212
import executorch.backends.vulkan.serialization.vulkan_graph_schema as vk_graph_schema
1313

@@ -33,6 +33,11 @@
3333

3434
from torch.fx.passes.operator_support import OperatorSupportBase
3535

36+
# pyre-ignore
37+
ops_not_to_decompose = [
38+
torch.ops.aten.upsample_nearest2d.vec,
39+
]
40+
3641

3742
class VulkanSupportedOperators(OperatorSupportBase):
3843
_ops: OpList = enumerate_supported_ops()
@@ -150,6 +155,11 @@ def __init__(self, compile_options: Optional[Dict[str, Any]] = None) -> None:
150155
compile_spec = parse_compile_options(self.options)
151156
self.delegation_spec = DelegationSpec(VulkanBackend.__name__, compile_spec)
152157

158+
def ops_to_not_decompose(
159+
self, ep: ExportedProgram
160+
) -> Tuple[List[torch._ops.OpOverload], Optional[Callable[[torch.fx.Node], bool]]]:
161+
return (ops_not_to_decompose, None)
162+
153163
def partition(self, exported_program: ExportedProgram) -> PartitionResult:
154164
# Run the CapabilityBasedPartitioner to return the largest possible
155165
# subgraphs containing the nodes with the tags

0 commit comments

Comments
 (0)