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 api for cudf::chunked_pack #13278

Merged
merged 9 commits into from
May 18, 2023

Conversation

abellina
Copy link
Contributor

@abellina abellina commented May 2, 2023

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 of cudf::chunked_pack. This is an iterator-like class that can be used to invoke cudf::pack (aka cudf::contigous_split without splits) over several iterations against a bounce buffer.

In order to create a ChunkedPack, the user calls makeChunkedPack from a Table instance. During this call the user can also pass an RmmDeviceMemoryResource to be used internally by cudf::chunked_pack exclusively for scratch/temporary data.

Checklist

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

Signed-off-by: Alessandro Bellina <[email protected]>
@github-actions github-actions bot added CMake CMake build issue Java Affects Java cuDF API. labels May 2, 2023
@abellina abellina added Spark Functionality that helps Spark RAPIDS non-breaking Non-breaking change feature request New feature or request and removed CMake CMake build issue Java Affects Java cuDF API. labels May 2, 2023
@abellina abellina mentioned this pull request May 2, 2023
4 tasks
@github-actions github-actions bot added CMake CMake build issue Java Affects Java cuDF API. labels May 3, 2023
* 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.
Copy link
Contributor

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.

Copy link
Contributor Author

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) {
Copy link
Contributor

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?

Copy link
Contributor Author

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.

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.

@abellina abellina marked this pull request as ready for review May 18, 2023 18:26
@abellina abellina requested a review from a team as a code owner May 18, 2023 18:26
Copy link
Contributor

@revans2 revans2 left a 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.

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019-2022, NVIDIA CORPORATION.
* Copyright (c) 2019-2023, NVIDIA CORPORATION.
Copy link
Contributor

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???

Copy link
Contributor Author

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);

Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

@abellina
Copy link
Contributor Author

/merge

@rapids-bot rapids-bot bot merged commit 9dde434 into rapidsai:branch-23.06 May 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CMake CMake build issue feature request New feature or request Java Affects Java cuDF API. non-breaking Non-breaking change Spark Functionality that helps Spark RAPIDS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants