MCPcopy Index your code
hub / github.com/cornell-zhang/heterocl

github.com/cornell-zhang/heterocl @v0.5

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.5 ↗ · + Follow
1,618 symbols 5,984 edges 187 files 217 documented · 13%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

GitHub license CircleCI

HeteroCL: A Multi-Paradigm Programming Infrastructure for Software-Defined Reconfigurable Computing

Website | Installation | Tutorials | Samples | Documentation

Introduction

With the pursuit of improving compute performance under strict power constraints, there is an increasing need for deploying applications to heterogeneous hardware architectures with accelerators, such as GPUs and FPGAs. However, although these heterogeneous computing platforms are becoming widely available, they are very difficult to program especially with FPGAs. As a result, the use of such platforms has been limited to a small subset of programmers with specialized hardware knowledge.

To tackle this challenge, we introduce HeteroCL, a programming infrastructure comprised of a Python-based domain-specific language (DSL) and a compilation flow. The HeteroCL DSL provides a clean programming abstraction that decouples algorithm specification from hardware customizations including data and processing customizations. HeteroCL can further capture the interdependence among these different customization techniques, allowing programmers to explore various performance/area/accuracy trade-offs in a systematic and productive manner.

Language Overview

flow

Current Compilation Flow

flow

Install MLIR-based HeteroCL

To install the HeteroCL-MLIR dialect, please make sure you have installed the tools below:

  • gcc >= 5.4
  • cmake >= 3.19
  • python >= 3.7

The following script shows the complete process of building the HeteroCL-MLIR dialect and connecting it with the HeteroCL frontend. It may take about 10 minutes to install the LLVM package depending on the internet connection and the hardware resource of your machine. If you are a HeteroCL developer, please refer to the guide in the HCL-MLIR repository and build the dialect with the Python binding from source.

git clone https://github.com/cornell-zhang/heterocl.git heterocl-mlir
cd heterocl-mlir
git submodule update --init --recursive
pip install . -v
# export LLVM path
export LLVM_BUILD_DIR=$(pwd)/hcl-dialect/externals/llvm-project/build
export PATH=${LLVM_BUILD_DIR}/bin:${PATH}

To verify HeteroCL is installed correctly, you can run the following test.

python3 -m pytest test

Related Publications

Related Work

Contributing to HeteroCL

Coding Style (Python)

We follow official Python coding style and use NumPy docstring style.

Coding Style (C and C++)

We follow Google coding style.

Steps

  1. Use clang-format to format your C-related files. The configuration file is in docs/.clang-format. Following is a sample command to format the file in place. Note that you need to put the configuration file at the same directory you execute the command.

clang-format -i -style=file <cpp-file> 2. Use Pull Request. Remember to select the most suitable labels and put it in the title. 3. Make sure all the tests pass.

Core symbols most depended-on inside this repo

Shape

Function 870
Method 588
Class 160

Languages

Python96%
C++4%

Modules by API surface

heterocl/ast/ast.py292 symbols
heterocl/schedule.py57 symbols
heterocl/ast/ir_builder.py57 symbols
tests/test_schedule_stream.py52 symbols
heterocl/ast/ast_visitor.py52 symbols
tests/test_dsl_basic.py51 symbols
heterocl/ast/build_cleaner.py51 symbols
heterocl/devices.py50 symbols
tests/test_schedule_compute.py35 symbols
tests/test_dtype.py32 symbols
tests/test_compute_basic.py30 symbols
heterocl/types.py29 symbols

For agents

$ claude mcp add heterocl \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page