Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
9ce2363
Update gitignore
Victor-Jung Mar 12, 2026
a937482
XDNA2 Platform Beta Support
Victor-Jung Mar 12, 2026
19e36c4
Add XDNA container
Victor-Jung Mar 17, 2026
5645eca
First attempt at generating MLIR code with Deeploy
Victor-Jung Mar 18, 2026
198df6a
Generate tiled code but too much logic is in the Template
Victor-Jung Mar 18, 2026
f550712
Move data movement in passes. Template represent for loop and aquire/…
Victor-Jung Mar 18, 2026
695a78a
Template is agnostic of tiling and data movement that are handled by …
Victor-Jung Mar 18, 2026
041f4f6
Add CI on self hosted runner
Victor-Jung Mar 19, 2026
ec8dbf5
Remove unecessary install
Victor-Jung Mar 19, 2026
edce995
Add cleanup step before checkout to fix permission
Victor-Jung Mar 19, 2026
b700881
aie import is optional to not enforce mlir-aie and llvm-aie package i…
Victor-Jung Mar 24, 2026
849c26e
Decouple xdna requirements from dev requirements
Victor-Jung Mar 24, 2026
aa85772
Format
Victor-Jung Mar 24, 2026
2e5acff
Format
Victor-Jung Mar 24, 2026
338cd9b
Add general todos for future refactoring
Victor-Jung Mar 26, 2026
0ac57e6
Format
Victor-Jung Mar 26, 2026
ce90206
Free output tasks in RT sequence
Victor-Jung May 7, 2026
d565dfe
Add -v flag for XDNA platform only.
Victor-Jung May 7, 2026
1d80113
Pin llvm-aie version
Victor-Jung May 7, 2026
97746fe
Add remainder loop to Add kernel
Victor-Jung May 7, 2026
e90e0ed
Use workdir to easily discard build-time files
Victor-Jung May 7, 2026
8a8e4f2
Bump mlir-aie to v1.3.2 and use llvm-aie nightly
Victor-Jung Jun 17, 2026
7825a61
Add docker action for XDNA
Victor-Jung Jun 17, 2026
b42625e
Use exernal_function instead of link_with to respect new norm from ML…
Victor-Jung Jun 17, 2026
8b4c504
Remove redundent mapping
Victor-Jung Jun 17, 2026
d46c45f
Format
Victor-Jung Jun 17, 2026
b8e9e34
Update Changelog
Victor-Jung Jun 17, 2026
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
54 changes: 54 additions & 0 deletions .github/workflows/_runner-xdna2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# SPDX-FileCopyrightText: 2025 ETH Zurich and University of Bologna
#
# SPDX-License-Identifier: Apache-2.0

---
name: _runner-xdna2

"on":
workflow_call:
inputs:
pytest-marker:
required: true
type: string
docker-image:
required: false
type: string
default: "deeploy-xdna:local"

jobs:
test-runner-xdna2:
runs-on: xdna2-npu
# NOTE: We cannot use the `container:` directive here because
# GitHub Actions does not support `--device` flags required for
# NPU access (/dev/accel/accel0). Instead we use explicit
# `docker run` commands.
steps:
- name: Fix workspace permissions
shell: bash
run: |
docker run --rm \
-v "${{ github.workspace }}":/workspace \
${{ inputs.docker-image }} \
chown -R $(id -u):$(id -g) /workspace || true
Comment thread
Victor-Jung marked this conversation as resolved.

- name: Checkout Repo
uses: actions/checkout@v4
with:
submodules: recursive

- name: Run Tests in Docker
shell: bash
run: |
docker run --rm \
--device /dev/accel/accel0 \
--ulimit memlock=-1 \
-v /opt/xilinx:/opt/xilinx \
-v "${{ github.workspace }}":/app/Deeploy \
-w /app/Deeploy \
${{ inputs.docker-image }} \
bash -c "
pip install -e . &&
cd DeeployTest &&
pytest test_platforms.py -v -m 'xdna2 and ${{ inputs.pytest-marker }}'
"
31 changes: 31 additions & 0 deletions .github/workflows/ci-platform-xdna2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# SPDX-FileCopyrightText: 2025 ETH Zurich and University of Bologna
#
# SPDX-License-Identifier: Apache-2.0

---
name: CI • XDNA2

"on":
push:
branches:
- "**"
tags:
- "v*.*.*"
pull_request:
workflow_dispatch:
inputs:
docker_image:
description: "XDNA2 Docker image (must be pre-built on the runner)"
required: false
default: "deeploy-xdna:local"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why use the local file and not ghcr.io/pulp-platform/deeploy-xdnba:devel"?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because right now the CI runs locally on one of my machine and I don't have collaborators. Once this platform becomes more mainstream I think it will be a good idea to publish a docker but until then it's overkill IMO. Especially considering that the XDNA platform has little dependencies.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, okay, I do not fully agree,' as building the container and making it available to others is very easy. But if you insist, I wont prevent the merge because of this.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 131cc2e


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

jobs:
xdna2-kernels:
uses: ./.github/workflows/_runner-xdna2.yml
with:
pytest-marker: "kernels"
docker-image: ${{ inputs.docker_image || 'deeploy-xdna:local' }}
100 changes: 100 additions & 0 deletions .github/workflows/docker-build-deeploy-xdna.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
# SPDX-FileCopyrightText: 2026 ETH Zurich and University of Bologna
#
# SPDX-License-Identifier: Apache-2.0

---
name: Docker • Build Deeploy XDNA Container

"on":
workflow_dispatch:

jobs:
prepare:
name: Fetch branch name or tag
runs-on: ubuntu-latest
outputs:
docker_tag: ${{ steps.generate_tag.outputs.docker_tag }}
steps:
- uses: actions/checkout@v4

- name: Set up environment variables
run: |
echo "BRANCH_NAME=${GITHUB_REF##*/}" >> $GITHUB_ENV
echo "TAG_NAME=${GITHUB_REF##*/}" >> $GITHUB_ENV
echo "IS_TAG=${GITHUB_REF_TYPE}" >> $GITHUB_ENV

- name: Set Docker tag
id: generate_tag
run: |
if [[ "${{ env.IS_TAG }}" == "tag" ]]; then
echo "docker_tag=${{ env.TAG_NAME }}" >> $GITHUB_OUTPUT
else
echo "docker_tag=${{ env.BRANCH_NAME }}" >> $GITHUB_OUTPUT
fi

build-deeploy-xdna:
name: Build Deeploy XDNA Image
needs: [prepare]
runs-on: ubuntu-latest
outputs:
digest-amd64: ${{ steps.digest.outputs.digest-amd64 }}
steps:
- uses: actions/checkout@v4

- name: Free up disk space
uses: jlumbroso/free-disk-space@v1.3.1
with:
tool-cache: true
android: true
dotnet: true
haskell: true
large-packages: true

- uses: docker/setup-buildx-action@v3

- name: GHCR Log-in
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build Cache for Docker
id: cache
uses: actions/cache@v4
with:
path: var-ccache
key: ${{ runner.os }}-amd64-build-cache-deeploy-xdna

- name: Inject build-cache
uses: reproducible-containers/buildkit-cache-dance@v3.1.0
with:
cache-map: |
{
"var-ccache": "/ccache"
}
skip-extraction: ${{ steps.cache.outputs.cache-hit }}

- name: Lower Case Repository Name
run: |
echo "OWNER_LC=${OWNER,,}" >>${GITHUB_ENV}
env:
OWNER: "${{ github.repository_owner }}"

- name: Build and push Deeploy XDNA image
id: build
uses: docker/build-push-action@v6
with:
platforms: linux/amd64
context: .
cache-from: type=gha
cache-to: type=gha,mode=min
file: Container/Dockerfile.deeploy-xdna
push: true
tags: |
ghcr.io/${{ env.OWNER_LC }}/deeploy-xdna:latest
ghcr.io/${{ env.OWNER_LC }}/deeploy-xdna:${{ needs.prepare.outputs.docker_tag }}

- name: Extract image digest
id: digest
run: echo "digest-amd64=${{ steps.build.outputs.digest }}" >> $GITHUB_OUTPUT
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,6 @@ CHANGELOG_GEN.md
.pyusbip/
.cache/

CLAUDE.md
# Claude context file
CLAUDE.md
Comment thread
Xeratec marked this conversation as resolved.
Container/xrt-debs/
10 changes: 10 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
- XDNA2 Platform Support [#179](https://github.com/pulp-platform/Deeploy/pull/179)
- Add Microbenchmarking Infrastructure and CI Using GVSoC CSR [#162](https://github.com/pulp-platform/Deeploy/pull/162)
- Fix CI Cache Generation [#176](https://github.com/pulp-platform/Deeploy/pull/176)
- Fix Broken CI [#175](https://github.com/pulp-platform/Deeploy/pull/175)
Expand All @@ -20,6 +21,12 @@ This file contains the changelog for the Deeploy project. The changelog is divid
- Fix GAP9 L3 Board Tests: readfs Flash Ordering and Duplicate Input Data [#196](https://github.com/pulp-platform/Deeploy/pull/196)

### Added
- XDNA2 (AIE2p) platform beta: first MLIR backend for Deeploy, targeting AMD/Xilinx NPU2 with a single BF16 Add kernel
- `MLIRNodeTemplate` and `MLIRCodeTransformation` base classes for MLIR-emitting backends
- Auto-tiling with L1 memory constraints for XDNA2
- XRT-based testbench with BF16 ULP tolerance comparison
- Docker container (`Dockerfile.deeploy-xdna`) and GitHub Actions build workflow
- CI workflow for XDNA2 on self-hosted runner
- Add many missing docstrings
- Add `__repr__()` function for `_ReferenceBuffer` class
- GAP9 Container Support with ARM64 architecture support
Expand All @@ -31,6 +38,9 @@ This file contains the changelog for the Deeploy project. The changelog is divid
- Add support for the Generic target for the following operators [Ceil](https://onnx.ai/onnx/operators/onnx__Ceil.html), [Floor](https://onnx.ai/onnx/operators/onnx__Floor.html), [Clip](https://onnx.ai/onnx/operators/onnx__Clip.html), [Sub](https://onnx.ai/onnx/operators/onnx__Sub.html), [Exp](https://onnx.ai/onnx/operators/onnx__Exp.html), [Sigmoid](https://onnx.ai/onnx/operators/onnx__Sigmoid.html), [Swish](https://onnx.ai/onnx/operators/onnx__Swish.html), [HardSigmoid](https://onnx.ai/onnx/operators/onnx__HardSigmoid.html), [HardSwish](https://onnx.ai/onnx/operators/onnx__HardSwish.html), [InstanceNormalization](https://onnx.ai/onnx/operators/onnx__InstanceNormalization.html), [GroupNormalization](https://onnx.ai/onnx/operators/onnx__GroupNormalization.html), [AveragePool](https://onnx.ai/onnx/operators/onnx__AveragePool.html), [GlobalAveragePool](https://onnx.ai/onnx/operators/onnx__GlobalAveragePool.html), [GlobalMaxPool](https://onnx.ai/onnx/operators/onnx__GlobalMaxPool.html).

### Changed
- `aie.dialects` API: move `link_with` from `aie_d.core()` to `aie_d.external_func()` (mlir-aie v1.3.2)
- Decouple XDNA requirements (`requirements-xdna.txt`) from base dev requirements
- Make `aie` import optional to not enforce mlir-aie package installation for non-XDNA users
- Use by default `devel` container for GAP9 CI
- Extend Readme platforms with GAP9 shields
- Move `MemoryAwareClosureGeneration` pass to `MemoryLevelExtension`
Expand Down
17 changes: 17 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ elseif(platform STREQUAL SoftHier)
message(STATUS "Building for platform 'SoftHier'")
elseif(platform STREQUAL Chimera)
message(STATUS "Building for platform 'Chimera'")
elseif(platform STREQUAL XDNA2)
message(STATUS "Building for platform 'XDNA2'")
else()
message(FATAL_ERROR "Invalid platform '${platform}' specified!")
endif()
Expand Down Expand Up @@ -309,5 +311,20 @@ if(platform STREQUAL Chimera)

endif()

if(platform STREQUAL XDNA2)

project(${TESTNAME} LANGUAGES CXX)

message(STATUS "============================= XDNA2 Configuration ============================")
message(STATUS "[cMake ] GENERATED_SOURCE = " ${GENERATED_SOURCE})
message(STATUS "[cMake ] TESTNAME = " ${TESTNAME})
message(STATUS "==============================================================================")
message(STATUS "")

add_subdirectory(TargetLibraries/XDNA2)
add_subdirectory(DeeployTest/Platforms/XDNA2)

endif()


print_simulation_config()
56 changes: 56 additions & 0 deletions Container/Dockerfile.deeploy-xdna
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# SPDX-FileCopyrightText: 2026 ETH Zurich and University of Bologna
#
# SPDX-License-Identifier: Apache-2.0

FROM ubuntu:24.04

ARG DEBIAN_FRONTEND=noninteractive
ENV TZ=Etc/UTC
ENV LANG=C.UTF-8
ENV LC_ALL=C.UTF-8
ENV PIP_BREAK_SYSTEM_PACKAGES=1
ENV LLVM_INSTALL_DIR="nope"

WORKDIR /app/build

RUN apt-get update && apt-get install -y \
software-properties-common \
&& add-apt-repository -y ppa:amd-team/xrt \
&& apt-get update && apt-get install -y \
cmake \
ninja-build \
g++ \
git \
git-lfs \
python3 \
python3-pip \
python-is-python3 \
uuid-dev \
wget \
curl \
ccache \
libxrt2 \
libxrt-npu2 \
libxrt-dev \
libxrt-utils \
libxrt-utils-npu \
&& rm -rf /var/lib/apt/lists/*

ENV XILINX_XRT=/opt/xilinx/xrt
ENV PATH=${XILINX_XRT}/bin:${PATH}
ENV LD_LIBRARY_PATH=${XILINX_XRT}/lib

# Remove unused files and clean up to reduce image size
WORKDIR /app
RUN rm -rf /app/build

COPY pyproject.toml requirements-xdna.txt ./
RUN pip install toml-to-requirements && \
toml-to-req --toml-file pyproject.toml && \
pip install -r requirements.txt && \
pip install -r requirements-xdna.txt && \
rm -f requirements.txt pyproject.toml requirements-xdna.txt

ENV MLIR_AIE_PYTHON=/usr/bin/python3

WORKDIR /app/Deeploy
Comment thread
Xeratec marked this conversation as resolved.
Loading
Loading