Gzip demo on Alveo card(U250)
Gzip demo on Alveo card(U250)
After the topic about pros and cons of the Alveo card, this is the topic to show example usecase of Alveo Card for high performance computing acceralation. This demo shall illustrate by a well known GZIP compression application on Linux OS. Gzip is an application to compress files on Linux. There are 2 significant factors when talking about this application which are size of compressed file and time consuming.
How to run the demo
DG’s Turnkey Accelerator System has pre-installed Xilinx’s Vitis Tools, XRT and Alveo package that ready to use.
To run the Gzip demo, it takes 7 processes starting with
1. Create a folder as a work location
2. Go to folder work location
3. Download the Xilinx’s demo project Github
git clone https://github.com/Xilinx/Vitis_Libraries.git
4. Go to the demo project in folder
5. Set the environment
6. Make Build the project
make build TARGET=hw DEVICE=u250
7. Make Run project
make run TARGET=hw DEVICE=u250
Note: Time taken in the make process depends on the performance of your system.
How to test?
We will compare the compression time and compressed file size of GZIP compression between Xilinx GZIP on Alveo Card and general gzip software on DG’s Turnkey Accelerator Systems.
Here is system specification of DG’s Turnkey Accelerator Systems (TKAS-D2101)
- Intel Gen 11th Core i7 Rocket Lake-S Processor with Deep Learning Boost AI acceleration and AVX-512 instruction set
- DDR4 3200MHz Memory 32GB
- Xilinx Alveo U250 Card
- 1 x NVMe SSD 512MB
- Tower Case with Thermaltake CPU Cooling Systems
- Pre-installed and ready to use
- Ubuntu 20.04 LTS Server
- Xilinx’s Vitis 2021.1 Tools
Here are detail of input files
Test file #1 A medical magnetic resonance image from silesia compression corpus http://sun.aei.polsl.pl/~sdeor/index.php?page=silesia. Size of the image is 10 MB
Test file #2 Symphony No.6 from https://filesamples.com/formats/wav . The music WAV file, 44100Hz sample rate and 1411 kbps bitrate. Size of the audio is 128.434 MB
Test file #3 ASCII text file from Linux’s syslog. Size of the text file is 415.760 MB
Test result of Gzip compression
Sys = refer to the time taken by the program in kernel mode (CPU usage)
User = refer to the time taken by the program in user mode (CPU usage)
Idle = refer to the total time by program minus (Sys+User) time (CPU idle)
As the graph above shows total time compression.
Test#1 uses the medical picture to compress. CPU spent 0.35 seconds to compress the picture while Xilinx Alveo card used 0.24 seconds to compress the same file. The result of Test#1 shows a slightly different time compression by Xilinx can compress the picture file faster than CPU only a second. Test#2 is compressing the music file by CPU takes almost three and half seconds to complete the task whereas Xilinx Gzip uses less than a second to finish the same task. It is 3 times faster than the CPU. How about compressing a text file. CPU still takes three seconds to finish but Xilinx Gzip takes approximately two and half seconds to complete the task.
The comparison table below show how well Xilinx Alveo card can offload tasks from CPU. Allow the same systems can handle more workload by adding Xilinx Alveo Card as Accellerator Card.
How about the file size after compress. From a 10 MB picture, CPU can compress it to 3.7 MB but Xilinx can make it at 3.9 MB. 0.2 MB is not a problem these days with high-capacity storage. For the music file, both of them zip it at 111.3 MB. On the text file case, the compressed file from CPU size is 31.3 MB meanwhile Xilinx Gzip can do at 46 MB. However both of them are able to reduce text files from 400 MB down to around 40 MB. That save a lot of space.
After all the tests, we can see that Hardware accelerator cards, like Xilinx Alveo, can bring benefits to users a lot. It saves time to compress files no matter how big the file is. On the compressed file size issue, it shows a little difference in small files. However, the compressed file size is up to the type of file.
if you are interested in Alveo card. please visit https://dgway.com/AcceleratorCards.html