-
Notifications
You must be signed in to change notification settings - Fork 912
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Propagate errors from Parquet reader kernels back to host (#14167)
Pass the error code to the host when a kernel detects invalid input. If multiple errors types are detected, they are combined using a bitwise OR so that caller gets the aggregate error code that includes all types of errors that occurred. Does not change the kernel side checks. Authors: - Vukasin Milovanovic (https://github.com/vuule) Approvers: - https://github.com/nvdbaranec - Divye Gala (https://github.com/divyegala) - Yunsong Wang (https://github.com/PointKernel) - Bradley Dice (https://github.com/bdice) URL: #14167
- Loading branch information
Showing
6 changed files
with
130 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,8 +32,12 @@ namespace { | |
// with V2 page headers; see https://www.mail-archive.com/[email protected]/msg11826.html). | ||
// this kernel only needs 96 threads (3 warps)(for now). | ||
template <typename level_t> | ||
__global__ void __launch_bounds__(96) gpuDecodeDeltaBinary( | ||
PageInfo* pages, device_span<ColumnChunkDesc const> chunks, size_t min_row, size_t num_rows) | ||
__global__ void __launch_bounds__(96) | ||
gpuDecodeDeltaBinary(PageInfo* pages, | ||
device_span<ColumnChunkDesc const> chunks, | ||
size_t min_row, | ||
size_t num_rows, | ||
int32_t* error_code) | ||
{ | ||
using cudf::detail::warp_size; | ||
__shared__ __align__(16) delta_binary_decoder db_state; | ||
|
@@ -79,7 +83,8 @@ __global__ void __launch_bounds__(96) gpuDecodeDeltaBinary( | |
// that has a value we need. | ||
if (skipped_leaf_values > 0) { db->skip_values(skipped_leaf_values); } | ||
|
||
while (!s->error && (s->input_value_count < s->num_input_values || s->src_pos < s->nz_count)) { | ||
while (s->error == 0 && | ||
(s->input_value_count < s->num_input_values || s->src_pos < s->nz_count)) { | ||
uint32_t target_pos; | ||
uint32_t const src_pos = s->src_pos; | ||
|
||
|
@@ -145,6 +150,11 @@ __global__ void __launch_bounds__(96) gpuDecodeDeltaBinary( | |
} | ||
__syncthreads(); | ||
} | ||
|
||
if (t == 0 and s->error != 0) { | ||
cuda::atomic_ref<int32_t, cuda::thread_scope_device> ref{*error_code}; | ||
ref.fetch_or(s->error, cuda::std::memory_order_relaxed); | ||
} | ||
} | ||
|
||
} // anonymous namespace | ||
|
@@ -157,6 +167,7 @@ void __host__ DecodeDeltaBinary(cudf::detail::hostdevice_vector<PageInfo>& pages | |
size_t num_rows, | ||
size_t min_row, | ||
int level_type_size, | ||
int32_t* error_code, | ||
rmm::cuda_stream_view stream) | ||
{ | ||
CUDF_EXPECTS(pages.size() > 0, "There is no page to decode"); | ||
|
@@ -165,11 +176,11 @@ void __host__ DecodeDeltaBinary(cudf::detail::hostdevice_vector<PageInfo>& pages | |
dim3 dim_grid(pages.size(), 1); // 1 threadblock per page | ||
|
||
if (level_type_size == 1) { | ||
gpuDecodeDeltaBinary<uint8_t> | ||
<<<dim_grid, dim_block, 0, stream.value()>>>(pages.device_ptr(), chunks, min_row, num_rows); | ||
gpuDecodeDeltaBinary<uint8_t><<<dim_grid, dim_block, 0, stream.value()>>>( | ||
pages.device_ptr(), chunks, min_row, num_rows, error_code); | ||
} else { | ||
gpuDecodeDeltaBinary<uint16_t> | ||
<<<dim_grid, dim_block, 0, stream.value()>>>(pages.device_ptr(), chunks, min_row, num_rows); | ||
gpuDecodeDeltaBinary<uint16_t><<<dim_grid, dim_block, 0, stream.value()>>>( | ||
pages.device_ptr(), chunks, min_row, num_rows, error_code); | ||
} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.