Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OPEN: Minor CI and Readme Improvements #8

Merged
merged 7 commits into from
Nov 3, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/BuildDocker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,5 @@ jobs:
context: .
file: Container/Dockerfile
push: true
tags: ghcr.io/pulp-platform/deeploy:main
# JUNGVI: If you operate from a fork and want to build a new docker make sure to replace 'pulp-platform' by your uname.
tags: ghcr.io/pulp-platform/deeploy:main
23 changes: 11 additions & 12 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@ on:
push:
pull_request:
workflow_dispatch:
schedule:
# Runs the CI on the default branch every 6 days at 2AM CET to keep the cache fresh
- cron: "0 1 */6 * *"

jobs:

build-deeploy:
runs-on: ubuntu-22.04
container:
image: ghcr.io/victor-jung/deeploy:main
image: ghcr.io/pulp-platform/deeploy:main
steps:
- name: Checkout Repo
uses: actions/checkout@v4
Expand Down Expand Up @@ -496,7 +499,7 @@ jobs:
deeploy-state-serialization:
runs-on: ubuntu-22.04
container:
image: ghcr.io/victor-jung/deeploy:main
image: ghcr.io/pulp-platform/deeploy:main
steps:
- name: Checkout Repo
uses: actions/checkout@v4
Expand All @@ -516,7 +519,7 @@ jobs:
deeploy-memory-level-extension:
runs-on: ubuntu-22.04
container:
image: ghcr.io/victor-jung/deeploy:main
image: ghcr.io/pulp-platform/deeploy:main
steps:
- name: Checkout Repo
uses: actions/checkout@v4
Expand All @@ -536,7 +539,7 @@ jobs:
deeploy-tiler-extension:
runs-on: ubuntu-22.04
container:
image: ghcr.io/victor-jung/deeploy:main
image: ghcr.io/pulp-platform/deeploy:main
steps:
- name: Checkout Repo
uses: actions/checkout@v4
Expand All @@ -560,7 +563,7 @@ jobs:
deeploy-memory-allocation-extension:
runs-on: ubuntu-22.04
container:
image: ghcr.io/victor-jung/deeploy:main
image: ghcr.io/pulp-platform/deeploy:main
steps:
- name: Checkout Repo
uses: actions/checkout@v4
Expand All @@ -582,7 +585,7 @@ jobs:
deeploy-typing:
runs-on: ubuntu-22.04
container:
image: ghcr.io/victor-jung/deeploy:main
image: ghcr.io/pulp-platform/deeploy:main
steps:
- name: Checkout Repo
uses: actions/checkout@v4
Expand All @@ -599,7 +602,7 @@ jobs:
deeploy-regex-matching:
runs-on: ubuntu-22.04
container:
image: ghcr.io/victor-jung/deeploy:main
image: ghcr.io/pulp-platform/deeploy:main
steps:
- name: Checkout Repo
uses: actions/checkout@v4
Expand All @@ -616,7 +619,7 @@ jobs:
linting:
runs-on: ubuntu-22.04
container:
image: ghcr.io/victor-jung/deeploy:main
image: ghcr.io/pulp-platform/deeploy:main
steps:
- name: Checkout Repo
uses: actions/checkout@v4
Expand Down Expand Up @@ -651,7 +654,3 @@ jobs:
run: |
grep -Lr "SPDX-License-Identifier: Apache-2.0" --exclude-dir="toolchain" --exclude-dir="install" --exclude-dir=".git" . --exclude-dir="third_party" --exclude-dir="TEST_*" --exclude-dir="runtime" | grep ".*\.h$" || [[ $? == 1 ]]
shell: bash




2 changes: 1 addition & 1 deletion .github/workflows/TestRunnerCortexM.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
test-runner-cortexm:
runs-on: ubuntu-22.04
container:
image: ghcr.io/victor-jung/deeploy:main
image: ghcr.io/pulp-platform/deeploy:main
steps:
- name: Checkout Repo
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/TestRunnerGeneric.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
test-runner-generic:
runs-on: ubuntu-22.04
container:
image: ghcr.io/victor-jung/deeploy:main
image: ghcr.io/pulp-platform/deeploy:main
steps:
- name: Checkout Repo
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/TestRunnerMempool.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
test-runner-mempool:
runs-on: ubuntu-22.04
container:
image: ghcr.io/victor-jung/deeploy:main
image: ghcr.io/pulp-platform/deeploy:main
steps:
- name: Checkout Repo
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/TestRunnerSiracusa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
test-runner-siracusa:
runs-on: ubuntu-22.04
container:
image: ghcr.io/victor-jung/deeploy:main
image: ghcr.io/pulp-platform/deeploy:main
steps:
- name: Checkout Repo
uses: actions/checkout@v4
Expand Down
21 changes: 13 additions & 8 deletions .github/workflows/TestRunnerTiledSiracusa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
L1: ${{ fromJSON(inputs.L1) }}
runs-on: ubuntu-22.04
container:
image: ghcr.io/victor-jung/deeploy:main
image: ghcr.io/pulp-platform/deeploy:main
steps:
- name: Checkout Repo
uses: actions/checkout@v4
Expand All @@ -47,11 +47,16 @@ jobs:
path: /app/.ccache
key: ${{ runner.os }}-ccache
- name: Run Test
run: |
cd DeeployTest
mkdir -p /app/.ccache
export CCACHE_DIR=/app/.ccache
source /app/install/pulp-sdk/configs/siracusa.sh
python testRunner_tiled_siracusa.py -t Tests/${{ inputs.test-name }} --cores=${{ inputs.num-cores }} --l1 ${{ matrix.L1 }} --defaultMemLevel=${{ inputs.default-memory-level }} ${{ inputs.double-buffer && '--doublebuffer' || '' }}
shell: bash
uses: nick-fields/retry@v3
Xeratec marked this conversation as resolved.
Show resolved Hide resolved
with:
timeout_minutes: 5
max_attempts: 3
retry_on: timeout
command: |
cd DeeployTest
mkdir -p /app/.ccache
export CCACHE_DIR=/app/.ccache
source /app/install/pulp-sdk/configs/siracusa.sh
python testRunner_tiled_siracusa.py -t Tests/${{ inputs.test-name }} --cores=${{ inputs.num-cores }} --l1 ${{ matrix.L1 }} --defaultMemLevel=${{ inputs.default-memory-level }} ${{ inputs.double-buffer && '--doublebuffer' || '' }}
shell: bash

2 changes: 1 addition & 1 deletion .github/workflows/TestRunnerTiledSiracusaSequential.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
test-runner-siracusa-tiled:
runs-on: ubuntu-22.04
container:
image: ghcr.io/victor-jung/deeploy:main
image: ghcr.io/pulp-platform/deeploy:main
steps:
- name: Checkout Repo
uses: actions/checkout@v4
Expand Down
21 changes: 13 additions & 8 deletions .github/workflows/TestRunnerTiledSiracusaWithNeureka.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
L1: ${{ fromJSON(inputs.L1) }}
runs-on: ubuntu-22.04
container:
image: ghcr.io/victor-jung/deeploy:main
image: ghcr.io/pulp-platform/deeploy:main
steps:
- name: Checkout Repo
uses: actions/checkout@v4
Expand All @@ -51,11 +51,16 @@ jobs:
path: /app/.ccache
key: ${{ runner.os }}-ccache-neureka
- name: Run Test
run: |
cd DeeployTest
mkdir -p /app/.ccache
export CCACHE_DIR=/app/.ccache
source /app/install/pulp-sdk/configs/siracusa.sh
python testRunner_tiled_siracusa_w_neureka.py -t Tests/${{ inputs.test-name }} --cores=${{ inputs.num-cores }} --l1 ${{ matrix.L1 }} --defaultMemLevel=${{ inputs.default-memory-level }} ${{ inputs.double-buffer && '--doublebuffer' || '' }} ${{ inputs.neureka-wmem && '--neureka-wmem' || '' }}
shell: bash
uses: nick-fields/retry@v3
with:
timeout_minutes: 5
max_attempts: 3
retry_on: timeout
command: |
cd DeeployTest
mkdir -p /app/.ccache
export CCACHE_DIR=/app/.ccache
source /app/install/pulp-sdk/configs/siracusa.sh
python testRunner_tiled_siracusa_w_neureka.py -t Tests/${{ inputs.test-name }} --cores=${{ inputs.num-cores }} --l1 ${{ matrix.L1 }} --defaultMemLevel=${{ inputs.default-memory-level }} ${{ inputs.double-buffer && '--doublebuffer' || '' }} ${{ inputs.neureka-wmem && '--neureka-wmem' || '' }}
shell: bash
Victor-Jung marked this conversation as resolved.
Show resolved Hide resolved

Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
test-runner-siracusa-neureka-tiled:
runs-on: ubuntu-22.04
container:
image: ghcr.io/victor-jung/deeploy:main
image: ghcr.io/pulp-platform/deeploy:main
steps:
- name: Checkout Repo
uses: actions/checkout@v4
Expand Down
71 changes: 67 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# Deeploy

Deeploy is a python tool to generate low-level optimized C Code for multi-cluster, heterogeneous SoCs. Its goal is to enable configurable deployment flows from a bottom-up compiler perspective, modelling target hardware in a fine-grained and modular manner.
![CI](https://github.com/pulp-platform/Deeploy/actions/workflows/CI.yml/badge.svg?branch=devel)
![Docker](https://github.com/pulp-platform/Deeploy/actions/workflows/BuildDocker.yml/badge.svg)
[![GitHub last commit](https://img.shields.io/github/last-commit/pulp-platform/Deeploy)](#)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
![](https://img.shields.io/badge/Provided_by_PULP_Platform-24AF4B)

Deeploy is an ONNX-to-C compiler that generates low-level optimized C Code for multi-cluster, heterogeneous SoCs. Its goal is to enable configurable deployment flows from a bottom-up compiler perspective, modeling target hardware in a fine-grained and modular manner.

Deeploy is developed as part of the PULP project, a joint effort between ETH Zurich and the University of Bologna.

Expand All @@ -10,12 +16,69 @@ Unless specified otherwise in the respective file headers, all code checked into

## Getting started

To install Deeploy, simply run
Installing Deeploy is as simple as running:
```
pip install -e .
```
to download and install the Python dependencies. Run
However, to run the code generated by Deeploy on a certain target, you need the toolchains and the simulators associated with this platform.

We provide a Docker container where Deeploy works Out-of-the-Box (*i.e.* with all the dependencies pre-installed). To pull the docker image, run:
```
docker pull ghcr.io/pulp-platform/deeploy:main
```
Then you can start the container in interactive mode with:
```
docker run -it ghcr.io/pulp-platform/deeploy:main
```
From the container, clone Deeploy, its submodules, and install the package with:
```
git clone https://github.com/pulp-platform/Deeploy.git && cd Deeploy
git submodule update --init --recursive
pip install -e .
```
Congratulations, you installed Deeploy and its dependencies! Now, to test your installation let's run one simple test on each platform with the following commands:
```
cd DeeployTest && source /app/install/pulp-sdk/configs/siracusa.sh
python testRunner_generic.py -t Tests/Adder
python testRunner_cortexm.py -t Tests/Adder
python testRunner_mempool.py -t Tests/Adder
python testRunner_siracusa.py -t Tests/Adder --cores=8
```

You can find the ONNX file in `DeeployTest/Tests/Adder`, to visualize it, you can use [Netron](https://netron.app/). You can also find the generated code for the platform X in `TEST_X` in `DeeployTest` and you should notice that the generated code for the `Adder` test is very simple. However, this gets more complex when you add tiling. Let's generate the code for a single layer but using tiling this time:
```
python testRunner_tiled_siracusa.py -t Tests/testMatMul --cores=8 --l1=16000
```
Now you can open the generated code in `DeeployTest/TEST_SIRACUSA/Tests/testMatMul/Network.c` and see how we executed a tiled layer.

## Supported Platforms

- **Generic CPU:**
- **CortexM Processors:**
- Simulators: [QEMU](https://www.qemu.org/)
- **MemPool extended with ITA:**
- Hardware: [Mempool paper](https://arxiv.org/abs/2303.17742), [ITA paper](https://arxiv.org/abs/2307.03493)
- Simulators: [Banshee](https://github.com/pulp-platform/banshee)
- **Siracusa:**
- Hardware: [Siracusa paper](https://arxiv.org/abs/2312.14750)
- Simulators: [GVSOC](https://github.com/gvsoc/gvsoc)

## Documentation

To build the documentation, simply run:
```
make docs
```
and open `docs/_build/html/index.html` for more extensive documentation & getting started guides.
Then open `docs/_build/html/index.html` for more extensive documentation & getting-started guides.

## Publications

### ESWEEK 2024: Deeploy: Enabling Energy-Efficient Deployment of Small Language Models On Heterogeneous Microcontrollers
```
@article{scherer2024deeploy,
title={Deeploy: Enabling Energy-Efficient Deployment of Small Language Models On Heterogeneous Microcontrollers},
author={Scherer, Moritz and Macan, Luka and Jung, Victor and Wiese, Philip and Bompani, Luca and Burrello, Alessio and Conti, Francesco and Benini, Luca},
journal={arXiv preprint arXiv:2408.04413},
year={2024}
}
```