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

[Datasets] BlockPrefetcher not colocated with iterator #25323

Closed
matthewdeng opened this issue May 31, 2022 · 2 comments · Fixed by #25344
Closed

[Datasets] BlockPrefetcher not colocated with iterator #25323

matthewdeng opened this issue May 31, 2022 · 2 comments · Fixed by #25344
Assignees
Labels
bug Something that is supposed to be working; but isn't data Ray Data-related issues P0 Issues that should be fixed in short order

Comments

@matthewdeng
Copy link
Contributor

What happened + What you expected to happen

When calling Dataset.iter_batches(prefetch_blocks=1), I expect the _BlockPrefetcher actor to be colocated with the Actor that's calling iter_batches, so that the data is actually prefetched on the same node.

From the repro below, the _BlockPrefetcher is being placed on a different node.

image

Versions / Dependencies

Ray nightly

Reproduction script

import time

import ray
from ray.data import Dataset


@ray.remote
class InfiniteIterator:

    def iterate(self, ds: Dataset, batch_size=32):
        epoch = 0
        # while True:
        for i in range(2):
            batch_id = 0
            for batch in ds.iter_batches(batch_size=batch_size, prefetch_blocks=2):
                print(f"Epoch {epoch} batch {batch_id}.")
                batch_id += 1
                time.sleep(1)
            epoch += 1


def main():
    ds = ray.data.range(1000)
    iterator = InfiniteIterator.remote()
    ray.get(iterator.iterate.remote(ds))


if __name__ == "__main__":
    main()

Issue Severity

High: It blocks me from completing my task.

@matthewdeng matthewdeng added bug Something that is supposed to be working; but isn't P0 Issues that should be fixed in short order data Ray Data-related issues labels May 31, 2022
@clarkzinzow clarkzinzow changed the title [Data] BlockPrefetcher not colocated with iterator [Datasets] BlockPrefetcher not colocated with iterator May 31, 2022
@zhe-thoughts
Copy link
Collaborator

Thanks for reporting this @matthewdeng .

  • Is this affecting any existing production users?
  • Is this a regression from 1.12 (I suppose not, but confirming here)

@scv119 scv119 assigned scv119 and unassigned clarkzinzow May 31, 2022
@scv119 scv119 linked a pull request May 31, 2022 that will close this issue
6 tasks
@scv119
Copy link
Contributor

scv119 commented May 31, 2022

Seems a scheduling bug in Ray core, see details in #25329

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something that is supposed to be working; but isn't data Ray Data-related issues P0 Issues that should be fixed in short order
Projects
None yet
4 participants