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

Clean up namespaces and improve compression-related headers #17621

Merged
merged 13 commits into from
Dec 20, 2024

Conversation

vuule
Copy link
Contributor

@vuule vuule commented Dec 18, 2024

Description

Moved compression-related stuff that was under cudf::io to cudf::io::detail.
Moved the nvcomp adapter from cudf::io::nvcomp to cudf::io::detail::nvcomp.
Extract common compression constants to appropriate headers, and updated the files to include what they use.

Changes are made in preparation for adding higher-level compression API that abstracts nvcomp use and simplifies caller code.

Checklist

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

Copy link

copy-pr-bot bot commented Dec 18, 2024

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@github-actions github-actions bot added the libcudf Affects libcudf (C++/CUDA) code. label Dec 18, 2024
@vuule vuule added improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Dec 18, 2024
@vuule
Copy link
Contributor Author

vuule commented Dec 18, 2024

/ok to test

@vuule vuule marked this pull request as ready for review December 18, 2024 20:23
@vuule vuule requested a review from a team as a code owner December 18, 2024 20:23
@vuule vuule requested review from vyasr and PointKernel December 18, 2024 20:23
Comment on lines 195 to 197
device_span<device_span<uint8_t const>> inflate_in_view{inflate_in.data(),
num_compressed_blocks};
device_span<device_span<uint8_t>> inflate_out_view{inflate_out.data(), num_compressed_blocks};
Copy link
Contributor Author

Choose a reason for hiding this comment

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

unrelated to header changes, just noticed that the spans are created for no reason here.

cpp/src/io/comp/common.hpp Outdated Show resolved Hide resolved
@@ -44,7 +45,11 @@ namespace io {
namespace orc {
namespace gpu {

namespace nvcomp = cudf::io::detail::nvcomp;
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't love that we have an internal namespace with the same name as nvcomp's own C++ namespace. This feels like it's asking for a resolution error to occur eventually. At the same time, I don't feel strongly enough to request a change.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've thought about this (briefly :D ), and went ahead because I've never seen a namespace in nvcomp; the header files we include are extern "C" { in the global namespace. Also, no file outside of the adapter should include anything from nvcomp.
FWIW, these files should stop depending on the nvcomp adapter (and thus the namespace) once I implement the high-level API that uses nvcomp transparently.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

all that said, I should have used a different name :D

Copy link
Contributor

Choose a reason for hiding this comment

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

I checked that nvcomp.hpp has namespace nvcomp, but I did not look at whether it has extern C. Let’s not worry unless it presents problems.

Copy link
Member

@PointKernel PointKernel left a comment

Choose a reason for hiding this comment

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

one non-blocking question otherwise looks good

Comment on lines -708 to -712
if (log_cyclecount) {
results[strm_id].reserved = clock() - s->tstart;
} else {
results[strm_id].reserved = 0;
}
Copy link
Member

Choose a reason for hiding this comment

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

Has the cycle count logic been relocated elsewhere, or is it simply being removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good question, I forgot to comment on this.
It's removed: It's unused and keeping it just adds noise to the future API changes.

Copy link
Contributor

@ttnghia ttnghia left a comment

Choose a reason for hiding this comment

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

Confirm that this does not break spark-rapids-jni build.

@vuule vuule added the 5 - Ready to Merge Testing and reviews complete, ready to merge label Dec 19, 2024
@vuule
Copy link
Contributor Author

vuule commented Dec 20, 2024

/merge

@rapids-bot rapids-bot bot merged commit fb62d0e into rapidsai:branch-25.02 Dec 20, 2024
106 checks passed
@vuule vuule deleted the comp-headers-cleanup branch December 20, 2024 17:09
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 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