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

[JNI] rmm based pinned pool #15219

Merged
merged 8 commits into from
Mar 5, 2024
Merged

Conversation

abellina
Copy link
Contributor

@abellina abellina commented Mar 4, 2024

Part of #14782.

This PR removes our old implementation of the java based pinned memory pool and replaces it with a jni layer on top of rmm::pool_memory_resource<rmm::pinned_host_memory_resource>

This PR does NOT set the default cuIO pinned host resource. That is happening after this PR goes in #15079. We'll need a follow on PR to change PinnedMemoryPool.initialize method to add an argument to set the cuIO pinned host resource.

I have run with this and version of it that are shared with cuIO and I can't find regressions in NDS at SF3K.

Note that we don't align anymore on our side. RMM is doing the same alignment we were doing before, using std::max_align_t.

Note also that the rmm pool doesn't have a quick way to find out what the current size is. So we had some tests that were asserting for this, and I have removed the asserts. If we would like to get that back I am happy to work with RMM to figure out how to do that.

Signed-off-by: Alessandro Bellina <[email protected]>
@abellina abellina requested a review from a team as a code owner March 4, 2024 15:08
Copy link

copy-pr-bot bot commented Mar 4, 2024

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@github-actions github-actions bot added the Java Affects Java cuDF API. label Mar 4, 2024
@abellina abellina added feature request New feature or request Performance Performance related issue Spark Functionality that helps Spark RAPIDS non-breaking Non-breaking change labels Mar 4, 2024
Copy link
Contributor

@jbrennan333 jbrennan333 left a comment

Choose a reason for hiding this comment

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

If we care about available bytes, we could track it in this class. But if it's not something we use in the plugin I don't think it is required.
Otherwise this looks good to me. One minor nit.

@abellina abellina changed the title JNI rmm based pinned pool [JNI] rmm based pinned pool Mar 4, 2024
@jbrennan333
Copy link
Contributor

/ok to test

@jbrennan333
Copy link
Contributor

One thing that could improve the tests is to actually write something to the buffers that are returned.

@abellina
Copy link
Contributor Author

abellina commented Mar 4, 2024

/ok to test

@abellina
Copy link
Contributor Author

abellina commented Mar 4, 2024

One thing that could improve the tests is to actually write something to the buffers that are returned.

@jbrennan333 I added a test in my latest commit. Thanks!

Copy link
Contributor

@jbrennan333 jbrennan333 left a comment

Choose a reason for hiding this comment

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

This looks good to me.

Comment on lines +190 to 191
long available = PinnedMemoryPool.getTotalPoolSizeBytes();
if (available < size) {
Copy link
Contributor

Choose a reason for hiding this comment

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

(nit) Is this size check really needed at all? Doesn't hurt anything though, so just a nit.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah it's a little weird, but we can keep calling this function and it will shutdown/recreate it as needed, so I don't see a huge need to change it right now, plus it's pre-existing code that continues to work.

@jbrennan333
Copy link
Contributor

/ok to test

@abellina
Copy link
Contributor Author

abellina commented Mar 5, 2024

/ok to test

@abellina
Copy link
Contributor Author

abellina commented Mar 5, 2024

Unrelated python failure:

FAILED test_parquet.py::test_read_parquet_partitioned_filtered[True-row-groups-pfilters1] - IndexError: list index out of range

@abellina
Copy link
Contributor Author

abellina commented Mar 5, 2024

/merge

@rapids-bot rapids-bot bot merged commit 176f75b into rapidsai:branch-24.04 Mar 5, 2024
74 checks passed
@abellina abellina deleted the jni_pinned_pool branch March 5, 2024 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request Java Affects Java cuDF API. non-breaking Non-breaking change Performance Performance related issue Spark Functionality that helps Spark RAPIDS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants