-
Notifications
You must be signed in to change notification settings - Fork 915
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
Add Arrow-NativeFile and PythonFile support to read_parquet and read_csv in cudf #9304
Merged
rapids-bot
merged 34 commits into
rapidsai:branch-21.12
from
rjzamora:native-file-simple
Oct 4, 2021
Merged
Add Arrow-NativeFile and PythonFile support to read_parquet and read_csv in cudf #9304
rapids-bot
merged 34 commits into
rapidsai:branch-21.12
from
rjzamora:native-file-simple
Oct 4, 2021
Conversation
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
rjzamora
added
2 - In Progress
Currently a work in progress
Python
Affects Python cuDF API.
Cython
Performance
Performance related issue
improvement
Improvement / enhancement to an existing function
labels
Sep 24, 2021
vyasr
approved these changes
Oct 4, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
C++ approval
jrhemstad
reviewed
Oct 4, 2021
jrhemstad
requested changes
Oct 4, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
rjzamora
added
5 - Ready to Merge
Testing and reviews complete, ready to merge
and removed
3 - Ready for Review
Ready for review by team
4 - Needs cuDF (Python) Reviewer
labels
Oct 4, 2021
@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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
5 - Ready to Merge
Testing and reviews complete, ready to merge
improvement
Improvement / enhancement to an existing function
non-breaking
Non-breaking change
Performance
Performance related issue
Python
Affects Python cuDF API.
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_parquet
andread_csv
functions. For example:AbstractBufferedFile
objects into Arrow-backedPythonFile
objects. Forread_parquet
, an Arrow-backedPythonFile
object 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).