-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Upgrade to nvCOMP 5.0.0.6 #19636
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
Upgrade to nvCOMP 5.0.0.6 #19636
Changes from 19 commits
8a210cf
aa2c40a
951010e
519e4d7
8892a6f
396fb17
f58ddf9
3ac71f3
13f1b8c
fcb8ed5
6f053c9
28c8c7c
9ac97c9
0cd906a
0e4a362
d7c989f
01421ca
50a2820
2b52b4b
050de17
b45faae
780610a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,7 +26,7 @@ flatbuffers_version: | |
| - "=24.3.25" | ||
|
|
||
| nvcomp_version: | ||
| - "=4.2.0.11" | ||
| - "=5.0.0.6" | ||
|
|
||
| zlib_version: | ||
| - ">=1.2.13" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -63,15 +63,16 @@ extern "C" { | |
|
|
||
| // methods for lz4 | ||
| JNIEXPORT jlong JNICALL Java_ai_rapids_cudf_nvcomp_NvcompJni_batchedLZ4CompressGetTempSize( | ||
| JNIEnv* env, jclass, jlong j_batch_size, jlong j_max_chunk_size) | ||
| JNIEnv* env, jclass, jlong j_batch_size, jlong j_max_chunk_size, jlong j_max_total_size) | ||
| { | ||
| try { | ||
| cudf::jni::auto_set_device(env); | ||
| auto batch_size = static_cast<std::size_t>(j_batch_size); | ||
| auto max_chunk_size = static_cast<std::size_t>(j_max_chunk_size); | ||
| auto total_size = static_cast<std::size_t>(j_max_total_size); | ||
| std::size_t temp_size = 0; | ||
| auto status = nvcompBatchedLZ4CompressGetTempSize( | ||
| batch_size, max_chunk_size, nvcompBatchedLZ4DefaultOpts, &temp_size); | ||
| auto status = nvcompBatchedLZ4CompressGetTempSizeAsync( | ||
| batch_size, max_chunk_size, nvcompBatchedLZ4CompressDefaultOpts, &temp_size, total_size); | ||
| check_nvcomp_status(env, status); | ||
| return static_cast<jlong>(temp_size); | ||
| } | ||
|
|
@@ -88,7 +89,7 @@ Java_ai_rapids_cudf_nvcomp_NvcompJni_batchedLZ4CompressGetMaxOutputChunkSize(JNI | |
| auto max_chunk_size = static_cast<std::size_t>(j_max_chunk_size); | ||
| std::size_t max_output_size = 0; | ||
| auto status = nvcompBatchedLZ4CompressGetMaxOutputChunkSize( | ||
| max_chunk_size, nvcompBatchedLZ4DefaultOpts, &max_output_size); | ||
| max_chunk_size, nvcompBatchedLZ4CompressDefaultOpts, &max_output_size); | ||
| check_nvcomp_status(env, status); | ||
| return static_cast<jlong>(max_output_size); | ||
| } | ||
|
|
@@ -119,30 +120,36 @@ Java_ai_rapids_cudf_nvcomp_NvcompJni_batchedLZ4CompressAsync(JNIEnv* env, | |
| auto out_ptrs = reinterpret_cast<void* const*>(j_out_ptrs); | ||
| auto compressed_out_sizes = reinterpret_cast<std::size_t*>(j_compressed_sizes_out_ptr); | ||
| auto stream = reinterpret_cast<cudaStream_t>(j_stream); | ||
| auto status = nvcompBatchedLZ4CompressAsync(in_ptrs, | ||
| // FIXME how to use these statuses ? They are not used either in the corresponding | ||
| // decompressor. | ||
|
Comment on lines
+123
to
+124
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How will we track this? Follow-up work?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I merged this as-is from #19309
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What does the new API write into this
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just read the doc:
So should we launch another kernel
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we don't want to sync stream here, we probably need to return the entire status array for checking later on. Otherwise, we would not be able to check for compression status of each data chunk. The
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes, this is pretty much what we do in libcudf |
||
| auto comp_statuses = rmm::device_uvector<nvcompStatus_t>(batch_size, stream); | ||
| auto status = nvcompBatchedLZ4CompressAsync(in_ptrs, | ||
| in_sizes, | ||
| chunk_size, | ||
| batch_size, | ||
| temp_ptr, | ||
| temp_size, | ||
| out_ptrs, | ||
| compressed_out_sizes, | ||
| nvcompBatchedLZ4DefaultOpts, | ||
| nvcompBatchedLZ4CompressDefaultOpts, | ||
| comp_statuses.data(), | ||
| stream); | ||
| check_nvcomp_status(env, status); | ||
| } | ||
| CATCH_STD(env, ); | ||
| } | ||
|
|
||
| JNIEXPORT jlong JNICALL Java_ai_rapids_cudf_nvcomp_NvcompJni_batchedLZ4DecompressGetTempSize( | ||
| JNIEnv* env, jclass, jlong j_batch_size, jlong j_chunk_size) | ||
| JNIEnv* env, jclass, jlong j_batch_size, jlong j_chunk_size, jlong j_max_total_size) | ||
| { | ||
| try { | ||
| cudf::jni::auto_set_device(env); | ||
| auto batch_size = static_cast<std::size_t>(j_batch_size); | ||
| auto chunk_size = static_cast<std::size_t>(j_chunk_size); | ||
| auto total_size = static_cast<std::size_t>(j_max_total_size); | ||
| std::size_t temp_size = 0; | ||
| auto status = nvcompBatchedLZ4DecompressGetTempSize(batch_size, chunk_size, &temp_size); | ||
| auto status = nvcompBatchedLZ4DecompressGetTempSizeAsync( | ||
| batch_size, chunk_size, nvcompBatchedLZ4DecompressDefaultOpts, &temp_size, total_size); | ||
| check_nvcomp_status(env, status); | ||
| return static_cast<jlong>(temp_size); | ||
| } | ||
|
|
@@ -181,6 +188,7 @@ Java_ai_rapids_cudf_nvcomp_NvcompJni_batchedLZ4DecompressAsync(JNIEnv* env, | |
| temp_ptr, | ||
| temp_size, | ||
| uncompressed_ptrs, | ||
| nvcompBatchedLZ4DecompressDefaultOpts, | ||
| uncompressed_statuses.data(), | ||
| stream); | ||
| check_nvcomp_status(env, status); | ||
|
|
@@ -218,15 +226,16 @@ Java_ai_rapids_cudf_nvcomp_NvcompJni_batchedLZ4GetDecompressSizeAsync(JNIEnv* en | |
|
|
||
| // methods for zstd | ||
| JNIEXPORT jlong JNICALL Java_ai_rapids_cudf_nvcomp_NvcompJni_batchedZstdCompressGetTempSize( | ||
| JNIEnv* env, jclass, jlong j_batch_size, jlong j_max_chunk_size) | ||
| JNIEnv* env, jclass, jlong j_batch_size, jlong j_max_chunk_size, jlong j_max_total_size) | ||
| { | ||
| try { | ||
| cudf::jni::auto_set_device(env); | ||
| auto batch_size = static_cast<std::size_t>(j_batch_size); | ||
| auto max_chunk_size = static_cast<std::size_t>(j_max_chunk_size); | ||
| auto total_size = static_cast<std::size_t>(j_max_total_size); | ||
| std::size_t temp_size = 0; | ||
| auto status = nvcompBatchedZstdCompressGetTempSize( | ||
| batch_size, max_chunk_size, nvcompBatchedZstdDefaultOpts, &temp_size); | ||
| auto status = nvcompBatchedZstdCompressGetTempSizeAsync( | ||
| batch_size, max_chunk_size, nvcompBatchedZstdCompressDefaultOpts, &temp_size, total_size); | ||
| check_nvcomp_status(env, status); | ||
| return static_cast<jlong>(temp_size); | ||
| } | ||
|
|
@@ -242,7 +251,7 @@ Java_ai_rapids_cudf_nvcomp_NvcompJni_batchedZstdCompressGetMaxOutputChunkSize( | |
| auto max_chunk_size = static_cast<std::size_t>(j_max_chunk_size); | ||
| std::size_t max_output_size = 0; | ||
| auto status = nvcompBatchedZstdCompressGetMaxOutputChunkSize( | ||
| max_chunk_size, nvcompBatchedZstdDefaultOpts, &max_output_size); | ||
| max_chunk_size, nvcompBatchedZstdCompressDefaultOpts, &max_output_size); | ||
| check_nvcomp_status(env, status); | ||
| return static_cast<jlong>(max_output_size); | ||
| } | ||
|
|
@@ -273,30 +282,36 @@ Java_ai_rapids_cudf_nvcomp_NvcompJni_batchedZstdCompressAsync(JNIEnv* env, | |
| auto out_ptrs = reinterpret_cast<void* const*>(j_out_ptrs); | ||
| auto compressed_out_sizes = reinterpret_cast<std::size_t*>(j_compressed_sizes_out_ptr); | ||
| auto stream = reinterpret_cast<cudaStream_t>(j_stream); | ||
| auto status = nvcompBatchedZstdCompressAsync(in_ptrs, | ||
| // FIXME how to use these statuses ? They are not used either in the corresponding | ||
| // decompressor. | ||
| auto comp_statuses = rmm::device_uvector<nvcompStatus_t>(batch_size, stream); | ||
|
Comment on lines
+285
to
+287
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similarly, we have the decompression status written into this array but here we don't check it to see if there is any failure. |
||
| auto status = nvcompBatchedZstdCompressAsync(in_ptrs, | ||
| in_sizes, | ||
| chunk_size, | ||
| batch_size, | ||
| temp_ptr, | ||
| temp_size, | ||
| out_ptrs, | ||
| compressed_out_sizes, | ||
| nvcompBatchedZstdDefaultOpts, | ||
| nvcompBatchedZstdCompressDefaultOpts, | ||
| comp_statuses.data(), | ||
| stream); | ||
| check_nvcomp_status(env, status); | ||
| } | ||
| CATCH_STD(env, ); | ||
| } | ||
|
|
||
| JNIEXPORT jlong JNICALL Java_ai_rapids_cudf_nvcomp_NvcompJni_batchedZstdDecompressGetTempSize( | ||
| JNIEnv* env, jclass, jlong j_batch_size, jlong j_chunk_size) | ||
| JNIEnv* env, jclass, jlong j_batch_size, jlong j_chunk_size, jlong j_max_total_size) | ||
| { | ||
| try { | ||
| cudf::jni::auto_set_device(env); | ||
| auto batch_size = static_cast<std::size_t>(j_batch_size); | ||
| auto chunk_size = static_cast<std::size_t>(j_chunk_size); | ||
| auto total_size = static_cast<std::size_t>(j_max_total_size); | ||
| std::size_t temp_size = 0; | ||
| auto status = nvcompBatchedZstdDecompressGetTempSize(batch_size, chunk_size, &temp_size); | ||
| auto status = nvcompBatchedZstdDecompressGetTempSizeAsync( | ||
| batch_size, chunk_size, nvcompBatchedZstdDecompressDefaultOpts, &temp_size, total_size); | ||
| check_nvcomp_status(env, status); | ||
| return static_cast<jlong>(temp_size); | ||
| } | ||
|
|
@@ -335,6 +350,7 @@ Java_ai_rapids_cudf_nvcomp_NvcompJni_batchedZstdDecompressAsync(JNIEnv* env, | |
| temp_ptr, | ||
| temp_size, | ||
| uncompressed_ptrs, | ||
| nvcompBatchedZstdDecompressDefaultOpts, | ||
| uncompressed_statuses.data(), | ||
| stream); | ||
| check_nvcomp_status(env, status); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.