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

Use nvcomp's snappy compressor in ORC writer #9242

Merged
merged 31 commits into from
Sep 22, 2021

Conversation

devavret
Copy link
Contributor

@devavret devavret commented Sep 16, 2021

Issue #9205

depends on #9235

devavret added 27 commits May 7, 2021 17:26
Cmake changes (excluding changes needed in nvcomp's cmake)
Replace cuIO's snappy compressor with nvcomp
When writing statistics, there's not enough space allocated in chunk's compressed buffer.
This results in the compressed buffer being written into another chunk's memory.
@devavret devavret requested a review from a team as a code owner September 16, 2021 20:26
@codecov
Copy link

codecov bot commented Sep 16, 2021

Codecov Report

Merging #9242 (11e20e7) into branch-21.10 (3ee3ecf) will decrease coverage by 0.00%.
The diff coverage is 0.00%.

Impacted file tree graph

@@               Coverage Diff                @@
##           branch-21.10    #9242      +/-   ##
================================================
- Coverage         10.85%   10.84%   -0.01%     
================================================
  Files               115      116       +1     
  Lines             19158    19171      +13     
================================================
  Hits               2080     2080              
- Misses            17078    17091      +13     
Impacted Files Coverage Δ
python/cudf/cudf/__init__.py 0.00% <ø> (ø)
python/cudf/cudf/_lib/__init__.py 0.00% <ø> (ø)
python/cudf/cudf/io/__init__.py 0.00% <0.00%> (ø)
python/cudf/cudf/io/text.py 0.00% <0.00%> (ø)
python/cudf/cudf/utils/ioutils.py 0.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4defd25...11e20e7. Read the comment docs.

@vuule vuule added cuIO cuIO issue improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Sep 17, 2021
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.

quick review, looks good so far

cpp/src/io/orc/writer_impl.cu Show resolved Hide resolved
cpp/src/io/orc/stripe_enc.cu Show resolved Hide resolved
Comment on lines +372 to +373
device_span<gpu_inflate_input_s> comp_in,
device_span<gpu_inflate_status_s> comp_out,
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't it mildly worse to pass a span here if you don't ever use the size? In the sense of having to hypothetically push another argument on the stack.

Copy link
Contributor

Choose a reason for hiding this comment

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

As I see it, the trade-off is that with span it's clear that the parameter is an array, not a pointer to a single object. Now, whether this is a good trade-off is up for debate :D

cpp/src/io/orc/stripe_enc.cu Outdated Show resolved Hide resolved
Copy link
Contributor

@elstehle elstehle left a comment

Choose a reason for hiding this comment

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

LGTM. Just one question.

Comment on lines +1333 to +1340
thrust::transform(rmm::exec_policy(stream),
compressed_bytes_written.begin(),
compressed_bytes_written.end(),
comp_out.begin(),
[] __device__(size_t size) {
gpu_inflate_status_s status{};
status.bytes_written = size;
return status;
Copy link
Contributor

Choose a reason for hiding this comment

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

Could this be replaced with a thrust::transform_output_iterator in the call to nvcompBatchedSnappyCompressAsync, basically to safe allocating and materializing the compressed_bytes_written? [1]

[1] https://thrust.github.io/doc/classthrust_1_1transform__output__iterator.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.

nvcompBatchedSnappyCompressAsync is a C API and doesn't take iterators. 😞

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, I see. Too bad! Thanks for clarifying 👍

@devavret devavret requested a review from nvdbaranec September 21, 2021 23:54
Copy link
Contributor

@hyperbolic2346 hyperbolic2346 left a comment

Choose a reason for hiding this comment

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

Looks good to me, just a couple copyrights to update.

cpp/src/io/orc/orc_common.h Show resolved Hide resolved
cpp/src/io/orc/stripe_init.cu Show resolved Hide resolved
@devavret
Copy link
Contributor Author

@gpucibot merge

@rapids-bot rapids-bot bot merged commit 08cbbcd into rapidsai:branch-21.10 Sep 22, 2021
devavret added a commit to devavret/cudf that referenced this pull request Sep 23, 2021
@vyasr vyasr added 4 - Needs Review Waiting for reviewer to review or respond and removed 4 - Needs cuIO Reviewer labels Feb 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4 - Needs Review Waiting for reviewer to review or respond 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.

6 participants