Add configuration context to dataset#19907
Merged
ericl merged 17 commits intoray-project:masterfrom Nov 4, 2021
Merged
Conversation
jjyao
approved these changes
Nov 3, 2021
Contributor
jjyao
left a comment
There was a problem hiding this comment.
Wait for clark's approval as well.
python/ray/data/context.py
Outdated
Comment on lines
+33
to
+34
| if _default_context is None: | ||
| _default_context = DatasetContext(None, 500 * 1024 * 1024) |
Contributor
There was a problem hiding this comment.
Do we need to consider thread safety there?
Contributor
Author
There was a problem hiding this comment.
Yeah making all Dataset APIs thread safe is a good idea, fixed.
| target_max_block_size: int): | ||
| """Private constructor (use get_current() instead).""" | ||
| self.block_owner = block_owner | ||
| self.target_max_block_size = target_max_block_size |
Contributor
Author
There was a problem hiding this comment.
It will be in the next PR (can leave it for now).
scv119
approved these changes
Nov 4, 2021
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?
This adds a globally propagated configuration context to Dataset, where configs can be set on the driver and workers can retrieve them via singleton pattern. This avoids redundant plumbing of configuration / resources like the block owner through developer / public APIs, which may make API stability difficult to maintain.