Git Product home page Git Product logo

superhero1991 / dali_pytorch_demo Goto Github PK

View Code? Open in Web Editor NEW

This project forked from yaysummeriscoming/dali_pytorch_demo

0.0 1.0 0.0 21 KB

Example code showing how to use Nvidia DALI in pytorch, with fallback to torchvision. Contains a few differences to the official Nvidia example, namely a completely CPU pipeline & improved memory usage

License: Apache License 2.0

Python 100.00%

dali_pytorch_demo's Introduction

DALI_pytorch_demo

Example code showing how to use Nvidia DALI in pytorch, with fallback to torchvision. Contains a few differences to the official Nvidia example:

  • Reimport DALI & recreate dataloaders at end of every epoch to reduce long term memory usage
  • Move CPU DALI pipeline completely to CPU, freeing up GPU resources
  • Keep DALI validation pipeline off GPU during training, reducing GPU memory usage

Compared to the official example, these mods allow for a ~50% increase in max batch size (tested using ResNet18 on a GCloud V100 instance with 10 workers:

Dataloader Type Max Batch Size
DALI GPU reference 640
DALI GPU 928 / 45% increase
DALI CPU reference 800
DALI CPU 1216 / 52% increase
Torchvision w/ PIL-SIMD 1248

Here are some benchmarks on a Google Cloud V100 instance with 12 vCPUs (6 physical cores), 78GB RAM, Apex FP16 training with Shufflenet V2 0.5 & batch size 512:

Dataloader Type Speed (images/s)
DALI GPU 3910
DALI CPU 1816
Torchvision w/ PIL-SIMD 1058

You can read the correspondig blog post here

dali_pytorch_demo's People

Contributors

yaysummeriscoming avatar

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.