Code Monkey home page Code Monkey logo

tetris's Introduction

Tetris

Introduction

This project includes the source code of NIPS 2018 paper:

TETRIS: TilE-matching the TRemendous Irregular Sparsity

Please cite this paper if you use the code.

Documentation

Speedup

The 'speedup' folder contains code and result for speedup. To run this code, make sure tensorflow, pytorch and blocksparse (from OpenAI) are installed.

We have sparse and dense result for convolution and matrix multiplication. The sparse cases are based on blocksparse library with tensorflow. The baseline cases are based on pytorch because tensorflow does not support convolution without cudnn, and we plan to use cublas as baseline.

To get the results, just run the four python code in speedup folder. For conv_sparse.py, you should specify the configuration file (see example) as the command line argument.

Accuracy

The 'accuracy' folder contains code and configurations for accuracy. To run this code, make sure pytorch, torchvision are installed and run the following command to prune and fine-tune the model.

CUDA_VISIBLE_DEVICES=0 python -W ignore main.py /path/to/ImageNet/ "config.json" --arch=VGG16_bn --lr=1e-3 --batch-size=64 --prefix=VGG16_bn

You should specify the path to ImageNet dataset, the model architecture used (in torchvision), and the pruning configurations (the json file, see example).

We have provide many configuration files (all the json files). It provide the block size for each dimension of each layer and the pruning rates.

Important notes

Pruning codes are implemented on GPU. It takes about 1 minute and 12GB GPU memory to prune VGG16. Make sure your GPU device provides enough memory.

tetris's People

Contributors

ji-u 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.