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

Performance improvements: insert break into __early_exit_find_or #1624

Merged

Conversation

SergeyKopienko
Copy link
Contributor

@SergeyKopienko SergeyKopienko commented Jun 17, 2024

In this error we fixing performance issue in the __early_exit_find_or::operator() :

  • we should break for-loop after call __found_local.store(1);

This performance issue has been found during preparation of the PR #1617

…eak into __early_exit_find_or

Signed-off-by: Sergey Kopienko <[email protected]>
@SergeyKopienko SergeyKopienko added this to the 2022.7.0 milestone Jun 17, 2024
@SergeyKopienko SergeyKopienko changed the title Insert break into __early_exit_find_or Performance improvements: insert break into __early_exit_find_or Jun 17, 2024
Copy link
Contributor

@MikeDvorskiy MikeDvorskiy left a comment

Choose a reason for hiding this comment

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

LGTM

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.

Very good improvement.
I didn't understand at first, but because we don't use SLM, and we limit the number of groups to the number of compute units, this allows __n_iter to grow with N, basically unbounded. This means that even though we likely need ALL work-items in a subgroup to see the early exit condition to get a benefit here (due to implementation as masked vector operations), we might have a very large __n_iter, and with data that has a reasonable chance to find the criteria throughout, this can still provide big savings.

@SergeyKopienko SergeyKopienko merged commit 224acf7 into main Jun 19, 2024
20 checks passed
@SergeyKopienko SergeyKopienko deleted the dev/skopienko/insert_break_into_early_exit_find_or branch June 19, 2024 13:07
SergeyKopienko added a commit that referenced this pull request Jul 10, 2024
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.

3 participants