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

Open
wants to merge 94 commits into
base: main
Choose a base branch
from

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 <sergey.kopienko@intel.com>
…introduce __parallel_merge_submitter_large for merge of biggest data sizes

Signed-off-by: Sergey Kopienko <sergey.kopienko@intel.com>
…using __parallel_merge_submitter_large for merge data equal or greater then 4M items

Signed-off-by: Sergey Kopienko <sergey.kopienko@intel.com>
Signed-off-by: Sergey Kopienko <sergey.kopienko@intel.com>
…fix compile error

Signed-off-by: Sergey Kopienko <sergey.kopienko@intel.com>
…fix Kernel names

Signed-off-by: Sergey Kopienko <sergey.kopienko@intel.com>
…rename template parameter names in __parallel_merge_submitter

Signed-off-by: Sergey Kopienko <sergey.kopienko@intel.com>
Signed-off-by: Sergey Kopienko <sergey.kopienko@intel.com>
…fix review comment

Signed-off-by: Sergey Kopienko <sergey.kopienko@intel.com>
…fix review comment

Signed-off-by: Sergey Kopienko <sergey.kopienko@intel.com>
…introduce __starting_size_limit_for_large_submitter into __parallel_merge

Signed-off-by: Sergey Kopienko <sergey.kopienko@intel.com>
…renames

Signed-off-by: Sergey Kopienko <sergey.kopienko@intel.com>
…introduce _split_point_t type

Signed-off-by: Sergey Kopienko <sergey.kopienko@intel.com>
…remove usages of std::make_pair

Signed-off-by: Sergey Kopienko <sergey.kopienko@intel.com>
…optimize evaluation of split-points on base diagonals

Signed-off-by: Sergey Kopienko <sergey.kopienko@intel.com>
…renames

Signed-off-by: Sergey Kopienko <sergey.kopienko@intel.com>
…extract eval_split_points_for_groups function

Signed-off-by: Sergey Kopienko <sergey.kopienko@intel.com>
…extract run_parallel_merge function

Signed-off-by: Sergey Kopienko <sergey.kopienko@intel.com>
…using SLM bank size to define chunk in the eval_nd_range_params function

Signed-off-by: Sergey Kopienko <sergey.kopienko@intel.com>
…using SLM bank size to define chunk in the eval_nd_range_params function (16)

Signed-off-by: Sergey Kopienko <sergey.kopienko@intel.com>
…restore old implementation of __find_start_point

Signed-off-by: Sergey Kopienko <sergey.kopienko@intel.com>
…rename: base_diag_part -> steps_between_two_base_diags

Signed-off-by: Sergey Kopienko <sergey.kopienko@intel.com>
…fix review comment

Signed-off-by: Sergey Kopienko <sergey.kopienko@intel.com>
…fix an error in __parallel_merge_submitter_large::eval_split_points_for_groups

Signed-off-by: Sergey Kopienko <sergey.kopienko@intel.com>
…onals is too short

Signed-off-by: Sergey Kopienko <sergey.kopienko@intel.com>
…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 <sergey.kopienko@intel.com>
…fix review comment: fix condition check in __find_start_point_in

Signed-off-by: Sergey Kopienko <sergey.kopienko@intel.com>
…apply GitHUB clang format

Signed-off-by: Sergey Kopienko <sergey.kopienko@intel.com>
Signed-off-by: Sergey Kopienko <sergey.kopienko@intel.com>
…er as private

Signed-off-by: Sergey Kopienko <sergey.kopienko@intel.com>
@SergeyKopienko SergeyKopienko marked this pull request as draft December 22, 2024 13:26
@SergeyKopienko SergeyKopienko force-pushed the dev/skopienko/optimize_merge_sort_V1 branch from 4574d07 to efa2649 Compare December 22, 2024 21:29
…or the largest data sizes

Signed-off-by: Sergey Kopienko <sergey.kopienko@intel.com>
….h -remove unused local variable

Signed-off-by: Sergey Kopienko <sergey.kopienko@intel.com>
….h - rename __find_or_eval_sp to __lookup_sp

Signed-off-by: Sergey Kopienko <sergey.kopienko@intel.com>
….h - fix an error in tests

Signed-off-by: Sergey Kopienko <sergey.kopienko@intel.com>
@SergeyKopienko SergeyKopienko force-pushed the dev/skopienko/optimize_merge_sort_V1 branch from efa2649 to 7906635 Compare December 22, 2024 21:39
…rge_sort.h - fix an error in tests"

This reverts commit 7906635.
…nt earlier

Signed-off-by: Sergey Kopienko <sergey.kopienko@intel.com>
….h - fix an error in tests

Signed-off-by: Sergey Kopienko <sergey.kopienko@intel.com>
….h - refactoring of __merge_sort_global_submitter __lookup_sp

Signed-off-by: Sergey Kopienko <sergey.kopienko@intel.com>
….h - refactoring of __merge_sort_global_submitter::eval_split_points_for_groups

Signed-off-by: Sergey Kopienko <sergey.kopienko@intel.com>
… largest data sizes on GPU only

Signed-off-by: Sergey Kopienko <sergey.kopienko@intel.com>
… largest data sizes on GPU only

Signed-off-by: Sergey Kopienko <sergey.kopienko@intel.com>
…nt earlier

Signed-off-by: Sergey Kopienko <sergey.kopienko@intel.com>
Signed-off-by: Sergey Kopienko <sergey.kopienko@intel.com>
@SergeyKopienko SergeyKopienko marked this pull request as ready for review December 22, 2024 22:45
….h - additional explanations in the __merge_sort_global_submitter::__lookup_sp function

Signed-off-by: Sergey Kopienko <sergey.kopienko@intel.com>
….h - fix capture modes in submit() calls

Signed-off-by: Sergey Kopienko <sergey.kopienko@intel.com>
….h - fix self-review comment: refactoring of __temp_sp_storages creation in the __merge_sort_global_submitter::operator()

Signed-off-by: Sergey Kopienko <sergey.kopienko@intel.com>
….h - remove extra static_cast in the __leaf_sorter::sort()

Signed-off-by: Sergey Kopienko <sergey.kopienko@intel.com>
….h - fix self-review comment: refactoring of __temp_sp_storages creation in the __merge_sort_global_submitter::operator()

Signed-off-by: Sergey Kopienko <sergey.kopienko@intel.com>
Signed-off-by: Sergey Kopienko <sergey.kopienko@intel.com>
Signed-off-by: Sergey Kopienko <sergey.kopienko@intel.com>
….h - avoid if statement inside Kernel's code

Signed-off-by: Sergey Kopienko <sergey.kopienko@intel.com>
Signed-off-by: Sergey Kopienko <sergey.kopienko@intel.com>
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.

1 participant