-
Notifications
You must be signed in to change notification settings - Fork 304
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
Fix the difference in 2D partitioning of GPUs in python and C++ #1950
Fix the difference in 2D partitioning of GPUs in python and C++ #1950
Conversation
…ython_2d_partition
rerun tests Rerunning to get latest updates that should fix build problem. |
Codecov Report
@@ Coverage Diff @@
## branch-22.02 #1950 +/- ##
===============================================
Coverage ? 70.28%
===============================================
Files ? 143
Lines ? 8922
Branches ? 0
===============================================
Hits ? 6271
Misses ? 2651
Partials ? 0 Continue to review full report at Codecov.
|
pcols = pcols - 1 | ||
return int(ngpus/pcols), pcols | ||
prows = int(math.sqrt(ngpus)) | ||
while ngpus % prows != 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.
this will be a very fast loop, but you should have just been able to subtract the delta of the modulo result from prows rather than looping.
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? I am not sure I am fully understanding your intention, but here prows
is varying.
Say ngpus
= 14. Then, int(sqrt(14))
will be 3. 14 % 3
will be 2. prows (3) - 2
will be 1. But we want prows
to be 2.
This code is based on the discussions from https://stackoverflow.com/questions/16266931/input-an-integer-find-the-two-closest-integers-which-when-multiplied-equal-th
@gpucibot merge |
If sqrt(# GPUs) is not an integer, prows > pcols in python and prows < pcols in C++.
The C++'s choice leads to better performance (especially for BFS & SSSP and on the systems with low inter-GPU communication bandwidth) and this reduces the difference between python and C++ testing/benchmarking.