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

Refactor Parquet kernel_error #14464

Merged
merged 7 commits into from
Nov 29, 2023
Merged

Conversation

etseidl
Copy link
Contributor

@etseidl etseidl commented Nov 21, 2023

Description

While reviewing #14453 it became clear that the typing for error codes was inconsistent with their use as bitmasks. This PR changes the typing of kernel_error::error_code to unsigned, and adds type aliases to make any future changes to kernel_error easier to implement.

Checklist

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

@etseidl etseidl requested a review from a team as a code owner November 21, 2023 20:28
@etseidl etseidl requested review from shrshi and ttnghia November 21, 2023 20:28
Copy link

copy-pr-bot bot commented Nov 21, 2023

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 libcudf Affects libcudf (C++/CUDA) code. label Nov 21, 2023
@vuule vuule self-requested a review November 21, 2023 20:35
@vuule vuule added improvement Improvement / enhancement to an existing function non-breaking Non-breaking change cuIO cuIO issue labels Nov 21, 2023
Copy link
Contributor

@vuule vuule left a comment

Choose a reason for hiding this comment

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

Love the use of the aliases.
Just got a few questions.

@@ -32,8 +32,12 @@ namespace cudf::io::parquet {
* the object's lifetime.
*/
class kernel_error {
public:
using error_type = uint32_t;
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm trying to come up with a consistent API. We currently expose data() and value(), i.e. the device_scalar API. If that does not change, we should probably stay consistent and declare value_type and pointer aliases.
https://docs.rapids.ai/api/librmm/stable/classrmm_1_1device__scalar.html

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

cpp/src/io/parquet/parquet_gpu.hpp Outdated Show resolved Hide resolved
Copy link
Contributor

@vuule vuule left a comment

Choose a reason for hiding this comment

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

🔥

@vuule
Copy link
Contributor

vuule commented Nov 29, 2023

/ok to test

@@ -426,7 +426,7 @@ __global__ void __launch_bounds__(decode_block_size)
device_span<ColumnChunkDesc const> chunks,
size_t min_row,
size_t num_rows,
int32_t* error_code)
kernel_error::pointer error_code)
Copy link
Contributor

@ttnghia ttnghia Nov 29, 2023

Choose a reason for hiding this comment

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

This looks awkward IMO. I feel much better with kernel_error::value_type*. Type aliasing a pointer to take away the * character makes it more error-prone as we can overlook and ignore the fact that this is a pointer.

Copy link
Member

Choose a reason for hiding this comment

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

I think it's fine. pointer is a pretty standard naming.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

And is consistent with the device_scalar interface, as @vuule pointed out above.

@vuule vuule added the 5 - Ready to Merge Testing and reviews complete, ready to merge label Nov 29, 2023
@vuule
Copy link
Contributor

vuule commented Nov 29, 2023

/merge

@rapids-bot rapids-bot bot merged commit 75d5978 into rapidsai:branch-24.02 Nov 29, 2023
67 checks passed
@etseidl etseidl deleted the error_code branch November 29, 2023 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5 - Ready to Merge Testing and reviews complete, ready to merge cuIO cuIO issue improvement Improvement / enhancement to an existing function libcudf Affects libcudf (C++/CUDA) code. non-breaking Non-breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants