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

Remove duplicated memory_resource_tests #1451

Merged
merged 6 commits into from
Feb 15, 2024

Conversation

miscco
Copy link
Contributor

@miscco miscco commented Jan 30, 2024

During the initial introduction of async_resource_ref we duplicated all tests that take a device_memory_resource*.

Now that we have already some experience with running it in production and are moving more of the interfaces to async resource_ref remove those duplicated tests.

closes #1450

Checklist

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

Durin the initial introduction of `async_resource_ref` we duplicated all tests that take a `device_memory_resource*`.

Now that we have already some experience with running it in production and are moving more of the interfaces to `async resource_ref` remove those duplicated tests.

closes rapidsai#1450
@miscco miscco requested review from a team as code owners January 30, 2024 14:21
@miscco miscco requested review from wence- and vyasr January 30, 2024 14:21
@github-actions github-actions bot added CMake cpp Pertains to C++ code labels Jan 30, 2024
@miscco miscco added feature request New feature or request tests Related to unit tests and removed CMake cpp Pertains to C++ code labels Jan 30, 2024
@miscco miscco requested a review from harrism January 30, 2024 14:22
@miscco miscco added the non-breaking Non-breaking change label Jan 30, 2024
Copy link
Member

@harrism harrism left a comment

Choose a reason for hiding this comment

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

Nice elimination of duplicates. This will save compile and test time!

Suggesting we test the host-pinned MR independently of the host-pinned pool if possible.

@@ -33,6 +33,7 @@ INSTANTIATE_TEST_SUITE_P(ResourceTests,
#endif
mr_factory{"Managed", &make_managed},
mr_factory{"Pool", &make_pool},
mr_factory{"HostPinnedPool", &make_host_pinned_pool},
Copy link
Member

Choose a reason for hiding this comment

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

💡 suggestion:

Suggested change
mr_factory{"HostPinnedPool", &make_host_pinned_pool},
mr_factory{"HostPinned", &make_host_pinned},
mr_factory{"HostPinnedPool", &make_host_pinned_pool},

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is actually not possible with the current test setup.

The tests machinery currently requires a std::function<std::shared_ptr<rmm::mr::device_memory_resource>>. However, pinned_host_memory_resource is not derived from device_memory_resource so that wont compile.

I am wary of completely rewriting the test infra in this PR.

Copy link
Member

Choose a reason for hiding this comment

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

Oh I thought when you created device_mr_ref_tests that you had changed that machinery for the ref tests. OK, that can be a follow up.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The issue is that we need to store the resource somewhere, as resource_ref is only a reference and now owning.

That is why I kept most of the base machinery unchanged

Copy link
Member

Choose a reason for hiding this comment

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

OK. Seems we need to find a way to test both the (new) MR(s) that just implement the concepts and the (legacy) MRs that just derive from device_memory_resource.

Copy link
Contributor

Choose a reason for hiding this comment

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

@miscco did you have further thoughts here?

Seems we need to find a way to test both the (new) MR(s) that just implement the concepts and the (legacy) MRs that just derive from device_memory_resource.

tests/mr/device/thrust_allocator_tests.cu Outdated Show resolved Hide resolved
@github-actions github-actions bot added CMake cpp Pertains to C++ code labels Feb 1, 2024
@miscco
Copy link
Contributor Author

miscco commented Feb 9, 2024

Ping for a second review

@bdice
Copy link
Contributor

bdice commented Feb 14, 2024

@miscco I granted a second approval here -- do you need anything else before merging this?

@miscco
Copy link
Contributor Author

miscco commented Feb 14, 2024

I was pondering whether we want to keep the old test, but we are indeed testing pinned_memory_resource in the host test suite so there is no need for additional tests AFAIK

@harrism
Copy link
Member

harrism commented Feb 15, 2024

/merge

@rapids-bot rapids-bot bot merged commit ce3af2c into rapidsai:branch-24.04 Feb 15, 2024
47 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CMake cpp Pertains to C++ code feature request New feature or request non-breaking Non-breaking change tests Related to unit tests
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Remove duplicated tests that test both a device_memory_resource* and a cuda::mr::async_resource_ref
3 participants