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

Tweak rmm configuration for C++ unit tests #4503

Merged
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions cpp/tests/utilities/base_fixture.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,18 @@ inline auto make_cuda() { return std::make_shared<rmm::mr::cuda_memory_resource>

inline auto make_managed() { return std::make_shared<rmm::mr::managed_memory_resource>(); }

inline auto make_pool()
// use_max set to true will use half of available GPU memory for RMM, otherwise
// otherwise we'll use 1/10.
inline auto make_pool(bool use_max = false)
{
// Reduce the default pool allocation to 1/6th of the GPU memory so that we can
// Reduce the default pool allocation to 1/10 of GPU memory so that we can
// run more than 2 tests in parallel at the same time. Changes to this value could
// effect the maximum amount of parallel tests, and therefore `tests/CMakeLists.txt`
// `_CUGRAPH_TEST_PERCENT` default value will need to be audited.
auto const [free, total] = rmm::available_device_memory();
auto const min_alloc = rmm::align_down(std::min(free, total / 6), rmm::CUDA_ALLOCATION_ALIGNMENT);
Copy link
Contributor

@seunghwak seunghwak Jun 25, 2024

Choose a reason for hiding this comment

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

We should update the comments above (or delete it). It is out-of-sync now.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, I'll update.

auto const min_alloc =
use_max ? rmm::align_down(std::min(free, total / 2), rmm::CUDA_ALLOCATION_ALIGNMENT)
: rmm::align_down(std::min(free, total / 10), rmm::CUDA_ALLOCATION_ALIGNMENT);
return rmm::mr::make_owning_wrapper<rmm::mr::pool_memory_resource>(make_cuda(), min_alloc);
}

Expand All @@ -99,7 +103,8 @@ inline auto make_binning()
* @throw cugraph::logic_error if the `allocation_mode` is unsupported.
*
* @param allocation_mode String identifies which resource type.
* Accepted types are "pool", "cuda", and "managed" only.
* Accepted types are "pool", "cuda", "managed" and
* "maxpool" only.
* @return Memory resource instance
*/
inline std::shared_ptr<rmm::mr::device_memory_resource> create_memory_resource(
Expand All @@ -108,6 +113,7 @@ inline std::shared_ptr<rmm::mr::device_memory_resource> create_memory_resource(
if (allocation_mode == "binning") return make_binning();
if (allocation_mode == "cuda") return make_cuda();
if (allocation_mode == "pool") return make_pool();
if (allocation_mode == "maxpool") return make_pool(true);
if (allocation_mode == "managed") return make_managed();
CUGRAPH_FAIL("Invalid RMM allocation mode");
}
Expand Down
2 changes: 1 addition & 1 deletion dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ dependencies:
common:
- output_types: [conda, pyproject]
packages:
- &thrift thriftpy2
- &thrift thriftpy2==0.5.0
python_run_cugraph_service_server:
common:
- output_types: [conda, pyproject]
Expand Down
2 changes: 1 addition & 1 deletion python/cugraph-service/client/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ authors = [
license = { text = "Apache 2.0" }
requires-python = ">=3.9"
dependencies = [
"thriftpy2",
"thriftpy2==0.5.0",
] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit ../../../dependencies.yaml and run `rapids-dependency-file-generator`.
classifiers = [
"Intended Audience :: Developers",
Expand Down
2 changes: 1 addition & 1 deletion python/cugraph-service/server/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ dependencies = [
"numpy>=1.23,<2.0a0",
"rapids-dask-dependency==24.8.*",
"rmm==24.8.*",
"thriftpy2",
"thriftpy2==0.5.0",
"ucx-py==0.39.*",
] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit ../../../dependencies.yaml and run `rapids-dependency-file-generator`.
classifiers = [
Expand Down
Loading