Check that distributed DAG is deadlock-free - #366
Conversation
92b53d1 to
0789c7d
Compare
7780422 to
78e3c46
Compare
|
Is this going in the direction you had in mind @inducer? |
Yes, but unless I'm mistaken, you're currently still missing the edges relating to inter-rank communication. (And those are the interesting ones.) |
af88a87 to
faa623e
Compare
|
I'm guessing the DAG being constructed here has nodes of the form
|
dd6d79d to
3af81dd
Compare
9d47108 to
446daf5
Compare
|
|
||
| print(all_summarized_parts) | ||
| output_to_defining_pid: Dict[_DistributedName, _DistributedPartId] = {} | ||
| for sumpart in all_summarized_parts.values(): |
There was a problem hiding this comment.
For the keys in part.input_name_to_recv_node, there are no corresponding output_names, which is why this fails later on.
There was a problem hiding this comment.
Ah, good catch. I believe that that's what we were missing. Do you want to push a fix?
There was a problem hiding this comment.
I'm not sure what the right fix is - should we just ignore those input names in the later loop (around line 1023)?
Edit:
Done in 89dc0ef
|
Is the global parts DAG verifier here noticing cycles in any of the distributed tests? I ask because it seems some of the CI runs are getting timed out by running into a deadlock -- https://github.com/inducer/pytato/actions/runs/3365558563/jobs/5583742094. The CI run is from #374. |
|
Looks like the CI in this PR is also experiencing the deadlock? I don't see any other reason why the tests would take this long. |
The tests (added in 05b4668) run fine on my local machine. My guess is that the MPI runtime inside the CI trips over the fact that one rank exited with an exception and just hangs. |
It seems to me moving to Py3.11 is triggering the error.
Could be the case. I didn't account for that. |
3c5339e to
5900a0c
Compare
|
Thanks! I ran deadlock_checker with this branch and the user experience was almost great. The driver reported the error --
|
|
(I'll remove myself as a reviewer since you guys are more knowledgeable about this than me.) |
Thanks, this is really helpful! There was a bug in
Right, with the fix there is a duplicate send from rank 0-> 1 now, which seems correct (the visualized DAG shows the same duplicate).
Not sure what the best way to handle this is. It seems like it's MPI runtime specific. |
66b9dc2 to
f02249c
Compare
afc6d24 to
7210e6f
Compare
794e1c7 to
a8a72dc
Compare
|
I'm working on cleaning this up. In I've dropped all the unrelated stuff. |
e114fe1 to
222611f
Compare
| with pytest.raises(ValueError): | ||
| verify_distributed_partition(comm, distributed_parts) | ||
| else: | ||
| verify_distributed_partition(comm, distributed_parts) |
There was a problem hiding this comment.
These tests don't cover many of the things the verifier guards against. While I'm tempted to merge this so that we can start using it, I feel like it might be wise to wait for coverage of at least the following scenarios:
- Duplicate send
- Duplicate recv
- Cycle in the graph
There was a problem hiding this comment.
Thanks - I added these additional tests in 8d112fe
222611f to
46992cd
Compare
46992cd to
994d1b2
Compare
|
Sorry, had a few more force-pushes just now for a few final cleanups. Done now. |
Co-authored-by: Matthias Diener <mdiener@illinois.edu>
4fda54a to
1a7e391
Compare
|
Thanks! And thanks for making these extra commits, that made the changes easy to review. I've folded them into the verifier and test commits, fixed some typos, and added a base class and eliminated what I believe was a redundant test. (The two spots that raised |
After merge: