-
Notifications
You must be signed in to change notification settings - Fork 915
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 api for cudf::chunked_pack #13278
JNI api for cudf::chunked_pack #13278
Conversation
Signed-off-by: Alessandro Bellina <[email protected]>
* JNI interface to cudf::chunked_pack. | ||
* | ||
* ChunkedPack is an iterator-like interface with the familiar `hasNext` and `next` | ||
* interface. `next` should be used in a loop until `hasNext` returns false. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: can we say more like
`ChunkedPack` has an Iterator-like API with the familiar `hasNext` and `next` methods.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
return true; | ||
} | ||
|
||
jobject packed_column_metadata_from(JNIEnv *env, std::unique_ptr<std::vector<uint8_t>> meta) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we create a jobect and do all of the reflection/etc if we could just return a jlong to java and let it call the constructor in java?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeap that is much easier, fixed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just two curious changes that appear to not be needed.
java/src/main/native/src/CudfJni.cpp
Outdated
@@ -1,5 +1,5 @@ | |||
/* | |||
* Copyright (c) 2019-2022, NVIDIA CORPORATION. | |||
* Copyright (c) 2019-2023, NVIDIA CORPORATION. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this needed? We are only changing the copyright date???
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry about that, it is fixed now.
@@ -51,7 +51,6 @@ convert_table_for_return(JNIEnv *env, std::unique_ptr<cudf::table> &&table_resul | |||
// | |||
|
|||
bool cache_contiguous_table_jni(JNIEnv *env); | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this change needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
/merge |
This PR is the standalone JNI side of #13260. Therefore it doesn't build in as is, but I am putting this up as draft for the Java reviewers to start taking a look.
This implements a
ChunkedPack
java class mirroring the interface ofcudf::chunked_pack
. This is an iterator-like class that can be used to invokecudf::pack
(akacudf::contigous_split
without splits) over several iterations against a bounce buffer.In order to create a
ChunkedPack
, the user callsmakeChunkedPack
from aTable
instance. During this call the user can also pass anRmmDeviceMemoryResource
to be used internally bycudf::chunked_pack
exclusively for scratch/temporary data.Checklist