splitTargetSizeInHalfGpu by data size if not target size#14684
splitTargetSizeInHalfGpu by data size if not target size#14684zpuller wants to merge 4 commits intoNVIDIA:mainfrom
Conversation
Signed-off-by: Zach Puller <zpuller@nvidia.com>
Signed-off-by: Zach Puller <zpuller@nvidia.com>
Signed-off-by: Zach Puller <zpuller@nvidia.com>
|
build |
Greptile SummaryThis PR fixes a no-op OOM-retry bug in both the GPU shuffle coalesce and join gather paths by adding a Confidence Score: 4/5Safe to merge; the core fix is correct and the two issues are edge-case regressions unlikely to surface in production. All findings are P2. The main concern is the removed element-count fallback in createSplitPolicyByTargetSize: for zero-byte tables, splitIndex stays 0 and concat([]) crashes rather than producing a handled OOM. The Long.MaxValue loop-exit trick is a minor style smell. Neither affects the primary happy-path fix. sql-plugin/src/main/scala/com/nvidia/spark/rapids/GpuShuffleCoalesceExec.scala — specifically the createSplitPolicyByTargetSize split loop and the removed element-count fallback. Important Files Changed
Sequence DiagramsequenceDiagram
participant Caller
participant withRetry
participant splitPolicy
participant splitTargetSizeInHalfInternal
Caller->>withRetry: AutoCloseableTargetSize(targetSize, minSize, dataSize)
withRetry->>Caller: attempt (targetSize)
Caller-->>withRetry: GpuSplitAndRetryOOM
withRetry->>splitPolicy: split(target)
splitPolicy->>splitTargetSizeInHalfInternal: target
alt dataSize > 0 AND dataSize <= targetSize/2
splitTargetSizeInHalfInternal-->>splitPolicy: newTarget = dataSize/2
else
splitTargetSizeInHalfInternal-->>splitPolicy: newTarget = targetSize/2
end
splitPolicy-->>withRetry: AutoCloseableTargetSize(newTarget, minSize, dataSize)
withRetry->>Caller: attempt (newTarget, smaller)
Caller-->>withRetry: success
withRetry-->>Caller: result
Reviews (2): Last reviewed commit: "pr comments" | Re-trigger Greptile |
Signed-off-by: Zach Puller <zpuller@nvidia.com>
|
build |
Fixes #14054.
Description
splitTargetSizeInHalfGpuis used as the split policy in both the GPU shuffle coalesce path and the join gather path (AbstractGpuJoinIterator). When OOM occurs, it halvestargetSizeand retries — but if the actual data is already smaller thantargetSize/2, this is a no-op and the retry will OOM again. The shuffle coalesce path had an element-count fallback for this case; the join path did not.This change moves the fallback logic into the split policy so it can be handled in a consistent way for both shuffle coalesce and join.
In the join case, we cannot discretely divide by elements in the same way as we don't have the full collection ahead of time, so we take a different approach that still accomplishes approximately the same goal; if the target size / 2 is > the total estimated data size, when the split would have previously failed/been a no-op, we instead choose the new target to be the estimated total data size / 2 instead of target size / 2.
Checklists
Documentation
Testing
(Please provide the names of the existing tests in the PR description.)
Performance