8000 [Data] Make `from_items` lineage serializable by bveeramani · Pull Request #52026 · ray-project/ray · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[Data] Make from_items lineage serializable #52026

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

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

bveeramani
Copy link
Member
@bveeramani bveeramani commented Apr 6, 2025

Why are these changes needed?

This PR makes the following changes:

  • Removes subclasses of AbstractFrom and renames AbstractFrom to FromBlocks:
    • The subclasses were inconsistent; we'd subclass AbstractFrom for some APIs like from_pandas but not for other APIs like from_dask
    • The subclasses don't add any additional functionality 
  • Remove some test assertions that a specific logical operator is found in the dataset stats and telemetry
    • These tests are brittle; if we ever change the logical operators for those APIs, the tests will break
    • The tests test multiple things (telemetry correctness and API correctness); if telemetry breaks, so will the tests. Testing a small piece of functionality is a good practice
  • (Main change) defers ray.put of input blocks to execution time rather than when the user-facing API is called
    • This allows us to serialize datasets with from_items

These changes are needed so that you can tune over datasets that look like this: ray.data.from_items([{"path": ...}, ...]).map(load_path)

Related issue number

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 <bveeramani@berkeley.edu>
@bveeramani bveeramani requested a review from a team as a code owner April 6, 2025 06:24
@bveeramani bveeramani marked this pull request as draft April 6, 2025 06:24
Signed-off-by: Balaji Veeramani <bveeramani@berkeley.edu>
Signed-off-by: Balaji Veeramani <bveeramani@berkeley.edu>
Signed-off-by: Balaji Veeramani <bveeramani@berkeley.edu>
@bveeramani bveeramani marked this pull request as ready for review April 7, 2025 17:32
Copy link
Contributor
@alexeykudinkin alexeykudinkin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, some minor comments

class FromBlocks(LogicalOperator):
"""Logical operator for in-heap-memory (not object store) input data.

If you want to create a Dataset from in-object-store data, use the `InputData`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's reconcile naming consistent for operators, FromBlocks and InputData are too disjoint so far.

I'd suggest something along the lines FromBlocks and FromBlockRefs (or along these lines)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will address in follow-up since the rename might create a large diff

input_metadata: List[BlockMetadata],
):
super().__init__(self.__class__.__name__, [], len(input_blocks))
assert len(input_blocks) == len(input_metadata), (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's just pass a list of tuples

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will address in follow-up since this PR maintains the current interface

Signed-off-by: Balaji Veeramani <bveeramani@berkeley.edu>
Signed-off-by: Balaji Veeramani <bveeramani@berkeley.edu>
@bveeramani bveeramani enabled auto-merge (squash) April 7, 2025 22:16
@github-actions github-actions bot added the go add ONLY when ready to merge, run all tests label Apr 7, 2025
Signed-off-by: Balaji Veeramani <bveeramani@berkeley.edu>
@github-actions github-actions bot disabled auto-merge April 9, 2025 06:16
Signed-off-by: Balaji Veeramani <bveeramani@berkeley.edu>
@bveeramani bveeramani enabled auto-merge (squash) April 9, 2025 06:42
Copy link
github-actions bot commented Jun 8, 2025

This pull request has been automatically marked as stale because it has not had
any activity for 14 days. It will be closed in another 14 days if no further activity occurs.
Thank you for your contributions.

You can always ask for help on our discussion forum or Ray's public slack channel.

If you'd like to keep this open, just leave any comment, and the stale label will be removed.

@github-actions github-actions bot added the stale The issue is stale. It will be closed within 7 days unless there are further conversation label Jun 8, 2025
Copy link

This pull request has been automatically closed because there has been no more activity in the 14 days
since being marked stale.

Please feel free to reopen or open a new pull request if you'd still like this to be addressed.

Again, you can always ask for help on our discussion forum or Ray's public slack channel.

Thanks again for your contribution!

@github-actions github-actions bot closed this Jun 23, 2025
@bveeramani bveeramani reopened this Jun 23, 2025
@github-actions github-actions bot removed the stale The issue is stale. It will be closed within 7 days unless there are further conversation label Jun 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
go add ONLY when ready to merge, run all tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0