Skip to content

Commit d22d67d

Browse files
authored
Deeploy-GAP9 Platform (pulp-platform#143)
This PR adds complete GAP9 platform support to Deeploy, including platform integration, DMA support, tiling capabilities, CI/CD workflows, and comprehensive testing infrastructure. This represents 20 commits specifically focused on GAP9 development. ## Added - Initial GAP9 platform integration with full deployer, bindings, and platform configuration ([Deeploy/Targets/GAP9/](vscode-webview://0as5edmc2kqqianp2mt1bvadajppa7c0dtrrgg4oii2dsnnmi6oq/Deeploy/Targets/GAP9/)) - GAP9 DMA support with L3 DMA and Mchan DMA implementations - GAP9-specific memory allocation and free templates - GAP9 tiling support for L3 memory - GAP9 CI/CD workflows (.github/workflows/_runner-gap9.yml, .github/workflows/ci-platform-gap9.yml, .github/workflows/ci-platform-gap9-tiled.yml) - Link to PULP-NN, PULP kernels, and Math libraries for GAP9 - GAP9 SDK configuration with cluster stack macros - GAP9 GVSoC simulation support ## Changed - Minimally modified PULP kernel syntax to fix GAP9 compiler issues. Changes are minimal and maintain compatibility with PULP kernels with GAP9 GCC toolchain-specific requirements - Transpose operator: Fixed GCC segmentation fault caused by template syntax (commit 9ca4595) - LayerNorm operator: Resolved epsilon ABI compatibility issue (commit 6b5c2e5)
1 parent 162aa45 commit d22d67d

66 files changed

Lines changed: 12295 additions & 37 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# SPDX-FileCopyrightText: 2025 ETH Zurich and University of Bologna
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
---
6+
name: _runner-gap9-tiled
7+
8+
"on":
9+
workflow_call:
10+
inputs:
11+
runner:
12+
required: true
13+
type: string
14+
docker-image:
15+
required: true
16+
type: string
17+
pytest-markers:
18+
required: true
19+
type: string
20+
21+
jobs:
22+
test-runner-gap9-tiled:
23+
runs-on: ${{ inputs.runner }}
24+
container:
25+
image: ${{ inputs.docker-image }}
26+
steps:
27+
- name: Checkout Repo
28+
uses: actions/checkout@v4
29+
with:
30+
submodules: recursive
31+
- name: Build Deeploy
32+
shell: bash
33+
run: |
34+
source /app/install/gap9-sdk/.gap9-venv/bin/activate
35+
source /app/install/gap9-sdk/configs/gap9_evk_audio.sh || true
36+
pip install -e . || true
37+
deactivate
38+
- name: Cache ccache
39+
uses: actions/cache/restore@v4
40+
with:
41+
path: /app/.ccache
42+
key: ccache-gap9
43+
- name: Run Test
44+
run: |
45+
source /app/install/gap9-sdk/.gap9-venv/bin/activate
46+
source /app/install/gap9-sdk/configs/gap9_evk_audio.sh || true
47+
export GVSOC_INSTALL_DIR=/app/install/gap9-sdk/install/workstation
48+
export GAP_RISCV_GCC_TOOLCHAIN=/app/install/gcc/gap9
49+
cd DeeployTest
50+
mkdir -p /app/.ccache
51+
export CCACHE_DIR=/app/.ccache
52+
pytest test_platforms.py -v -m "${{ inputs.pytest-markers }}"
53+
deactivate
54+
shell: bash

.github/workflows/_runner-gap9.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# SPDX-FileCopyrightText: 2025 ETH Zurich and University of Bologna
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
---
6+
name: _runner-gap9
7+
8+
"on":
9+
workflow_call:
10+
inputs:
11+
runner:
12+
required: true
13+
type: string
14+
docker-image:
15+
required: true
16+
type: string
17+
pytest-marker:
18+
required: true
19+
type: string
20+
21+
jobs:
22+
test-runner-gap9:
23+
runs-on: ${{ inputs.runner }}
24+
container:
25+
image: ${{ inputs.docker-image }}
26+
steps:
27+
- name: Checkout Repo
28+
uses: actions/checkout@v4
29+
with:
30+
submodules: recursive
31+
- name: Build Deeploy
32+
shell: bash
33+
run: |
34+
source /app/install/gap9-sdk/.gap9-venv/bin/activate
35+
source /app/install/gap9-sdk/configs/gap9_evk_audio.sh || true
36+
pip install -e . || true
37+
deactivate
38+
- name: Cache ccache
39+
uses: actions/cache/restore@v4
40+
with:
41+
path: /app/.ccache
42+
key: ccache-gap9
43+
- name: Run Test
44+
run: |
45+
source /app/install/gap9-sdk/.gap9-venv/bin/activate
46+
source /app/install/gap9-sdk/configs/gap9_evk_audio.sh || true
47+
export GVSOC_INSTALL_DIR=/app/install/gap9-sdk/install/workstation
48+
export GAP_RISCV_GCC_TOOLCHAIN=/app/install/gcc/gap9
49+
cd DeeployTest
50+
mkdir -p /app/.ccache
51+
export CCACHE_DIR=/app/.ccache
52+
pytest test_platforms.py -v -n 4 -m "gap9 and ${{ inputs.pytest-marker }}"
53+
deactivate
54+
shell: bash

.github/workflows/ci-lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,4 @@ jobs:
6464
- name: Check Licenses
6565
shell: bash
6666
run: |
67-
python scripts/reuse_skip_wrapper.py $(find . \( -name '*.py' -o -name '*.c' -o -name '*.h' -o -name '*.html' -o -name '*.rst' -o -name '*.yml' -o -name '*.yaml' \) -not -path "*toolchain*" -not -path "*third_party*" -not -path "*.git/*" -not -path "*install/*" -type f)
67+
python scripts/reuse_skip_wrapper.py $(find . \( -name '*.py' -o -name '*.c' -o -name '*.h' -o -name '*.html' -o -name '*.rst' -o -name '*.yml' -o -name '*.yaml' \) -not -path "*toolchain*" -not -path "*third_party*" -not -path "*prebuilt*" -not -path "*.git/*" -not -path "*install/*" -type f)
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# SPDX-FileCopyrightText: 2025 ETH Zurich and University of Bologna
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
---
6+
name: CI • GAP9 (Tiled)
7+
8+
"on":
9+
push:
10+
branches:
11+
- "**"
12+
tags:
13+
- "v*.*.*"
14+
pull_request:
15+
workflow_dispatch:
16+
inputs:
17+
docker_image_deeploy:
18+
description: "Deeploy Image to use"
19+
required: false
20+
default: "ghcr.io/pulp-platform/deeploy-gap9:latest"
21+
22+
concurrency:
23+
group: ${{ github.workflow }}-${{ github.ref }}
24+
cancel-in-progress: true
25+
26+
jobs:
27+
select-env:
28+
uses: ./.github/workflows/_select-env.yml
29+
with:
30+
docker_image_deeploy: ${{ github.event.inputs.docker_image_deeploy || github.repository == 'pulp-platform/Deeploy' && 'ghcr.io/pulp-platform/deeploy-gap9:latest'}}
31+
32+
gap9-kernels-tiled-singlebuffer-L2:
33+
needs: select-env
34+
uses: ./.github/workflows/_runner-gap9-tiled.yml
35+
with:
36+
runner: ${{ needs.select-env.outputs.runner }}
37+
docker-image: ${{ needs.select-env.outputs.image }}
38+
pytest-markers: "gap9_tiled and kernels and singlebuffer and l2"
39+
40+
gap9-kernels-tiled-doublebuffer-L2:
41+
needs: select-env
42+
uses: ./.github/workflows/_runner-gap9-tiled.yml
43+
with:
44+
runner: ${{ needs.select-env.outputs.runner }}
45+
docker-image: ${{ needs.select-env.outputs.image }}
46+
pytest-markers: "gap9_tiled and kernels and doublebuffer and l2"
47+
48+
gap9-models-tiled-singlebuffer-L2:
49+
needs: select-env
50+
uses: ./.github/workflows/_runner-gap9-tiled.yml
51+
with:
52+
runner: ${{ needs.select-env.outputs.runner }}
53+
docker-image: ${{ needs.select-env.outputs.image }}
54+
pytest-markers: "gap9_tiled and models and singlebuffer and l2"
55+
56+
gap9-models-tiled-doublebuffer-L2:
57+
needs: select-env
58+
uses: ./.github/workflows/_runner-gap9-tiled.yml
59+
with:
60+
runner: ${{ needs.select-env.outputs.runner }}
61+
docker-image: ${{ needs.select-env.outputs.image }}
62+
pytest-markers: "gap9_tiled and models and doublebuffer and l2"
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# SPDX-FileCopyrightText: 2025 ETH Zurich and University of Bologna
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
---
6+
name: CI • GAP9
7+
8+
"on":
9+
push:
10+
branches:
11+
- "**"
12+
tags:
13+
- "v*.*.*"
14+
pull_request:
15+
workflow_dispatch:
16+
inputs:
17+
docker_image_deeploy:
18+
description: "Deeploy Image to use"
19+
required: false
20+
default: "ghcr.io/pulp-platform/deeploy-gap9:latest"
21+
22+
23+
concurrency:
24+
group: ${{ github.workflow }}-${{ github.ref }}
25+
cancel-in-progress: true
26+
27+
jobs:
28+
select-env:
29+
uses: ./.github/workflows/_select-env.yml
30+
with:
31+
docker_image_deeploy: ${{ github.event.inputs.docker_image_deeploy || (github.repository == 'pulp-platform/Deeploy' && 'ghcr.io/pulp-platform/deeploy-gap9:latest') }}
32+
33+
gap9-kernels:
34+
needs: select-env
35+
uses: ./.github/workflows/_runner-gap9.yml
36+
with:
37+
runner: ${{ needs.select-env.outputs.runner }}
38+
docker-image: ${{ needs.select-env.outputs.image }}
39+
pytest-marker: "kernels"
40+
41+
gap9-models:
42+
needs: select-env
43+
uses: ./.github/workflows/_runner-gap9.yml
44+
with:
45+
runner: ${{ needs.select-env.outputs.runner }}
46+
docker-image: ${{ needs.select-env.outputs.image }}
47+
pytest-marker: "models"
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# SPDX-FileCopyrightText: 2025 ETH Zurich and University of Bologna
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
---
6+
name: Infrastructure • Generate CCache GAP9
7+
8+
"on":
9+
workflow_dispatch:
10+
inputs:
11+
docker_image_deeploy:
12+
description: "Deeploy GAP9 Image to use"
13+
required: false
14+
default: "ghcr.io/pulp-platform/deeploy-gap9:latest"
15+
schedule:
16+
# Runs the workflow on the default branch every day at 2AM CET to keep the cache fresh
17+
- cron: "0 2 * * *"
18+
19+
jobs:
20+
generate-ccache-gap9:
21+
runs-on: ubuntu-latest
22+
container:
23+
image: ${{ github.event.inputs.docker_image_deeploy || 'ghcr.io/pulp-platform/deeploy-gap9:latest' }}
24+
steps:
25+
- name: Checkout Repo
26+
uses: actions/checkout@v4
27+
with:
28+
submodules: recursive
29+
- name: Build Deeploy
30+
shell: bash
31+
run: |
32+
source /app/install/gap9-sdk/.gap9-venv/bin/activate
33+
source /app/install/gap9-sdk/configs/gap9_evk_audio.sh || true
34+
pip install -e . || true
35+
deactivate
36+
37+
- name: Generate CCache for GAP9
38+
run: |
39+
source /app/install/gap9-sdk/.gap9-venv/bin/activate
40+
source /app/install/gap9-sdk/configs/gap9_evk_audio.sh || true
41+
export GVSOC_INSTALL_DIR=/app/install/gap9-sdk/install/workstation
42+
export GAP_RISCV_GCC_TOOLCHAIN=/app/install/gcc/gap9
43+
cd DeeployTest
44+
mkdir -p /app/.ccache
45+
export CCACHE_DIR=/app/.ccache
46+
pytest 'test_platforms.py::test_gap9_kernels[Kernels/Integer/Add/Regular]' --skipsim
47+
pytest 'test_platforms.py::test_gap9_tiled_kernels_l2_singlebuffer[Kernels/Integer/Add/Large-5000-L2-singlebuffer]' --skipsim
48+
deactivate
49+
50+
- name: Clean and Upload CCache
51+
uses: actions/cache@v4
52+
with:
53+
path: /app/.ccache
54+
key: ccache-gap9

.gitmodules

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
# SPDX-License-Identifier: Apache-2.0
44

55
[submodule "pulp-nn-mixed"]
6-
path = TargetLibraries/PULPOpen/third_party/pulp-nn-mixed
6+
path = TargetLibraries/third_party/pulp-nn-mixed
77
url = https://github.com/pulp-platform/pulp-nn-mixed.git
88
[submodule "pulp-nnx"]
9-
path = TargetLibraries/PULPOpen/third_party/pulp-nnx
9+
path = TargetLibraries/third_party/pulp-nnx
1010
url = https://github.com/pulp-platform/pulp-nnx.git
1111
[submodule "CMSIS-NN"]
1212
path = TargetLibraries/CMSIS/third_party/CMSIS-NN

CHANGELOG.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,15 @@ This file contains the changelog for the Deeploy project. The changelog is divid
55

66

77
### List of Pull Requests
8+
- Deeploy-GAP9 Platform [#143](https://github.com/pulp-platform/Deeploy/pull/143)
89
- Update CLI interface Across Project, Fix Tutorial, and Remove Legacy Test [#157](https://github.com/pulp-platform/Deeploy/pull/157)
910

1011
### Added
11-
-
12+
- Added GAP9 Platform Support: Deployer, Bindings, Templates, Tiler, DMA (L3Dma/MchanDma), target library, CI workflows
1213

1314
### Changed
15+
- Update `pulp-nnx` and `pulp-nn-mixed` submodules to their latest versions
16+
- PULP-NN moved to TargetLibraries third-party folder
1417
- Aligned CLI commands across the project
1518

1619
### Fixed
@@ -50,7 +53,7 @@ This file contains the changelog for the Deeploy project. The changelog is divid
5053
- Fix bias hoisting in generic GEMM with no bias [#126](https://github.com/pulp-platform/Deeploy/pull/126)
5154

5255
### Added
53-
- The `publish.yml` action to build a branch and push it to PyPi. The action is automatically triggered when a tag with the "v*" format is emitted.
56+
- The `publish.yml` action to build a branch and push it to PyPi. The action is automatically triggered when a tag with the "v*" format is emitted.
5457
- I created a release of [Banshee](https://github.com/pulp-platform/banshee/releases/tag/v0.5.0-prebuilt) so we don't need to rebuild it over and over. The `Makefile` now pulls that release depending on the platform.
5558
- I bumped the onnx-graphsurgeon version such that we don't need to use NVIDIA's PyPi index anymore.
5659
- `_export_graph` assigns their export type to the tensors before export.

0 commit comments

Comments
 (0)