Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
edc51bd
Fix read_tfrecords_benchmark nightly test
jianoaix Dec 8, 2022
61f4d6d
Merge branch 'master' of https://github.com/ray-project/ray
jianoaix Dec 14, 2022
a33a943
Merge branch 'master' of https://github.com/ray-project/ray
jianoaix Dec 16, 2022
36ebe52
Merge branch 'master' of https://github.com/ray-project/ray
jianoaix Dec 16, 2022
ce6763e
Merge branch 'master' of https://github.com/ray-project/ray
jianoaix Dec 19, 2022
0e2c29e
Merge branch 'master' of https://github.com/ray-project/ray
jianoaix Dec 21, 2022
f2b6ed0
Merge branch 'master' of https://github.com/ray-project/ray
jianoaix Dec 22, 2022
bb6c5c4
Merge branch 'master' of https://github.com/ray-project/ray
jianoaix Jan 4, 2023
540fe79
Merge branch 'master' of https://github.com/ray-project/ray
jianoaix Jan 10, 2023
edad7d0
Merge branch 'master' of https://github.com/ray-project/ray
jianoaix Jan 10, 2023
60cc079
Merge branch 'master' of https://github.com/ray-project/ray
jianoaix Jan 11, 2023
a3d3980
Merge branch 'master' of https://github.com/ray-project/ray
jianoaix Jan 12, 2023
001579c
Merge branch 'master' of https://github.com/ray-project/ray
jianoaix Jan 17, 2023
8aeed6c
Merge branch 'master' of https://github.com/ray-project/ray
jianoaix Jan 18, 2023
7a9a49b
Merge branch 'master' of https://github.com/ray-project/ray
jianoaix Jan 19, 2023
ef97167
Merge branch 'master' of https://github.com/ray-project/ray
jianoaix Jan 20, 2023
6f0563c
Merge branch 'master' of https://github.com/ray-project/ray
jianoaix Jan 21, 2023
bcec4d6
Merge branch 'master' of https://github.com/ray-project/ray
jianoaix Jan 24, 2023
ddef4e5
Merge branch 'master' of https://github.com/ray-project/ray
jianoaix Jan 25, 2023
fc9a175
Merge branch 'master' of https://github.com/ray-project/ray
jianoaix Jan 25, 2023
f0e90b7
Merge branch 'master' of https://github.com/ray-project/ray
jianoaix Jan 26, 2023
999d1de
Merge branch 'master' of https://github.com/ray-project/ray
jianoaix Jan 26, 2023
d8159e3
Merge branch 'master' of https://github.com/ray-project/ray
jianoaix Jan 30, 2023
d81cd02
Merge branch 'master' of https://github.com/ray-project/ray
jianoaix Jan 31, 2023
bc831bb
Merge branch 'master' of https://github.com/ray-project/ray
jianoaix Jan 31, 2023
c444395
Merge branch 'master' of https://github.com/ray-project/ray
jianoaix Feb 2, 2023
642da6f
Merge branch 'master' of https://github.com/ray-project/ray
jianoaix Feb 3, 2023
f713f2f
Merge branch 'master' of https://github.com/ray-project/ray
jianoaix Feb 6, 2023
d416a73
Merge branch 'master' of https://github.com/ray-project/ray
jianoaix Feb 9, 2023
da5acee
Merge branch 'master' of https://github.com/ray-project/ray
jianoaix Feb 10, 2023
ab64cb6
Merge branch 'master' of https://github.com/ray-project/ray
jianoaix Feb 10, 2023
7a5d5e3
Merge branch 'master' of https://github.com/ray-project/ray
jianoaix Feb 11, 2023
47010ca
Merge branch 'master' of https://github.com/ray-project/ray
jianoaix Feb 13, 2023
b9fcb5f
Merge branch 'master' of https://github.com/ray-project/ray
jianoaix Feb 13, 2023
bfd724d
Enable streaming executor by default
jianoaix Feb 13, 2023
9baa73a
Merge branch 'master' of https://github.com/ray-project/ray into enab…
jianoaix Feb 16, 2023
e1d0df5
current resource usage
jianoaix Feb 16, 2023
94a88ee
parquet test: num computed
jianoaix Feb 16, 2023
c670a3b
resource limits
jianoaix Feb 16, 2023
2c608f4
Merge branch 'master' of https://github.com/ray-project/ray into enab…
jianoaix Feb 22, 2023
c5a6aa9
merge
jianoaix Feb 22, 2023
6c82ad2
fix treating numpy as block format
jianoaix Feb 22, 2023
4cbcbae
fix issues related to default dataset_format and partial execution in…
jianoaix Feb 22, 2023
82bc7a7
fix incorrect ownership resolution from bundle iter to blocklist
jianoaix Feb 22, 2023
7e31d52
unset the streaming flag
jianoaix Feb 22, 2023
c4b7f42
cleanup
jianoaix Feb 22, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion python/ray/data/_internal/execution/legacy_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,11 +266,13 @@ def bulk_fn(

def _bundles_to_block_list(bundles: Iterator[RefBundle]) -> BlockList:
blocks, metadata = [], []
owns_blocks = True
for ref_bundle in bundles:
if not ref_bundle.owns_blocks:
owns_blocks = False
for block, meta in ref_bundle.blocks:
blocks.append(block)
metadata.append(meta)
owns_blocks = all(b.owns_blocks for b in bundles)
return BlockList(blocks, metadata, owned_by_consumer=owns_blocks)


Expand Down
2 changes: 1 addition & 1 deletion python/ray/data/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -2825,7 +2825,7 @@ def iter_rows(self, *, prefetch_blocks: int = 0) -> Iterator[Union[T, TableRow]]
for batch in self.iter_batches(
batch_size=None, prefetch_blocks=prefetch_blocks, batch_format=batch_format
):
batch = BlockAccessor.for_block(batch)
batch = BlockAccessor.for_block(BlockAccessor.batch_to_block(batch))
for row in batch.iter_rows():
yield row

Expand Down
46 changes: 37 additions & 9 deletions python/ray/data/tests/test_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -1369,17 +1369,26 @@ def test_count_lazy(ray_start_regular_shared):

def test_lazy_loading_exponential_rampup(ray_start_regular_shared):
ds = ray.data.range(100, parallelism=20)
assert ds._plan.execute()._num_computed() == 0

def check_num_computed(expected):
if ray.data.context.DatasetContext.get_current().use_streaming_executor:
# In streaing executor, ds.take() will not invoke partial execution
# in LazyBlocklist.
assert ds._plan.execute()._num_computed() == 0
else:
assert ds._plan.execute()._num_computed() == expected

check_num_computed(0)
assert ds.take(10) == list(range(10))
assert ds._plan.execute()._num_computed() == 2
check_num_computed(2)
assert ds.take(20) == list(range(20))
assert ds._plan.execute()._num_computed() == 4
check_num_computed(4)
assert ds.take(30) == list(range(30))
assert ds._plan.execute()._num_computed() == 8
check_num_computed(8)
assert ds.take(50) == list(range(50))
assert ds._plan.execute()._num_computed() == 16
check_num_computed(16)
assert ds.take(100) == list(range(100))
assert ds._plan.execute()._num_computed() == 20
check_num_computed(20)


def test_dataset_repr(ray_start_regular_shared):
Expand Down Expand Up @@ -1696,7 +1705,14 @@ def to_pylist(table):
# Default ArrowRows.
for row, t_row in zip(ds.iter_rows(), to_pylist(t)):
assert isinstance(row, TableRow)
assert isinstance(row, ArrowRow)
# In streaming, we set batch_format to "default" because calling
# ds.dataset_format() will still invoke bulk execution and we want
# to avoid that. As a result, it's receiving PandasRow (the defaut
# batch format).
if ray.data.context.DatasetContext.get_current().use_streaming_executor:
assert isinstance(row, PandasRow)
else:
assert isinstance(row, ArrowRow)
assert row == t_row

# PandasRows after conversion.
Expand All @@ -1710,7 +1726,14 @@ def to_pylist(table):
# Prefetch.
for row, t_row in zip(ds.iter_rows(prefetch_blocks=1), to_pylist(t)):
assert isinstance(row, TableRow)
assert isinstance(row, ArrowRow)
# In streaming, we set batch_format to "default" because calling
# ds.dataset_format() will still invoke bulk execution and we want
# to avoid that. As a result, it's receiving PandasRow (the defaut
# batch format).
if ray.data.context.DatasetContext.get_current().use_streaming_executor:
assert isinstance(row, PandasRow)
else:
assert isinstance(row, ArrowRow)
assert row == t_row


Expand Down Expand Up @@ -2181,7 +2204,12 @@ def test_lazy_loading_iter_batches_exponential_rampup(ray_start_regular_shared):
ds = ray.data.range(32, parallelism=8)
expected_num_blocks = [1, 2, 4, 4, 8, 8, 8, 8]
for _, expected in zip(ds.iter_batches(batch_size=None), expected_num_blocks):
assert ds._plan.execute()._num_computed() == expected
if ray.data.context.DatasetContext.get_current().use_streaming_executor:
# In streaming execution of ds.iter_batches(), there is no partial
# execution so _num_computed() in LazyBlocklist is 0.
assert ds._plan.execute()._num_computed() == 0
Copy link
Contributor

Choose a reason for hiding this comment

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

This is basically disabling this test. How about we just force it to use bulk executor instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This assertion still has value as it checks that streaming execution didn't run LazyBlocklist.

else:
assert ds._plan.execute()._num_computed() == expected


def test_add_column(ray_start_regular_shared):
Expand Down