-
Notifications
You must be signed in to change notification settings - Fork 32
Topology-aware default pool sizing for PinnedMemoryResource
#1012
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
Changes from 3 commits
3786047
e8782c4
7bbd171
5e448ca
a97925b
097a30c
501186e
fe59b38
4d03100
9cf3d57
96c63fa
082ee2d
cc3a27e
e41a61f
08f6e8e
0f12758
10a0a15
e9f4cd9
f651ff9
45c9841
4a0a737
7a9e349
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,6 +7,8 @@ | |
| #include <sched.h> | ||
| #include <unistd.h> | ||
|
|
||
| #include <cucascade/memory/topology_discovery.hpp> | ||
|
|
||
| #include <rapidsmpf/error.hpp> | ||
| #include <rapidsmpf/system_info.hpp> | ||
|
|
||
|
|
@@ -79,4 +81,24 @@ std::uint64_t get_numa_node_host_memory([[maybe_unused]] int numa_id) noexcept { | |
| return safe_cast<std::uint64_t>(ret); | ||
| } | ||
|
|
||
| namespace { | ||
| const auto& get_topology() { | ||
| static const auto topo = [] { | ||
| cucascade::memory::topology_discovery discovery; | ||
| RAPIDSMPF_EXPECTS( | ||
| discovery.discover(), | ||
| "get_host_memory_per_gpu(): failed to discover system topology", | ||
| std::runtime_error | ||
| ); | ||
| return discovery; | ||
| }(); | ||
| return topo.get_topology(); | ||
| } | ||
| } // namespace | ||
|
|
||
| std::uint64_t get_host_memory_per_gpu() { | ||
| auto const num_gpus = get_topology().num_gpus; | ||
| return get_total_host_memory() / std::max<std::uint64_t>(1, num_gpus); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you double-check how IIRC, the conditions for GPU memory to be exposed as system memory are:
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah! this is a good point.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @pentschev you were right Peter.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice that there was a simple solution. I also didn't think of the bigger picture of the problem, we cannot just take the whole host memory and divide equally among GPUs, since their NUMA nodes may have different amount of memory, and looks like your new solution already ensures that. |
||
| } | ||
|
|
||
| } // namespace rapidsmpf | ||
Uh oh!
There was an error while loading. Please reload this page.