
a single kernel, resulting in a single pass over the data. Moreover,
we can even inline the decompression with query execution, re-
sulting in a single round-trip to the global memory for the whole
decompression step and query execution.
We call this tile-based decompression model which is inspired by
Crystal [
40
]. Tile-based decompression allows us to decode at close to
memory bandwidth speed, resulting in a very low decompression
overhead over the previous compression work for GPU. It also
eliminates the need for sophisticated compression planners used by
past works [
18
,
30
], since instead of balancing the trade-o between
decompression time and compression ratio, we can simply choose
the scheme with the best compression ratio — all schemes achieve
similar performance. To the best of our knowledge, this is the rst
paper to decompress cascaded compression schemes in a single
kernel pass and inline with the query execution.
2) Ecient Decompression of Bit-Packed Schemes
Besides the organization of dierent compression schemes, the
decompression speed of individual schemes is also limited in GPU
today. Prior works on CPU compression [16] have shown that bit-
aligned packing compression schemes manage to achieve better
compression ratio compared to byte- and word-aligned packing.
Supporting ecient bit-level packing in GPU is challenging due to
the SIMT programming model and the relatively limited instruction
set to perform bit-level alignment, which is not a problem in CPU
compression schemes due to more powerful CPU instructions.
In this paper, we design optimized bit-packing based compres-
sion schemes and their optimization techniques in the context of
GPU. Specically, we introduce three new bit-packing based com-
pression schemes:
GPU-FOR
does bit-packing in conjunction with
Frame-Of-Reference (FOR) and work well with uniform data and
can handle skew;
GPU-DFOR
uses delta encoding with bit-packing
and FOR, targeting sorted or semi-sorted data;
GPU-RFOR
uses RLE
encoding with bit-packing and FOR, targeting data with high av-
erage run length. These schemes are designed to oer improved
compression ratios while still being able to decode data in parallel
across thousands of threads at close to memory bandwidth speeds.
Overall, our compression schemes can be decoded 2.2
×
faster than
previous implementations.
We integrate the tile-based decompression model and
GPU-FOR
,
GPU-DFOR
, and
GPU-RFOR
into the Crystal framework [
40
], an open-
source highly optimized GPU data analytics engine. We encapsu-
late decompression into a device function that enables program-
mers to change a kernel operating on an uncompressed array to a
compressed column with a single line of code. Our compression
schemes target integer, decimal, and dictionary-encoded strings
and support all query operations that run on these data types. In
data analytics workloads, prior works [
14
,
34
,
40
] and commercial
systems [
7
] typically apply dictionary encoding on top of string
columns to encode them to integers.
In summary this paper makes the following contributions:
•
We introduce tile-based decompression, a decompression strategy
that allows us to decode the data in a single pass at close to
memory bandwidth speed and inline with query execution.
•
We present three optimized bit-packing based compression
schemes (
GPU-FOR
,
GPU-DFOR
, and
GPU-RFOR
) that can be used
to store data compactly on the GPU.
•
We present an integration of the decompression routines into
the Crystal framework and demonstrate ease of use.
•
We present an evaluation
1
on multiple synthetic benchmarks
and on the Star Schema Benchmark (SSB). On SSB, our schemes
can achieve similar compression rates to the best state-of-the-art
compression schemes in GPU (i.e., nvCOMP) while being 2.2
×
and 2.6
×
faster in decompression speed and query running time.
The rest of the paper is organized as follows: related work and
background are discussed in Section 2. We introduce the tile-based
decompression model in Section 3. We present the data format and
the unpacking implementation on the GPU for
GPU-FOR
,
GPU-DFOR
,
and
GPU-RFOR
in Section 4, 5, and 6 respectively. Section 7 discusses
the integration into Crystal. Section 8 discusses the usage and choice
of compression scheme, parameter, and other relevant discussion.
Section 9 evaluates the performance and compression ratio of our
approach against other schemes on GPU. Finally, we conclude in
Section 10.
2 BACKGROUND AND RELATED WORK
In this section, we review the basics of GPU architecture and de-
scribe past approaches to data compression on GPUs and CPUs.
2.1 GPU Architecture
Performance of database operations on GPU is bound by the mem-
ory subsystem (either shared or global memory) [
49
]. The lowest
and largest memory in the hierarchy is the global memory. A mod-
ern GPU can have global memory capacity of up to 80 GB with
memory bandwidth of up to 2000 GBps. Each GPU has a number
of compute units called Streaming Multiprocessors (SMs). Each SM
has a number of cores and a xed set of registers. Each SM also
has a shared memory (SMEM) which serves as a scratchpad that is
controlled by the programmer and can be accessed by all the cores
in the SM. Accesses to global memory from a SM are cached in the
L2 cache (L2 cache is shared across all SMs) and optionally also in
the L1 cache (L1 cache is local to each SM).
Processing on the GPU is done by a large number of threads
organized into thread blocks (each run by one SM). Thread block
size can vary from 32 to 1024 threads. Thread blocks are further
divided into groups of threads called warps (usually consisting of
32 threads). The threads of a warp execute in a Single Instruction
Multiple Threads (SIMT) model, where each thread executes the
same instruction stream on dierent data. The device groups global
memory loads and stores from threads in a single warp such that
multiple loads/stores to the same cache line are combined into a
single request. Maximum bandwidth can be achieved when a warp’s
accesses to global memory target neighboring locations.
The programming model allows users to explicitly allocate global
memory and shared memory. Shared memory has an order of mag-
nitude higher bandwidth than global memory (10 TBps vs. 900 GBps
on the Nvidia V100 GPU) but has much smaller capacity (a few MB
vs. multiple GB). Finally, registers are the fastest layer of the mem-
ory hierarchy. If a thread block needs more registers than available,
register values spill over to global memory.
1
The source code is available at https://github.com/anilshanbhag/gpu-compression
Session 19: Databases for Emerging Hardware
SIGMOD ’22, June 12–17, 2022, Philadelphia, PA, USA
评论