Skip to content

Commit

Permalink
Enable Zstandard decompression only when all nvcomp integrations are …
Browse files Browse the repository at this point in the history
…enabled (NVIDIA#10944)

Closes NVIDIA#9055
Limiting due to known nvcomp issues.

Authors:
  - Vukasin Milovanovic (https://github.com/vuule)

Approvers:
  - Nghia Truong (https://github.com/ttnghia)
  - Jim Brennan (https://github.com/jbrennan333)
  - Vyas Ramasubramani (https://github.com/vyasr)
  - Mike Wilson (https://github.com/hyperbolic2346)
  - Bradley Dice (https://github.com/bdice)
  - GALI PREM SAGAR (https://github.com/galipremsagar)

URL: rapidsai/cudf#10944
  • Loading branch information
vuule authored May 25, 2022
1 parent df5dc08 commit 31e1739
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
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")

0 comments on commit 31e1739

Please sign in to comment.