All Projects → Tiramisu-Compiler → Tiramisu

Tiramisu-Compiler / Tiramisu

Licence: mit
A polyhedral compiler for expressing fast and portable data parallel algorithms

Projects that are alternatives of or similar to Tiramisu

Casadi
CasADi is a symbolic framework for numeric optimization implementing automatic differentiation in forward and reverse modes on sparse matrix-valued computational graphs. It supports self-contained C-code generation and interfaces state-of-the-art codes such as SUNDIALS, IPOPT etc. It can be used from C++, Python or Matlab/Octave.
Stars: ✭ 714 (+4.23%)
Mutual labels:  library, code-generation, optimization
Libfirm
graph based intermediate representation and backend for optimising compilers
Stars: ✭ 305 (-55.47%)
Mutual labels:  compiler, optimization
Rascal
The implementation of the Rascal meta-programming language (including interpreter, type checker, parser generator, compiler and JVM based run-time system)
Stars: ✭ 284 (-58.54%)
Mutual labels:  compiler, code-generation
Swaggen
OpenAPI/Swagger 3.0 Parser and Swift code generator
Stars: ✭ 385 (-43.8%)
Mutual labels:  library, code-generation
Graphit
GraphIt - A High-Performance Domain Specific Language for Graph Analytics
Stars: ✭ 254 (-62.92%)
Mutual labels:  compiler, code-generation
Deepc
vendor independent deep learning library, compiler and inference framework microcomputers and micro-controllers
Stars: ✭ 260 (-62.04%)
Mutual labels:  compiler, deep-neural-networks
Mini C
Dr Strangehack, or: how to write a self-hosting C compiler in 10 hours
Stars: ✭ 372 (-45.69%)
Mutual labels:  compiler, code-generation
Hybridizer Basic Samples
Examples of C# code compiled to GPU by hybridizer
Stars: ✭ 186 (-72.85%)
Mutual labels:  compiler, optimization
Compiler
The Hoa\Compiler library.
Stars: ✭ 458 (-33.14%)
Mutual labels:  compiler, library
Llvm
Project moved to: https://github.com/llvm/llvm-project
Stars: ✭ 4,461 (+551.24%)
Mutual labels:  code-generation, optimization
Awesome Tensor Compilers
A list of awesome compiler projects and papers for tensor computation and deep learning.
Stars: ✭ 490 (-28.47%)
Mutual labels:  compiler, code-generation
flatorize
Generate fast implementations of mathematical expressions. Inclues a linear algebra library.
Stars: ✭ 18 (-97.37%)
Mutual labels:  linear-algebra, code-generation
linnea
Linnea is an experimental tool for the automatic generation of optimized code for linear algebra problems.
Stars: ✭ 60 (-91.24%)
Mutual labels:  linear-algebra, code-generation
Simpeg
Simulation and Parameter Estimation in Geophysics - A python package for simulation and gradient based parameter estimation in the context of geophysical applications.
Stars: ✭ 283 (-58.69%)
Mutual labels:  linear-algebra, optimization
Lfortran
Official mirror of https://gitlab.com/lfortran/lfortran. Please submit pull requests (PR) there. Any PR sent here will be closed automatically.
Stars: ✭ 220 (-67.88%)
Mutual labels:  compiler, library
Ojalgo
oj! Algorithms
Stars: ✭ 336 (-50.95%)
Mutual labels:  linear-algebra, optimization
Solid
🎯 A comprehensive gradient-free optimization framework written in Python
Stars: ✭ 546 (-20.29%)
Mutual labels:  library, optimization
Phplrt
PHP Language Recognition Tool
Stars: ✭ 127 (-81.46%)
Mutual labels:  compiler, library
One
On-device Neural Engine
Stars: ✭ 162 (-76.35%)
Mutual labels:  compiler, optimization
Teaching
Teaching Materials for Dr. Waleed A. Yousef
Stars: ✭ 435 (-36.5%)
Mutual labels:  linear-algebra, optimization

MIT licensed

Overview

Tiramisu is a compiler for expressing fast and portable 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 following is an example of a Tiramisu program specified using the C++ API.

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

void generate_code()
{
    // Specify the name of the function that you want to create.
    tiramisu::init("foo");

    // Declare two iterator variables (i and j) such that 0<=i<100 and 0<=j<100.
    var i("i", 0, 100), j("j", 0, 100);

    // Declare a Tiramisu expression (algorithm) that is equivalent to the following C code
    // for (i=0; i<100; i++)
    //   for (j=0; j<100; j++)
    //     C(i,j) = 0;
    computation C({i,j}, 0);
    
    // Specify optimizations
    C.parallelize(i);
    C.vectorize(j, 4);
    
    buffer b_C("b_C", {100, 100}, p_int32, a_output);
    C.store_in(&b_C);

    // Generate code
    C.codegen({&b_C}, "generated_code.o");
}

Building Tiramisu from Sources

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 18.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>
    
    • Note: Make sure <TIRAMISU_ROOT_DIR> is absolute path!
  3. Optional: configure the tiramisu build by editing configure.cmake. Needed only if you want to generate MPI or GPU code, run the BLAS benchmarks, or if you want to build the autoscheduler module. 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.
    • To build the autoscheduler module, set USE_AUTO_SCHEDULER to TRUE.
  4. Build the main Tiramisu library

     mkdir build
     cd build
     cmake ..
     make -j tiramisu
    
  5. If you want to build the autoscheduler module, set USE_AUTO_SCHEDULER to TRUE in configure.cmake, and after building Tiramisu :

     make tiramisu_auto_scheduler
    

Tiramisu on a Virtual Machine

Users can use the Tiramisu virtual machine disk image. The image is created using virtual box (5.2.12) and has Tiramisu already pre-compiled and ready for use. It was compiled using the same instructions in this README file.

Once you download the image, unzip it and use virtual box to open the file 'TiramisuVM.vbox'.

Once the virtual machine has started, open a terminal, then go to the Tiramisu directory

cd /home/b/tiramisu/

If asked for a username/password

Username:b
Password:b

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].