-
Notifications
You must be signed in to change notification settings - Fork 769
[SYCL]: basic support of contexts with multiple devices in Level-Zero #2440
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
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
e58ec28
[SYCL]: basic support of contexts with multiple devices in Level-Zero
smaslov-intel 9041386
[SYCL]: rebased
smaslov-intel 713cbde
[SYCL]: fixed bug reported in CI
smaslov-intel 94138e2
[SYCL]: change mode to 644
smaslov-intel ca779d0
[SYCL]: fixed uninitialized local variable used
smaslov-intel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@smaslov-intel : What do you mean by rely on Level-Zero for migration across devices?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jandres742 , I mean that the image/sampler created on one device with
zeImageCreate
/zeSamplerCreate
are made available for access in other devices of this SYCL context without any explicit transfers in the Level-Zero plugin. Note that for buffers I usezeMemAllocShared
but image/sampler don't have shared counterparts.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
L0 does not implicitly migrate between devices, nor for images nor buffers. From here, https://spec.oneapi.com/level-zero/latest/core/PROG.html#memory:
Shared allocations: Migratable to: Another Device = Optional
Additionally. Access from one device to another device's buffers and images are not supported at all moments. Proper way of confirming such access exist is using
zeDeviceCanAccessPeer()
https://spec.oneapi.com/level-zero/latest/core/api.html?highlight=canaccess#zedevicecanaccesspeerThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @jandres742 !
Not even between sub-devices of the same root device?
So what
Optional
really means? Is this an option of what?At what circumstances can we rely on it?
But we need a way to guarantee such sharing between devices in the same SYCL context.
Is there a way to force the migration that is optional?
Should we just copy explicitly if no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jandres742 , ping
I've added TODO comments for now and would like to proceed with this PR, please approve if you are OK with that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's no need for migrations between sub-devices, as they are part of the same device and each sub-device can access another sub-device's memory. Issue is when we are are referring about migrations between two separate physical devices.
That means that it depends on HW and SW (L0 driver, and kernel driver) support. Not always would be present for all platforms.
Exactly. The only way of enforcing migrations between devices is to implement a SW fallback with bounce buffering in the host.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good 👍