Git Product home page Git Product logo

sync_bnorm's Introduction

SyncBatchNorm implementation

This project implements the synchronized batch normalization layer with forward/backward passes. It is compared with torch implementation on several benchmarks

Report

Solution details and experiments results are available in report.ipynb.

Benchmarking

BatchNorm benchmark

Direct comparison of custom and library versions with time/memory benchmarking are executed with

python bn_benchmark.py --size=<number of GPU> --norm_type=<selected_implementation custom or lib>

It runs forward/backward methods with hidden_size in [128, 256, 512, 1024] and batch_size in [32, 64].

Training benchmark

More complex full training pipelines supports more

python training_benchmark.py \
    --norm_type=<selected_implementation custom or lib> \
    --size=<number of GPU> \
    --batch_size=<selected batch size for training> \
    --grad_accum=<grad accumulation steps> \
    --n_epoch=<number of training epochs> \
    --run_val=<run validation epoch or not>
    

Tests

Correctness tests are provided in test_syncbn.py and can be run by

pytest .

sync_bnorm's People

Contributors

alexander4127 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.