qonnx.transformation.create_generic_partitions (module)

class qonnx.transformation.create_generic_partitions.PartitionFromDict(partitioning={}, partition_dir=None)

Bases: qonnx.transformation.base.Transformation

Split a graph into partitions. Each resulting partition node has a model attribute indicating the path to the subordinate onnx file. Cleanup and InferShapes() transformations should be applied first.

This transformation builds on PartitionFromLambda() and takes a dictionary that defines partitions based on node indices.

Argument 0: partitioning * Dictionary with the following format: { partition_id : node_index_list } * Example: {0 : [3,4,5], 1 : range(10, 15)}

Argument 1 (optional): partition_dir * Manually define where to save the partition models

apply(model)
class qonnx.transformation.create_generic_partitions.PartitionFromLambda(partitioning=<function PartitionFromLambda.<lambda>>, partition_dir=None)

Bases: qonnx.transformation.base.Transformation

Split a graph into partitions. Each resulting partition node has a model attribute indicating the path to the subordinate onnx file. Cleanup and InferShapes() transformations should be applied first.

Argument 0: partitioning * Function performing the mapping: node -> partition_id (int or string) * Partitions may not cover the graph completely (nodes mapped to -1 are retained) * Mapping must return -1 for GenericPartition nodes

Argument 1 (optional): partition_dir * Manually define where to save the partition models

apply(model)