Skip to content

[SYCL] Visit explicit dependencies during finished command cleanup #2265

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

Closed
wants to merge 1 commit into from

Conversation

sergey-semenov
Copy link
Contributor

@sergey-semenov sergey-semenov commented Aug 5, 2020

Previously, only implicit dependencies (represented by DepDesc) of each
command node were visited during finished command cleanup. That meant
that command nodes with no implicit dependencies were never cleaned up
unless waited for directly (via queue::wait or event::wait on that
event). This patch changes graph traversal during cleanup, so that all
command dependencies are visited, whether represented by DepDesc or not.

Signed-off-by: Sergey Semenov [email protected]

@sergey-semenov sergey-semenov requested a review from a team as a code owner August 5, 2020 15:27
@sergey-semenov sergey-semenov requested a review from rbegam August 5, 2020 15:27
@sergey-semenov
Copy link
Contributor Author

I'll take a look at the test failures

Copy link
Contributor

@rbegam rbegam left a comment

Choose a reason for hiding this comment

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

LGTM. Please fix the test fails.

Previously, only implicit dependencies (represented by DepDesc) of each
command node were visited during finished command cleanup. That meant
that command nodes with no implicit dependencies were never cleaned up
unless waited for directly (via queue::wait or event::wait on that
event). This patch changes graph traversal during cleanup, so that all
command dependencies are visited, whether represented by DepDesc or not.

Signed-off-by: Sergey Semenov <[email protected]>
@sergey-semenov sergey-semenov changed the title [SYCL] Handle command groups that have not been waited for [SYCL] Visit explicit dependencies during finished command cleanup Aug 27, 2020
@sergey-semenov
Copy link
Contributor Author

Sorry for the delay. I ended up switching to a different solution due to issues when cleaning up commands during graph builder destruction. @rbegam please, take a look.

@sergey-semenov sergey-semenov requested a review from rbegam August 27, 2020 15:52
@sergey-semenov sergey-semenov marked this pull request as draft August 28, 2020 11:05
@sergey-semenov
Copy link
Contributor Author

An alternate solution would be to kill off command nodes without explicit dependencies after their enqueuing. That would address more problematic cases than this change alone. Moving this PR to draft for now.

@keryell
Copy link
Contributor

keryell commented Aug 28, 2020

It looks like now you have accumulated some experience about this foggy unexplored part of the SYCL specification.
I am pretty sure the SYCL committee would love a presentation on this context, such as resource exhaustion, dead-locks, memory explosion... and some mitigations you have come with.

@sergey-semenov
Copy link
Contributor Author

Superseded by #2492

jsji pushed a commit that referenced this pull request Jan 4, 2024
…2265)

ImageOpMask pointer was passed to closure as reference.
Closure is executed outside of original stack frame which renders
reference invalid. Fixes some ASan errors from issue #2233.

Original commit:
KhronosGroup/SPIRV-LLVM-Translator@29d4cd3
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