Skip to content
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

Optimize merge_sort algorithm for largest data sizes #1977

Merged
merged 165 commits into from
Jan 28, 2025

Conversation

SergeyKopienko
Copy link
Contributor

@SergeyKopienko SergeyKopienko commented Dec 19, 2024

In this PR we extends the approach from #1933 to merge_sort algorithm.

…introduce new function __find_start_point_in

Signed-off-by: Sergey Kopienko <[email protected]>
…introduce __parallel_merge_submitter_large for merge of biggest data sizes

Signed-off-by: Sergey Kopienko <[email protected]>
…using __parallel_merge_submitter_large for merge data equal or greater then 4M items

Signed-off-by: Sergey Kopienko <[email protected]>
Signed-off-by: Sergey Kopienko <[email protected]>
…rename template parameter names in __parallel_merge_submitter

Signed-off-by: Sergey Kopienko <[email protected]>
Signed-off-by: Sergey Kopienko <[email protected]>
…introduce __starting_size_limit_for_large_submitter into __parallel_merge

Signed-off-by: Sergey Kopienko <[email protected]>
…introduce _split_point_t type

Signed-off-by: Sergey Kopienko <[email protected]>
…remove usages of std::make_pair

Signed-off-by: Sergey Kopienko <[email protected]>
…optimize evaluation of split-points on base diagonals

Signed-off-by: Sergey Kopienko <[email protected]>
…extract eval_split_points_for_groups function

Signed-off-by: Sergey Kopienko <[email protected]>
…extract run_parallel_merge function

Signed-off-by: Sergey Kopienko <[email protected]>
…using SLM bank size to define chunk in the eval_nd_range_params function

Signed-off-by: Sergey Kopienko <[email protected]>
…using SLM bank size to define chunk in the eval_nd_range_params function (16)

Signed-off-by: Sergey Kopienko <[email protected]>
…restore old implementation of __find_start_point

Signed-off-by: Sergey Kopienko <[email protected]>
…rename: base_diag_part -> steps_between_two_base_diags

Signed-off-by: Sergey Kopienko <[email protected]>
…fix an error in __parallel_merge_submitter_large::eval_split_points_for_groups

Signed-off-by: Sergey Kopienko <[email protected]>
…erge_submitter_large` into one `__parallel_merge_submitter` (#1956)
…fix review comment: remove extra condition check from __find_start_point_in

Signed-off-by: Sergey Kopienko <[email protected]>
…fix review comment: fix condition check in __find_start_point_in

Signed-off-by: Sergey Kopienko <[email protected]>
…apply GitHUB clang format

Signed-off-by: Sergey Kopienko <[email protected]>
….h - fix review comment: It looks like we just write to the scratch buffer
…rge_sort.h - fix review comment: remove condition check in __lookup_sp"

This reverts commit 7488c94.
….h - fix self review comment: redesign work with base diagonals
….h - fix review comment: remove postfix _w from function names inside __merge_sort_global_submitter class
….h - fix self review comment: redesign work with base diagonals
danhoeflinger
danhoeflinger previously approved these changes Jan 27, 2025
Copy link
Contributor

@danhoeflinger danhoeflinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Between the adjustments, discussions and TODOs recorded, I think this is in good shape now.
LGTM, thanks Sergey.

Edit: Please fix clang format and I will re-approve.

@danhoeflinger danhoeflinger self-requested a review January 27, 2025 21:11
@danhoeflinger danhoeflinger dismissed their stale review January 27, 2025 21:12

needs clang format

@SergeyKopienko
Copy link
Contributor Author

FYI: The performance has been checked, no issue detected.

Copy link
Contributor

@danhoeflinger danhoeflinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As mentioned above, LGTM.

@SergeyKopienko SergeyKopienko merged commit ab4ae3d into main Jan 28, 2025
22 checks passed
@SergeyKopienko SergeyKopienko deleted the dev/skopienko/optimize_merge_sort_V1 branch January 28, 2025 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants