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] Improve events cleanup for immediate command lists #7715

Merged
merged 17 commits into from
Dec 13, 2022

Conversation

againull
Copy link
Contributor

@againull againull commented Dec 8, 2022

Currently we call zeEventQueryStatus every time before removing an event from an immediate command list.

There are several improvements which can be done:

  1. Currently we synchronize immediate command lists in synchronize() under queue lock. So we can just remove all events from all command lists right there without checking the status.
  2. If we know that some event is completed and queue is in-order then we can cleanup all preceding events including that event without checking the status. Introduced new CleanupEventsInImmCmdLists function to do that. Additionally made this function autonomous so that it can cleanup events in the immediate command lists of the queue for any case.
    Made resetCommandLists to call CleanupEventsInImmCmdLists to have single point of entry.
  3. We can avoid calling zeEventQueryStatus by checking LastCommandEvent for in-order queues and by checking Completed flag.
  4. Also if we end up walking over command list and checking status then break early as soon as first non-completed event is found.

@againull againull requested a review from a team as a code owner December 8, 2022 23:43
@smaslov-intel
Copy link
Contributor

Invite @rdeodhar for review and sync with his works in the area

@againull againull requested a review from rdeodhar December 9, 2022 18:20
Copy link
Contributor

@rdeodhar rdeodhar left a comment

Choose a reason for hiding this comment

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

Besides CI testing, please test SYCL benchmarks on PVC with immediate commandlists turned on.

@againull
Copy link
Contributor Author

Besides CI testing, please test SYCL benchmarks on PVC with immediate commandlists turned on.

Tested SYCL benchmarks, no failures caused by this PR.

* Limit cleaning up events to a single command list.
* Reuse code.
@againull againull merged commit 179ffa1 into intel:sycl Dec 13, 2022
@againull againull deleted the imm_list_events_cleanup branch December 13, 2022 20:34
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