whatisgithub

What is dali?

nvidia/dali — explained in plain English

Analysis updated 2026-06-26

5,691C++Audience · developerComplexity · 3/5Setup · moderate

In one sentence

NVIDIA's GPU-accelerated data loading library that speeds up AI training by moving image, video, and audio preprocessing from CPU to GPU, plugs into PyTorch, TensorFlow, and PaddlePaddle as a drop-in replacement.

Mindmap

mindmap
  root((DALI))
    What it does
      GPU data loading
      Decode and transform
      Parallel prefetch
    Supported formats
      Images JPG PNG
      Video H264
      Audio WAV FLAC OGG
    Frameworks
      PyTorch
      TensorFlow
      PaddlePaddle
    How to use
      Python pipeline API
      Dynamic mode
      Custom steps
    Getting started
      pip install
      NVIDIA containers
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Speed up image classification training by offloading resize, crop, and decode steps to the GPU instead of the CPU.

USE CASE 2

Load and preprocess video datasets for action recognition models without a CPU bottleneck slowing things down.

USE CASE 3

Replace the default data loader in a PyTorch or TensorFlow training script to make GPU utilization jump from 60% to near 100%.

USE CASE 4

Build a custom audio preprocessing pipeline for speech recognition models using DALI's extensible Python API.

What is it built with?

C++PythonCUDAPyTorchTensorFlowPaddlePaddle

How does it compare?

nvidia/dalicnr-isti-vclab/meshlabtencent/libpag
Stars5,6915,6755,672
LanguageC++C++C++
Setup difficultymoderatemoderatemoderate
Complexity3/53/53/5
Audiencedeveloperresearcherdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 30min

Install via pip (nvidia-dali package) or use NVIDIA's official PyTorch/TensorFlow container images where it comes pre-bundled. Requires a CUDA-capable NVIDIA GPU.

Open source, free to use and modify. Check the repo for the exact license terms.

So what is it?

DALI, the NVIDIA Data Loading Library, is a tool for speeding up the stage of AI model training that happens before the model itself sees any data. When training an AI system to recognize images or understand audio, a large amount of work goes into preparing the raw data first: loading files from disk, decoding compressed images or audio, cropping, resizing, normalizing values, and applying random variations to make the model more general. Traditionally this preparation runs on the CPU and often becomes the slowest step, leaving the GPU waiting. DALI moves that preparation work to the GPU, running the decoding and transformation steps there instead. It also handles tasks like loading data in advance before the current batch finishes processing, running multiple operations in parallel, and processing many samples at once. From the developer's perspective this machinery runs in the background without requiring extra code to manage. The library supports a wide range of file formats including common image types, video encoded with H.264 and other codecs, and audio formats like WAV, FLAC, and OGG. It connects to the three most widely used AI training frameworks, TensorFlow, PyTorch, and PaddlePaddle, and is designed to slot in as a drop-in replacement for the data loading code those frameworks already provide. On the code side, DALI offers a Python API where you define a pipeline by calling functions that describe the steps, and the library figures out how to run them efficiently. There is also a newer dynamic mode that looks more like ordinary Python loops. Custom processing steps can be added for cases the library does not cover out of the box. It is open source, installable via pip, and comes pre-bundled in the official NVIDIA container images for TensorFlow and PyTorch. The full README is longer than what was shown.

Copy-paste prompts

Prompt 1
I'm training a PyTorch image classifier and my GPU sits idle waiting for data. Show me how to replace my existing DataLoader with NVIDIA DALI to move preprocessing to the GPU.
Prompt 2
Using NVIDIA DALI, write a pipeline that loads JPEG images from a folder, randomly crops and flips them, normalizes pixel values, and returns batches ready for a TensorFlow model.
Prompt 3
I have a video dataset in H.264 format. Write a DALI pipeline that decodes the videos, samples frames, and feeds them into a PyTorch training loop.
Prompt 4
Show me how to add a custom preprocessing step in NVIDIA DALI's Python API for a transformation the library doesn't support out of the box.
Prompt 5
Explain how DALI prefetching and parallel execution work, and show a minimal example that demonstrates the performance difference vs standard CPU preprocessing.

Frequently asked questions

What is dali?

NVIDIA's GPU-accelerated data loading library that speeds up AI training by moving image, video, and audio preprocessing from CPU to GPU, plugs into PyTorch, TensorFlow, and PaddlePaddle as a drop-in replacement.

What language is dali written in?

Mainly C++. The stack also includes C++, Python, CUDA.

What license does dali use?

Open source, free to use and modify. Check the repo for the exact license terms.

How hard is dali to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is dali for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.