Giter Site home page Giter Site logo

hsintao / dali Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nvidia/dali

0.0 1.0 0.0 40.55 MB

A library containing both highly optimized building blocks and an execution engine for data pre-processing in deep learning applications

Home Page: https://docs.nvidia.com/deeplearning/sdk/dali-developer-guide/index.html

License: Apache License 2.0

CMake 3.27% Dockerfile 0.07% C 4.86% C++ 81.92% Python 4.09% Cuda 5.18% Shell 0.60%

dali's Introduction

License Documentation

NVIDIA DALI

Today’s deep learning applications include complex, multi-stage pre-processing data pipelines that include compute-intensive steps mainly carried out on the CPU. For instance, steps such as load data from disk, decode, crop, random resize, color and spatial augmentations and format conversions are carried out on the CPUs, limiting the performance and scalability of training and inference tasks. In addition, the deep learning frameworks today have multiple data pre-processing implementations, resulting in challenges such as portability of training and inference workflows and code maintainability.

NVIDIA Data Loading Library (DALI) is a collection of highly optimized building blocks and an execution engine to accelerate input data pre-processing for deep learning applications. DALI provides both performance and flexibility of accelerating different data pipelines, as a single library, that can be easily integrated into different deep learning training and inference applications.

Key highlights of DALI include:

  • Full data pipeline accelerated from reading from disk to getting ready for training/inference
  • Flexibility through configurable graphs and custom operators
  • Support for image classification and segmentation workloads
  • Ease of integration through direct framework plugins and open source bindings
  • Portable training workflows with multiple input formats - JPEG, LMDB, RecordIO, TFRecord
  • Extensible for user specific needs through open source license

DALI and NGC

DALI is preinstalled in the NVIDIA GPU Cloud TensorFlow, PyTorch, and MXNet containers in versions 18.07 and later.

Installing prebuilt DALI packages

Prerequisites

  • Linux x64
  • NVIDIA Driver_ supporting CUDA 9.0 or later (i.e., 384.xx or later driver releases)
  • One or more of the following deep learning frameworks:
    • MXNet 1.3_ mxnet-cu90 or later
    • PyTorch 0.4_
    • TensorFlow 1.7_ or later

Installation

pip install --extra-index-url https://developer.download.nvidia.com/compute/redist nvidia-dali

Compiling DALI from source

Prerequisites

Linux x64
GCC 4.9.2_ or later
NVIDIA CUDA 9.0_ CUDA 8.0 compatibility is provided unofficially
nvJPEG library_ This can be unofficially disabled. See below
protobuf_
version 2 or later
(version 3 or later is required for TensorFlow TFRecord file format support)
CMake 3.5_ or later
libjpeg-turbo 1.5.x_ or later This can be unofficially disabled. See below
FFmpeg 3.4.2_ or later We recommend using version 3.4.2 compiled following the instructions below.
OpenCV 3_ or later
We recommend using version 3.4+, however previous versions are also compatible.
OpenCV 2.x compatibility is provided unofficially
(Optional) liblmdb 0.9.x_ or later
One or more of the following Deep Learni
  • MXNet 1.3_ mxnet-cu90 or
  • PyTorch 0.4_
  • TensorFlow 1.7_ or later
ng frameworks: later

Note

TensorFlow installation is required to build the TensorFlow plugin for DALI

Note

Items marked "unofficial" are community contributions that are believed to work but not officially tested or maintained by NVIDIA.

Note

This software uses code of FFmpeg licensed under the LGPLv2.1 and its source can be downloaded https://developer.download.nvidia.com/compute/redist/nvidia-dali/ffmpeg-3.4.2.tar.bz2

FFmpeg was compiled using the following command line:

./configure \
  --prefix=/usr/local \
  --disable-static \
  --disable-all \
  --disable-autodetect \
  --disable-iconv \
  --enable-shared \
  --enable-avformat \
  --enable-avcodec \
  --enable-avfilter \
  --enable-protocol=file \
  --enable-demuxer=mov,matroska \
  --enable-bsf=h264_mp4toannexb,hevc_mp4toannexb && \
  make

Get the DALI source

git clone --recursive https://github.com/NVIDIA/dali
cd dali

Make the build directory

mkdir build
cd build

Compile DALI

To build DALI without LMDB support:

cmake ..
make -j"$(nproc)"

To build DALI with LMDB support:

cmake -DBUILD_LMDB=ON ..
make -j"$(nproc)"

To build DALI using Clang (experimental):

Note

This build is experimental and it is not maintained and tested like the default configuration. It is not guaranteed to work. We recommend using GCC for production builds.

cmake -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang  ..
make -j"$(nproc)"

Optional CMake build parameters:

  • BUILD_PYTHON - build Python bindings (default: ON)
  • BUILD_TEST - include building test suite (default: ON)
  • BUILD_BENCHMARK - include building benchmarks (default: ON)
  • BUILD_LMDB - build with support for LMDB (default: OFF)
  • BUILD_NVTX - build with NVTX profiling enabled (default: OFF)
  • BUILD_TENSORFLOW - build TensorFlow plugin (default: OFF)
  • (Unofficial) BUILD_JPEG_TURBO - build with libjpeg-turbo (default: ON)
  • (Unofficial) BUILD_NVJPEG - build with nvJPEG (default: ON)

Install Python bindings

pip install dali/python

Getting started

The docs/examples_ directory contains a series of examples (in the form of Jupyter notebooks) highlighting different features of DALI. It also contains examples of how to use DALI to interface with deep learning frameworks.

Documentation for the latest stable release is available here. Nightly version of the documentation that stays in sync with the master branch is available here.

Additional resources

  • GPU Technology Conference 2018 presentation about DALI, T. Gale, S. Layton and P. Tredak: slides, recording.

Contributing to DALI

Contributions to DALI are more than welcome. To contribute to DALI and make pull requests, follow the guidelines outlined in the Contributing document.

Reporting problems, asking questions -----------------------------------

We appreciate any feedback, questions or bug reporting regarding this project. When help with code is needed, follow the process outlined in the Stack Overflow (https://stackoverflow.com/help/mcve) document. Ensure posted examples are: - minimal – use as little code as possible that still produces the same problem - complete – provide all parts needed to reproduce the problem. Check if you can strip external dependency and still show the problem. The less time we spend on reproducing problems the more time we have to fix it - verifiable – test the code you're about to provide to make sure it reproduces the problem. Remove all other problems that are not related to your request/question.

Contributors

DALI was built with major contributions from Trevor Gale, Przemek Tredak, Simon Layton, Andrei Ivanov, Serge Panev

dali's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.