-
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] Avoid serializing datasource for Parquet read tasks #41712
Conversation
Signed-off-by: Balaji Veeramani <balaji@anyscale.com>
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.
Thanks for the fix!
Is there a way to add a unit test to prevent the issue in the future? |
This sounds to me a release blocker. We should cherry pick to prevent regression. |
@@ -390,7 +391,7 @@ def get_read_tasks(self, parallelism: int) -> List[ReadTask]: | |||
columns, | |||
schema, | |||
f, | |||
self._include_paths, | |||
include_paths, |
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.
we can make the ParquetDatasource class non-serializable to avoid this issue in the future.
@c21 I can't think of a good way to directly unit test this. If it's okay with you, I'll merge this PR now since it's a release blocker, and if we come up with an effective test, I'll add it in a follow-up PR? Also, per @raulchen's suggestion, we could make |
…ct#41712) ray-project#41118 added an include_paths parameter to ParquetDatasource. As part of the PR, we pass an self._include_paths attribute to Parquet read tasks. As a result, the datasource (self) gets serialized with each read tasks. Normally, this isn't an issue, but if you're working with a large dataset (like in the failing release test), then the datasource is slow to serialize. This PR fixes the issue by removing the reference to self. Signed-off-by: Balaji Veeramani <balaji@anyscale.com>
…41725) #41118 added an include_paths parameter to ParquetDatasource. As part of the PR, we pass an self._include_paths attribute to Parquet read tasks. As a result, the datasource (self) gets serialized with each read tasks. Normally, this isn't an issue, but if you're working with a large dataset (like in the failing release test), then the datasource is slow to serialize. This PR fixes the issue by removing the reference to self. Signed-off-by: Balaji Veeramani <balaji@anyscale.com>
Why are these changes needed?
#41118 added an
include_paths
parameter toParquetDatasource
. As part of the PR, we pass anself._include_paths
attribute to Parquet read tasks:ray/python/ray/data/datasource/parquet_datasource.py
Lines 385 to 394 in e862ec2
As a result, the datasource (
self
) gets serialized with each read tasks. Normally, this isn't an issue, but if you're working with a large dataset (like in the failing release test), then the datasource is slow to serialize.This PR fixes the issue by removing the reference to
self
.Related issue number
Fixes #41390
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.