MCPcopy Create free account
hub / github.com/pytorch/executorch / partition

Method partition

backends/vulkan/test/utils.py:104–124  ·  view source on GitHub ↗
(self, exported_program: ExportedProgram)

Source from the content-addressed store, hash-verified

102 self.delegation_spec = DelegationSpec("custom_partition", [])
103
104 def partition(self, exported_program: ExportedProgram) -> PartitionResult:
105 capability_partitioner = CapabilityBasedPartitioner(
106 exported_program.graph_module,
107 NodeFlagIsSetChecker(self.field),
108 allows_single_node_partition=True,
109 )
110 partition_list = capability_partitioner.propose_partitions()
111
112 partition_tags = {}
113 for partition in partition_list:
114 for node in partition.nodes:
115 tag = f"tag{partition.id}"
116 node.meta["delegation_tag"] = tag
117 partition_tags[tag] = self.delegation_spec
118
119 tag_constant_data(exported_program)
120 tag_mutated_buffer(exported_program)
121
122 return PartitionResult(
123 tagged_exported_program=exported_program, partition_tags=partition_tags
124 )
125
126
127def mark_node_range(

Callers 1

Calls 5

tag_constant_dataFunction · 0.90
tag_mutated_bufferFunction · 0.90
PartitionResultClass · 0.90
propose_partitionsMethod · 0.80

Tested by

no test coverage detected