Skip to content

[SYCL] Fix big and non-uniform work-groups handling in reduction kernels #2859

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

Merged

Conversation

v-klochkov
Copy link
Contributor

@v-klochkov v-klochkov commented Dec 3, 2020

This patch also does minor optimization in the main kernels created
for reductions. The previous code tried to handle non-uniform work-group sizes
and it did it wrong way. That code was removed as it is user's responsibility
to provide nd_range that is handled well by the devices, at least for
main kernels.

The patch conservatively limits the maximum work-group size handled by
the reduction implementation to avoid various runtime errors caused
by selecting too optimistic work-group size for reductions. This solution
is rather temporary until reduction kernels precompilation/query approach
is implemented.

Signed-off-by: Vyacheslav N Klochkov [email protected]

…rnels

This patch also does minor optimization in the main kernels created
for reductions. The previous code tried to handle non-uniform work-group sizes
and it did it wrong way. That code was removed as it is user's responsibility
to provide nd_range that is handled well by the devices, at least for
main kernels.

The patch conservatively limits the maximum work-group size handled by
the reduction implementation to avoid various runtime errors caused
by selecting too optimistic work-group size for reductions. This solution
is rather temporary until reduction kernels precompilation/query approach
is implemented.

Signed-off-by: Vyacheslav N Klochkov <[email protected]>
alexbatashev
alexbatashev previously approved these changes Dec 4, 2020
Copy link
Contributor

@alexbatashev alexbatashev left a comment

Choose a reason for hiding this comment

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

LGTM

@v-klochkov
Copy link
Contributor Author

LGTM
Thank you. The new LIT test failed on ACC though and I need to tune heuristics there.

@bader bader changed the title [SYCL] - Fix big and non-uniform work-groups handling in reduction ke… [SYCL] Fix big and non-uniform work-groups handling in reduction kernels Dec 4, 2020
Pennycook
Pennycook previously approved these changes Dec 4, 2020
Copy link
Contributor

@bader bader left a comment

Choose a reason for hiding this comment

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

Please, fix CI failures.

@v-klochkov v-klochkov dismissed stale reviews from Pennycook and alexbatashev via 1e0e0a3 December 5, 2020 00:34
@v-klochkov v-klochkov requested a review from bader December 5, 2020 03:31
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.

4 participants