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

[SYCL] fix for leaking commands when exception thrown #16618

Draft
wants to merge 6 commits into
base: sycl
Choose a base branch
from

Conversation

cperkinsintel
Copy link
Contributor

When enqueueing a command and its dependencies, an exception might be thrown. In that case, the command will have a failed EnqueueStatus. During the clean up, we don't want to reenqueue it if we know it has failed before.

…e thrown. In that case, the command will have a failed EnqueueStatus. During the clean up, we don't want to reenqueue it if we know it has failed before
@sergey-semenov
Copy link
Contributor

Could you please add a unit test for this?

@cperkinsintel
Copy link
Contributor Author

cperkinsintel commented Jan 14, 2025

@sergey-semenov - The mem tests ( UR_L0_LEAKS_DEBUG=1) for max_num_work_groups.cpp is how this was discovered, in its error case. I can make a new e2e test file that explicitly cribs that combination. Would that work? Or do you want a UNIT test as opposed to an E2E one? Not quite sure what that'd look like.

@sergey-semenov
Copy link
Contributor

I mean, since there's no need to involve any backend to verify this, I'd prefer the more lightweight option of adding a unit test here. I think inserting a failed-to-enqueue MockCommand into the graph then checking if its destructor fired after cleaning up the buffer it depends on should be doable and check what we want here. Alternatively, you could just build a regular kernel enqueue graph with queue::submit while redefining urEnqueue... to fail and just check that we make the required ur.*Release calls.

@cperkinsintel cperkinsintel marked this pull request as draft January 14, 2025 19:38
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.

2 participants