Skip to content

[Partitioner] Partitioner Refactoring 2 #3318

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

Conversation

beicy
Copy link
Contributor

@beicy beicy commented Jul 29, 2019

Summary:
In this PR, the following methods are updated ( the way of how to calculate the memory usage/computation for each node is not changed) :

  1. In previous version, Partitioner had a map to store the node and its memory usage. Now this one is removed, and a function uint64_t getNodeMemUsage(const Node *node) is added in to PartitionerUtils.cpp. That is, instead of pre-calculating all nodes' memory usage and storing it in a map, we calculate it when it is necessary. This function is now only called in loadBalancedPartitioning, and for each node, it is only called once. So no need to store the value in a map.
  2. In previous version, Partitioner had a map to store the node and its computation time. Similar as the above memory usage refactoring, a function float getNodeComputeTime(const Node *node, const BackendInfo backendInfo) is added to return the computation time of a node when it is necessary. Now the backendInfo is added as a param in this function for different type of backends.

Documentation:
#2298
[Optional Fixes #issue]

Test Plan: ninja test.

Please see a detailed explanation of how to fill out the fields in the relevant sections in PULL_REQUEST.md.

@nrsatish
Copy link
Contributor

LGTM

@nrsatish nrsatish self-assigned this Jul 29, 2019
Copy link
Contributor

@nickgg nickgg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

Copy link

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@beicy has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

Copy link

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@beicy has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link

@beicy merged this pull request in bbb1b84.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants