-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
Make write an operator as part of the execution plan #32015
Merged
Merged
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
Signed-off-by: jianoaix <iamjianxiao@gmail.com>
jianoaix
requested review from
ericl,
scv119,
clarkzinzow,
jjyao and
c21
as code owners
January 28, 2023 00:10
jianoaix
added
the
@author-action-required
The PR author is responsible for the next step. Remove tag to send back to the reviewer.
label
Jan 28, 2023
jianoaix
removed
the
@author-action-required
The PR author is responsible for the next step. Remove tag to send back to the reviewer.
label
Feb 7, 2023
ericl
reviewed
Feb 7, 2023
ericl
approved these changes
Feb 7, 2023
ericl
approved these changes
Feb 7, 2023
This was referenced Feb 10, 2023
ericl
pushed a commit
that referenced
this pull request
Feb 14, 2023
7 tasks
ericl
pushed a commit
that referenced
this pull request
Feb 21, 2023
With the new `write` added (from #32015 and #32440), Ray Data intends to support both the `write` and `do_write` functions for now. The check currently uses the `hasattr()` function to ensure the datasource object has a `write` method before using it. However, this is insufficient for a custom datasource that inherits from `Datasource` since `Datasource` has the `write` method implemented. If the custom datasource only has `do_write` implemented, `hasattr(datasource, "write")` will return True since `hasattr()` will detect methods via inheritance. The solution is to check if the `write` method was overwritten from `Datasource.write`. Any class that has not implemented `write` will have the equality check return True
edoakes
pushed a commit
to edoakes/ray
that referenced
this pull request
Mar 22, 2023
Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
edoakes
pushed a commit
to edoakes/ray
that referenced
this pull request
Mar 22, 2023
Follow up to ray-project#32015. Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
edoakes
pushed a commit
to edoakes/ray
that referenced
this pull request
Mar 22, 2023
With the new `write` added (from ray-project#32015 and ray-project#32440), Ray Data intends to support both the `write` and `do_write` functions for now. The check currently uses the `hasattr()` function to ensure the datasource object has a `write` method before using it. However, this is insufficient for a custom datasource that inherits from `Datasource` since `Datasource` has the `write` method implemented. If the custom datasource only has `do_write` implemented, `hasattr(datasource, "write")` will return True since `hasattr()` will detect methods via inheritance. The solution is to check if the `write` method was overwritten from `Datasource.write`. Any class that has not implemented `write` will have the equality check return True Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
peytondmurray
pushed a commit
to peytondmurray/ray
that referenced
this pull request
Mar 22, 2023
With the new `write` added (from ray-project#32015 and ray-project#32440), Ray Data intends to support both the `write` and `do_write` functions for now. The check currently uses the `hasattr()` function to ensure the datasource object has a `write` method before using it. However, this is insufficient for a custom datasource that inherits from `Datasource` since `Datasource` has the `write` method implemented. If the custom datasource only has `do_write` implemented, `hasattr(datasource, "write")` will return True since `hasattr()` will detect methods via inheritance. The solution is to check if the `write` method was overwritten from `Datasource.write`. Any class that has not implemented `write` will have the equality check return True
elliottower
pushed a commit
to elliottower/ray
that referenced
this pull request
Apr 22, 2023
Follow up to ray-project#32015. Signed-off-by: elliottower <elliot@elliottower.com>
elliottower
pushed a commit
to elliottower/ray
that referenced
this pull request
Apr 22, 2023
With the new `write` added (from ray-project#32015 and ray-project#32440), Ray Data intends to support both the `write` and `do_write` functions for now. The check currently uses the `hasattr()` function to ensure the datasource object has a `write` method before using it. However, this is insufficient for a custom datasource that inherits from `Datasource` since `Datasource` has the `write` method implemented. If the custom datasource only has `do_write` implemented, `hasattr(datasource, "write")` will return True since `hasattr()` will detect methods via inheritance. The solution is to check if the `write` method was overwritten from `Datasource.write`. Any class that has not implemented `write` will have the equality check return True Signed-off-by: elliottower <elliot@elliottower.com>
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.
Why are these changes needed?
Today the "write" is not captured as an operator in the execution plan: it just fully executes the plan and then launches Ray tasks to perform the writing.
By make it a write operator, we will have a cleaner/unified model to handle how "write" is supported, enable query optimization for write (e.g. read->map->write can be fused into one operator node) for better performance.
Note: supporting this write operator in the new query plan will be in a follow-up PR.
Benchmarked on a single node:
Before:
After:
The write fusion generally makes it faster. And it took only half of the time with fusion to complete this entire benchmark.
Related issue number
Checks
git commit -s
) in this PR.scripts/format.sh
to lint the changes in this PR.