views:

4360

answers:

6

Does anyone know a project which implements standard compression methods (like Zip, GZip, BZip2, LZMA,...) using NVIDIA's CUDA library?

I was wondering if algorithms which can make use of a lot of parallel tasks (like compression) wouldn't run much faster on a graphics card than with a dual or quadcore CPU.

What do you think about the pros and cons of such an approach?


Edit: Removed the "TAR" (Copy&Paste mistake) as mentioned by martinus.

+2  A: 

Typically compression algorithms cannot make use of parallel tasks, it is not easy to make the algorithms highly parallelizeable. In your examples, TAR is not a compression algorithm, and the only algorithm that might be highly parallelizeable is BZIP because it is a block compression algorithm. Each block can be compressed separately, but this would require lots and lots of memory. LZMA does not work in parallel either, when you see 7zip using multiple threads this is because 7zip splits the data stream into 2 different streams that each are compressed with LZMA in a separate thread, so the compression algorithm itself is not paralllel. This splitting only works when the data permits this.

martinus
A: 

Encryption algorithms have been quite successful in this area, so you might want to look into that. Here is a paper related to CUDA and AES encryption:http://www.manavski.com/downloads/PID505889.pdf

Robert Gould
With a quick glance, that seems to accelerate encryption of each block. Doesn't help that block ciphers needs to be chained to avoid certain types of attacks. http://en.wikipedia.org/wiki/Block_cipher_modes_of_operation
Calyth
True that paper doesn't cover it but there is a paper in GPU gems a co- worker wrote about AES decription with shafer code, not Cuda, that does cover chaining. Unfortunately the article isn't on the web. Anyways chaining can be handled by the GPU
Robert Gould
+8  A: 

Not aware of anyone having done that and made it public. Just IMHO, it doesn't sound very promising.

As Martinus points out, some compression algorithms are highly serial. Block compression algorithms like LZW can be parallelized by coding each block independently. Ziping a large tree of files can be parallelized at the file level.

However, none of these is really SIMD-style parallelism (Single Instruction Multiple Data), and they're not massively parallel.

GPUs are basically vector processors, where you can be doing hundreds or thousands of ADD instructions all in lock step, and executing programs where there are very few data-dependent branches.

Compression algorithms in general sound more like an SPMD (Single Program Multiple Data) or MIMD (Multiple Instruction Multiple Data) programming model, which is better suited to multicore cpus.

Video compression algorithms can be accellerated by GPGPU processing like CUDA only to the extent that there is a very large number of pixel blocks that are being cosine-transformed or convolved (for motion detection) in parallel, and the IDCT or convolution subroutines can be expressed with branchless code.

GPUs also like algorithms that have high numeric intensity (the ratio of math operations to memory accesses.) Algorithms with low numeric intensity (like adding two vectors) can be massively parallel and SIMD, but still run slower on the gpu than the cpu because they're memory bound.

Die in Sente
My first thought of paralellizing was the ones with the "large tree of files", but the other reasons you mentioned have convinced me, thx.
Peter
A: 

What is CUDAS memory limitations? I.e. is 4K to 32K blocks to much for it to handle data in parallel, gzip can be compressed in parallel by not saving the dictionary between blocks, this increases the file size by ~5%. See. Dictzip for an example.

Erik Johansson
+3  A: 

See this stanford paper (part 4).

Mark Nottingham
Link is broken.
ChrisInEdmonton
From google cache: http://209.85.129.132/search?q=cache:USDSbeM0weAJ:ppl.stanford.edu/cs315a/pub/Main/CS315a/CUDA_Compression_Final_Report.pdf+/CUDA_Compression_Final_Report.pdf
Martin
A: 

obviously no one in this thread has heard of pbzip2 or pigz. google it.

duncan brown