Data Loading using Parallel Iterator

When we use a parallel iterator , when is the data actually fetched across actors?
eg:

it = ray.util.iter.from_items([1, 2, 3, 4], num_shards=2)

for item in it.gather_async:
     print(item)

the data is loaded across the shards in the first line itself, or when gather async is called data is fetched across shards.

1 Like

cc @amogkam Can you respond his question? Thank you!

from_items will eagerly shard the data. Operations on the iterator are done lazily.