dali-dynamic-mode
Installation
SKILL.md
DALI Dynamic Mode
Purpose
Guide AI agents in writing, reviewing, and migrating code that uses DALI's imperative dynamic-mode API, nvidia.dali.experimental.dynamic (ndd).
Instructions
- Import dynamic mode as
nvidia.dali.experimental.dynamic as nddand write code as directnddcalls in ordinary Python; do not use pipeline-mode APIs such asPipeline,@pipeline_def,pipe.build(), orpipe.run(). - Treat readers as stateful: create them once, reuse them across epochs, and pass
batch_sizetonext_epoch(...). - Pass explicit
batch_sizeto random ops; there is no pipeline-level batch size to inherit. - Use dynamic-mode API conventions:
device="gpu"instead of pipeline-mode"mixed",Batch.tensors[...]for sample selection, andBatch.slice[...]for per-sample slicing.
Prerequisites
- To run or validate code, NVIDIA DALI must be installed with dynamic mode importable as
nvidia.dali.experimental.dynamic. - GPU decode or GPU operators require a CUDA-capable DALI build and an available NVIDIA GPU/driver.
- Framework conversion examples require the target framework installed, such as PyTorch for
.torch().