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

Switch cuIO benchmarks to use pinned-pool host allocations by default. #15805

Merged
Merged
Changes from all 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
19 changes: 2 additions & 17 deletions cpp/benchmarks/fixture/nvbench_fixture.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ static std::string cuio_host_mem_param{
* Initializes the default memory resource to use the RMM pool device resource.
*/
struct nvbench_base_fixture {
using host_pooled_mr_t = rmm::mr::pool_memory_resource<rmm::mr::pinned_host_memory_resource>;

inline auto make_cuda() { return std::make_shared<rmm::mr::cuda_memory_resource>(); }

inline auto make_pool()
Expand Down Expand Up @@ -90,22 +88,10 @@ struct nvbench_base_fixture {
return *mr;
}

inline rmm::host_async_resource_ref make_cuio_host_pinned_pool()
{
if (!this->host_pooled_mr) {
// Don't store in static, as the CUDA context may be destroyed before static destruction
this->host_pooled_mr = std::make_shared<host_pooled_mr_t>(
std::make_shared<rmm::mr::pinned_host_memory_resource>().get(),
size_t{1} * 1024 * 1024 * 1024);
}

return *this->host_pooled_mr;
}

inline rmm::host_async_resource_ref create_cuio_host_memory_resource(std::string const& mode)
{
if (mode == "pinned") return make_cuio_host_pinned();
if (mode == "pinned_pool") return make_cuio_host_pinned_pool();
if (mode == "pinned_pool") return cudf::io::get_host_memory_resource();
CUDF_FAIL("Unknown cuio_host_mem parameter: " + mode + "\nExpecting: pinned or pinned_pool");
}

Expand Down Expand Up @@ -139,8 +125,7 @@ struct nvbench_base_fixture {
std::shared_ptr<rmm::mr::device_memory_resource> mr;
std::string rmm_mode{"pool"};

std::shared_ptr<host_pooled_mr_t> host_pooled_mr;
std::string cuio_host_mode{"pinned"};
std::string cuio_host_mode{"pinned_pool"};
};

} // namespace cudf
Loading