Commit 41129e5
authored
Add DBR 17.3 Delta CTAS/RTAS support and fix optimized writes [databricks] (NVIDIA#15320)
Fixes NVIDIA#15263
### Description
The initial Delta Lake write support for Databricks Runtime 17.3 kept
atomic CTAS and RTAS operations on CPU. In addition, DBR 17.3 optimized
writes could lose their target-partitioning marker during CPU-to-GPU
shuffle conversion, preventing the optimized-write exchange from being
reconstructed and resized correctly on GPU.
This PR enables the supported DBR 17.3 Delta CTAS/RTAS paths on GPU and
fixes the optimized-write shuffle conversion.
In this PR:
- Converts supported `AtomicCreateTableAsSelectExec` and
`AtomicReplaceTableAsSelectExec` plans to the corresponding GPU atomic
wrappers.
- Retains DBR’s native catalog, staged-table, commit, abort, cache
invalidation, and table-replacement semantics.
- Keeps the query and Delta data-file write path GPU-eligible inside the
atomic operation.
- Preserves `DeltaOptimizedWritePartitioning` as the target partitioning
while advertising the derived physical partitioning as the shuffle
output.
- Preserves optimized-write marker-local configuration overrides during
CPU-to-GPU conversion.
- Keeps the target and physical partitioning contracts consistent
through tree copies, explicit partition-count changes, and AQE
reconstruction.
- Adds structural plan validation based on the `DELTA_OPTIMIZED_WRITE`
shuffle origin, preventing unrelated GPU exchanges from satisfying the
optimized-write plan check.
- Adds focused conversion and AQE coverage for the DBR 17.3
optimized-write shuffle.
### Expected fallback behavior
The implementation continues to fall back to CPU for table-creation
features whose DBR metadata or catalog semantics have not been qualified
for the GPU create path, including:
- Row filters and column masks.
- Liquid clustering and auto-TTL.
- Catalog-owned tables and coordinated commits.
- Explicit or session-default deletion-vector creation settings that
require unsupported metadata handling.
When Delta optimized writes are enabled with AQE, the
`DELTA_OPTIMIZED_WRITE` exchange can run on GPU. With optimized writes
enabled and AQE disabled, DBR uses its non-AQE
`DeltaOptimizedWriterExec`; that path remains an expected CPU fallback.
### Performance
The scaled workload used:
- Databricks Runtime 17.3, Spark 4.0, and Scala 2.13.
- Eight `g4dn.4xlarge` T4 workers and a matching driver.
- A deterministic SF100-class Delta source with 452,433,852 rows across
12 source tables and 27.36 GB of compressed source data.
- Fourteen representative model-build transformations producing
425,795,424 final rows.
This is an SF100-class workload and is not an official TPC-DS SF100
benchmark.
#### GPU Delta writer benefit
Delta optimized writes were disabled in this comparison so that it
isolates the Delta writer change.
| Configuration | Delta writer | Fresh CTAS | Replacement RTAS |
| --- | --- | ---: | ---: |
| RAPIDS 26.06 release | CPU fallback | 138.819 s | 133.876 s |
| 26.08 SNAPSHOT CPU-writer control | CPU | 128.665 s | 126.982 s |
| 26.08 SNAPSHOT with this GPU write path | GPU | 92.874 s | 90.778 s |
Compared with the same-26.08 CPU-writer control, GPU Delta writing was:
- 1.385x faster for fresh table creation.
- 1.399x faster for replacement.
Compared with the RAPIDS 26.06 released behavior, it was:
- 1.495x faster for fresh table creation, a 33.1% wall-time reduction.
- 1.475x faster for replacement, a 32.2% wall-time reduction.
Physical-plan validation confirmed that the 26.06 run accelerated the
query operators but crossed through `GpuColumnarToRow` into CPU
`WriteIntoDeltaCommand`/`WriteFiles`. The 26.08 GPU result used the GPU
atomic wrapper and GPU Delta writer.
#### Delta optimized-write tradeoff
spark.databricks.delta.optimizeWrite.enabled=false/true using the build
jar from this PR.
| Delta optimized writes | Fresh median | Replacement median | Output
files |
| --- | ---: | ---: | ---: |
| Off | 95.724 s | 95.318 s | 2,004 |
| On, with AQE | 117.304 s | 116.041 s | 84 |
Enabling optimized writes increased write time by 22.5% for fresh
creation and 21.7% for replacement. In exchange, it reduced the output
from 2,004 files to 84 files, a 23.86x reduction.
This was not caused by CPU fallback: the optimize-on runs used GPU
atomic wrappers, GPU Delta writing, and GPU `DELTA_OPTIMIZED_WRITE`
exchanges. The additional time represents the actual repartitioning and
file-sizing work required to produce the more compact layout.
### Checklists
Documentation
- [ ] Updated for new or modified user-facing features or behaviors
- [x] No user-facing change
Testing
- [x] Added or modified tests to cover new code paths
- [ ] Covered by existing tests
(Please provide the names of the existing tests in the PR description.)
- [ ] Not required
Performance
- [x] Tests ran and results are added in the PR description
- [ ] Issue filed with a link in the PR description
- [ ] Not required
---------
Signed-off-by: Niranjan Artal <nartal@nvidia.com>1 parent 09482e5 commit 41129e5
23 files changed
Lines changed: 1705 additions & 226 deletions
File tree
- delta-lake/delta-spark400db173/src/main/scala/com
- databricks/sql/transaction/tahoe/rapids
- nvidia/spark/rapids/delta
- integration_tests/src/main/python
- sql-plugin/src/main
- scala
- com/nvidia/spark/rapids
- org/apache/spark/sql/rapids
- execution
- spark330db/scala
- com/nvidia/spark/rapids/shims
- org/apache/spark/sql/rapids/execution
- spark350db143/scala/org/apache/spark/sql/execution/datasources/v2/rapids
- spark400db173/scala
- com/nvidia/spark/rapids/shims
- org/apache/spark
- rapids/shims
- sql
- execution/datasources/v2/rapids
- rapids/execution
Lines changed: 250 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
0 commit comments