-
Notifications
You must be signed in to change notification settings - Fork 120
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
[UR] Add support for bidirectional USM prefetching #2312
base: main
Are you sure you want to change the base?
Conversation
…into ianayl/2way-prefetch
…into ianayl/2way-prefetch
…into ianayl/2way-prefetch
…into ianayl/2way-prefetch
…into ianayl/2way-prefetch
…into ianayl/2way-prefetch
…into ianayl/2way-prefetch
…into ianayl/2way-prefetch
…into ianayl/2way-prefetch
…into ianayl/2way-prefetch
…into ianayl/2way-prefetch
…into ianayl/2way-prefetch
…into ianayl/2way-prefetch
…into ianayl/2way-prefetch
…into ianayl/2way-prefetch
if (Flags == UR_USM_MIGRATION_FLAG_DEVICE_TO_HOST) { | ||
logger::warning("USM migration from device to host is not currently " | ||
"supported by level zero."); | ||
return UR_RESULT_SUCCESS; | ||
} |
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.
This early return is a problem for out-of-order command-lists in that it doesn't respect the command dependencies or signal dependent commands when finished.
In the else
branch below think we just want to opt-out of the actual zeCommandListAppendMemoryPrefetch
but keep the zeCommandListAppendWaitOnEvents
and zeCommandListAppendSignalEvent
commnads.
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.
Hey thanks for reviewing! Admittedly I'm not the most familiar with how things work in L0; would I also need to do this for source/adapters/level_zero/memory.cpp:1243?
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.
Yes I think that the same issue with an early return, the OutEvent
output parameter won't be set and it's not respecting EventWaitList
dependencies
…into ianayl/2way-prefetch
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.
CUDA/HIP 👍
…into ianayl/2way-prefetch
This PR implements the previously unimplemented
ur_usm_migration_flags_t
enum, and adds the logic for prefetching for from the device to host for each implemented adapter.Note that level zero currently does not support this behavior: it remains unimplemented for now until level zero implements a way to prefetch from device to host.
Corresponding intel/llvm PR for testing: intel/llvm#16047