Accelerate Delta OPTIMIZE ... ZORDER BY on the GPU for OSS Delta 3.3–4.3 [databricks] #16759
All Vouch review confidence checks passed
Residual risk 0.17 = Change Risk (0.42) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.42 · 346 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.350
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #16759"
general
weight: 0.35
sdrp713
Fixes https://github.com/NVIDIA/cudf-spark/issues/16985.
Description
OPTIMIZE ... ZORDER BYon OSS Delta Lake 3.3–4.3 used to fall back to the CPU. This PR runs it on the GPU, using the existingGpuInterleaveBits,GpuHilbertLongIndexand range partition shuffle.GpuOptimizeTableCommand.GpuDeltaReorgTableCommand.validateZorderByColumns, so the errors match the CPU.Testing
Added CPU vs GPU tests in
delta_lake_optimize_table_test.py. They cover:They also compare the
ZOrderStats/ZOrderFileStatsmetrics. Local runs passed on Delta 4.1.0, 4.3.0 and 3.3.3.Also found https://github.com/NVIDIA/cudf-spark/issues/16946 when running tests.
Performance
Spark 4.1.1 + Delta 4.3.0, 8 workers, 3 runs per arm. CPU and GPU were given matched resources. The workload ran OPTIMIZE ... ZORDER BY on a Delta table of 100M rows in 256 small files, with maxFileSize set to 128 MB. Each run used a fresh shallow clone of a CPU written seed, so the CPU and GPU runs started from identical layouts. It covered four cases:
1. Z order on two columns (a bigint and an int hash), on an unpartitioned table.
2. The same two columns on a table partitioned 8 ways.
3. Four mixed columns (bigint, int, date and string), unpartitioned.
4. The two column case on a table with deletion vectors on every input file (about 1% of rows deleted).
| Case | CPU (s) | GPU (s) | Speedup | p-value |
|---|---|---|---|---|
| Unpartitioned, 2 columns | 11.5 | 5.3 | 2.16x | 0.011 |
| Partitioned, 2 columns | 11.3 | 10.0 | 1.13x | not significant |
| Unpartitioned, 4 mixed columns | 13.4 | 6.7 | 2.00x | 0.002 |
| DV table, 2 columns | 14.2 | 7.8 | 1.81x | 0.001 |
Checklists
Documentation
Testing
(Please provide the names of the existing tests in the PR description.)
Performance