Skip to content

BoiseState-AdaptLab/CodeSynthesis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CodeSynthesis

Authors: Tobi Popoola, Flo Ciaglia, Catherine Olschanowsky

Overview

This is a research piece for generating inspector/executor code for sparse format conversion.

Build Instructions

git clone https://github.com/BoiseState-AdaptLab/CodeSynthesis
cd CodeSynthesis
mkdir build/
cd build/
cmake ../
make

Running Synthesis

We currently have preloaded format descriptions for COO, CSR, DIA,ELL, MORTONCOO, COO3D, MCOO3D more formats will be added

cd build
./bin/CodeSynthesis_Driver -src <formatname>,<dataName> -dest <formatName>,<dataName>\
[-fuse <statement-list-delimited-by-comma> -fuselevel <level>] [-known "<set>"]\
[-recipe <file>]

Driver generates synth.h and synth.c files which can be compiled / added to a pre-existing project.

Optimization options

Fuse Syntax:

Example S0: {[0,i,0,j,0] | stuff}; S1:{[1,i,0,j,0] | stuff}

Option: -fuse S0,S1 -fuselevel 2

for (i to ..)
   for (j to ..)
      S0

for (i to ..)
   for (j to ..)
      S1

Result S0: {[0,i,0,j,0] | stuff}; S1:{[0,i,1,j,0] | stuff}

for (i to ..)
   for (j to ..)
      S0
      S1

Constraint simplification:

option: -known ""

The iteration space explores constraints that are true and not needed to be generated

Recipe :

File should be formatted as follows

[statmentId] [Relation] 
[statmentId] [Relation]

File can take an arbitrary list of transformations to apply to a statement Id.

The transformation should be applied to the padded execution schedule of the resulting computation. This can be inspected using the polyhedral data flow graph or the code generated by the synthesis work.

Examples

COO TO CSR + Fusion

cd build
./bin/CodeSynthesis_Driver -src COO,ACOO -dest CSR,ACSR  -fuse 0,1 -fuselevel 1

COO TO CSC + Fusion

cd build
./bin/CodeSynthesis_Driver -src COO,ACOO -dest CSC,ACSC -fuse 2,3,4,6 -fuselevel 2

COO3D TO MCOO3D + Fusion

cd build
./bin/CodeSynthesis_Driver -src 3DCOO,A3DCOO -dest 3DMCOO,A3DMCOO -fuse 2,3,4,5 -fuselevel 2

CSR TO DIA

cd build
./bin/CodeSynthesis_Driver -src CSR,ACSR -dest DIA,ADIA

CSR TO CSC + FUSION

cd build
./bin/CodeSynthesis_Driver -src CSR,ACSR -dest CSC,ACSC -fuse 2,3,4,6 -fuselevel 2

CSC TO DIA

cd build
./bin/CodeSynthesis_Driver -src CSC,ACSC -dest DIA,ADIA

ELL To DIA (ELL Descriptor Incomplete)

cd build
./bin/CodeSynthesis_Driver -src ELL,AELL -dest DIA,ADIA

Build Scripts

Some preset scripts have been generated by the synthesis algorithm, samples of these conversion scripts are available for inspection and check.

   make scripts

Unit Tests

cd build/
make test