You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have been experimenting with "immediate mode" shuffle, where we immediately repartition batches using interleave record batches to produce small batches per output partition and then use a BatchCoalescer to combine these small batches into larger batches before encoding.
I am creating this issue to capture lessons learned.
The main issue I am running into with this approach is higher peak memory due to allocator churn due to interleave creating so many small arrays. This approach uses 2x the peak memory of the buffered approach.
If I understand correctly, the current proposal is similar to gluten's hash shuffle writer (default behavior).
buffered-mode shuffle is similar to gluten's sort shuffle writer: insert batch -> add batches to a global buffer -> spilt by pid and evict to partition writer
immediate-mode shuffle is similar to gluten's hash shuffle writer: insert batch -> spilt and push to partition buffers -> evict partition buffer to parititon writer
According to the performance report at apache/gluten#6475, the performance of the two shuffle modes may be related to the number of partitions.
I am closing this as completed, since we did this experiment. Although it has benefits in some cases, it does not scale well with large number of output partitions due to the need to maintain builders or batch coalesces per output partition.
Activity
andygrove commentedon Mar 31, 2026
The main issue I am running into with this approach is higher peak memory due to allocator churn due to interleave creating so many small arrays. This approach uses 2x the peak memory of the buffered approach.
andygrove commentedon Mar 31, 2026
Gluten follows this approach:
This avoids a lot of intermediate allocations.
wForget commentedon Apr 3, 2026
If I understand correctly, the current proposal is similar to gluten's hash shuffle writer (default behavior).
According to the performance report at apache/gluten#6475, the performance of the two shuffle modes may be related to the number of partitions.
andygrove commentedon Apr 25, 2026
I am closing this as completed, since we did this experiment. Although it has benefits in some cases, it does not scale well with large number of output partitions due to the need to maintain builders or batch coalesces per output partition.