-
Notifications
You must be signed in to change notification settings - Fork 915
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
Refactor all AST-related APIs and internals including conditional joins and compute_column #8783
Conversation
… outstanding PR comments from PR rapidsai#8214.
…r to recompilation of AST-consuming code when AST internals change.
…iate shared mem story to account for nullability.
… exceed cudf limits.
Wow, the PR is huge!!! |
I agree, this PR is huge. Pretty much this exact mindset of not lumping too many changes into one PR is what led to this big PR because all of the upstream PRs were limited in scope to facilitate review. More than 90% of this PR is just moving code around, not new logic, so I felt more comfortable making a large one and providing the summary in the PR description. That said, I'm happy to try and split this up if @harrism and @hyperbolic2346 would prefer. I probably didn't do a perfect job of committing in a sequence that there's an exact correspondence between a subsets of commits and smaller, self-contained PRs, but it's probably close enough that some amount of cherry-picking and copy-pasting would get me there reasonably quickly. |
@@ -119,7 +119,7 @@ static void BM_ast_transform(benchmark::State& state) | |||
// Execute benchmark | |||
for (auto _ : state) { | |||
cuda_event_timer raii(state, true); // flush_l2_cache = true, stream = 0 | |||
cudf::ast::compute_column(table, expression_tree_root); | |||
cudf::compute_column(table, expression_tree_root); |
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.
Without the ast
namespace, compute_column
is an extremelty generic function name. If this is going to be in the top-level cudf
namespace, can the name be improved to better tell users what it does?
I don't know enough about AST to do a wonderful review. I started yesterday but then realized this is for 21.10. Just submitted my pending comments. Splitting it up, or providing a guide to what I should focus on would help. Unfortunately the diffs from github are not helpful in some files -- it is interleaving unrelated code. |
I'll give splitting this up a go and follow up. |
I think my original commits are atomic enough that I should be able to split this into multiple PRs (although unfortunately not entirely independent, so there will be some required sequence). I'm going to leave this PR as a draft for now so that there's a record of all the relevant work, then I'll close it once all of the subsequent associated PRs are completed and merged. |
This PR has a large changset, but most of the contents are just shuffling around already existing code to handle a number of previously existing tasks that we delayed to expedite work on our abstract syntax tree evaluator (#5494, #7418) and associated APIs (conditional joins (#8214, #5397) and column computation (#5494)). The changes include:
compute_column
API. Properly separating the parsing and evaluation of an expression helps deconvolute the code, reduce recompilation times when any AST-related files are touched, and helps easily delineate public and private APIs.ast/expressions.hpp
header), completely hiding all parsing and evaluation logic. Moving more code from headers to source files further improves the situation and also improves compilation times by reducing the dependence of public header files on private ones (e.g.ast/expressions.hpp
no longer requiresast/detail/operators.hpp
). Thecompute_column
function has now been moved totransform.hpp
.ast_plan
and thelinearizer
have been combined into one class, theexpression_parser
. The rename emphasizes the purpose of the class rather than the implementation details, and the combination helps remove a lot of otherwise superfluous accessors to the buffers created during parsing. We have no use case for parsing an expression on the host without moving to the device and the two were already effectively coupled internally, so this change manifests that reality in the class structure.