Skip to content

[SYCL] Lower queue::wait() to piQueueFinish when possible #4044

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 7 commits into from
Jul 8, 2021

Conversation

sergey-semenov
Copy link
Contributor

This patch changes the logic of queue::wait() from waiting on each
individual event in order of submission of their tasks to checking if
each event's task has been enqueued, waiting for those that haven't been
and calling piQueueFinish to take care of the rest.

Notable exceptions to this new behaviour are host queues, queues that
emulate out-of-order execution by creating multiple queues underneath
and host task events, which are run on host regardless of the queue they
are bound to.

This patch changes the logic of queue::wait() from waiting on each
individual event in order of submission of their tasks to checking if
each event's task has been enqueued, waiting for those that haven't been
and calling piQueueFinish to take care of the rest.

Notable exceptions to this new behaviour are host queues, queues that
emulate out-of-order execution by creating multiple queues underneath
and host task events, which are run on host regardless of the queue they
are bound to.
@sergey-semenov sergey-semenov requested review from a team and rbegam and removed request for a team July 2, 2021 11:41
@sergey-semenov
Copy link
Contributor Author

TBD: add unit tests.

Any blocked command was being added to MPreparedHostDepsEvents which led
to waiting for the dependency event before enqueueing the dependant
command rather than passing the dependency to PI.
@sergey-semenov sergey-semenov marked this pull request as ready for review July 6, 2021 14:34
@sergey-semenov sergey-semenov requested a review from a team as a code owner July 6, 2021 14:34
@sergey-semenov sergey-semenov requested a review from s-kanaev July 6, 2021 14:34
s-kanaev
s-kanaev previously approved these changes Jul 6, 2021
s-kanaev
s-kanaev previously approved these changes Jul 6, 2021
@bader
Copy link
Contributor

bader commented Jul 7, 2021

@sergey-semenov, please, fix pre-commit failures.

Level Zero plugin has recently started to call wait on events during
piEventRelease. With the queue::wait change we started to release some
events during submit, prior to their completion. This introduces
implicit wait on every submit that would produce such an event, which
also interferes with level zero batching.

Work around this by storing such events for level zero only to release
them later.
Copy link
Contributor

@s-kanaev s-kanaev left a comment

Choose a reason for hiding this comment

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

LGTM

@sergey-semenov
Copy link
Contributor Author

@sergey-semenov, please, fix pre-commit failures.

@bader @vladimirlaz Done, the remaining failures are expected and covered by intel/llvm-test-suite#338

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