Giter Club home page Giter Club logo

tiramisu's Introduction

MIT licensed

Overview

Tiramisu is a compiler for expressing fast, portable and composable data parallel computations. It provides a simple C++ API for expressing algorithms (Tiramisu expressions) and how these algorithms should be optimized by the compiler. Tiramisu can be used in areas such as linear and tensor algebra, deep learning, image processing, stencil computations and machine learning.

The Tiramisu compiler is based on the polyhedral model thus it can express a large set of loop optimizations and data layout transformations. Currently it targets (1) multicore X86 CPUs, (2) Nvidia GPUs, (3) Xilinx FPGAs (Vivado HLS) and (4) distributed machines (using MPI). It is designed to enable easy integration of code generators for new architectures.

Example

The user can write Tiramisu expressions within a C++ code as follows.

// C++ code with a Tiramisu expression.
#include "tiramisu.h"

void foo(int N, int array_a[N], int array_b[N], int array_c[N])
{

    tiramisu::init();

    // Declare an iterator and inputs
    tiramisu::iter i, j;
    tiramisu::in A(i,j), B(i,j);

    // Declare the Tiramisu expression (algorithm)
    tiramisu::comp C(i,j) = A(i,j) + B(i,j);
    
    // Specify optimizations
    C.parallelize(i).vectorize(j, 4);

    // Realize, compile and run the expression
    C.realize(tiramisu::int32_t, {N});
    C.compile({(A, array_a), (B, array_b), (C, array_c)});
    C.run();
}

Building Tiramisu

This section provides a short description of how to build Tiramisu. A more detailed description is provided in INSTALL. The installation instructions below have been tested on Linux Ubuntu (14.04) and MacOS (10.12) but should work on other Linux and MacOS versions.

Prerequisites

Required
  1. CMake: version 3.5 or greater.

  2. Autoconf and libtool.

Optional
  1. OpenMPI and OpenSSh: if you want to generate and run distributed code (MPI).
  2. CUDA Toolkit: if you want to generate and run CUDA code.

Building

  1. Get Tiramisu

     git clone https://github.com/Tiramisu-Compiler/tiramisu.git
     cd tiramisu
    
  2. Get and install Tiramisu submodules (ISL, LLVM and Halide). This step may take between few minutes to few hours (downloading and compiling LLVM is time consuming).

     ./utils/scripts/install_submodules.sh <TIRAMISU_ROOT_DIR>
    
  3. Optional: configure the tiramisu build by editing configure.cmake. Needed only if you want to generate MPI or GPU code, or if you want to run the BLAS benchmarks. A description of what each variable is and how it should be set is provided in comments in configure.cmake.

    • To use the GPU backend, set USE_GPU to true. If the CUDA library is not found automatically while building Tiramisu, the user will be prompt to provide the path to the CUDA library.
    • To use the distributed backend, set USE_MPI to true. If the MPI library is not found automatically, set the following variables: MPI_INCLUDE_DIR, MPI_LIB_DIR, and MPI_LIB_FLAGS.
  4. Build the main Tiramisu library

     mkdir build
     cd build
     cmake ..
     make -j tiramisu
    

Getting Started

Run Tests

To run all the tests, assuming you are in the build/ directory

make test

or

ctest

To run only one test (test_01 for example)

ctest -R 01

This will compile and run the code generator and then the wrapper.

To view the output of a test pass the --verbose option to ctest.

tiramisu's People

Contributors

rbaghdadi avatar psuriana avatar malekbr avatar jrayzero avatar abeakkas avatar bhafsa avatar emanueledelsozzo avatar isramekki avatar radjahachilif avatar

Watchers

James Cloos 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.