Add Arrow-NativeFile and PythonFile support to read_parquet and read_csv in cudf#9304
Merged
rapids-bot[bot] merged 34 commits intorapidsai:branch-21.12from Oct 4, 2021
Merged
Conversation
charlesbluca
approved these changes
Oct 4, 2021
jrhemstad
reviewed
Oct 4, 2021
jrhemstad
requested changes
Oct 4, 2021
Contributor
jrhemstad
left a comment
There was a problem hiding this comment.
Default constructor is not safe.
shwina
reviewed
Oct 4, 2021
shwina
reviewed
Oct 4, 2021
shwina
reviewed
Oct 4, 2021
rjzamora
commented
Oct 4, 2021
jrhemstad
approved these changes
Oct 4, 2021
Member
Author
|
@gpucibot merge |
This was referenced Oct 5, 2021
rapids-bot bot
pushed a commit
that referenced
this pull request
Oct 6, 2021
This is a simple follow-up to #9304 and #9265 meant to achieve the following: - After this PR, the default behavior of `cudf.read_csv` will be to convert fsspec-based `AbstractBufferedFile` objects to Arrow `PythonFile` objects for non-local file systems. Since `PythonFile` objects inherit from `NativeFile` objects, libcudf can seek/read distinct byte ranges without requiring the entire file to be read into host memory (i.e. the default behavior enables proper partial IO from remote storage) - #9265 recently added an fsspec-based optimization for transfering csv byte ranges into local memory. That optimization already allowed us to avoid a full file transfer when a specific `byte_range` is specified to the `cudf.read_csv` call. However, the simpler approach introduced in this PR is (1) more general, (2) easier to maintain, and (3) demonstrates comparable performance. Therefore, this PR also rolls back one of the less-maintainable optimizations added in #9265 (local buffer clipping). Authors: - Richard (Rick) Zamora (https://github.com/rjzamora) Approvers: - https://github.com/brandon-b-miller URL: #9376
rapids-bot bot
pushed a commit
that referenced
this pull request
Oct 7, 2021
This is a follow-up to #9304, and is more-or-less the ORC version of #9376 These changes will enable partial IO to behave "correctly" for `cudf.read_orc` from remote storage. Simpe multi-stripe file example: ```python # After this PR %time gdf = cudf.read_orc(orc_path, stripes=[0], storage_options=storage_options) CPU times: user 579 ms, sys: 166 ms, total: 744 ms Wall time: 2.38 s # Before this PR %time gdf = cudf.read_orc(orc_path, stripes=[0], storage_options=storage_options) CPU times: user 3.9 s, sys: 1.47 s, total: 5.37 s Wall time: 8.5 s ``` Authors: - Richard (Rick) Zamora (https://github.com/rjzamora) Approvers: - Charles Blackmon-Luca (https://github.com/charlesbluca) URL: #9377
Closed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 PR implements a simple but critical subset of the the features implemented and discussed in #8961 and #9225. Note that I suggest those PRs be closed in favor of a few simpler PRs (like this one).
What this PR DOES do:
read_parquetandread_csvfunctions. For example:AbstractBufferedFileobjects into Arrow-backedPythonFileobjects. Forread_parquet, an Arrow-backedPythonFileobject can be used (in place of an optimized fsspec transfer) by passinguse_python_file_object=True:or
What this PR does NOT do:
Props to @shridharathi for doing most of the work for this in #8961 (this PR only extends that work to include parquet and add tests).