Skip to content

[SYCL] Fix depends_on handling with pi commands #5901

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 25 commits into from
Sep 1, 2022

Conversation

KseniyaTikhomirova
Copy link
Contributor

Fixes two related issues:

  1. if pi task is blocked by host task or host accessor it can not be enqueued and piEvent is not present in its event_impl. When we schedule new pi task with explicit (depends_on) dependency on the first one - its is absent in MDeps since we have no usual memory dependencies and present in MPreparedDepsEvents. MPreparedDepsEvents is used in enqueueImp for obtaining piEvents. Any events from MPreparedDepsEvents w/o pi events will be just skipped.
    AddDep always call processDepEvent which distributes events to MPreparedDepsEvents (pi event expected) and MPreparedHostDepsEvents (no pi event) so replacement of MDeps in enqueueCommand should be valid.
  2. if we have kernel w/o usual memory dependencies (MDeps & MUsers are empty) blocked kernel will be just "cleanup" and its execution will be skipped.

@KseniyaTikhomirova KseniyaTikhomirova changed the title [SYCL] Fix depends_on handling with blocked commands [SYCL] Fix depends_on handling with pi commands Apr 1, 2022
Signed-off-by: Tikhomirova, Kseniya <[email protected]>
Signed-off-by: Tikhomirova, Kseniya <[email protected]>
Signed-off-by: Tikhomirova, Kseniya <[email protected]>
Signed-off-by: Tikhomirova, Kseniya <[email protected]>
Signed-off-by: Tikhomirova, Kseniya <[email protected]>
@KseniyaTikhomirova KseniyaTikhomirova marked this pull request as ready for review April 5, 2022 06:59
@KseniyaTikhomirova KseniyaTikhomirova requested a review from a team as a code owner April 5, 2022 06:59
@KseniyaTikhomirova
Copy link
Contributor Author

@sergey-semenov , @s-kanaev , @romanovvlad , hi, folks, could you please review since you know almost all context for this change?

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.

Partial review done.
To be continued :-)

Comment on lines 331 to 334
else if (MCommand)
return sycl::info::event_command_status::submitted;
}
return MHostEvent && MState.load() != HES_Complete
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it be the same if we just return submitted if MState.load() != HES_Complete?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, now MHostEvent check seems to be redundant here, thanks.

Signed-off-by: Tikhomirova, Kseniya <[email protected]>
Signed-off-by: Tikhomirova, Kseniya <[email protected]>
@KseniyaTikhomirova KseniyaTikhomirova temporarily deployed to aws August 12, 2022 10:25 Inactive
Signed-off-by: Tikhomirova, Kseniya <[email protected]>
@KseniyaTikhomirova KseniyaTikhomirova temporarily deployed to aws August 12, 2022 10:37 Inactive
Signed-off-by: Tikhomirova, Kseniya <[email protected]>
@KseniyaTikhomirova KseniyaTikhomirova temporarily deployed to aws August 12, 2022 15:40 Inactive
@KseniyaTikhomirova KseniyaTikhomirova temporarily deployed to aws August 12, 2022 16:02 Inactive
sergey-semenov
sergey-semenov previously approved these changes Aug 25, 2022
Copy link
Contributor

@sergey-semenov sergey-semenov left a comment

Choose a reason for hiding this comment

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

Very minor comments aside, LGTM

Signed-off-by: Tikhomirova, Kseniya <[email protected]>
@KseniyaTikhomirova
Copy link
Contributor Author

@intel/llvm-gatekeepers this commit is ready to merge, could you help please?

@steffenlarsen steffenlarsen merged commit 346a6c5 into intel:sycl Sep 1, 2022
KseniyaTikhomirova added a commit to KseniyaTikhomirova/llvm that referenced this pull request Sep 6, 2022
steffenlarsen pushed a commit that referenced this pull request Sep 13, 2022
Cross dependency event_impl vs queue_impl prevents objects release.
Event_impl now has only weak pointer to queue.

Signed-off-by: Tikhomirova, Kseniya <[email protected]>
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.

6 participants