akothen / Hydride

A retargetable and extensible synthesis-based compiler for modern hardware architectures

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Hydride

Hydride is a retargetable and extensible synthesis-based compiler for modern hardware architectures.

Hydride has two major components:

  • Automatic IR Generator - It is responsible for automatically designing and generating code generation support for language- and target-independent, retargetable compiler IR that we call AutoLLVM IR.
  • Code Synthesizer - It automatically generates AutoLLVM IR instructions in a solver-aided language called Rosette for a given domain-specific code implemented in Halide, Pytorch and TensorFlow.

Prerequisites

Python

Z3

  • Install z3:
    • MacOS: brew install z3
    • Linux example: sudo apt-get install -y z3

Racket

  • Install Racket
    • Linux example (works for all versions of Racket):
    wget https://download.racket-lang.org/installers/8.6/racket-8.6-x86_64-linux-cs.sh
    sh racket-8.6-x86_64-linux-cs.sh

Directory Structure

  • code-syntheizer contains the experimental files for adding the notion of cost for different benchmark kernels and code for grammar generator.
  • codegen-generator contains the custom compiler to generate target-agnostic semantics for target ISAs in Rosette for synthesis, LLVM IR extensions and legalization code for generating low-level code executable on a given supported target.
  • frontends contains modified versions of DSL compilers Hydride supports (Halide and MLIR).
  • backends contains modified version of low-level compilers like LLVM that contains backends to different targets.
  • rosette is the modified version of Rosette necessary for Hydride.
  • benchmarks contains the benchmarks on which Hydride is evaluated against other mainline DSL compilers.

Instructions to install Hydride

From the root directory, run the setup bash script to set up appropriate paths first.

source setup.sh

Install the frontends and backends, and Rosette and Hydride code synthesizer by running the following install script.

bash install.sh

Now you are ready to use Hydride!

Targets Supported

  • x86 (SSE, SSE2, AVX, AVX2, AVX512 (includes VNNI), MMX, FMA)
  • Hexagon (HVX)
  • AArch64 (Neon)

Publication

The first paper on Hydride was published at ASPLOS '24. You can download the paper from ACM Digital Library. If you use Hydride, please cite both the compiler and the paper!

@inproceedings{kothari2024hydride,
  title={Hydride: A Retargetable and Extensible Synthesis-based Compiler for Modern Hardware Architectures},
  author={Kothari, Akash and Noor, Abdul Rafae and Xu, Muchen and Uddin, Hassam and Baronia, Dhruv and Baziotis, Stefanos and Adve, Vikram and Mendis, Charith and Sengupta, Sudipta},
  booktitle={Proceedings of the 29th ACM International Conference on Architectural Support for Programming Languages and Operating Systems, Volume 2},
  pages={514--529},
  year={2024}
}

About

A retargetable and extensible synthesis-based compiler for modern hardware architectures

License:Apache License 2.0


Languages

Language:LLVM 64.0%Language:C++ 17.4%Language:C 6.1%Language:Assembly 6.0%Language:Python 2.4%Language:Racket 1.5%Language:ASL 1.2%Language:MLIR 0.6%Language:Objective-C 0.3%Language:HTML 0.1%Language:CMake 0.1%Language:OCaml 0.1%Language:Objective-C++ 0.1%Language:Cuda 0.0%Language:Makefile 0.0%Language:Shell 0.0%Language:Go 0.0%Language:Perl 0.0%Language:TypeScript 0.0%Language:Jupyter Notebook 0.0%Language:Java 0.0%Language:JavaScript 0.0%Language:Haskell 0.0%Language:Batchfile 0.0%Language:Roff 0.0%Language:Emacs Lisp 0.0%Language:HLSL 0.0%Language:CSS 0.0%Language:Vim Script 0.0%Language:C# 0.0%Language:PureBasic 0.0%Language:Starlark 0.0%Language:Fortran 0.0%Language:Dockerfile 0.0%Language:M 0.0%Language:Cool 0.0%Language:MATLAB 0.0%Language:AppleScript 0.0%Language:RenderScript 0.0%Language:SWIG 0.0%Language:Swift 0.0%Language:Rust 0.0%Language:Smarty 0.0%Language:BitBake 0.0%Language:Pawn 0.0%