-
Notifications
You must be signed in to change notification settings - Fork 54
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 sort() #312
Implement sort() #312
Conversation
# Conflicts: # heat/core/manipulation.py # heat/core/tests/test_manipulations.py
…ning are not tested much yet
# Conflicts: # heat/core/manipulations.py # heat/core/tests/test_manipulations.py
Codecov Report
@@ Coverage Diff @@
## master #312 +/- ##
==========================================
+ Coverage 96.99% 97.06% +0.06%
==========================================
Files 53 53
Lines 9051 9265 +214
==========================================
+ Hits 8779 8993 +214
Misses 272 272
Continue to review full report at Codecov.
|
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.
Really nice work, have minor issues noted down here.
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.
bump
The code is now made more efficient to use less MPI=calls. It still needs one call for each coordinate that is not along the split axis but I don't see a way to improve this because every coordinate needs to be balanced for itself. The speed-up is roughly at about 6 for a vector of size (1000, 1) compared to the version where a MPI-call was made for every swap. |
Targets issue #144.
Sort is implemented using some parallel sorting algorithms with pivots and a balancing afterwards. Problem case is where axis = a.split because there the sorting is affected by the values of the other processes. In the end the returned tensor has the same shape as the local input tensor. The lower processes have the lower (higher) values, if sorting is performed ascending (descending) (MPI_WORLD.rank == 0 has the lowest (highest)).
The sorting is not stable, which means that equal elements might be in a different ordering than in the original array. This leads to the problem that the indices of the elements in the original data can be different and still produce the same sorting result.