-
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
base: devel
Are you sure you want to change the base?
Changes from all commits
9ce2363
a937482
19e36c4
5645eca
198df6a
f550712
695a78a
041f4f6
ec8dbf5
edce995
b700881
849c26e
aa85772
2e5acff
338cd9b
0ac57e6
ce90206
d565dfe
1d80113
97746fe
e90e0ed
8a8e4f2
7825a61
b42625e
8b4c504
d46c45f
b8e9e34
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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 | ||
|
|
||
| - 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 }}' | ||
| " | ||
| 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" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why use the local file and not
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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' }} | ||
| 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 |
| 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.
|
||
Uh oh!
There was an error while loading. Please reload this page.