Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Benchmark Storage Systems for Generative AI Workloads

· 5 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

This guide explains how to benchmark storage systems specifically for generative AI workloads, covering the unique I/O patterns of model training, fine-tuning, and inference. You'll learn what metrics matter, how to design a realistic test, and how to interpret results to choose or tune storage for your AI pipeline.

What You'll Need

  • A storage system to test (local NVMe, network-attached storage, cloud volume, or parallel file system).
  • A client machine with enough CPU, RAM, and network bandwidth to avoid bottlenecking the test.
  • Benchmarking tools: fio for block-level tests, mdtest or ior for file metadata and POSIX I/O, and Python with PyTorch or TensorFlow for real workload simulation.
  • Access to representative data: a sample dataset similar in size and file count to your actual training data.
  • Monitoring tools (e.g., iostat, nvidia-smi, top) to capture system utilization during tests.

Step-by-Step

  1. Define your workload profile. Identify which phase you're benchmarking: training (large sequential reads/writes of checkpoints), data loading (many small random reads of images/text), or inference (low-latency reads of model weights). Write down the average file size, number of files, and access pattern (sequential vs. random, read vs. write ratio).
  2. Set up a clean test environment. Ensure the storage system is idle (no other jobs), and the client has enough resources. For network storage, verify the network link (e.g., 10GbE, 25GbE) and that no QoS policies are throttling the test.
  3. Run a baseline block-level test with fio. Create a job file that mimics your workload. For example, for random reads of 4KB files, use rw=randread, bs=4k, iodepth=32. Run for at least 60 seconds to get stable numbers. Record IOPS, throughput, and latency percentiles (p50, p99).
  4. Test metadata performance. Generative AI datasets often have millions of small files. Use mdtest to measure file creation, stat, and deletion rates. Run with a realistic number of directories and files (e.g., 100k files across 1k dirs).
  5. Simulate a real training data load. Write a Python script using PyTorch's DataLoader with your actual dataset or a representative subset. Measure the time to iterate through the dataset for one epoch. This captures the end-to-end impact of storage on GPU utilization (look for GPU idle time).
  6. Test checkpoint write and read. During training, models save checkpoints (often multi-GB files). Use fio with a single large file write (e.g., rw=write, bs=1M, size=10G) to measure sustained throughput. Then read it back to simulate resumption.
  7. Run the tests multiple times. At least three runs per configuration to account for variance. Use the median or average for comparison.
  8. Monitor system resources. During each test, record CPU, memory, network, and storage utilization. This helps identify if the storage is the bottleneck or if the client is.
  9. Analyze and compare. Create a table with your key metrics: throughput (MB/s), IOPS, latency, and time-to-epoch. Compare against your requirements (e.g., need to load 100GB in under 5 minutes).

Common Mistakes

  • Testing with too small a dataset. If the dataset fits in the OS page cache, you're measuring cache, not storage. Use files larger than the client's RAM.
  • Ignoring metadata. Many gen AI pipelines are metadata-bound. If you only test throughput, you'll miss that file creation is the bottleneck.
  • Using the wrong block size. For image data, 4KB reads are realistic; for checkpoint files, 1MB is better. Using a single block size for all tests misrepresents your workload.
  • Not warming up. Some storage systems have caches. Run a short warm-up (e.g., 10 seconds) before the timed test to get steady-state numbers.
  • Forgetting to measure GPU utilization. The ultimate goal is to keep GPUs busy. If storage is fast but the data pipeline is CPU-bound, you might optimize the wrong layer.

Tips

  • Use realistic concurrency. Match the number of worker processes to your training setup (e.g., 8 workers per GPU).
  • Test both peak and sustained performance. Some systems have bursty performance; sustained numbers matter for long training runs.
  • Include mixed read/write tests. Training often interleaves reads and writes (e.g., reading data while writing checkpoints). Use rw=rw in fio to simulate.
  • Check for consistency. Run a checksum on files after writing to ensure data integrity, especially on network storage.
  • Document everything. Record the exact tool versions, system config, and storage settings. Reproducibility is key.

Troubleshooting

  • Results are highly variable. Check for background jobs, network congestion, or other tenants on shared storage. Re-run during off-peak hours.
  • Throughput is lower than expected. Verify the client's network interface speed and that it's not negotiating at a lower rate. Check for packet loss with ping -f or iperf3.
  • Latency spikes. Look at the storage system's logs for garbage collection or compaction. For NVMe, check for thermal throttling.
  • fio reports errors. Ensure the test file path is writable and has enough space. Check dmesg for I/O errors.
  • Python data loader is slow. Profile with cProfile to see if it's storage or CPU. Try increasing num_workers and prefetch_factor in PyTorch.

Frequently Asked Questions

What is the most important metric for gen AI storage?

It depends on the phase. For training, sustained read throughput (MB/s) for data loading and write throughput for checkpoints are critical. For inference, latency (p99) matters most.

Should I benchmark with real data or synthetic?

Real data is best, but synthetic data that matches file size and count is acceptable. The key is to replicate the access pattern, not the content.

How long should each benchmark run?

At least 60 seconds for fio tests to reach steady state. For end-to-end data loading, run for at least one full epoch or 10 minutes, whichever is longer.

What is a good result?

There's no universal number. Compare against your workload requirements. For example, if you need to load 100GB in 10 minutes, you need at least 170 MB/s sustained throughput.

Can I benchmark cloud storage the same way?

Yes, but be aware of network latency and potential throttling. Run tests from a VM in the same region as the storage to minimize network effects.

Do I need to benchmark metadata separately?

Yes, especially if your dataset has many small files. Metadata performance often becomes the bottleneck before throughput does.