pytorch
aad01718 - Introduce aggressive merge to `CapabilityPartitioner` (#100195)

Commit
1 year ago
Introduce aggressive merge to `CapabilityPartitioner` (#100195) With the old partitioner, suppose `add` is supported, the following code ```python def fn(a, b, c, d): x = a + b # add y = c + d # add_1 return (x, y) traced = symbolic_trace(fn) partitioner = CapabilityBasedPartitioner(traced, supported_ops, allows_single_node_partition=True) partitions = partitioner.propose_partitions() ``` results in the partitions `[[add], [add_1]]`. However, since these two partitions do not depend on each other, they can be aggressively merged into a single partition `[[add, add_1]]` without causing any issues. This PR introduces a new feature that allows such aggressive merging by introducing an option `aggressive_merge` to the Partitioner class. Pull Request resolved: https://github.com/pytorch/pytorch/pull/100195 Approved by: https://github.com/SherlockNoMad
Author
Committer
Parents
Loading