Skip to content

Remove warning in the stream pool when asking for more streams than available - #18236

Merged
rapids-bot[bot] merged 2 commits into
NVIDIA:branch-25.04from
vuule:stream-pool-no-rr-warn
Mar 13, 2025
Merged

rapids-bot[bot] merged 2 commits into
NVIDIA:branch-25.04from
vuule:stream-pool-no-rr-warn

Conversation

@vuule

@vuule vuule commented Mar 11, 2025 •

Copy link
Copy Markdown
Contributor

Description

When get_streams requests more streams than there are in the pool, the pool returns existing streams in round-robin order. We originally included this warning because the behavior might be surprising to the caller. However, this warning just clutters the logs when we don't add extra logic to make sure we don't ask for more streams than available.

Removing the warning and cleaning up call sites.

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

@copy-pr-bot

copy-pr-bot Bot commented Mar 11, 2025

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@github-actions github-actions Bot added the libcudf Affects libcudf (C++/CUDA) code. label Mar 11, 2025
@vuule vuule changed the title Remove warning in the stream pool when asking for more streams than there are in thepool Remove warning in the stream pool when asking for more streams than available Mar 11, 2025
@vuule vuule added improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Mar 11, 2025
@vuule

vuule commented Mar 11, 2025

Copy link
Copy Markdown
Contributor Author

/ok to test

@vuule vuule mentioned this pull request Mar 11, 2025
3 tasks done
@vuule
vuule marked this pull request as ready for review March 11, 2025 23:18
@vuule
vuule requested a review from a team as a code owner March 11, 2025 23:18
@vuule
vuule requested review from mhaseeb123 and shrshi March 11, 2025 23:18
@vuule vuule moved this to Burndown in libcudf Mar 11, 2025
@vuule vuule added this to libcudf Mar 11, 2025
std::min<std::size_t>({sources.size() - start_source + 1,
cudf::detail::global_cuda_stream_pool().get_stream_pool_size(),
pools::tpool().get_thread_count()});
std::min<std::size_t>(sources.size() - start_source + 1, pools::tpool().get_thread_count());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we remove the cur_stream++ % stream_pool.size() mod operation now? Just use cur_stream++?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, number of streams is limited to pools::tpool().get_thread_count()

Comment thread cpp/src/io/comp/comp.cpp
auto const streams = cudf::detail::fork_streams(stream, num_streams);
for (size_t i = 0; i < num_chunks; ++i) {
auto const idx = task_order[i];
auto const cur_stream = streams[i % streams.size()];

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
auto const cur_stream = streams[i % streams.size()];
auto const cur_stream = streams[i];

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can't remove the modulo because the number of streams can still be lower than the number of chunks: auto const num_streams = std::min<std::size_t>(num_chunks, h_comp_pool().get_thread_count());

@vyasr
vyasr requested a review from bdice March 12, 2025 22:40
@vuule

vuule commented Mar 13, 2025

Copy link
Copy Markdown
Contributor Author

/merge

@rapids-bot
rapids-bot Bot merged commit f588b7e into NVIDIA:branch-25.04 Mar 13, 2025
@vuule
vuule deleted the stream-pool-no-rr-warn branch March 13, 2025 22:08
@GregoryKimball GregoryKimball moved this from Burndown to Landed in libcudf Mar 13, 2025
@GregoryKimball GregoryKimball removed this from libcudf May 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement Improvement / enhancement to an existing function libcudf Affects libcudf (C++/CUDA) code. non-breaking Non-breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants