-
Notifications
You must be signed in to change notification settings - Fork 116
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
[SYCL][UR][L0] Access UMF pool handles through usm::pool_manager #905
base: main
Are you sure you want to change the base?
Conversation
Please open draft PR in intel/llvm for pre-merge testing, as indicated here https://github.com/oneapi-src/unified-runtime/pull/902/files |
Draft for pre-merge testing: intel/llvm#11357 |
// Store the host memory pool. It does not depend on any device. | ||
umf::pool_unique_handle_t HostMemPool; | ||
usm::pool_manager<usm::pool_descriptor> PoolManager; | ||
usm::pool_manager<usm::pool_descriptor> ProxyPoolManager; |
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.
I'm wondering if it wouldn't be better to just have a flag in pool_descriptor to decide if we do any pooling. We could then have only a single pool manager.
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.
But is it fitting to place such an option in the pool_descriptor
?
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.
Why not? I think in the future, we will want to have even more options in pool_descriptor, e.g. related to access characteristics, etc. that would influence pooling.
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.
I agree, this looks odd. If you decide to do otherwise, please add a comment.
87f4bb1
to
1357d8b
Compare
7298939
to
3af465b
Compare
7785d65
to
9bd5d0e
Compare
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.
I've only reviewed source/adapters/level_zero/command_buffer.cpp
, but LGTM
9bd5d0e
to
d74a357
Compare
d74a357
to
0c9ca70
Compare
227801c
to
71cac2c
Compare
I have updated the target branch of this PR from the |
71cac2c
to
0e1b8db
Compare
Codecov ReportAttention:
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #905 +/- ##
==========================================
- Coverage 15.44% 15.44% -0.01%
==========================================
Files 239 239
Lines 33970 33970
Branches 3758 3758
==========================================
- Hits 5246 5245 -1
- Misses 28673 28674 +1
Partials 51 51 ☔ View full report in Codecov by Sentry. |
0e1b8db
to
5d76778
Compare
967903d
to
b424494
Compare
b424494
to
25b9f9b
Compare
e39523a
to
7bf047d
Compare
@@ -178,111 +183,120 @@ UR_APIEXPORT ur_result_t UR_APICALL urContextSetExtendedDeleter( | |||
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; | |||
} | |||
|
|||
// Template helper function for creating USM pools for given pool descriptor. | |||
template <typename P, typename... Args> | |||
std::pair<ur_result_t, umf::pool_unique_handle_t> |
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 now a helper for this sort of case: https://github.com/oneapi-src/unified-runtime/blob/main/source/ur/ur.hpp#L277
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.
I don't know if there's a benefit to using it since I call umf::poolMakeUnique
that returns a pair anyway.
return (Desc.deviceReadOnly) ? usm::DisjointPoolMemType::SharedReadOnly | ||
: usm::DisjointPoolMemType::Shared; | ||
default: | ||
// Added to suppress 'not all control paths return a value' warning. |
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.
ur::unreachable()
?
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.
Done.
// Store the host memory pool. It does not depend on any device. | ||
umf::pool_unique_handle_t HostMemPool; | ||
usm::pool_manager<usm::pool_descriptor> PoolManager; | ||
usm::pool_manager<usm::pool_descriptor> ProxyPoolManager; |
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.
I agree, this looks odd. If you decide to do otherwise, please add a comment.
@kswiecicki please create an intel/llvm PR to test the changes. |
There's one already: intel/llvm#11357 |
2093065
to
174e2e4
Compare
... to get the UR_USM_ALLOC_INFO_POOL alloc info.
174e2e4
to
350a5dc
Compare
This PR contains cherry-picked commits from #630.