Skip to content
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

Merged
merged 3 commits into from
Jul 15, 2024

Conversation

revans2
Copy link
Collaborator

@revans2 revans2 commented Jul 12, 2024

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 always throw an error. But we have a hasSideEffects method on all GpuExpressions, 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.

Signed-off-by: Robert (Bobby) Evans <bobby@apache.org>
@revans2
Copy link
Collaborator Author

revans2 commented Jul 12, 2024

build

@revans2
Copy link
Collaborator Author

revans2 commented Jul 12, 2024

build

@revans2
Copy link
Collaborator Author

revans2 commented Jul 12, 2024

permerge failed with #8418

@revans2
Copy link
Collaborator Author

revans2 commented Jul 12, 2024

build

Comment on lines 167 to 169
// 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)
Copy link
Member

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.

@revans2
Copy link
Collaborator Author

revans2 commented Jul 12, 2024

@jlowe I updated the comments please take another look.

@revans2
Copy link
Collaborator Author

revans2 commented Jul 12, 2024

build

@revans2 revans2 merged commit 0e308e1 into NVIDIA:branch-24.08 Jul 15, 2024
41 checks passed
@revans2 revans2 deleted the allow_more_tiered branch July 15, 2024 13:13
@sameerz sameerz added tech debt performance A performance related task/issue labels Jul 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance A performance related task/issue tech debt
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants