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

[SYCL] Follow up fixes for group_sort extension #14591

Merged
merged 3 commits into from
Jul 18, 2024

Conversation

againull
Copy link
Contributor

@againull againull commented Jul 16, 2024

  • Change memory_required queries to return the exact size of local memory which needs to be allocated for group_sort algorithm, currently it is a bit more than required.
  • Fix a bug in align_key_value_scratch where I didn't take into account that std::align changes value of KeysScratchSpace. To find scratch of the values I need to use original value of this variable.
  • Fix mistake in the test where keys/values were mixed up. This is more of a cosmetic change.
    RunSortKeyValueOverGroup functions accepts two vectors - the first is considered keys, and the second is considered values.
    Verification is done in the same function (with the same assumption that the first vector is keys and the second is values).
    So it doesn't actually matter in which order aforementioned arguments are provided, test still serves it purpose.

* Change memory_required queries to return the exact size of local memory
  which needs to be allocated for group_sort algorithm, currently it is
  a bit more than required.
* Fix a bug in align_key_value_scratch where I didn't take into account
  that std::align changes value of KeysScratchSpace. To find scratch of
  the values I need to use original value of this variable.
* Fix mistake in the test where keys/values were mixed up.
@aelovikov-intel
Copy link
Contributor

KeysScratchSpace bug seems to have been introduced in #14399, it would makes sense for the reviewer from that PR to review this one as he'd be more familiar with the surrounding code. Adding @dm-vodopyanov to reviewers.

@againull
Copy link
Contributor Author

tag @andreyfe1

@aelovikov-intel
Copy link
Contributor

Fix mistake in the test where keys/values were mixed up.

How did it pass before and how did you find it? Should we change some values for keys/values in the test as well?

Copy link
Contributor

@andreyfe1 andreyfe1 left a comment

Choose a reason for hiding this comment

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

Thanks!

@againull
Copy link
Contributor Author

againull commented Jul 17, 2024

Fix mistake in the test where keys/values were mixed up.

How did it pass before and how did you find it? Should we change some values for keys/values in the test as well?

This is more of a cosmetic change.
RunSortKeyValueOverGroup functions accepts two vectors - the first is considered keys, and the second is considered values.
Verification is done in the same function (with the same assumption that the first vector is keys and the second is values).

So it doesn't actually matter if we do:

RunSortKeyValueOverGroup<UseGroupT::WorkGroup, 1>(Q, Data, Keys,
                                                      Comparator);

or

RunSortKeyValueOverGroup<UseGroupT::WorkGroup, 1>(Q, Keys, Data,
                                                      Comparator);

Keys and Data vectors are filled with random numbers (and these two vectors are different) and test serves it purpose no matter the order of the aforementioned arguments, so additional changes are not necessary.

@aelovikov-intel
Copy link
Contributor

This is more of a cosmetic change.

Please add this explanation to the PR description.

@againull
Copy link
Contributor Author

This is more of a cosmetic change.

Please add this explanation to the PR description.

Added.

Copy link
Contributor

@aelovikov-intel aelovikov-intel left a comment

Choose a reason for hiding this comment

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

LGTM for two out of three changes here. Still needs @dm-vodopyanov 's approval.

@dm-vodopyanov
Copy link
Contributor

LGTM for two out of three changes here. Still needs @dm-vodopyanov 's approval.

Suggest to approve without my approval because code reviews for all previous group_sort patches were made by @andreyfe1, as Andrey is an expert in group_sort extension, and he put above his informal approval for the current patch.

@againull againull merged commit 0360e6a into intel:sycl Jul 18, 2024
14 checks passed
@againull againull deleted the fixup_group_sort branch August 7, 2024 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants