[FEA] Add GPU support for NTILE [databricks] - #15417
Conversation
Signed-off-by: Gera Shegalov <gshegalov@nvidia.com>
Greptile SummaryAdds GPU acceleration for Spark’s NTILE window function.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart LR
A[Spark NTILE expression] --> B[GpuNTileMeta]
B --> C[GpuNTile replacement]
C --> D[Full-partition row count]
C --> E[Row number]
D --> F[Integer bucket arithmetic]
E --> F
F --> G[NTILE bucket result]
Reviews (2): Last reviewed commit: "Update generated support metadata for NT..." | Re-trigger Greptile |
Signed-off-by: Gera Shegalov <gshegalov@nvidia.com>
|
build |
|
Let's run the premerge CI including databricks just to be sure. |
|
build |
|
|
||
|
|
||
| def test_percent_rank_no_part_multiple_batches(): | ||
| def test_percent_rank_ntile_no_part_multiple_batches(): |
There was a problem hiding this comment.
Nit (non-blocking): Could we add @validate_execs_in_gpu_plan("GpuRunningWindowExec", "GpuCachedDoublePassWindowExec") to this forced-multibatch test and the corresponding single-part test below? That would ensure they keep exercising the intended memory-bounded physical plan, rather than only checking CPU/GPU result equivalence.
|
nit: this PR adds support for NTILE on GPU, and thus introduces a user-facing change. It also updates the document for the new NTILE support. The PR checklist about documentation should be fixed. |
Fixes #8626.
Description
Adds GPU acceleration for the NTILE window function by reusing the existing window replacement machinery. The replacement computes row_number and a full-partition count, then applies Spark-compatible integer bucket arithmetic, including partitions smaller than the requested bucket count.
GpuNTileMeta is a named meta class colocated with the GPU expression, following the convention tracked by #10838.
Testing on Spark 3.3.0 / Scala 2.12:
Performance was smoke-tested locally with the freshly built 26.10 jar using local[4]. The benchmark query was:
Each timed run collected the checksum after setting spark.rapids.sql.enabled to false or true. AQE was disabled, spark.sql.shuffle.partitions was set to 32, and medians used three alternating CPU/GPU iterations after one warmup. CPU median was 1.076 s and GPU median was 0.538 s, for a 2.00x speedup.
Checklists
Documentation
Testing
Performance