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] Fix duplicate execution in dataset.union #45238

Closed
wants to merge 1 commit into from

Conversation

liuxsh9
Copy link
Contributor

@liuxsh9 liuxsh9 commented May 10, 2024

Why are these changes needed?

When using dataset.union, we observed a duplicate execution, as demonstrated by the reproducing script and its execution timeline.

import ray
import time

def fun(batch):
    time.sleep(1)
    return batch

ray.init()
ds0 = ray.data.from_items([i for i in range(10)]).repartition(10)
ds0 = ds0.map_batches(fun, concurrency=1)

ds1 = ray.data.from_items([i for i in range(10)]).repartition(10)
ds1 = ds1.map_batches(fun, concurrency=1)

ds = ds0.union(ds1)
ds = ds.map_batches(fun, concurrency=1)
ds = ds.materialize()

3d4d2d74796a7322d41196de61535dfd

This PR aims to fix this issue. After:

30dcf69f5dea1105017f9bdf79e4034c

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: Xiaoshuang Liu <liuxiaoshuang4@huawei.com>
@anyscalesam anyscalesam added data Ray Data-related issues triage Needs triage (eg: priority, bug/not-bug, and owning component) labels May 14, 2024
@anyscalesam anyscalesam added P2 Important issue, but not time-critical and removed triage Needs triage (eg: priority, bug/not-bug, and owning component) labels May 30, 2024
@liuxsh9
Copy link
Contributor Author

liuxsh9 commented Jun 25, 2024

@anyscalesam Thanks to #45860 , the issue has been resolved. We can now close this.

@liuxsh9 liuxsh9 closed this Jun 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data Ray Data-related issues P2 Important issue, but not time-critical
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants