Skip to content

[SYCL] Enqueue dependencies of blocked command #2543

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 29 commits into from

Conversation

s-kanaev
Copy link
Contributor

@s-kanaev s-kanaev commented Sep 25, 2020

Let's have this part of dependency graph:

  EC2 -> C2 -> EC1 -> C1

EC1 and EC2 are of helper type EmptyCommand. Both are blocked.
C1 and C2 are of any other type which represents some meaningful operation i.e. the one that actually does something useful, like ExecCGCommand with a host task or UpdateHostReqCommand for host accessor.
This part of graph is result of two submissions: the first one adds EC1 -> C1 and the second adds EC2 -> C2 -> EC1.
The submission process in both cases adds the corresponding Cx command in first place and then adds the empty command ECx. When Cx is added to the graph it's also added to list of leaves for corresponding memory record. Now, when ECx is added to graph it removes corresponding Cx from list of leaves. ECx is added to the list instead of Cx. Blocked state of ECx prevents it from being enqueued.

Upon the second submission, C2 isn't going to be enqueued right away as it depends on blocked EC1.

When C1 finishes (whether it is a host task or host accessor's update command) SYCL RT will unblock EC1 and trigger enqueue process for leaves of memory records C1 was depending by. Eventually, RT will enqueue the EC1 which will set its event into complete state. Though, EC2 isn't going to be enqueued due to it's blocked state. Neither does its dependencies.

PR with test: #2540
PR with comment fix: #2541

A more workaroundey way is available at #2542

Sergey Kanaev added 7 commits September 25, 2020 12:10
Signed-off-by: Sergey Kanaev <sergey.kanaev@intel.com>
Signed-off-by: Sergey Kanaev <sergey.kanaev@intel.com>
Signed-off-by: Sergey Kanaev <sergey.kanaev@intel.com>
Signed-off-by: Sergey Kanaev <sergey.kanaev@intel.com>
Signed-off-by: Sergey Kanaev <sergey.kanaev@intel.com>
Signed-off-by: Sergey Kanaev <sergey.kanaev@intel.com>
Sergey Kanaev added 5 commits September 25, 2020 17:29
Signed-off-by: Sergey Kanaev <sergey.kanaev@intel.com>
Signed-off-by: Sergey Kanaev <sergey.kanaev@intel.com>
Signed-off-by: Sergey Kanaev <sergey.kanaev@intel.com>
Signed-off-by: Sergey Kanaev <sergey.kanaev@intel.com>
@s-kanaev s-kanaev marked this pull request as ready for review September 25, 2020 14:45
@s-kanaev s-kanaev requested a review from a team as a code owner September 25, 2020 14:45
@s-kanaev
Copy link
Contributor Author

Need to fix unit-test

@DenisBakhvalov
Copy link
Contributor

DenisBakhvalov commented Sep 26, 2020

LGTM. I think this change likely will not pessimize the problem which was fixed by bc8f0a4.

@s-kanaev
Copy link
Contributor Author

I think his change likely will not pessimize the problem which was fixed by bc8f0a4.

Is there any benchmark to check this assumption/hypothesis?

Sergey Kanaev added 9 commits September 28, 2020 14:17
@DenisBakhvalov
Copy link
Contributor

I think his change likely will not pessimize the problem which was fixed by bc8f0a4.

Is there any benchmark to check this assumption/hypothesis?

No, there is not. Only unit tests.

Sergey Kanaev added 8 commits September 29, 2020 16:29
Signed-off-by: Sergey Kanaev <sergey.kanaev@intel.com>
Signed-off-by: Sergey Kanaev <sergey.kanaev@intel.com>
Signed-off-by: Sergey Kanaev <sergey.kanaev@intel.com>
Signed-off-by: Sergey Kanaev <sergey.kanaev@intel.com>
Signed-off-by: Sergey Kanaev <sergey.kanaev@intel.com>
Signed-off-by: Sergey Kanaev <sergey.kanaev@intel.com>
Signed-off-by: Sergey Kanaev <sergey.kanaev@intel.com>
@s-kanaev
Copy link
Contributor Author

I think that we should prefer #2561 instead of this one.

@s-kanaev
Copy link
Contributor Author

Closing this PR as there is a more preferable solution in #2561

@s-kanaev s-kanaev closed this Sep 30, 2020
@s-kanaev s-kanaev deleted the private/s-kanaev/ht-workaround-2 branch October 1, 2020 08:17
iclsrc pushed a commit that referenced this pull request Jul 26, 2024
Document how llvm intrinsics are lowered by SPIRV-LLVM-Translator.

Signed-off-by: Lu, John <john.lu@intel.com>

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