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

Enable Zstandard decompression only when all nvcomp integrations are enabled #10944

Merged
merged 3 commits into from
May 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions cpp/src/io/comp/nvcomp_adapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include "nvcomp_adapter.cuh"

#include <cudf/utilities/error.hpp>
#include <io/utilities/config_utils.hpp>

#include <nvcomp/snappy.h>

Expand Down Expand Up @@ -76,6 +77,17 @@ void batched_decompress(compression_type compression,
size_t max_uncomp_chunk_size,
rmm::cuda_stream_view stream)
{
// TODO Consolidate config use to a common location
if (compression == compression_type::ZSTD) {
#if NVCOMP_HAS_ZSTD
CUDF_EXPECTS(cudf::io::detail::nvcomp_integration::is_all_enabled(),
"Zstandard compression is experimental, you can enable it through "
"`LIBCUDF_NVCOMP_POLICY` environment variable.");
#else
CUDF_FAIL("nvCOMP 2.3 or newer is required for Zstandard compression");
#endif
}

auto const num_chunks = inputs.size();

// cuDF inflate inputs converted to nvcomp inputs
Expand Down
7 changes: 2 additions & 5 deletions python/cudf/cudf/tests/test_orc.py
Original file line number Diff line number Diff line change
Expand Up @@ -1727,8 +1727,5 @@ def test_orc_reader_zstd_compression(list_struct_buff):
try:
got = cudf.read_orc(buffer)
assert_eq(expected, got)
except RuntimeError as e:
if "Unsupported compression type" in str(e):
pytest.mark.xfail(reason="nvcomp build doesn't have zstd")
else:
raise e
except RuntimeError:
pytest.mark.xfail(reason="zstd support is not enabled")
7 changes: 2 additions & 5 deletions python/cudf/cudf/tests/test_parquet.py
Original file line number Diff line number Diff line change
Expand Up @@ -2515,8 +2515,5 @@ def test_parquet_reader_zstd_compression(datadir):
df = cudf.read_parquet(fname)
pdf = pd.read_parquet(fname)
assert_eq(df, pdf)
except RuntimeError as e:
if "Unsupported compression type" in str(e):
pytest.mark.xfail(reason="nvcomp build doesn't have zstd")
else:
raise e
except RuntimeError:
pytest.mark.xfail(reason="zstd support is not enabled")