[FEA] Update raft::handle_t
to be coupled with one cudaStream_t
instance
#293
Labels
raft::handle_t
to be coupled with one cudaStream_t
instance
#293
The idea is to create a "light" handle that does not do any resource initialization except on request. The changes to the handle will be as follows:
raft::handle_t(rmm::cuda_stream_view = {}, const rmm::cuda_stream_pool& = {0}
. This means both the main stream and stream pool are now not owned by the handle, except for NULL stream and 0 sized poolhandle.set_stream()
methodrmm::cuda_stream_pool
being created by the developer and not the handle allows for the safe creation and deletion of streams (which are a light resource) by the scope which they are bound. This will enable several programming patterns:Previous pattern No. 1:
New pattern No. 1:
Previous pattern No. 2:
New pattern No. 2:
raft::handle_t::get_stream()
andraft::handle_t::get_stream_pool()
raft::handle_t::sync_stream()
-> syncs main streamraft::handle_t::sync_stream_pool()
-> syncs stream pool if size > 0raft::handle_t::wait_stream_pool_on_stream()
-> make stream pool wait on main stream to finish its latest taskraft::handle_t::set_stream()
method since a new light raft handle can be created instead, without needing to update resources of previous handle. Also removed equivalent method from cythonsetStream*
function to correctly set their handles on main stream. Previously, this was not being doneHandle
constructor can acceptstream=None
andn_streams=0
in its constructorThe text was updated successfully, but these errors were encountered: