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

[SYCLomatic] Bugfix in non-trivial run length encode's usage of oneDPL's reduce-by-segment #2596

Conversation

mmichel11
Copy link
Contributor

The current non-trivial run length encode implementation is dependent on an internal implementation detail in oneDPL. The defined operator (named op) in the reduce_by_segment call is dependent on segments being processed serially by a single work-item. In particular, the get<2>(lhs) += get<0>(rhs); update is dependent on get<2>(rhs) having no run length information that needs to be propagated through the reduction. When the segment is reduced serially, this is always the case.

oneDPL's new reduce-by-segment performance improvements does not process segments serially but rather distributes work evenly throughout work items. Information regarding lengths of runs are lost in get<2>(rhs) when oneDPL's new sub-group scan is performed. To resolve this issue, the flag element in the tuple is changed from a bool to an integral type and is used to compute the length of the run instead of separating the flag from the run-length count. As a result, partial computations of the run-length in get<0>(rhs) are propagated through the reduction. Additional logic is required when defining the mask to ensure that all elements of the run are flagged, and the padded end case is properly handled.

Please note that this PR is dependent on uxlfoundation/oneDPL#1987 to compile.

The previous implementation was dependent on implementation details of
oneDPL's reduce_by_segment. These adjustments fix this.

Signed-off-by: Matthew Michel <matthew.michel@intel.com>
Signed-off-by: Matthew Michel <matthew.michel@intel.com>
@mmichel11 mmichel11 requested a review from a team as a code owner January 3, 2025 16:53
Copy link
Contributor

@tomflinda tomflinda left a comment

Choose a reason for hiding this comment

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

LGMT

@zhimingwang36 zhimingwang36 merged commit eb7646a into oneapi-src:SYCLomatic Jan 6, 2025
7 checks passed
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