-
Notifications
You must be signed in to change notification settings - Fork 234
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
Allow more expressions to be tiered [databricks] #11179
Conversation
Signed-off-by: Robert (Bobby) Evans <bobby@apache.org>
build |
build |
permerge failed with #8418 |
build |
// We don't strip off the first condition expression because it is the only one | ||
// that is guaranteed to be executed. | ||
c.branches.map(_._1) |
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.
The case above only looks at the very first expression of the first branch, but this grabs the predicate expression of all branches. These are not guaranteed to be executed when there's side effects, as it will short-circuit sometimes in such a way that some of the branch predicates will never be evaluated. Sort of like the GpuIf case, don't we want to be examining whether the branch predicate expressions have side effects?
Comment mentions "the first condition expression" but this grabs all conditional expressions which is confusing.
@jlowe I updated the comments please take another look. |
build |
This is part of some work I am doing to be able to combine multiple expressions together into a single kernel. But this was large enough that I thought I should do it separately.
Essentially this comes down to that we are being very conservative in doing tiered projects. We assume that all expressions could throw an exception so we have to have rules that deal with conditional expressions so we don't accidentally rewrite something like
if(never going to happen, throw an error, it is all good)
to alwaysthrow an error
. But we have ahasSideEffects
method on allGpuExpression
s, which is used in the conditionals code to avoid these same situations. This updates the tiered expression code to only be conservative in cases where it is warranted.