Skip to content

[SYCL] Use a global flush buffer in stream #1678

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
May 27, 2020

Conversation

shahabl
Copy link

@shahabl shahabl commented May 12, 2020

Change stream implementation to use a global buffer for all the
work-items to flush their outputs into. Previously a set of local flush
buffers were used for this purpose.

This change is made to avoid the issue of some devices running out of
local memory when available space is less than statement size times the
number of work-items.

Signed-off-by: Shahab Layeghi [email protected]

Change stream implementation to use a global buffer for all the
work-items to flush their outputs into. Previously a set of local flush
buffers were used for this purpose.

This change is made to avoid the issue of some devices running out of
local memory when available space is less than statement size times the
number of work-items.

Signed-off-by: Shahab Layeghi <[email protected]>
@shahabl shahabl marked this pull request as ready for review May 12, 2020 15:35
@shahabl shahabl requested review from againull and a team as code owners May 12, 2020 15:35
@shahabl shahabl requested a review from v-klochkov May 12, 2020 15:35
@s-kanaev
Copy link
Contributor

Is there any impact on performance within this implementation?

againull
againull previously approved these changes May 12, 2020
@againull
Copy link
Contributor

againull commented May 15, 2020

Is there any impact on performance within this implementation?

In previous implementation where we used flush buffer in local memory users saw 10x slowdown in some cases because local memory was exhausted. So I expect that mainly this change has positive performance effect.

@@ -22,6 +23,15 @@ AccessorImplHost::~AccessorImplHost() {
}
}

void AccessorImplHost::resize(size_t GlobalSize) {
if (GlobalSize != 1) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why 1 is special value here?

Copy link
Author

Choose a reason for hiding this comment

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

No special significance anymore, but now it prevents some unnecessary operations.

Copy link
Contributor

Choose a reason for hiding this comment

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

OK, then, when do you call resize method with GlobalSize equal to one?

@@ -59,7 +59,7 @@ int main() {
check_size<program, 16>();
check_size<range<1>, 8>();
check_size<sampler, 16>();
check_size<stream, 208>();
check_size<stream, 144>();
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe you'll have to update version of library now.

Copy link
Author

Choose a reason for hiding this comment

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

Is there something besides the change already done in sycl/CMakeLists.txt?

Copy link
Contributor

Choose a reason for hiding this comment

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

Add a comment per review.

Signed-off-by: Shahab Layeghi <[email protected]>
Minor format fix

Signed-off-by: Shahab Layeghi <[email protected]>
@againull againull self-requested a review May 21, 2020 18:37
@againull
Copy link
Contributor

againull commented May 27, 2020

@s-kanaev, @v-klochkov Merging is blocked, I believe because your approve is required on behalf of runtime reviewers. Please approve or provide your feedback.

@againull againull requested a review from s-kanaev May 27, 2020 01:56
@againull againull merged commit 385520a into intel:sycl May 27, 2020
@shahabl shahabl deleted the shahabl/stream-global-flush-1 branch May 27, 2020 18:36
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