Repository navigation
[GPU] Device-side filters - #128777
Closed
scanhex12 wants to merge 1 commit into
Closed
[GPU] Device-side filters#128777scanhex12 wants to merge 1 commit into
scanhex12 wants to merge 1 commit into
Conversation
`GPUFilterCompiler` compiles a predicate of an `ActionsDAG` - comparisons of numeric, `Date`, `Date32` and `DateTime` columns with each other and with constants, `and`, `or` and `not` - into a `GPUFilterProgram`, a short program of registers, and `GPUFilter.cuh` evaluates such a program for a row on the device. `compileGPUExpression` compiles a `Float64` computed by `plus`, `minus`, `multiply` and `divide` into one as well. Nothing uses them yet: they are for the aggregations and reads on the GPU to filter rows on the device.
scanhex12
marked this pull request as draft
November 2, 2026 23:06
Contributor
|
Workflow [PR], commit [cbb4892] Summary: ❌
|
Member
Author
|
I'll try to use JIT compilation to escape the creation another pipeline executor |
Blargian
pushed a commit
to Blargian/ClickHouse
that referenced
this pull request
Nov 10, 2026
…to PTX The device evaluates a predicate or an expression over the columns of a row with the code that the functions of ClickHouse compile into for the CPU, rather than with a second implementation of their semantics. `GPUExpressionCompiler` builds the `CompileDAG` of an output of `ActionsDAG`, as the CPU's JIT does, and emits a kernel around `CompileDAG::compile`, a thread for each row, that LLVM's NVPTX target turns into PTX for the device's architecture. An expression with a function that does not compile, or with a `Nullable` column, is refused, with the reason. A predicate's kernel writes the null mask of cuDF directly, by `vote.ballot.sync`; an expression's kernel writes a `Float64` for each row. The PTX is kept by the hash of the expression, and `GPUExpression.cpp` loads it once, with `cudaLibraryLoadData`, and runs it with `cudaLaunchKernel`. - A string or `Decimal` constant compared with a column is converted to the column's type and the comparison rebuilt for it: `d < '1994-01-01'`. - `FunctionComparison` compiles a comparison of two dates of the same type, `Date`, `Date32` or `DateTime`, as the integers that hold them, which the CPU's JIT gains as well. - The bundled LLVM builds its NVPTX target with `ENABLE_GPU`, which now requires `ENABLE_EMBEDDED_COMPILER`. Related: ClickHouse#119502 Related: ClickHouse#128777
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.
Changelog category (leave one):
Workflow [PR]
Sync PR [sync-upstream/pr/128777]