Skip to content

[SYCL] Use macro SYCL_REDUCTION_DETERMINISTIC for stable reduction re… #3876

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
merged 3 commits into from
Jun 7, 2021

Conversation

v-klochkov
Copy link
Contributor

…sults

The macro SYCL_REDUCTION_DETERMINISTIC is not defined by default.

This patch also has NFC portion which removes reduction only specific
code from known_identity.hpp file.

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

…sults

The macro SYCL_REDUCTION_DETERMINISTIC is not defined by default.

This patch also has NFC portion which removes reduction only specific
code from known_identity.hpp file.

Signed-off-by: Vyacheslav N Klochkov <[email protected]>
@v-klochkov v-klochkov requested a review from Pennycook June 3, 2021 21:59
Comment on lines +45 to +47
#ifdef SYCL_REDUCTION_DETERMINISTIC
bool_constant<false>;
#else
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this sufficient to guarantee determinism? I don't think the work-group/sub-group reduction functions are guaranteed to be deterministic across all devices. Since there's only one implementation that's guaranteed to be deterministic (i.e. the manual tree reduction), why not guard all but that implementation behind ifndef SYCL_REDUCTION_DETERMINISTIC?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right. I disabled reduce() algorithm when the macro is defined: ead7383

@v-klochkov v-klochkov marked this pull request as ready for review June 4, 2021 19:29
@v-klochkov v-klochkov requested a review from a team as a code owner June 4, 2021 19:29
@v-klochkov v-klochkov requested a review from sergey-semenov June 4, 2021 19:29
@bader bader merged commit a3fc51a into intel:sycl Jun 7, 2021
@v-klochkov v-klochkov deleted the public_reduction_deterministic_macro branch June 7, 2021 17: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.

4 participants