[data][train] Minor rework of get_dataset_shard#55825
Merged
Conversation
Signed-off-by: Justin Yu <justinvyu@anyscale.com>
…rk_get_dataset_shard
Contributor
There was a problem hiding this comment.
Code Review
This pull request refactors how dataset shards are provided to workers by introducing a DatasetShardProvider. This is a good abstraction that improves encapsulation. However, I've identified two critical regressions. First, the new implementation no longer evaluates callable datasets, which would break existing user code. Second, the TrainContext no longer correctly handles cases where no datasets are provided, which will lead to a runtime error. I've provided suggestions to fix both of these issues.
Signed-off-by: Justin Yu <justinvyu@anyscale.com>
…rk_get_dataset_shard
Signed-off-by: Justin Yu <justinvyu@anyscale.com>
Contributor
Author
|
release test to verify no regressions https://buildkite.com/ray-project/release/builds/54747 |
matthewdeng
approved these changes
Aug 22, 2025
jugalshah291
pushed a commit
to jugalshah291/ray_fork
that referenced
this pull request
Sep 11, 2025
Adds a slim wrapper around dataset shard iterators passed to each worker. --------- Signed-off-by: Justin Yu <justinvyu@anyscale.com> Signed-off-by: jugalshah291 <shah.jugal291@gmail.com>
dstrodtman
pushed a commit
that referenced
this pull request
Oct 6, 2025
Adds a slim wrapper around dataset shard iterators passed to each worker. --------- Signed-off-by: Justin Yu <justinvyu@anyscale.com> Signed-off-by: Douglas Strodtman <douglas@anyscale.com>
landscapepainter
pushed a commit
to landscapepainter/ray
that referenced
this pull request
Nov 17, 2025
Adds a slim wrapper around dataset shard iterators passed to each worker. --------- Signed-off-by: Justin Yu <justinvyu@anyscale.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.
Summary
Adds a slim wrapper around dataset shard iterators passed to each worker.
dataset_shardsdictionary access with a provider pattern that encapsulates dataset shard retrieval logicDatasetsSetupCallbackto returnDatasetShardProviderinstances instead of raw dataset shardsTrainContextand related classes to use the new provider patternDatasetShardMetadatawhich can be extended for more flexible dataset sharding configuration in the future.