-
Notifications
You must be signed in to change notification settings - Fork 16
Implements a distributed partitioner that is lazier than find_distributed_partitions
#277
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
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
54b90db
MPMS materialization: support distributed nodes
kaushikcfd 57a0f8d
make reverse_graph emit immutable objects
kaushikcfd 18c40f5
Implements DirectPredecessorsGetter
kaushikcfd 700138a
implements CopyMapperWithExtraArgs
kaushikcfd 2de4b2b
find_distributed_partition: better algorithm
kaushikcfd bbb3ff3
Adds example to demonstrate eager send scheduling
kaushikcfd 0b40e71
materialize nodes before find_distributed_partition
kaushikcfd 596a8e3
adds a regression on a DAG with no comm. nodes
kaushikcfd File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| """ | ||
| An example to demonstrate the behavior of | ||
| :func:`pytato.find_distrbuted_partition`. One of the key characteristic of the | ||
| partitioning routine is to recompute expressions that appear in the multiple | ||
| partitions but are not materialized. | ||
| """ | ||
| import pytato as pt | ||
| import numpy as np | ||
|
|
||
| size = 2 | ||
| rank = 0 | ||
|
|
||
| x1 = pt.make_placeholder("x1", shape=(10, 4), dtype=np.float64) | ||
| x2 = pt.make_placeholder("x2", shape=(10, 4), dtype=np.float64) | ||
| x3 = pt.make_placeholder("x3", shape=(10, 4), dtype=np.float64) | ||
| x4 = pt.make_placeholder("x4", shape=(10, 4), dtype=np.float64) | ||
|
|
||
|
|
||
| tmp1 = (x1 + x2).tagged(pt.tags.ImplStored()) | ||
| tmp2 = tmp1 + x3 | ||
| # "marking" *tmp2* so that its duplication can be clearly visualized. | ||
| tmp2 = tmp2.tagged(pt.tags.Named("tmp2")) | ||
| tmp3 = (2 * x4).tagged(pt.tags.ImplStored()) | ||
| tmp4 = tmp2 + tmp3 | ||
|
|
||
| recv = pt.staple_distributed_send(tmp4, dest_rank=(rank-1) % size, comm_tag=10, | ||
| stapled_to=pt.make_distributed_recv( | ||
| src_rank=(rank+1) % size, comm_tag=10, shape=(10, 4), dtype=int)) | ||
|
|
||
| out = tmp2 + recv | ||
| result = pt.make_dict_of_named_arrays({"out": out}) | ||
|
|
||
| partitions = pt.find_distributed_partition(result) | ||
|
|
||
| # Visualize *partitions* to see that each of the two partitions contains a node | ||
| # named 'tmp2'. | ||
| pt.show_dot_graph(partitions) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.