-
Notifications
You must be signed in to change notification settings - Fork 46
Beta Support for XDNA2 Platform #179
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
Merged
Victor-Jung
merged 30 commits into
pulp-platform:devel
from
Victor-Jung:pr/xdna-support
Jun 23, 2026
Merged
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
9ce2363
Update gitignore
Victor-Jung a937482
XDNA2 Platform Beta Support
Victor-Jung 19e36c4
Add XDNA container
Victor-Jung 5645eca
First attempt at generating MLIR code with Deeploy
Victor-Jung 198df6a
Generate tiled code but too much logic is in the Template
Victor-Jung f550712
Move data movement in passes. Template represent for loop and aquire/…
Victor-Jung 695a78a
Template is agnostic of tiling and data movement that are handled by …
Victor-Jung 041f4f6
Add CI on self hosted runner
Victor-Jung ec8dbf5
Remove unecessary install
Victor-Jung edce995
Add cleanup step before checkout to fix permission
Victor-Jung b700881
aie import is optional to not enforce mlir-aie and llvm-aie package i…
Victor-Jung 849c26e
Decouple xdna requirements from dev requirements
Victor-Jung aa85772
Format
Victor-Jung 2e5acff
Format
Victor-Jung 338cd9b
Add general todos for future refactoring
Victor-Jung 0ac57e6
Format
Victor-Jung ce90206
Free output tasks in RT sequence
Victor-Jung d565dfe
Add -v flag for XDNA platform only.
Victor-Jung 1d80113
Pin llvm-aie version
Victor-Jung 97746fe
Add remainder loop to Add kernel
Victor-Jung e90e0ed
Use workdir to easily discard build-time files
Victor-Jung 8a8e4f2
Bump mlir-aie to v1.3.2 and use llvm-aie nightly
Victor-Jung 7825a61
Add docker action for XDNA
Victor-Jung b42625e
Use exernal_function instead of link_with to respect new norm from ML…
Victor-Jung 8b4c504
Remove redundent mapping
Victor-Jung d46c45f
Format
Victor-Jung b8e9e34
Update Changelog
Victor-Jung 1cc2113
Use the xdna docker image from ghcr instead of local image
Victor-Jung 6808a28
Fix typo
Victor-Jung 6636ad9
Rename MLIRDataTypes into MLIRAIETypes
Victor-Jung File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| # 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 | ||
|
|
||
| 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 | ||
|
|
||
| - 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 }}' | ||
| " | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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_deeploy: | ||
| description: "XDNA2 Deeploy Docker Image to use" | ||
| required: false | ||
| default: "ghcr.io/pulp-platform/deeploy-xdna:devel" | ||
|
|
||
| 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 || 'ghcr.io/pulp-platform/deeploy-xdna:devel' }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
|
Xeratec marked this conversation as resolved.
|
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.