add node by node cost function (#47009)
Summary:
This PR adds node-by-node cost function. Given a partition of nodes, get_latency_of_one_partition function will find the critical path in the partition and return its latency. A test unit is also provided. In the test unit, a graph module is partitioned into two partitions and the latency of each partition is tested.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/47009
Reviewed By: gcatron
Differential Revision: D24692542
Pulled By: scottxu0730
fbshipit-source-id: 64c20954d842507be0d1afa2516d88f705e11224