-
Notifications
You must be signed in to change notification settings - Fork 313
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
[REVIEW] python 2D shuffling #1133
[REVIEW] python 2D shuffling #1133
Conversation
Please update the changelog in order to start CI tests. View the gpuCI docs here. |
def get_2D_div(ngpus): | ||
pcols = int(math.sqrt(ngpus)) | ||
while ngpus % pcols != 0: | ||
pcols = pcols - 1 | ||
return int(ngpus/pcols), pcols |
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.
Python code to find prows and pcols
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.
We don't have MG CI resources, but could we have a unit test that developers could execute locally if they have > 1 GPU?
python/cugraph/structure/shuffle.py
Outdated
return partitions | ||
|
||
|
||
def shuffle(dg): |
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.
Suggest adding prows and pcols as parameters to the shuffle function, defaulting to None.
One of the easiest tuning things we want experienced users to be able to do is to configure prows and pcols, and it seems like this would be an easy way to do it.
If prows and pcols are specified then we should use them, otherwise we should compute them. If a user specifies one then the other should be computable (ngpus / 'whichever one is specified'). If user specifies neither then we can compute as the current code does.
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.
added
python/cugraph/structure/shuffle.py
Outdated
def shuffle(dg): | ||
ddf = dg.edgelist.edgelist_df | ||
ngpus = get_n_workers() | ||
prows, pcols = get_2D_div(ngpus) |
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.
Should probably add a check that prows * pcols = ngpus. The implementation of get_2D_div guarantees that, but if the user specifies a value to tune things that isn't guaranteed.
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.
added
|
||
def get_2D_div(ngpus): | ||
pcols = int(math.sqrt(ngpus)) | ||
while ngpus % pcols != 0: |
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.
Too lazy today to sit down and do math, but we should be able to directly compute this without a while loop.
python/cugraph/structure/shuffle.py
Outdated
def _set_partitions_pre(df, num_verts, prows, pcols): | ||
rows_per_div = math.ceil(num_verts/prows) | ||
cols_per_div = math.ceil(num_verts/pcols) | ||
partitions = df['src'].floordiv(rows_per_div) * pcols + df['dst'].floordiv(cols_per_div) |
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.
Can we do this? If I am not mistaken, we apply a hash function to edge source & destination vertices to determine the partition each edge belongs to. So, each partition will have roughly same number of rows or columns but they will not be same (and can't be determined in this way). Am I missing something?
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.
updated
rerun tests |
rerun tests |
rerun tests |
python/cugraph/structure/shuffle.py
Outdated
return partitions | ||
|
||
|
||
def shuffle(dg): |
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.
A few documentation lines would be a good addition
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.
added
…into branch-0.16
…into branch-0.16
Codecov Report
@@ Coverage Diff @@
## branch-0.16 #1133 +/- ##
===============================================
- Coverage 73.44% 72.19% -1.26%
===============================================
Files 60 61 +1
Lines 2335 2406 +71
===============================================
+ Hits 1715 1737 +22
- Misses 620 669 +49
Continue to review full report at Codecov.
|
No description provided.