-
Notifications
You must be signed in to change notification settings - Fork 915
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
Testing stream pool implementation #14437
Testing stream pool implementation #14437
Conversation
…_global_cuda_stream_pool
/ok to test |
/ok to test |
/ok to test |
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.
The code looks fine, but I have a little bit of confusion that I would like to clear up. Thanks!
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 is just a copy-paste of the declarations from stream_pool.cpp, right? It's a good change, just want to make sure I'm not missing any other changes.
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 have moved the parent class declaration and create_global_cuda_stream_pool
from stream_pool.cpp
to the header file so that test_cuda_stream_pool
in identify_stream_usage.cpp
can include it.
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.
Notes from an offline discussion - cuda_stream_pool
was "hidden" in the source file on purpose; we want the pool usage to be limited to fork_streams
/join_streams
. The change here exposes more of the stream pool than we'd like.
However, we don't see a better solution, since the current approach at least does not require additional APIs in libcudf.
class test_cuda_stream_pool : public cuda_stream_pool { | ||
public: | ||
rmm::cuda_stream_view get_stream() override { return cudf::test::get_default_stream(); } | ||
rmm::cuda_stream_view get_stream(stream_id_type stream_id) override |
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.
Can we remove the variable name since it's never used (or if that causes unforeseen problems, mark it as [[ maybe_unused ]]
)?
rmm::cuda_stream_view get_stream(stream_id_type stream_id) override | |
rmm::cuda_stream_view get_stream(stream_id_type) override |
/ok to test |
/ok to test |
… comment Co-authored-by: Vyas Ramasubramani <[email protected]>
/ok to test |
/ok to test |
Co-authored-by: Vukasin Milovanovic <[email protected]>
/ok to test |
* | ||
* @return the number of stream objects in the pool | ||
*/ | ||
virtual std::size_t get_stream_pool_size() const = 0; |
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.
The name is a bit redundant. We know that this is a stream pool.
virtual std::size_t get_stream_pool_size() const = 0; | |
virtual std::size_t get_pool_size() const = 0; |
or just size()
.
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.
get_pool_size()
is consistent with rmm::cuda_stream_pool
. Surprised this wasn't caught before.
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.
yeah, should be get_pool_size
. Not a change for this PR, IMO.
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.
Okay, but then please address it in a follow up work.
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.
Thank you for pointing this out! I'll work on this change in a follow-up PR.
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 isn't this a change for this PR, if all the code in this section is new in this PR?
|
||
class StreamPoolTest : public cudf::test::BaseFixture {}; | ||
|
||
__global__ void do_nothing_kernel() {} |
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 am not sure if this kernel without any code will be optimized out so the for loop below will never be executed?
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.
Thanks for pointing this out! I printed the GPU trace from the nsys profiler to check this and it shows that the do_nothing_kernel
is being executed.
/ok to test |
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.
Nice work.
/merge |
Description
The goal of this PR is to create a global pool containing only the cudf test stream which is to be used all stream tests that invoke
fork_streams
in their execution path. The stream pool is constructed bycreate_global_cuda_stream_pool()
inidentify_stream_usage.cpp
, and overrides the function implementation inutilities/stream_pool.cpp
when preloaded.The test checks for only
cudaLaunchKernel
being invoked with the wrong stream.Checklist