-
Notifications
You must be signed in to change notification settings - Fork 125
[HIP] Fix memory type detection in allocation info queries and USM copy2D #1455
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
aarongreig
merged 2 commits into
oneapi-src:main
from
GeorgeWeb:georgi/fix-hip-usm-copy2d
Apr 10, 2024
Merged
[HIP] Fix memory type detection in allocation info queries and USM copy2D #1455
aarongreig
merged 2 commits into
oneapi-src:main
from
GeorgeWeb:georgi/fix-hip-usm-copy2d
Apr 10, 2024
Conversation
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
f359a59
to
19b92ac
Compare
19b92ac
to
0711559
Compare
hdelan
reviewed
Apr 1, 2024
hdelan
reviewed
Apr 1, 2024
hdelan
reviewed
Apr 1, 2024
hdelan
reviewed
Apr 1, 2024
0711559
to
c7bb252
Compare
GeorgeWeb
commented
Apr 1, 2024
fd26ede
to
d96bd03
Compare
hdelan
reviewed
Apr 2, 2024
68b68b1
to
83c5eee
Compare
hdelan
approved these changes
Apr 2, 2024
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.
LGTM
83c5eee
to
d50ea1d
Compare
d50ea1d
to
9cd4150
Compare
…py2D Takes extra care identifying unknown/unregistered memory allocations since ROCm 6.0.0 introduces hipMemoryTypeUnregistered, which we now use to identify system allocations and the attributes query will still return success in this case.
9cd4150
to
92b60b7
Compare
steffenlarsen
pushed a commit
to intel/llvm
that referenced
this pull request
Apr 10, 2024
…M copy2D (#13059) Test CI for oneapi-src/unified-runtime#1455 --------- Co-authored-by: Aaron Greig <[email protected]>
kbenzie
pushed a commit
to kbenzie/unified-runtime
that referenced
this pull request
Apr 16, 2024
…copy2d [HIP] Fix memory type detection in allocation info queries and USM copy2D
19 tasks
kbenzie
pushed a commit
that referenced
this pull request
Apr 17, 2024
[HIP] Fix memory type detection in allocation info queries and USM copy2D
kbenzie
pushed a commit
to kbenzie/intel-llvm
that referenced
this pull request
Apr 18, 2024
…M copy2D (intel#13059) Test CI for oneapi-src/unified-runtime#1455 --------- Co-authored-by: Aaron Greig <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
hip
HIP adapter specific issues
ready to merge
Added to PR's which are ready to merge
v0.9.x
Include in the v0.9.x release
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.
This PR fixes detection of the pointer type for sycl pointer allocation info queries and USM copy2D for the HIP backend.
With regards to
urUSMGetMemAllocInfo
forUR_USM_ALLOC_INFO_TYPE
:Takes extra care identifying unknown/unregistered memory allocations since ROCm 6.0.0 introduces
hipMemoryTypeUnregistered
, which we now use to identify system allocations and the attributes query will still return success in this case.With regards to
urEnqueueUSMMemcpy2D
:This is a little awkward workaround. Ideally we'd just use
hipPointerGetAttribute
but it crashes when used on system / pageable host memory hence usinghipPointerGetAttributes
to first determine that and ideally use the memory type value. From ROCm 5.7.1 we cannot rely on the memory type member of the attributes struct to detect whether it is device or host as managed allocations finally update it to managed memory type, hence we need to query the type specifically viahipPointerGetAttribute
now knowing that the memory handle is not pageable host memory.Ideally we'd just use allocation flags to determine the memory type and call it a day, but ROCm does not update the user-facing flags member from the attributes struct, so sadly we have no way of relying on allocation flags.
intel/llvm CI: intel/llvm#13059