Fix ORC reader when using device_read_async
while the destination device buffers are not ready
#17074
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fixes a bug in ORC reader when
device_read_async
is called while the destination device buffers are not ready to write in. In detail, this bug is becausedevice_read_async
does not use the user-provided stream but its own generated stream for data copying. As such, the copying ops could happen before the destination device buffers are being allocated, causing data corruption.This bug only shows up in certain conditions, and also hard to reproduce. It occurs when copying buffers with small sizes (below
gds_threshold
) and most likely to show up with settingrmm_mode=async
.