Code Monkey home page Code Monkey logo

eventqueue's Introduction

Event Queue Dialect

Event queue (Equeue) dialect is an MLIR Dialect that models concurrent devices in terms of control and structure.

Motivation

The main motivation of the event queue dialect is to efficiently estimate performance of programs running on heterogenous accelerators. The dialect is designed to bridge the gap between low-level hardware specific dialects and high-level dialects with little hardware specific information, thus facilitating custom lowering among different design choices. In particular, the EventQueue dialect supports modeling memory size constraints, bandwidth constraints, and processing time across a large number of heterogenous processors with distributed event-based control.

By and large, event queue dialect is design to estimate performance of concurrent devices. It supports:

  • Arbitrary hardware hierarchy and each hardware with its own properties.

  • Modeling data movement and buffer allocation that is critical to energy and efficiency estimation.

  • Model concurrency between heterogenous devices.

Check further documentation to see how the goals are achieved.

EQueue Dialect in MLIR Lowering Pipeline

lowering_pipeline

Event queue dialect is designed to do performance analysis.

Because there is a gap between high level dialect that has no structure information, and low level dialect that is too detail to analyze, event queue dialect bridges them.

The input for the event queue dialect is high level control dialect without structure and the output will be dialect describing detailed structure information.

In the lowering pipeline, equeue dialect is at the same level as gpu dialect. The difference is that existing gpu dialect assumes a synchronous gpu model and try to communicate with gpu.barrier among concurrent gpus, while equeue dialect models a more general design, where it allows any kinds of structure, thus allowing maximum flexibility. To describe the complexity of any possible structure in a flexible device like FPGA, equeue dialect develops a general semantics for asynchronous communication between concurrent devices.

How to Use

Dependency

The dependency of this project is MLIR. Because MLIR is project that frequently being updated. When I started the EQueue project, The latest stable version was 12-init. One needs checkout to the right version.

git clone https://github.com/llvm/llvm-project.git
git fetch --all --tags
git checkout tags/llvmorg-12-init -b <your-branch-name>

and then follow MLIR quick start to build executable.

Quick Start

After git clone and cd the repo,

mkdir build
cp *.sh build/
cd build
#change LLVM_EXTERNAL_LIT and MLIR_DIR in run.sh to your local directory
sh config; sh run.sh
./bin/equeue-opt ../test/Equeue/[path-to-input-file.mlir]

Debug Outputs

If one want to turn on debug outputs with -debug or debug-only when there are multiple debugging options

./bin/equeue-opt ../test/Equeue/[path-to-input-file.mlir] -debug
# when there are multiple debugging options
./bin/equeue-opt ../test/Equeue/[path-to-input-file.mlir] -debug-only=command_processor
# to redirect output to file
./bin/equeue-opt ../test/Equeue/[path-to-input-file.mlir] -debug > & report

Visualization

By default equeue-opt will generate a Trace Event Format JSON file to test/Equeue/out.json . You can specify the output file name with -json

./bin/equeue-opt ../test/Equeue/[path-to-input-file.mlir] -json [path-to-json-file.json]

The output JSON file can be viewed in chrome://tracing/

Below is the visualization of running test/EQueue/gpu.mlir

visualization

Examples

You may want to check on Examples on the convolution and the finite impulse response. Detailed explanation can be found in the example directory

Paper and Citation

The paper is accepted to HPCA 2022. We upload a preprint to Arxiv.

Contact

I am Zhijing at Cornell University. This project is originally my Xilinx internship project. I extend after the internship and now it is accepted by HPCA 2022. I will put the reference later. If getting to any trouble, you can contact me at [email protected]

eventqueue's People

Contributors

tissue3 avatar viviye 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.