MCPcopy Create free account
hub / github.com/Tiramisu-Compiler/tiramisu

github.com/Tiramisu-Compiler/tiramisu @V0.2

Chat with this repo
repository ↗ · DeepWiki ↗ · release V0.2 ↗ · + Follow
8,910 symbols 41,349 edges 1,230 files 3,926 documented · 44% updated 20mo agoV0.2 · 2018-07-26★ 96038 open issues

Browse by type

Functions 7,611 Types & classes 1,299
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

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 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.
    tiramisu::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;
    tiramisu::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

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`. Requires CUDA library to be installed on the system.
- 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.

Core symbols most depended-on inside this repo

Shape

Function 6,579
Class 1,107
Method 1,032
Enum 192

Languages

C71%
C++23%
Python6%

Modules by API surface

3rdParty/isl/isl_map.c762 symbols
3rdParty/isl/interface/isl.py467 symbols
3rdParty/isl/isl_aff.c371 symbols
3rdParty/isl/isl_union_map.c301 symbols
src/tiramisu_core.cpp257 symbols
3rdParty/isl/isl_scheduler.c256 symbols
3rdParty/isl/isl_tab_pip.c239 symbols
3rdParty/isl/isl_polynomial.c205 symbols
3rdParty/isl/isl_test.c174 symbols
3rdParty/isl/isl_schedule_node.c166 symbols
3rdParty/isl/isl_map_simplify.c158 symbols
3rdParty/isl/isl_output.c156 symbols

For agents

$ claude mcp add tiramisu \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page