Skip to content
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

Don't create more streams than required in cuda_pool #864

Merged
merged 1 commit into from
Nov 21, 2023

Conversation

msimberg
Copy link
Contributor

Create number of streams based on get_num_worker_threads if the runtime is up, otherwise fall back to hardware_concurrency. This is intended to work around issues with HIP event creation being significantly slower if many streams are created. E.g. on an AMD EPYC system with 128 hardware threads (hardware_concurrency == 128) the cuda_pool would create (3 + 3) * hardware_concurrency = 768 streams per rank, even if the runtime is only started with e.g. 8 threads (8 ranks per node, without hyperthreading). If the actual number of runtime threads is used, the number of threads created is instead 48. This can significantly improve performance if many kernels are submitted.

The cuda_pool still falls back to using hardware_concurrency if it's created before the pika runtime is started.

Create number of streams based on get_num_worker_threads if runtime is up, otherwise fall back to
hardware_concurrency.
@msimberg msimberg added this to the 0.21.0 milestone Nov 20, 2023
@msimberg msimberg self-assigned this Nov 20, 2023
Copy link
Contributor

@aurianer aurianer left a comment

Choose a reason for hiding this comment

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

LGTM thanks!

@msimberg msimberg enabled auto-merge November 21, 2023 18:15
@msimberg
Copy link
Contributor Author

cscs-ci run

@msimberg msimberg added this pull request to the merge queue Nov 21, 2023
Merged via the queue into main with commit 90bf96f Nov 21, 2023
66 of 67 checks passed
@msimberg msimberg deleted the limit-num-streams-cuda-pool branch November 22, 2023 11:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Archive
Development

Successfully merging this pull request may close these issues.

2 participants