Skip to content
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

Merged
merged 1 commit into from
Dec 8, 2023

Conversation

bveeramani
Copy link
Member

@bveeramani bveeramani commented Dec 7, 2023

Why are these changes needed?

#41118 added an include_paths parameter to ParquetDatasource. As part of the PR, we pass an self._include_paths attribute to Parquet read tasks:

ReadTask(
lambda f=fragments: _read_fragments(
block_udf,
to_batches_kwargs,
default_read_batch_size_rows,
columns,
schema,
f,
self._include_paths,
),

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

  • I've signed off every commit(by using the -s flag, i.e., git commit -s) in this PR.
  • I've run scripts/format.sh to lint the changes in this PR.
  • I've included any doc changes needed for https://docs.ray.io/en/master/.
    • I've added any new APIs to the API Reference. For example, if I added a
      method in Tune, I've added it in doc/source/tune/api/ under the
      corresponding .rst file.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failures at https://flakey-tests.ray.io/
  • Testing Strategy
    • Unit tests
    • Release tests
    • This PR is not tested :(

Signed-off-by: Balaji Veeramani <balaji@anyscale.com>
@bveeramani bveeramani marked this pull request as draft December 7, 2023 23:49
@bveeramani bveeramani marked this pull request as ready for review December 7, 2023 23:54
Copy link
Contributor

@c21 c21 left a 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!

@c21
Copy link
Contributor

c21 commented Dec 8, 2023

Is there a way to add a unit test to prevent the issue in the future?

@c21 c21 added the ray 2.9 Issues targeting Ray 2.9 release (~Q4 CY2023) label Dec 8, 2023
@c21
Copy link
Contributor

c21 commented Dec 8, 2023

This sounds to me a release blocker. We should cherry pick to prevent regression.

@c21 c21 added the release-blocker P0 Issue that blocks the release label Dec 8, 2023
@@ -390,7 +391,7 @@ def get_read_tasks(self, parallelism: int) -> List[ReadTask]:
columns,
schema,
f,
self._include_paths,
include_paths,
Copy link
Contributor

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.

@bveeramani
Copy link
Member Author

Is there a way to add a unit test to prevent the 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 ParquetDatasource non-serializable in the future.

@bveeramani bveeramani merged commit 039d67b into ray-project:master Dec 8, 2023
15 of 16 checks passed
@bveeramani bveeramani deleted the fix-release-test branch December 8, 2023 08:01
bveeramani added a commit to bveeramani/ray that referenced this pull request Dec 8, 2023
…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>
architkulkarni pushed a commit that referenced this pull request Dec 8, 2023
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ray 2.9 Issues targeting Ray 2.9 release (~Q4 CY2023) release-blocker P0 Issue that blocks the release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Release test torch_batch_inference_hetero_10tb_parquet failed
4 participants