Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
5 changes: 2 additions & 3 deletions .github/workflows/ci-platform-gap9-tiled.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,17 @@ name: CI • GAP9 (Tiled)
docker_image_deeploy:
description: "Deeploy Image to use"
required: false
default: "ghcr.io/pulp-platform/deeploy-gap9:latest"
default: "ghcr.io/pulp-platform/deeploy-gap9:devel"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
select-env:
if: github.repository == 'pulp-platform/Deeploy'
uses: ./.github/workflows/_select-env.yml
with:
docker_image_deeploy: ${{ github.event.inputs.docker_image_deeploy || github.repository == 'pulp-platform/Deeploy' && 'ghcr.io/pulp-platform/deeploy-gap9:latest'}}
docker_image_deeploy: ${{ github.event.inputs.docker_image_deeploy || 'ghcr.io/pulp-platform/deeploy-gap9:devel' }}

gap9-kernels-tiled-singlebuffer-L2:
needs: select-env
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/ci-platform-gap9.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ name: CI • GAP9
docker_image_deeploy:
description: "Deeploy Image to use"
required: false
default: "ghcr.io/pulp-platform/deeploy-gap9:latest"
default: "ghcr.io/pulp-platform/deeploy-gap9:devel"


concurrency:
Expand All @@ -26,10 +26,9 @@ concurrency:

jobs:
select-env:
if: github.repository == 'pulp-platform/Deeploy'
uses: ./.github/workflows/_select-env.yml
with:
docker_image_deeploy: ${{ github.event.inputs.docker_image_deeploy || (github.repository == 'pulp-platform/Deeploy' && 'ghcr.io/pulp-platform/deeploy-gap9:latest') }}
docker_image_deeploy: ${{ github.event.inputs.docker_image_deeploy || 'ghcr.io/pulp-platform/deeploy-gap9:devel' }}

gap9-kernels:
needs: select-env
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/infra-generate-ccache-gap9.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ name: Infrastructure • Generate CCache GAP9
docker_image_deeploy:
description: "Deeploy GAP9 Image to use"
required: false
default: "ghcr.io/pulp-platform/deeploy-gap9:latest"
default: "ghcr.io/pulp-platform/deeploy-gap9:devel"
schedule:
# Runs the workflow on the default branch every day at 2AM CET to keep the cache fresh
- cron: "0 2 * * *"
Expand All @@ -21,7 +21,7 @@ jobs:
if: github.repository == 'pulp-platform/Deeploy'
runs-on: ubuntu-latest
container:
image: ${{ github.event.inputs.docker_image_deeploy || 'ghcr.io/pulp-platform/deeploy-gap9:latest' }}
image: ${{ github.event.inputs.docker_image_deeploy || 'ghcr.io/pulp-platform/deeploy-gap9:devel' }}
steps:
- name: Checkout Repo
uses: actions/checkout@v4
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ This file contains the changelog for the Deeploy project. The changelog is divid


### List of Pull Requests
- Fix Broken CI [#175](https://github.com/pulp-platform/Deeploy/pull/175)
- Improve Docstring and Debugging [#160](https://github.com/pulp-platform/Deeploy/pull/160)
- Add GAP9 Container Support [#163](https://github.com/pulp-platform/Deeploy/pull/163)
- Extend Codeowners [#164](https://github.com/pulp-platform/Deeploy/pull/164)
Expand All @@ -23,6 +24,8 @@ This file contains the changelog for the Deeploy project. The changelog is divid
- Added GAP9 Platform Support: Deployer, Bindings, Templates, Tiler, DMA (L3Dma/MchanDma), target library, CI workflows

### Changed
- Use by default `devel` container for GAP9 CI
- Extend Readme platforms with GAP9 shields
- Move `MemoryAwareClosureGeneration` pass to `MemoryLevelExtension`
- Move `MemoryAwarePrint*` passes to `MemoryLevelExtension`
- Make `sizeInBytes` a class property instead of a function
Expand All @@ -35,6 +38,8 @@ This file contains the changelog for the Deeploy project. The changelog is divid
- Added @runwangdl as a code owner

### Fixed
- Fix Docker flow to fetch `*.so` git lfs files
- Downgrade `setuptools` to `81.0.0`
- im2col buffer size in Conv1d template
- Fix missing dependency in pre-commit-config
- Fix test paths in Deeploy 101 tutorial
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ Now you can open the generated code in `DeeployTest/TEST_SIRACUSA/Tests/testMatM
| **Snitch Cluster** | [Snitch paper](https://arxiv.org/abs/2002.10143) | [GVSoC](https://github.com/gvsoc/gvsoc) | [![CI • Snitch](https://github.com/pulp-platform/Deeploy/actions/workflows/ci-platform-snitch.yml/badge.svg)](https://github.com/pulp-platform/Deeploy/actions/workflows/ci-platform-snitch.yml) [![CI • Snitch (Tiled)](https://github.com/pulp-platform/Deeploy/actions/workflows/ci-platform-snitch-tiled.yml/badge.svg)](https://github.com/pulp-platform/Deeploy/actions/workflows/ci-platform-snitch-tiled.yml)
| **SoftHier** | [Repo](https://github.com/gvsoc/gvsoc/tree/soft_hier_release) | [GVSoC](https://github.com/gvsoc/gvsoc/tree/soft_hier_release) | [![CI • SoftHier](https://github.com/pulp-platform/Deeploy/actions/workflows/ci-platform-softhier.yml/badge.svg)](https://github.com/pulp-platform/Deeploy/actions/workflows/ci-platform-softhier.yml)
| **Chimera** | [Repo](https://github.com/pulp-platform/chimera) | [GVSoC](https://github.com/gvsoc/gvsoc) | [![CI • Chimera](https://github.com/pulp-platform/Deeploy/actions/workflows/ci-platform-chimera.yml/badge.svg)](https://github.com/pulp-platform/Deeploy/actions/workflows/ci-platform-chimera.yml)
| **GAP9** | [Repo](https://github.com/pulp-platform/gap-sdk) | [GVSoC](https://github.com/pulp-platform/gap-sdk) | [![CI • GAP9](https://github.com/pulp-platform/Deeploy/actions/workflows/ci-platform-gap9.yml/badge.svg)](https://github.com/pulp-platform/Deeploy/actions/workflows/ci-platform-gap9.yml) [![CI • GAP9 (Tiled)](https://github.com/pulp-platform/Deeploy/actions/workflows/ci-platform-gap9-tiled.yml/badge.svg)](https://github.com/pulp-platform/Deeploy/actions/workflows/ci-platform-gap9-tiled.yml)


## Publications

Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ readme = "README.md"

requires-python = ">=3.10"
dependencies = [
'setuptools==81.0.0',
'protobuf==4.23.3',
'numpy<2.0.0',
'onnx',
Expand Down
71 changes: 46 additions & 25 deletions scripts/gap9-build_sdk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,36 +5,49 @@
# SPDX-License-Identifier: Apache-2.0

# gap9-build_sdk.sh
# Helper script to clone, patch and build the GAP9 SDK. Intended to be
# invoked from the Makefile with environment variables set:
# GAP9_SDK_INSTALL_DIR (required)
# GAP9_SDK_COMMIT_HASH (optional, fallback provided)
# ROOT_DIR (optional, defaults to script dir)
#
# Clone, prepare, patch, and build a GAP9 SDK checkout in place.
# This script is intended to be called from the project Makefile.
#
# Environment variables:
# GAP9_SDK_INSTALL_DIR Required. Target directory for the SDK checkout/build.
# GAP9_SDK_COMMIT_HASH Required. Commit to checkout.
# GAP_SDK_URL Required. Git remote used for fetching the SDK.
# ROOT_DIR Optional. Base directory for patch lookup.
# Default: directory of this script.

ROOT_DIR="${ROOT_DIR:-$(cd "$(dirname "$0")" && pwd)}"
GAP9_SDK_INSTALL_DIR="${GAP9_SDK_INSTALL_DIR:?GAP9_SDK_INSTALL_DIR must be set}"
GAP9_SDK_COMMIT_HASH="${GAP9_SDK_COMMIT_HASH:-897955d7ab326bd31684429eb16a2e485ab89afb}"
GAP_SDK_URL="${GAP_SDK_URL:-git@iis-git.ee.ethz.ch:wiesep/gap9_sdk.git}"
GAP9_SDK_COMMIT_HASH="${GAP9_SDK_COMMIT_HASH:?GAP9_SDK_COMMIT_HASH must be set}"
GAP_SDK_URL="${GAP_SDK_URL:?GAP_SDK_URL must be set}"

echo "Preparing GAP9 SDK in: ${GAP9_SDK_INSTALL_DIR}"
mkdir -p "${GAP9_SDK_INSTALL_DIR}"
# Fail if CD fails, e.g. due to missing permissions or if the path is a file.
cd "${GAP9_SDK_INSTALL_DIR}" || exit 1

if [ -d "${GAP9_SDK_INSTALL_DIR}/.git" ]; then
echo "Directory ${GAP9_SDK_INSTALL_DIR} already exists and looks like a git repo. Updating remote URL and fetching latest changes..."
cd "${GAP9_SDK_INSTALL_DIR}" || exit 1
git remote set-url origin "${GAP_SDK_URL}" || true
if [ ! -d ".git" ]; then
# Support reusing a pre-created directory that is not yet a git repo.
echo "Directory exists but .git folder is missing. Reinitializing git repository..."
git init
git remote add origin "${GAP_SDK_URL}"
git fetch --depth=1 origin ${GAP9_SDK_COMMIT_HASH}
GIT_LFS_SKIP_SMUDGE=1 git reset --hard "${GAP9_SDK_COMMIT_HASH}"
else
echo "Cloning GAP9 SDK..."
GIT_LFS_SKIP_SMUDGE=1 git clone "${GAP_SDK_URL}" "${GAP9_SDK_INSTALL_DIR}"
# Keep local uncommitted changes out of the way before checkout.
echo "Setting remote URL and fetching latest changes..."
git remote set-url origin "${GAP_SDK_URL}"
git fetch --depth=1 origin ${GAP9_SDK_COMMIT_HASH}
git add .
git stash || true # Stash may fail if there are no changes, ignore that.
fi

cd "${GAP9_SDK_INSTALL_DIR}" || exit 1
echo "Checking out commit ${GAP9_SDK_COMMIT_HASH} (stash and fetch if necessary)"
git fetch --all --tags || true
git stash || true
GIT_LFS_SKIP_SMUDGE=1 git checkout "${GAP9_SDK_COMMIT_HASH}"
git submodule update --init --recursive
git lfs pull --include="*.so"

# Platform specific patch
# Select platform patch by Debian arch first, then uname fallback.
ARCH=$(dpkg --print-architecture 2>/dev/null || true)
if [ -z "$ARCH" ]; then
ARCH=$(uname -m)
Expand All @@ -45,14 +58,22 @@ arm64 | aarch64) PATCH=gap9-arm64.patch ;;
*) PATCH= ;;
esac

set -e # Enable strict error handling for the build process
if [ -n "$PATCH" ] && [ -f "${ROOT_DIR}/${PATCH}" ]; then
echo "Applying platform patch: $PATCH"
git apply "${ROOT_DIR}/${PATCH}"
set -e # Fail fast for patch/build operations.
if [ -n "$PATCH" ]; then
if [ -f "${ROOT_DIR}/${PATCH}" ]; then
echo "Applying platform patch from ${ROOT_DIR}: $PATCH"
git apply "${ROOT_DIR}/${PATCH}"
elif [ -f "${ROOT_DIR}/Container/${PATCH}" ]; then
echo "Applying platform patch from ${ROOT_DIR}/Container: $PATCH"
git apply "${ROOT_DIR}/Container/${PATCH}"
else
echo "No platform-specific patch to apply for architecture '$ARCH' (looked for ${ROOT_DIR}/${PATCH} and ${ROOT_DIR}/Container/${PATCH})"
fi
else
echo "No platform-specific patch to apply for architecture '$ARCH' (looked for ${ROOT_DIR}/${PATCH})"
echo "No platform-specific patch to apply for architecture '$ARCH'"
fi
set +e # Disable strict error handling to allow deactivation even if build fails

set +e # Relax mode so cleanup/deactivate still runs on non-critical failures.

echo "Setting up Python virtual environment and installing dependencies"
python -m venv .gap9-venv
Expand All @@ -62,9 +83,9 @@ echo "Sourcing GAP9 SDK environment"
. configs/gap9_evk_audio.sh || true

echo "Invoking make install_dependency cmake_sdk.build"
set -e # Enable strict error handling for the build process
set -e # Build must stop immediately on errors.
make install_dependency cmake_sdk.build openocd.all autotiler.all
set +e # Disable strict error handling to allow deactivation even if build fails
set +e # Allow deactivation even if previous step failed.

deactivate

Expand Down
Loading