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

Use rmm::percent_of_free_device_memory in arena_mr_tests #1674

Closed
wence- opened this issue Sep 9, 2024 · 0 comments · Fixed by #1689
Closed

Use rmm::percent_of_free_device_memory in arena_mr_tests #1674

wence- opened this issue Sep 9, 2024 · 0 comments · Fixed by #1689
Assignees
Labels
cpp Pertains to C++ code improvement Improvement / enhancement to an existing function tech debt debt Internal clean up and improvements to reduce maintenance and technical debt in general

Comments

@wence-
Copy link
Contributor

wence- commented Sep 9, 2024

TEST_F(ArenaTest, AllocateNinetyPercent) // NOLINT
{
EXPECT_NO_THROW([]() { // NOLINT(cppcoreguidelines-avoid-goto)
auto const free = rmm::available_device_memory().first;
auto const ninety_percent = rmm::align_up(
static_cast<std::size_t>(static_cast<double>(free) * 0.9), rmm::CUDA_ALLOCATION_ALIGNMENT);
arena_mr mr(rmm::mr::get_current_device_resource(), ninety_percent);
}());
}

We should refactor this test to use rmm::percent_of_free_device_memory. I think the only difference is whether it uses rmm::align_up vs. rmm::align_down, but that seems unimportant here?

Originally posted by @bdice in #1672 (comment)

@wence- wence- self-assigned this Sep 9, 2024
@harrism harrism added tech debt debt Internal clean up and improvements to reduce maintenance and technical debt in general improvement Improvement / enhancement to an existing function cpp Pertains to C++ code labels Sep 9, 2024
wence- added a commit to wence-/rmm that referenced this issue Sep 30, 2024
Rather than hand-coding a fraction of the device memory use the
utility routine.

- Closes rapidsai#1674
rapids-bot bot pushed a commit that referenced this issue Sep 30, 2024
Rather than hand-coding a fraction of the device memory use the utility routine.

- Closes #1674

Authors:
  - Lawrence Mitchell (https://github.com/wence-)

Approvers:
  - Rong Ou (https://github.com/rongou)

URL: #1689
@github-project-automation github-project-automation bot moved this from Todo to Done in RMM Project Board Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cpp Pertains to C++ code improvement Improvement / enhancement to an existing function tech debt debt Internal clean up and improvements to reduce maintenance and technical debt in general
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants