Add objects GC in dataset iterator - #34030
Merged
Merged
Conversation
β¦project#32493)" (ray-project#33485)" This reverts commit 5c79954.
jianoaix
requested review from
c21,
clarkzinzow,
ericl,
jjyao and
scv119
as code owners
April 3, 2023 23:39
jianoaix
commented
Apr 4, 2023
|
|
||
| check_no_spill(ctx, ds.repeat()) | ||
| check_no_spill(ctx, ds.window(blocks_per_window=20)) | ||
| check_to_torch_no_spill(ctx, ds.repeat()) |
Contributor
Author
There was a problem hiding this comment.
This will fail (i.e. have spilling) if without this PR.
Contributor
|
Nice find! |
ericl
approved these changes
Apr 5, 2023
c21
approved these changes
Apr 5, 2023
| block_iterator, stats, executor = ds._plan.execute_to_iterator() | ||
| ds._current_executor = executor | ||
| return block_iterator, stats | ||
| return block_iterator, stats, False |
Contributor
There was a problem hiding this comment.
shall we update the type hint at line 28 as well?
Comment on lines
+38
to
+45
| if epoch_pipeline._first_dataset is not None: | ||
| blocks_owned_by_consumer = ( | ||
| epoch_pipeline._first_dataset._plan.execute()._owned_by_consumer | ||
| ) | ||
| else: | ||
| blocks_owned_by_consumer = ( | ||
| epoch_pipeline._peek()._plan.execute()._owned_by_consumer | ||
| ) |
Contributor
There was a problem hiding this comment.
could you add a comment in code for why we need to do this?
jianoaix
commented
Apr 5, 2023
jianoaix
left a comment
Contributor
Author
There was a problem hiding this comment.
The pipelined_ingestion_1500_gb has been consistently passing: https://buildkite.com/ray-project/release-tests-pr/builds?branch=jianoaix%3Aiteratorgcblocks
Will wait the CI to pass and then merge.
| block_iterator, stats, executor = ds._plan.execute_to_iterator() | ||
| ds._current_executor = executor | ||
| return block_iterator, stats | ||
| return block_iterator, stats, False |
Comment on lines
+38
to
+45
| if epoch_pipeline._first_dataset is not None: | ||
| blocks_owned_by_consumer = ( | ||
| epoch_pipeline._first_dataset._plan.execute()._owned_by_consumer | ||
| ) | ||
| else: | ||
| blocks_owned_by_consumer = ( | ||
| epoch_pipeline._peek()._plan.execute()._owned_by_consumer | ||
| ) |
Contributor
Author
|
There is failure in python/ray/data/tests/test_dataset_consumption.py:: test_dataset_lineage_serialization_unsupported, but it's not relevant here. |
jianoaix
added a commit
to jianoaix/ray
that referenced
this pull request
Apr 6, 2023
* Revert "[Datasets] Revert "Enable streaming executor by default (ray-project#32493)" (ray-project#33485)" This reverts commit 5c79954. * Add objects GC in dataset iterator * test it * more tests * fix comment * add a little more memory as it's close to the limit and may make test flaky * feedback
elliottower
pushed a commit
to elliottower/ray
that referenced
this pull request
Apr 22, 2023
* Revert "[Datasets] Revert "Enable streaming executor by default (ray-project#32493)" (ray-project#33485)" This reverts commit 5c79954. * Add objects GC in dataset iterator * test it * more tests * fix comment * add a little more memory as it's close to the limit and may make test flaky * feedback Signed-off-by: elliottower <elliot@elliottower.com>
ProjectsByJackHe
pushed a commit
to ProjectsByJackHe/ray
that referenced
this pull request
May 4, 2023
* Revert "[Datasets] Revert "Enable streaming executor by default (ray-project#32493)" (ray-project#33485)" This reverts commit 5c79954. * Add objects GC in dataset iterator * test it * more tests * fix comment * add a little more memory as it's close to the limit and may make test flaky * feedback Signed-off-by: Jack He <jackhe2345@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why are these changes needed?
Fix: #33846
The DatasetIterator doesn't eagerly GC objects, which resulted in OOM of consumer nodes. The new consumer nodes that got brought up were not in sync with other healthy consumer nodes. The DatasetPipeline requires all consumers to read windows in sync, so this caused the pipeline to hang and then fail with timeout.
Related issue number
Checks
git commit -s) in this PR.scripts/format.shto lint the changes in this PR.method in Tune, I've added it in
doc/source/tune/api/under thecorresponding
.rstfile.