-
Notifications
You must be signed in to change notification settings - Fork 49
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
Implement weak partial ordering (WPO) of the graph for concurrent fixpoint iteration. #5
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@int3 has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still working through the paper, but this looks pretty awesome. Thank you!!
private: | ||
// WPO nodes. | ||
std::vector<WpoNodeT> m_nodes; | ||
// Top level nodes. Nodes that are outside of any component. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Top level nodes. Nodes that are outside of any component. | |
// Top level nodes: Nodes that are outside of any component. |
} | ||
|
||
private: | ||
// Construct auxilary data-structures. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/auxilary/auxiliary/
bool is_widening_point() const { return m_widen; } | ||
|
||
private: | ||
// Add successor. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need for comments that state things that are obvious from the code :)
|
||
using WpoIdx = uint32_t; | ||
|
||
class SimpleGraph2 final { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you factor SimpleGraph
from the WeakTopologicalOrderingTest into a separate file and reuse it here?
int i = 0; | ||
std::ostringstream wto; | ||
bool first = true; | ||
while (!wl.empty()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This check-properties-and-print-wto-string code seems to be repeated across many tests... could it be factored out?
worklist_h.pop_back(); | ||
for (auto p : m_non_back_preds[v]) { | ||
auto rep_p = rep[dsets.find_set(p)]; | ||
auto it = nested_SCCs_h.find(rep_p); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: The it
here will shadow the it
in line 412.
We've decided to merge this as-is and do the fixups ourselves. Thanks for all your work @skkeem! We're super excited to productionize this :) |
…point iteration. (#5) Summary: This implements the Weak Partial Ordering (WPO) of a graph that generalizes the WTO. It can be used to implement concurrent fixpoint iteration algorithms. It is implemented in an iterative style so that it does not stack overflow during the WPO construction. - Test cases are added, including the cases for the irreducible graphs. - Ran clang-format to clean up the codes. Publications: - Sung Kook Kim, Arnaud J. Venet, and Aditya V. Thakur. Deterministic Parallel Fixpoint Computation. To appear in POPL 2020 - preprint: [arXiv:1909.05951](https://arxiv.org/abs/1909.05951) Pull Request resolved: facebook/SPARTA#5 Reviewed By: yuxuanchen1997 Differential Revision: D18169499 Pulled By: int3 fbshipit-source-id: 64fcc87ce94b33c34fdbe89a327ebb7e99b64697
…point iteration. (#5) Summary: This implements the Weak Partial Ordering (WPO) of a graph that generalizes the WTO. It can be used to implement concurrent fixpoint iteration algorithms. It is implemented in an iterative style so that it does not stack overflow during the WPO construction. - Test cases are added, including the cases for the irreducible graphs. - Ran clang-format to clean up the codes. Publications: - Sung Kook Kim, Arnaud J. Venet, and Aditya V. Thakur. Deterministic Parallel Fixpoint Computation. To appear in POPL 2020 - preprint: [arXiv:1909.05951](https://arxiv.org/abs/1909.05951) Pull Request resolved: facebook/SPARTA#5 Reviewed By: yuxuanchen1997 Differential Revision: D18169499 Pulled By: int3 fbshipit-source-id: 64fcc87ce94b33c34fdbe89a327ebb7e99b64697
Hi @skkeem , I am not sure if the get_num_outer_preds(WpoIdx exit) funtion is the corresponding method for NumOuterSchedPreds in paper. As I found the result given for one of the node in the following graph doesn't seem to match expectation. Construct a SimpleGraph2 using following codes:
Traverse through the graph and print out get_num_outer_preds for exit nodes, and predecessors of each nodes. The result for exit node with NodeId "46" only have number for head node with NodeId "46". However in the component for exit node with NodeId "46", there is another node with NodeId "74", it have two predecessors in WPO, one is node with NodeId "16" which is outside of the component, another is node with NodeId "73" which is inside of the component, so I think get_num_outer_preds for exit node with NodeId "46" should have node with NodeId "74" have value 1 (but there is no value for node with NodeId "74"). Thanks for your help! |
Hello @ssj933, Thank you for bringing this to my attention.
As you have correctly pointed out, I have fixed the bug and added corresponding test cases in PR #7 . Thank you. |
This implements the Weak Partial Ordering (WPO) of a graph that generalizes the WTO.
It can be used to implement concurrent fixpoint iteration algorithms.
It is implemented in an iterative style so that it does not stack overflow during the WPO construction.
Publications: