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

Overview

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 
   

   

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]

You might also like...
A tutorial showing how to train, convert, and run TensorFlow Lite object detection models on Android devices, the Raspberry Pi, and more!
A tutorial showing how to train, convert, and run TensorFlow Lite object detection models on Android devices, the Raspberry Pi, and more!

A tutorial showing how to train, convert, and run TensorFlow Lite object detection models on Android devices, the Raspberry Pi, and more!

PyTorch-LIT is the Lite Inference Toolkit (LIT) for PyTorch which focuses on easy and fast inference of large models on end-devices.

PyTorch-LIT PyTorch-LIT is the Lite Inference Toolkit (LIT) for PyTorch which focuses on easy and fast inference of large models on end-devices. With

Ever felt tired after preprocessing the dataset, and not wanting to write any code further to train your model? Ever encountered a situation where you wanted to record the hyperparameters of the trained model and able to retrieve it afterward? Models Playground is here to help you do that. Models playground allows you to train your models right from the browser.
Code and model benchmarks for "SEVIR : A Storm Event Imagery Dataset for Deep Learning Applications in Radar and Satellite Meteorology"

NeurIPS 2020 SEVIR Code for paper: SEVIR : A Storm Event Imagery Dataset for Deep Learning Applications in Radar and Satellite Meteorology Requirement

Framework for abstracting Amiga debuggers and access to AmigaOS libraries and devices.

Framework for abstracting Amiga debuggers. This project provides abstration to control an Amiga remotely using a debugger. The APIs are not yet stable

Madanalysis5 - A package for event file analysis and recasting of LHC results

Welcome to MadAnalysis 5 Outline What is MadAnalysis 5? Requirements Downloading

Python Library for learning (Structure and Parameter) and inference (Statistical and Causal) in Bayesian Networks.

pgmpy pgmpy is a python library for working with Probabilistic Graphical Models. Documentation and list of algorithms supported is at our official sit

This repository is related to an Arabic tutorial, within the tutorial we discuss the common data structure and algorithms and their worst and best case for each, then implement the code using Python.

Data Structure and Algorithms with Python This repository is related to the Arabic tutorial here, within the tutorial we discuss the common data struc

Comments
  • [Config Failed] The dependency target

    [Config Failed] The dependency target "MLIRLinalgOps" of target "obj.EQueueTransforms" does not exist.

    /usr/local/bin/cmake -DCMAKE_BUILD_TYPE=Debug Ninja .. -DLLVM_EXTERNAL_LIT=/root/llvm-project/build/bin/llvm-lit -DMLIR_DIR=/root/llvm-project/build/lib/cmake/mlir -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Debug -G "CodeBlocks - Unix Makefiles" /tmp/tmp.xOJn99tuSu
    -- The CXX compiler identification is Clang 6.0.0
    -- The C compiler identification is Clang 6.0.0
    -- Check for working CXX compiler: /usr/bin/clang++
    -- Check for working CXX compiler: /usr/bin/clang++ -- works
    -- Detecting CXX compiler ABI info
    -- Detecting CXX compiler ABI info - done
    -- Detecting CXX compile features
    -- Detecting CXX compile features - done
    -- Check for working C compiler: /usr/bin/clang
    -- Check for working C compiler: /usr/bin/clang -- works
    -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - done
    -- Detecting C compile features
    -- Detecting C compile features - done
    -- Using MLIRConfig.cmake in: /root/llvm-project/build/lib/cmake/mlir
    -- Using LLVMConfig.cmake in: /llvm-project/build/lib/cmake/llvm
    -- Linker detection: GNU ld
    -- Performing Test LLVM_LIBSTDCXX_MIN
    -- Performing Test LLVM_LIBSTDCXX_MIN - Success
    -- Performing Test LLVM_LIBSTDCXX_SOFT_ERROR
    -- Performing Test LLVM_LIBSTDCXX_SOFT_ERROR - Success
    -- Performing Test C_SUPPORTS_FPIC
    -- Performing Test C_SUPPORTS_FPIC - Success
    -- Performing Test CXX_SUPPORTS_FPIC
    -- Performing Test CXX_SUPPORTS_FPIC - Success
    -- Building with -fPIC
    -- Performing Test SUPPORTS_FVISIBILITY_INLINES_HIDDEN_FLAG
    -- Performing Test SUPPORTS_FVISIBILITY_INLINES_HIDDEN_FLAG - Success
    -- Performing Test C_SUPPORTS_WERROR_DATE_TIME
    -- Performing Test C_SUPPORTS_WERROR_DATE_TIME - Success
    -- Performing Test CXX_SUPPORTS_WERROR_DATE_TIME
    -- Performing Test CXX_SUPPORTS_WERROR_DATE_TIME - Success
    -- Performing Test C_SUPPORTS_WERROR_UNGUARDED_AVAILABILITY_NEW
    -- Performing Test C_SUPPORTS_WERROR_UNGUARDED_AVAILABILITY_NEW - Success
    -- Performing Test CXX_SUPPORTS_WERROR_UNGUARDED_AVAILABILITY_NEW
    -- Performing Test CXX_SUPPORTS_WERROR_UNGUARDED_AVAILABILITY_NEW - Success
    -- Performing Test CXX_SUPPORTS_MISSING_FIELD_INITIALIZERS_FLAG
    -- Performing Test CXX_SUPPORTS_MISSING_FIELD_INITIALIZERS_FLAG - Success
    -- Performing Test C_SUPPORTS_IMPLICIT_FALLTHROUGH_FLAG
    -- Performing Test C_SUPPORTS_IMPLICIT_FALLTHROUGH_FLAG - Success
    -- Performing Test CXX_SUPPORTS_IMPLICIT_FALLTHROUGH_FLAG
    -- Performing Test CXX_SUPPORTS_IMPLICIT_FALLTHROUGH_FLAG - Success
    -- Performing Test C_SUPPORTS_COVERED_SWITCH_DEFAULT_FLAG
    -- Performing Test C_SUPPORTS_COVERED_SWITCH_DEFAULT_FLAG - Success
    -- Performing Test CXX_SUPPORTS_COVERED_SWITCH_DEFAULT_FLAG
    -- Performing Test CXX_SUPPORTS_COVERED_SWITCH_DEFAULT_FLAG - Success
    -- Performing Test CXX_SUPPORTS_CLASS_MEMACCESS_FLAG
    -- Performing Test CXX_SUPPORTS_CLASS_MEMACCESS_FLAG - Failed
    -- Performing Test CXX_SUPPORTS_NOEXCEPT_TYPE_FLAG
    -- Performing Test CXX_SUPPORTS_NOEXCEPT_TYPE_FLAG - Success
    -- Performing Test CXX_WONT_WARN_ON_FINAL_NONVIRTUALDTOR
    -- Performing Test CXX_WONT_WARN_ON_FINAL_NONVIRTUALDTOR - Success
    -- Performing Test CXX_SUPPORTS_SUGGEST_OVERRIDE_FLAG
    -- Performing Test CXX_SUPPORTS_SUGGEST_OVERRIDE_FLAG - Failed
    -- Performing Test C_WCOMMENT_ALLOWS_LINE_WRAP
    -- Performing Test C_WCOMMENT_ALLOWS_LINE_WRAP - Success
    -- Performing Test C_SUPPORTS_STRING_CONVERSION_FLAG
    -- Performing Test C_SUPPORTS_STRING_CONVERSION_FLAG - Success
    -- Performing Test CXX_SUPPORTS_STRING_CONVERSION_FLAG
    -- Performing Test CXX_SUPPORTS_STRING_CONVERSION_FLAG - Success
    -- Performing Test C_SUPPORTS_MISLEADING_INDENTATION_FLAG
    -- Performing Test C_SUPPORTS_MISLEADING_INDENTATION_FLAG - Failed
    -- Performing Test CXX_SUPPORTS_MISLEADING_INDENTATION_FLAG
    -- Performing Test CXX_SUPPORTS_MISLEADING_INDENTATION_FLAG - Failed
    -- Looking for os_signpost_interval_begin
    -- Looking for os_signpost_interval_begin - not found
    -- Configuring done
    CMake Error at /llvm-project/llvm/cmake/modules/AddLLVM.cmake:522 (add_dependencies):
      The dependency target "MLIRLinalgOps" of target "obj.EQueueTransforms" does
      not exist.
    Call Stack (most recent call first):
      /llvm-project/build/lib/cmake/mlir/AddMLIR.cmake:147 (llvm_add_library)
      /llvm-project/build/lib/cmake/mlir/AddMLIR.cmake:416 (add_mlir_library)
      lib/Transforms/CMakeLists.txt:1 (add_mlir_dialect_library)
    
    
    -- Generating done
    CMake Generate step failed.  Build files cannot be regenerated correctly.
    
    
    

    here is my llvm.spec:

    Name: LLVM
    Version: 14.0.0git
    Release: 0
    Summary: LLVM (An Optimizing Compiler Infrastructure)
    License: Apache-2.0 with LLVM exception
    Vendor: None (open source)
    Group: Development/Compilers
    URL: http://llvm..org/
    Source: http://llvm.org/releases/14.0.0git/LLVM-14.0.0git.tar.gz
    BuildRoot: %{_tmppath}/%{name}-root
    Requires: /sbin/ldconfig
    BuildRequires: gcc >= 3.4
    
    %description
    LLVM is a compiler infrastructure designed for compile-time, link-time, runtime,
    and idle-time optimization of programs from arbitrary programming languages.
    LLVM is written in C++ and has been developed since 2000 at the University of
    Illinois and Apple. It currently supports compilation of C and C++ programs, 
    using front-ends derived from GCC 4.0.1. A new front-end for the C family of
    languages is in development. The compiler infrastructure
    includes mirror sets of programming tools as well as libraries with equivalent
    functionality.
    
    %prep
    %setup -q -n LLVM-14.0.0git
    
    %build
    ./configure \
    --prefix=%{_prefix} \
    --bindir=%{_bindir} \
    --datadir=%{_datadir} \
    --includedir=%{_includedir} \
    --libdir=%{_libdir} \
    --enable-optimized \
    --enable-assertions 
    make tools-only
    
    %install
    rm -rf %{buildroot}
    make install DESTDIR=%{buildroot}
    
    %clean
    rm -rf %{buildroot}
    
    %post -p /sbin/ldconfig
    
    %postun -p /sbin/ldconfig
    
    %files
    %defattr(-, root, root)
    %doc CREDITS.TXT LICENSE.TXT README.txt docs/*.{html,css,gif,jpg} docs/CommandGuide
    %{_bindir}/*
    %{_libdir}/*.o
    %{_libdir}/*.a
    %{_libdir}/*.so
    %{_includedir}/llvm
    
    %changelog
    * Fri Aug 04 2006 Reid Spencer
    - Updates for release 1.8
    * Fri Apr 07 2006 Reid Spencer
    - Make the build be optimized+assertions
    * Fri May 13 2005 Reid Spencer
    - Minor adjustments for the 1.5 release
    * Mon Feb 09 2003 Brian R. Gaeke
    - Initial working version of RPM spec file.
    
    

    I compiled mlir with:

    -G "Ninja" -DLLVM_ENABLE_PROJECTS="mlir" -DLLVM_BUILD_EXAMPLES=ON -DLLVM_TARGETS_TO_BUILD="X86;NVPTX;AMDGPU" -DLLVM_ENABLE_ASSERTIONS=ON
    
    opened by LeiWang1999 0
Owner
Cornell Capra
Computer architecture & programming abstractions at Cornell University.
Cornell Capra
Generic Event Boundary Detection: A Benchmark for Event Segmentation

Generic Event Boundary Detection: A Benchmark for Event Segmentation We release our data annotation & baseline codes for detecting generic event bound

null 47 Nov 22, 2022
Event-forecasting - Event Forecasting Algorithms With Python

event-forecasting Event Forecasting Algorithms Theory Correlating events in comp

Intellia ICT 4 Feb 15, 2022
An implementation for `Text2Event: Controllable Sequence-to-Structure Generation for End-to-end Event Extraction`

Text2Event An implementation for Text2Event: Controllable Sequence-to-Structure Generation for End-to-end Event Extraction Please contact Yaojie Lu (@

Roger 153 Jan 7, 2023
The coda and data for "Measuring Fine-Grained Domain Relevance of Terms: A Hierarchical Core-Fringe Approach" (ACL '21)

We propose a hierarchical core-fringe learning framework to measure fine-grained domain relevance of terms – the degree that a term is relevant to a broad (e.g., computer science) or narrow (e.g., deep learning) domain.

Jie Huang 14 Oct 21, 2022
Locally Enhanced Self-Attention: Rethinking Self-Attention as Local and Context Terms

LESA Introduction This repository contains the official implementation of Locally Enhanced Self-Attention: Rethinking Self-Attention as Local and Cont

Chenglin Yang 20 Dec 31, 2021
DziriBERT: a Pre-trained Language Model for the Algerian Dialect

DziriBERT DziriBERT is the first Transformer-based Language Model that has been pre-trained specifically for the Algerian Dialect. It handles Algerian

null 117 Jan 7, 2023
MM1 and MMC Queue Simulation using python - Results and parameters in excel and csv files

implementation of MM1 and MMC Queue on randomly generated data and evaluate simulation results then compare with analytical results and draw a plot curve for them, simulate some integrals and compare results and run monte carlo algorithm with them

Mohamadreza Rezaei 1 Jan 19, 2022
ROS-UGV-Control-Interface - Control interface which can be used in any UGV

ROS-UGV-Control-Interface Cam Closed: Cam Opened:

Ahmet Fatih Akcan 1 Nov 4, 2022
Hand Gesture Volume Control is AIML based project which uses image processing to control the volume of your Computer.

Hand Gesture Volume Control Modules There are basically three modules Handtracking Program Handtracking Module Volume Control Program Handtracking Pro

VITTAL 1 Jan 12, 2022