-
Notifications
You must be signed in to change notification settings - Fork 5.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[AIR] Deal with nested Chain in BatchPredictor #31407
Merged
amogkam
merged 5 commits into
ray-project:master
from
Yard1:nested_chain_batch_predictor
Jan 4, 2023
Merged
[AIR] Deal with nested Chain in BatchPredictor #31407
amogkam
merged 5 commits into
ray-project:master
from
Yard1:nested_chain_batch_predictor
Jan 4, 2023
Conversation
This file contains 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
Signed-off-by: Antoni Baum <[email protected]>
Signed-off-by: Antoni Baum <[email protected]>
Yard1
requested review from
clarkzinzow,
jiaodong,
bveeramani and
matthewdeng
as code owners
January 3, 2023 18:56
Yard1
requested review from
amogkam,
ericl,
scv119,
jjyao,
jianoaix and
c21
as code owners
January 3, 2023 18:56
amogkam
reviewed
Jan 3, 2023
Signed-off-by: Antoni Baum <[email protected]>
amogkam
reviewed
Jan 3, 2023
Thanks @Yard1! Lgtm, just couple minor comments about the type hints and keeping the signature exactly the same as the base class. |
Signed-off-by: Antoni Baum <[email protected]>
bveeramani
approved these changes
Jan 3, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
amogkam
approved these changes
Jan 3, 2023
AmeerHajAli
pushed a commit
that referenced
this pull request
Jan 12, 2023
BatchPredictor._determine_preprocessor_batch_format has a special case for Chain, where it obtains the first preprocessor contained within Chain in order to determine which transformation function to use for the dataset (as Chain doesn't implement any). However, with #29706 allowing for nested Chains, this check fails if the first preprocessor within a Chain is also a Chain. This PR removes this special case from BatchPredictor and instead subclasses _determine_transform_to_use inside Chain itself, which allows us to both deal with the nested Chain case and improve code structure. Signed-off-by: Antoni Baum <[email protected]>
tamohannes
pushed a commit
to ju2ez/ray
that referenced
this pull request
Jan 25, 2023
BatchPredictor._determine_preprocessor_batch_format has a special case for Chain, where it obtains the first preprocessor contained within Chain in order to determine which transformation function to use for the dataset (as Chain doesn't implement any). However, with ray-project#29706 allowing for nested Chains, this check fails if the first preprocessor within a Chain is also a Chain. This PR removes this special case from BatchPredictor and instead subclasses _determine_transform_to_use inside Chain itself, which allows us to both deal with the nested Chain case and improve code structure. Signed-off-by: Antoni Baum <[email protected]> Signed-off-by: tmynn <[email protected]>
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?
BatchPredictor._determine_preprocessor_batch_format
has a special case forChain
, where it obtains the first preprocessor contained withinChain
in order to determine which transformation function to use for the dataset (asChain
doesn't implement any). However, with #29706 allowing for nestedChain
s, this check fails if the first preprocessor within aChain
is also aChain
.This PR removes this special case from
BatchPredictor
and instead subclasses_determine_transform_to_use
insideChain
itself, which allows us to both deal with the nestedChain
case and improve code structure.Related issue number
Checks
git commit -s
) in this PR.scripts/format.sh
to lint the changes in this PR.