Giter VIP home page Giter VIP logo

tpp-mlir's Introduction

TPP MLIR

This is an experiment in using MLIR to automatically select the best Tensor Processing Primitives for linear algebra.

This repository contains an out-of-tree MLIR dialect as well as an opt-like tool to operate on that dialect and a runner-like tool to execute and benchmark MLIR kernels.

It also contains the recipes to use LIBXSMM from inside MLIR and can be used by other tools to drive our passes.

There's work in progress inside IREE to use this work on their pipeline.

This repository was previously called tpp-sandbox. If you have a checkout with the previous name, please follow these instructions to rename the remote locally.

Build Status

TPP build status

How to build LLVM

# Clone
git clone https://github.com/llvm/llvm-project.git
# Please check-out the llvm version in: build_tools/llvm_version.txt
mkdir llvm-project/build
pushd llvm-project/build

# This is important for the next step
export CUSTOM_LLVM_ROOT=`pwd`
echo $CUSTOM_LLVM_ROOT
export PATH=$CUSTOM_LLVM_ROOT/bin:$PATH

# Build
cmake -G Ninja ../llvm \
   -DLLVM_ENABLE_PROJECTS=mlir \
   -DLLVM_BUILD_EXAMPLES=ON \
   -DLLVM_INSTALL_UTILS=ON \
   -DLLVM_TARGETS_TO_BUILD="X86;NVPTX;AMDGPU" \
   -DCMAKE_BUILD_TYPE=RelWithDebInfo \
   -DLLVM_ENABLE_ASSERTIONS=ON \
   -DCMAKE_C_COMPILER=clang \
   -DCMAKE_CXX_COMPILER=clang++ \
   -DLLVM_USE_LINKER=lld
ninja 

popd

How to build TPP MLIR

This setup assumes that you have built LLVM and MLIR in $CUSTOM_LLVM_ROOT as above.

# Clone
git clone https://github.com/plaidml/tpp-mlir.git
mkdir tpp-mlir/build
pushd tpp-mlir/build

# Build & test
cmake -G Ninja .. \
   -DCMAKE_BUILD_TYPE=RelWithDebInfo \
   -DMLIR_DIR=$CUSTOM_LLVM_ROOT/lib/cmake/mlir \
   -DLLVM_EXTERNAL_LIT=$CUSTOM_LLVM_ROOT/bin/llvm-lit
cmake --build . --target check-tpp-opt

popd

To build the documentation from the TableGen description of the dialect operations, run:

cmake --build . --target mlir-doc

License

This dialect template is made available under the Apache License 2.0 with LLVM Exceptions. See the LICENSE.txt file for more details.

Note:

tpp-mlir's People

Contributors

adam-smnk avatar chelini avatar gmngeoffrey avatar hfp avatar jmgorius avatar kavithatipturmadhu avatar nicolasvasilache avatar rengolin avatar stephenneuendorffer avatar

Stargazers

 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.