-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
[Data] Fixing DelegatingBlockBuilder
to avoid re-serializing objects multiple times
#48509
Merged
bveeramani
merged 2 commits into
ray-project:master
from
alexeykudinkin:ak/dlg-blk-bld-fix
Nov 13, 2024
Merged
[Data] Fixing DelegatingBlockBuilder
to avoid re-serializing objects multiple times
#48509
bveeramani
merged 2 commits into
ray-project:master
from
alexeykudinkin:ak/dlg-blk-bld-fix
Nov 13, 2024
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: Alexey Kudinkin <ak@anyscale.com>
alexeykudinkin
requested review from
scottjlee,
bveeramani,
raulchen,
stephanie-wang and
omatthew98
as code owners
November 2, 2024 03:13
alexeykudinkin
changed the title
[Data] Fixing
[WIP][Data] Fixing Nov 2, 2024
DelegatingBlockBuilder
to avoid re-serializing objects multiple timesDelegatingBlockBuilder
to avoid re-serializing objects multiple times
alexeykudinkin
changed the title
[WIP][Data] Fixing
[Data] Fixing Nov 12, 2024
DelegatingBlockBuilder
to avoid re-serializing objects multiple timesDelegatingBlockBuilder
to avoid re-serializing objects multiple times
alexeykudinkin
commented
Nov 12, 2024
Comment on lines
-26
to
-36
import pyarrow | ||
|
||
if self._builder is None: | ||
try: | ||
check = ArrowBlockBuilder() | ||
check.add(item) | ||
check.build() | ||
self._builder = ArrowBlockBuilder() | ||
except (TypeError, pyarrow.lib.ArrowInvalid, ArrowConversionError): | ||
# Can also handle nested Python objects, which Arrow cannot. | ||
self._builder = PandasBlockBuilder() |
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.
These fallbacks are no longer necessary since Arrow now support ArrowPythonObjectType allowing to fallback to serializing rows as native Python objects (using pickle)
bveeramani
approved these changes
Nov 12, 2024
JP-sDEV
pushed a commit
to JP-sDEV/ray
that referenced
this pull request
Nov 14, 2024
…s multiple times (ray-project#48509) Currently, we're serializing first row in every block twice when adding it t/h `DelegatingBlockBuilder`, carrying tangible overhead and impact on latency for large enough rows. Provided that `ArrowBlockBuilder` is now able to handle arbitrary Python object we can just deprecate `DelegatingBlockBuilder` altogether. --------- Signed-off-by: Alexey Kudinkin <ak@anyscale.com>
mohitjain2504
pushed a commit
to mohitjain2504/ray
that referenced
this pull request
Nov 15, 2024
…s multiple times (ray-project#48509) Currently, we're serializing first row in every block twice when adding it t/h `DelegatingBlockBuilder`, carrying tangible overhead and impact on latency for large enough rows. Provided that `ArrowBlockBuilder` is now able to handle arbitrary Python object we can just deprecate `DelegatingBlockBuilder` altogether. --------- Signed-off-by: Alexey Kudinkin <ak@anyscale.com> Signed-off-by: mohitjain2504 <mohit.jain@dream11.com>
dentiny
pushed a commit
to dentiny/ray
that referenced
this pull request
Dec 7, 2024
…s multiple times (ray-project#48509) Currently, we're serializing first row in every block twice when adding it t/h `DelegatingBlockBuilder`, carrying tangible overhead and impact on latency for large enough rows. Provided that `ArrowBlockBuilder` is now able to handle arbitrary Python object we can just deprecate `DelegatingBlockBuilder` altogether. --------- Signed-off-by: Alexey Kudinkin <ak@anyscale.com> Signed-off-by: hjiang <dentinyhao@gmail.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?
Currently, we're serializing first row in every block twice when adding it t/h
DelegatingBlockBuilder
, carrying tangible overhead and impact on latency for large enough rows.Provided that
ArrowBlockBuilder
is now able to handle arbitrary Python object we can just deprecateDelegatingBlockBuilder
altogether.Related issue number
Checks
git commit -s
) in this PR.scripts/format.sh
to lint the changes in this PR.method in Tune, I've added it in
doc/source/tune/api/
under thecorresponding
.rst
file.