2. Demonstrating GDS with GDSIO#

GDSIO is a benchmarking tool designed to leverage NVIDIA’s GPUDirect Storage (GDS) technology. Similar to the popular FIO utility, GDSIO allows users to configure various parameters such as block sizes, threads, read/write patterns, and interfaces. However, GDSIO is specifically focused on measuring the performance of GPU memory to storage transfers.

With GDSIO, users can evaluate throughput and latency metrics, enabling meaningful comparisons between different data transfer modes. Below, we provide examples to illustrate how GDSIO can be used to get started.

2.1. Examples#

Example 1: Basic GPU-to-Storage Write

The simplest GDSIO command performs a GPU-to-storage write operation. The following command writes 8 KB (-s 8K) of data from GPU 0 (-d 0) to the file /mnt/gds/test. The data is written in two 4 KB blocks (-i 4K), and the -I 1 flag specifies a single iteration.

/usr/local/cuda/gds/tools/gdsio -x 0 -d 0 -s 8K -i 4K -f /mnt/gds/test -I 1

IoType: WRITE XferType: GPUD Threads: 1 DataSetSize: 8/8(KiB) IOSize: 4(KiB) Throughput: 0.001081 GiB/sec, Avg_Latency: 14.000000 usecs ops: 2 total_time 0.007057 secs

This operation measures GPU-to-storage transfer performance. The reported throughput, latency, and total execution time provide insights into the efficiency of direct data transfer.

Example 2: Comparing GDS Mode to CPU-Mediated Transfers

To compare GPU-Direct transfers (GPUD) with traditional GPU ↔ CPU ↔ Storage transfers, simply switch to the -x 2 mode:

/usr/local/cuda/gds/tools/gdsio -x 2 -d 0 -s 8K -i 4K -f /mnt/gds/a -I 1

IoType: WRITE XferType: CPU_GPU Threads: 1 DataSetSize: 8/8(KiB) IOSize: 4(KiB) Throughput: 0.001127 GiB/sec, Avg_Latency: 40.000000 usecs ops: 2 total_time 0.006769 secs

This comparison highlights the efficiency of GDS by contrasting it with the added latency and slightly higher throughput of CPU-mediated transfers.

Example 3: Batch Mode for GPU Writes

Batch mode (-x 6) groups multiple small write operations into a single submission to improve efficiency. In this example, we write 8 KB (-s 8K) in batches of 10 entries (-w 10), each 4 KB in size (-i 4K). This configuration results in two batches, with a total of 20 I/O operations (2 batches × 10 I/Os per batch).

The next operation using the batch mode of GDS:

  • Batch mode (-x 6) will gather 10 entries (-w 10), each of size 4k (-i 4K) into a single group and submit a write. There are a total of two batches to generate the entire desired write size (-s 8K). The aggregate number of I/Os is 20 (2 batches * 10 I/Os per batch)

    /usr/local/cuda/gds/tools/gdsio -x 6 -d 0 -s 8K -i 4K -D /mnt/gds/dir -I 1 -w 10
    
    IoType: WRITE XferType: GPU_BATCH Threads: 1 IoDepth: 10 DataSetSize: 80/80(KiB) IOSize: 4(KiB) Throughput: 0.010523 GiB/sec, Avg_Latency: 3476.650000 usecs ops: 20 total_time 0.007250 secs
    

    This operation demonstrates the performance benefits of batching, showing improved throughput for grouped I/O operations. The directory contents are as follows to show 10 files, each of size 8K.

    ls -l /mnt/gds/dir
    
    total 80
    -rw-r--r-- 1 root root 8192 Dec  5 17:12 gdsio.0
    -rw-r--r-- 1 root root 8192 Dec  5 17:12 gdsio.1
    -rw-r--r-- 1 root root 8192 Dec  5 17:12 gdsio.2
    -rw-r--r-- 1 root root 8192 Dec  5 17:12 gdsio.3
    -rw-r--r-- 1 root root 8192 Dec  5 17:12 gdsio.4
    -rw-r--r-- 1 root root 8192 Dec  5 17:12 gdsio.5
    -rw-r--r-- 1 root root 8192 Dec  5 17:12 gdsio.6
    -rw-r--r-- 1 root root 8192 Dec  5 17:12 gdsio.7
    -rw-r--r-- 1 root root 8192 Dec  5 17:12 gdsio.8
    -rw-r--r-- 1 root root 8192 Dec  5 17:12 gdsio.9
    

Additional information on GDSIO can be found at GDSIO Benchmark.