
Robustness. Spilling the join state to CPU memory results in a
performance cli [
81
]. These sharp performance drops are dicult
to account for in query optimizers, because cardinality estimates can
be signicantly wrong [
28
,
87
]. Thus, GPU-enabled DBMSs must
gracefully scale to large data sizes for a consistent user experience.
Eciency. State-of-the-art approaches reduce interconnect trans-
fers by shifting computations from the GPU to the CPU [
42
,
44
,
113
,
134
,
140
]. However, both interconnect bandwidth and CPU
cycles are scarce resources. DBMSs should use the GPU to ooad
computations from the CPU, while maximizing performance.
A newly emerging technology, fast GPU interconnects, has the
potential to help us address the above challenges. Fast interconnects
provide GPUs with high-bandwidth, cache-coherent access to main
memory. Recent examples include NVLink 2.0 [
97
] and 4.0 [
53
],
Innity Fabric [6], and Compute Express Link 2.0 [31].
In this work, we investigate how fast interconnects can improve
GPU join throughput. Our goal is to enable GPUs to process joins
with a state that exceeds the GPU memory capacity. Thus, we
consider joins smaller and larger than the GPU memory. For large
joins, we partition data out-of-core in CPU memory using the fast
interconnect to achieve data locality during the join. In contrast,
small joins require us to cache all intermediate results in GPU
memory to avoid unnecessary data transfers. We combine the GPU-
based partitioning and the caching in our new,
h
ierarchical
h
ybrid
hash join algorithm:
3
H
+
≡ the Triton join.
Overall, our contributions are as follows:
(1)
We investigate the requirements of an out-of-core GPU join
in regard to fast interconnects, and identify hardware bottle-
necks that limit scalability (Section 3).
(2)
We propose a new GPU radix partitioning algorithm that
takes advantage of fast interconnects to achieve a high band-
width and scale to large data volumes (Section 4).
(3)
We present our new Triton join algorithm, a scalable radix-
partitioned GPU hash join that partitions data using the GPU
and caches partitioned data in GPU memory (Section 5).
The further structure of this paper is as follows. In Section 2,
we briey introduce modern GPU hardware and joins. Next, we
motivate our approach by revisiting out-of-core GPU joins in Sec-
tion 3. After that, we demonstrate our out-of-core radix partitioning
approach in Section 4, and then overcome these challenges with our
Triton join in Section 5. In Section 6, we show our evaluation and
discuss our insights. Finally, we review related work in Section 7
and conclude in Section 8.
2 BACKGROUND
In this section, we provide an overview of the hardware architecture
of a fast-interconnect system, and of hardware-sensitive joins.
2.1 GPUs and Fast Interconnects
Fast interconnects are able to connect a GPU and a CPU with high
bandwidth, a unied address space, and system-wide cache-coher-
ence [
6
,
58
,
97
,
104
]. As an example, we show the architecture of an
IBM AC922 system [
93
] with an IBM POWER9 CPU and an Nvidia
V100 GPU in Figure 2. Although we focus on NVLink 2.0, other
fast interconnects such as Compute Express Link [
31
], Innity Fab-
ric [6], and OpenCAPI [103] specify a similar system architecture.
Streaming
GPU
CPU
Core Core Core Core
Coalescing Unit
L1 Cache &
Scratchpad
L1
TLB
SM SM SM SM
L2 Cache
L2 TLB
IOMMU
Memory
Controller
IOTLB
Page Table Walkers
NVLink Processing Unit
GPU Mem
CPU Mem
High-Speed Hub
NVLink 2.0
Memory
Controller
MMU
75 GB/s
Memory
GB/s
170
GB/s
900
Multiprocessor
Registers
Figure 2: Hardware architecture of a system with a fast inter-
connect. The electrical bandwidths are annotated.
Overview. The system consists of one or more multi-core CPUs
and discrete GPUs. Each GPU is attached to a CPU by NVLink 2.0,
and has at least 16 GiB of on-board memory with 900 GB/s of
bandwidth [
97
]. Each CPU comes with up to 4 TiB of memory
attached at 170 GB/s [139].
GPU Architecture. GPUs such as Nvidia “Volta” [
27
,
97
] and
AMD “Vega” [
3
] execute threads in parallel on up to 84 streaming
multiprocessors (SM). Each SM schedules threads in hardware [
79
],
and provides up to 65 thousand registers to hide memory latencies
of up to 2 µs [
38
]. Each SM consists of 32–128 cores, on which 32
threads are physically executed together as a warp [
101
]. GPU pro-
gramming languages abstract multiple warps as a thread block [
5
,
101
]. Warps coalesce (i.e., group) adjacent memory accesses into a
single memory transaction to improve memory transfer eciency [
32
,
94
] and to reduce the memory address translation request rate [
118
].
The GPU caches memory accesses in its L1 and L2 caches [27].
Address Translation. CPUs and GPUs share a single address
space [
27
]. A program’s virtual addresses are translated into physi-
cal addresses on a memory access [
27
]. Translations are cached in
a hierarchy of translation lookaside buers (TLBs) [
126
]. Although
GPU vendors do not publish details, it is widely accepted that
“Pascal” and newer GPUs have two TLB levels [
61
,
64
,
65
,
69
,
75
].
The L1 TLB is private to each SM, while multiple SMs share a
L2 TLB [
10
,
69
]. In addition, CPU memory accesses are translated
by an I/O memory management unit (IOMMU) [21, 22, 27, 57]. The
IOMMU is part of the CPU and contains an IOTLB and 12 par-
allel page table walkers [
21
,
56
,
57
]. On a IOTLB miss, the page
table walkers fetch a translation from a page table stored as a radix
tree in CPU memory [
56
,
62
]. GPUs are able to coalesce page ta-
ble walks [
69
,
110
,
111
], and thus the IOMMU returns up to 16
translations at a time [
57
]. Both the GPU and the IOMMU support
4 KiB, 64 KiB and 2 MiB pages [
21
,
56
,
57
,
98
], and the IOMMU also
supports 1 GiB pages [21, 56].
NVLink 2.0. The GPU connects to the CPU at 75 GB/s in both
directions, for a total of 150 GB/s [
93
]. The connection is mediated
by a high-speed hub on the GPU [
96
], and an NVLink processing
unit on the CPU [
57
]. These units send and receive packets con-
sisting of a 16-byte header and 1–256 bytes of payload [
38
,
57
].
Small payloads incur additional overhead. Small reads are padded
to a 32-byte payload [
38
]. Small writes require a 16-byte “byte en-
able” header extension [
38
], that species which payload bytes to
write [
103
]. The GPU SMs support packets up to 128 bytes (i.e.,
an L1 cacheline [
65
,
71
]), and direct memory access copy engines
handle packets up to 256 bytes [
57
]. We calculate that the maximum
eective bandwidth is 62–65.7 GiB/s per direction.
Session 14: Modern Hardware and In-memory DBMS
SIGMOD ’22, June 12–17, 2022, Philadelphia, PA, USA
评论