Code Monkey home page Code Monkey logo

akothen / hydride Goto Github PK

View Code? Open in Web Editor NEW
2.0 8.0 0.0 388.68 MB

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

License: Apache License 2.0

Racket 1.64% Python 2.60% Shell 0.01% C++ 18.65% CSS 0.01% TypeScript 0.01% JavaScript 0.01% HTML 0.14% LLVM 68.63% C 6.50% CMake 0.10% Makefile 0.02% Java 0.01% MATLAB 0.01% Objective-C 0.28% Objective-C++ 0.06% Batchfile 0.01% Smarty 0.01% ASL 1.32% Jupyter Notebook 0.01%
compiler-construction compilers program-synthesis isa-semantics retargetability dsl halide high-performance llvm mlir instruction-selection vectorization automlir formal-semantics formal-verification

hydride's Introduction

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}
}

hydride's People

Contributors

akothen avatar rafaenoor avatar scarlet1ssimo avatar baziotis avatar kunalsheth avatar heasummn avatar boronhub avatar goldsteinn avatar

Stargazers

 avatar Matt avatar

Watchers

aksarben avatar Vikram S. Adve avatar Muntasir Mallick avatar  avatar  avatar  avatar  avatar  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.