Giter VIP home page Giter VIP logo

lessw2020 / alcop-artifact Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hgyhungry/alcop-artifact

0.0 0.0 0.0 52.58 MB

License: Apache License 2.0

Shell 0.77% JavaScript 0.05% C++ 38.76% Python 54.94% C 1.21% Objective-C 0.08% Java 0.68% Go 0.38% Rust 1.32% TypeScript 0.32% Objective-C++ 0.30% Cuda 0.06% Makefile 0.23% HTML 0.01% CMake 0.76% RenderScript 0.01% Batchfile 0.01% Cython 0.10%

alcop-artifact's Introduction

Auto-pipelining Test

Requirement

NVIDIA GPU Ampere generation or later (compute capability >= 80)

Build TVM framework

Build from Source

You can follow the standard TVM installation flow. Because auto-pipelining feature requires changes to TVM source, you need to build TVM from source following the instructions.

You can follow the steps below, and refer to https://tvm.apache.org/docs/install/from_source.html and https://tvm.apache.org/docs/install/from_source.html#python-package-installation for trouble-shooting. If you encounter errors, please file an issue.

Key steps

# start from an NVIDIA docker 
docker run -it --gpus all -v /path/to/this/repo:/tvm -w /tvm nvidia/cuda:11.4.0-cudnn8-devel-ubuntu20.04 bash

# inside the docker, install all the dependencies
apt-get update
apt-get install -y python3 python3-pip python3-dev python3-setuptools gcc libtinfo-dev zlib1g-dev build-essential cmake libedit-dev libxml2-dev git llvm
pip install numpy decorator attrs tornado psutil 'xgboost>=1.1.0' cloudpickle matplotlib torch pytest

# create build directory
mkdir build
cp cmake/config.cmake.template build/config.cmake

# build the TVM shared library
cd build
cmake ..
make -j8

# expose the TVM python directory to PYTHONPATH
export TVM_HOME=/tvm
export PYTHONPATH=$TVM_HOME/python:${PYTHONPATH}

Start from the prepared docker image

We prepare a docker image where everything is installed and you can directly start running the following steps. The image is build just using the scripts in the previous part.

docker run -it --gpus all -w /tvm hguyue1/alcop:latest bash

# inside the docker
export TVM_HOME=/tvm
export PYTHONPATH=$TVM_HOME/python:${PYTHONPATH} # to use tvm python package

The source code is in /tvm of the docker image. Environment variable TVM_HOME is also set to /tvm.

Check the auto-pipelining unit test

cd ${TVM_HOME}/auto_pipeline_exp/single_op
python3 dense_tensorcore_in_topi.py # baseline
python3 dense_tensorcore_autopipeline_example.py # optimized

Run the autotvm tuning script with auto pipelining integrated

cd ${TVM_HOME}/auto_pipeline_exp/single_op
sh run.sh

Design Details

  • TOPI template with support for pipelining and shared memory swizzling: tvm/python/tvm/topi/exp_cuda/*
  • Auto-pipelining program transformation pass: tvm/python/tvm/contrib/auto_pipeline.py

alcop-artifact's People

Contributors

anijain2305 avatar apivovarov avatar areusch avatar comaniac avatar icemelon avatar jroesch avatar junrushao avatar jwfromm avatar kazum avatar kevinthesun avatar laurawly avatar leandron avatar lixiaoquan avatar lunderberg avatar marisakirisame avatar masahi avatar mehrdadh avatar merrymercy avatar mousius avatar siju-samuel avatar srkreddy1238 avatar tkonolige avatar tmoreau89 avatar tqchen avatar vegaluisjose avatar vinx13 avatar wweic avatar yzhliu avatar zhiics avatar zihengjiang 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.