Giter Club home page Giter Club logo

fait's Introduction

FAIT: A Holistic Functionalization Approach to Optimizing Imperative Tensor Programs in Deep Learning

TensorSSA and For Loop Auto Parallel in long-tail. The architecture overview of FAIT is as follows:

arch_overview

Dependency

  • LibTorch
  • LibTorchVision

Build From Source

Linux

# install torch vision
git clone https://github.com/pytorch/vision.git
cd vision
git checkout release/2.0
mkdir build && cd build
cmake -DWITH_CUDA=ON .. && make && make install

# build pytorch from source
git clone https://github.com/pytorch/pytorch.git --recursive
git checkout v2.0.0
cd pytorch
python setup.py develop --user

# build source
git clone https://github.com/JimyMa/fait.git --recursive
cd fait
mkdir build && cd build
cmake -DCMAKE_PREFIX_PATH=`python -c 'import torch;print(torch.utils.cmake_prefix_path)' ` ..
make -j{$nproc}

Run the imperative tensor program using FAIT

We take the post-process of SSD as an example.

cd $PATH/OF/FAIT
# Step 1: Download features of SSD extracted by computer vision networks
mkdir -p feats; cd feats
https://github.com/JimyMa/FAIT/releases/download/V0.0.1/ssd_feat.pt

# Step 2: generate scripted graph of imperative tensor program
cd ../models
python ssd_bbox.py

# Step 3: run fait
cd ../build
./fait ../models/ssd_bbox.pt ../models/ssd_bbox.json ../feats/ssd_feat.pt
# Latency: 942.5us

# Step 4 (optional): run TorchScript nvfuser
./run_ts ../models/ssd_bbox.pt ../models/ssd_bbox.json ../feats/ssd_feat.pt
# Latency: 7.386ms (nvfuser backend)
# Latency: 2.053ms (nnc backend)

fait's People

Contributors

wzh99 avatar jimyma avatar

Stargazers

 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.