Use cudf::pack with pinned mr in TableChunk::copy#966
Open
nirandaperera wants to merge 2 commits intorapidsai:mainfrom
Open
Use cudf::pack with pinned mr in TableChunk::copy#966nirandaperera wants to merge 2 commits intorapidsai:mainfrom
cudf::pack with pinned mr in TableChunk::copy#966nirandaperera wants to merge 2 commits intorapidsai:mainfrom
Conversation
Signed-off-by: niranda perera <niranda.perera@gmail.com>
Contributor
Author
|
This PR depends on #967 because it now requires precise packed sizes for pinned memory. |
pentschev
reviewed
Apr 16, 2026
|
|
||
| /** | ||
| * @brief Move device buffer data into a Buffer. | ||
| * @brief Move device/ pinned host buffer data into a Buffer. |
Member
There was a problem hiding this comment.
Suggested change
| * @brief Move device/ pinned host buffer data into a Buffer. | |
| * @brief Move device or pinned host buffer data into a Buffer. |
Comment on lines
+313
to
+314
| * @param mem_type The memory type of the underlying @p data. This requires to be a | ||
| * device accessible memory type (ie. MemoryType::DEVICE or MemoryType::PINNED_HOST). |
Member
There was a problem hiding this comment.
Suggested change
| * @param mem_type The memory type of the underlying @p data. This requires to be a | |
| * device accessible memory type (ie. MemoryType::DEVICE or MemoryType::PINNED_HOST). | |
| * @param mem_type The memory type of the underlying @p data. A device accessible memory | |
| * type is required (ie. MemoryType::DEVICE or MemoryType::PINNED_HOST). |
| RAPIDSMPF_EXPECTS( | ||
| pinned_mr_ != PinnedMemoryResource::Disabled, | ||
| "pinned memory resource is not available", | ||
| std::invalid_argument |
Member
There was a problem hiding this comment.
Nit: should this actually be a std::runtime_error? The memory type isn't technically invalid, it is an error only from a runtime/system perspective.
Contributor
Author
There was a problem hiding this comment.
Yeah, I think that's reasonable.
Comment on lines
+164
to
+167
| // a. reservaiton in pinned memory - Use cudf::pack to directly copy the table | ||
| // data to pinned memory. | ||
| // b. reservaiton in host memory - Use cudf::pack to copy the table data to | ||
| // intermediate device memory and then copy to host memory. |
Member
There was a problem hiding this comment.
Suggested change
| // a. reservaiton in pinned memory - Use cudf::pack to directly copy the table | |
| // data to pinned memory. | |
| // b. reservaiton in host memory - Use cudf::pack to copy the table data to | |
| // intermediate device memory and then copy to host memory. | |
| // a. reservation in pinned memory - Use cudf::pack to directly copy the table | |
| // data to pinned memory. | |
| // b. reservation in host memory - Use cudf::pack to copy the table data to | |
| // intermediate device memory and then copy to host memory. |
Comment on lines
+197
to
+198
| // use cudf pack with pinned mr. When the pinned mr is warmed up, the | ||
| // performance |
Contributor
Author
There was a problem hiding this comment.
I've lost the train of thought! LOL.
pentschev
approved these changes
Apr 16, 2026
Member
pentschev
left a comment
There was a problem hiding this comment.
Looks good overall, left some requests for typo fixes and phrasing improvements, and a nit.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In a previous analysis we found that using
cudf::packwith a pinned mem resource performs similar to,Since (1) use unreserved device memory,
TableChunk::copyis prone to OOM. This PR changes pinned memory to usecudf::packdirectly.Depends on #967