Skip to content

Commit ac42948

Browse files
authored
Merge branch 'pulp-platform:devel' into devel
2 parents 9b44940 + 59a268d commit ac42948

File tree

13 files changed

+141
-148
lines changed

13 files changed

+141
-148
lines changed

.github/workflows/publish.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# SPDX-FileCopyrightText: 2025 ETH Zurich and University of Bologna
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
name: Publish
6+
7+
on:
8+
push:
9+
tags:
10+
- "v*"
11+
workflow_dispatch:
12+
13+
permissions:
14+
contents: read
15+
id-token: write
16+
17+
env:
18+
UV_EXTRA_INDEX_URL: https://pypi.ngc.nvidia.com
19+
20+
jobs:
21+
publish-pypi:
22+
name: Publish to PyPI
23+
if: github.event_name == 'push'
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@v5
28+
29+
- name: Install uv
30+
uses: astral-sh/setup-uv@v7
31+
32+
- name: Build artifacts
33+
run: uv build
34+
35+
- name: Test wheel installation
36+
run: uv run --isolated --no-project --with dist/*.whl python -c "import Deeploy"
37+
38+
- name: Test sdist installation
39+
run: uv run --isolated --no-project --with dist/*.tar.gz python -c "import Deeploy"
40+
41+
- name: Publish to PyPI
42+
run: uv publish
43+
44+
publish-test-pypi:
45+
name: Publish to Test PyPI
46+
if: github.event_name == 'workflow_dispatch'
47+
runs-on: ubuntu-latest
48+
steps:
49+
- name: Checkout
50+
uses: actions/checkout@v5
51+
52+
- name: Install uv
53+
uses: astral-sh/setup-uv@v7
54+
55+
- name: Build artifacts
56+
run: uv build
57+
58+
- name: Test wheel installation
59+
run: uv run --isolated --no-project --with dist/*.whl python -c "import Deeploy"
60+
61+
- name: Test sdist installation
62+
run: uv run --isolated --no-project --with dist/*.tar.gz python -c "import Deeploy"
63+
64+
- name: Publish to Test PyPI
65+
run: uv publish --publish-url https://test.pypi.org/legacy/

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ This file contains the changelog for the Deeploy project. The changelog is divid
44
## Unreleased (Planned Release Target: v0.2.1)
55

66
### List of Pull Requests
7+
- PyPi Package Deployment + Remove Banshee Dept [#154](https://github.com/pulp-platform/Deeploy/pull/154)
78
- PyTest Migration [#144](https://github.com/pulp-platform/Deeploy/pull/144)
89
- Update submodule `pulp-nn-mixed` [#145](https://github.com/pulp-platform/Deeploy/pull/145)
910
- Improve Profiling [#138](https://github.com/pulp-platform/Deeploy/pull/138)
@@ -31,6 +32,10 @@ This file contains the changelog for the Deeploy project. The changelog is divid
3132
- Fix bias hoisting in generic GEMM with no bias [#126](https://github.com/pulp-platform/Deeploy/pull/126)
3233

3334
### Added
35+
- 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.
36+
- 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.
37+
- I bumped the onnx-graphsurgeon version such that we don't need to use NVIDIA's PyPi index anymore.
38+
- `_export_graph` assigns their export type to the tensors before export.
3439
- `pytest` and `pytest-xdist` as dependencies of Deeploy.
3540
- A `pytest.ini` for the global configuration of PyTest for the project.
3641
- `conftest.py` to define CLI args for PyTest for the whole project, it also defines a set of global fixtures and markers.
@@ -93,6 +98,7 @@ This file contains the changelog for the Deeploy project. The changelog is divid
9398
- Calculate non-kernel overhead and show total time spent during profiling
9499

95100
### Changed
101+
- Rename package name from `PULP-Deeploy` to `deeploy-pulp`.
96102
- Each CI workflow has been simplified to call the pytest suite with certain markers.
97103
- Structure of Tests subdir for improved ordering
98104
- Structure of .gitignore file for improved ordering
@@ -137,6 +143,8 @@ This file contains the changelog for the Deeploy project. The changelog is divid
137143
- Print kernel profiling information for all memory levels
138144

139145
### Fixed
146+
- Update `install.md` to remove rust mention and fix test command.
147+
- Update `README.md` to remove reference to NVIDIA's PyPi index.
140148
- `nvidia-pyindex` was broken as it now tries to build the wheel to respect the new policy on packages using `pyproject`. Instead of installing this package, we just add the `https://pypi.ngc.nvidia.com` channel to the pip config file.
141149
- Pin versions of broken dependencies of Banshee.
142150
- Fixed ReduceMean parallelization and tiling issues described in Issue [#134](https://github.com/pulp-platform/Deeploy/issues/134).

Container/Dockerfile.deeploy

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ FROM ${BASE_IMAGE} AS toolchain
88

99
# Intermediate Stage
1010
ARG DEBIAN_FRONTEND=noninteractive
11-
ARG BENDER_VERSION=0.28.1
11+
ARG BENDER_VERSION=0.29.1
1212
ARG UBUNTU_VERSION=22.04
1313
ARG TARGETPLATFORM
1414

1515
ENV DEBIAN_FRONTEND=noninteractive
1616
ENV TZ=Etc/UTC
17-
ENV PATH="/root/.cargo/bin:/app/bender:${PATH}"
17+
ENV PATH="/app/install/bender:${PATH}"
1818
ENV LLVM_INSTALL_DIR=/app/install/llvm
1919

2020
WORKDIR /app
@@ -42,14 +42,13 @@ RUN --mount=type=cache,target=/ccache \
4242
ccache -s
4343

4444
# Install Bender
45-
RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \
45+
RUN mkdir -p /app/install/bender && \
46+
if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \
4647
wget https://github.com/pulp-platform/bender/releases/download/v${BENDER_VERSION}/bender-${BENDER_VERSION}-x86_64-linux-gnu-ubuntu${UBUNTU_VERSION}.tar.gz && \
47-
tar xzf bender-${BENDER_VERSION}-x86_64-linux-gnu-ubuntu${UBUNTU_VERSION}.tar.gz && \
48-
cp /app/bender /bin; \
48+
tar xzf bender-${BENDER_VERSION}-x86_64-linux-gnu-ubuntu${UBUNTU_VERSION}.tar.gz -C /app/install/bender; \
4949
elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then \
50-
wget https://github.com/Xeratec/bender/releases/download/v0.28.3-rc1/bender-0.28.3-rc1-arm64-linux-gnu-ubuntu${UBUNTU_VERSION}.tar.gz && \
51-
tar xzf bender-0.28.3-rc1-arm64-linux-gnu-ubuntu${UBUNTU_VERSION}.tar.gz && \
52-
cp /app/bender /bin; \
50+
wget https://github.com/pulp-platform/bender/releases/download/v${BENDER_VERSION}/bender-${BENDER_VERSION}-arm64-linux-gnu-ubuntu${UBUNTU_VERSION}.tar.gz && \
51+
tar xzf bender-${BENDER_VERSION}-arm64-linux-gnu-ubuntu${UBUNTU_VERSION}.tar.gz -C /app/install/bender; \
5352
fi
5453

5554
# Compile Snitch Runtime
@@ -77,10 +76,12 @@ ENV SNITCH_HOME=/app/install/snitch_cluster
7776
ENV CHIMERA_SDK_HOME=/app/install/chimera-sdk
7877
ENV LLVM_INSTALL_DIR=/app/install/llvm
7978
ENV GVSOC_INSTALL_DIR=/app/install/gvsoc
79+
ENV BANSHEE_INSTALL_DIR=/app/install/banshee
8080
ENV SOFTHIER_INSTALL_DIR=/app/install/softhier
8181
ENV MINIMALLOC_INSTALL_DIR=/app/install/minimalloc
8282
ENV MEMPOOL_HOME=/app/install/mempool
83-
ENV PATH=/root/.cargo/bin:/app/install/qemu/bin:/app/install/banshee:$PATH
83+
ENV BENDER_INSTALL_DIR=/app/install/bender
84+
ENV PATH=/app/install/qemu/bin:/app/install/banshee:/app/install/bender:$PATH
8485

8586
WORKDIR /app
8687

@@ -90,8 +91,7 @@ COPY pyproject.toml ./
9091
RUN mkdir -p /etc && printf "[global]\nextra-index-url = https://pypi.ngc.nvidia.com\n" > /etc/pip.conf
9192

9293
# Install dependencies
93-
RUN mkdir -p /root/.cargo/bin/ && \
94-
apt-get update && \
94+
RUN apt-get update && \
9595
apt-get install -y git-lfs \
9696
wget \
9797
ccache \
@@ -128,4 +128,3 @@ RUN pip install -r requirements-dev.txt -r core-requirements.txt -r gapy-require
128128

129129
# Copy pre-built toolchains and emulators
130130
COPY --from=toolchain /app/install ./install
131-
COPY --from=toolchain /root/.cargo/bin/banshee /root/.cargo/bin/banshee

Container/Dockerfile.toolchain

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ ENV TZ=Etc/UTC
1313
ENV CC="ccache gcc"
1414
ENV CXX="ccache g++"
1515
ENV CCACHE_DIR=/ccache
16-
ENV PATH="/root/.cargo/bin:${PATH}"
1716

1817
# Change the working directory
1918
WORKDIR /app
@@ -68,14 +67,6 @@ RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && \
6867
python get-pip.py && \
6968
rm get-pip.py
7069

71-
# Build Rust tools
72-
RUN apt remove cargo -y && \
73-
apt autoremove -y && \
74-
curl https://sh.rustup.rs -sSf | bash -s -- -y && \
75-
rustup install 1.63.0 && \
76-
rustup default 1.63.0 && \
77-
rustup component add rust-src
78-
7970
# Install meson
8071
RUN pip install meson
8172

Deeploy/DeeployTypes.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3104,6 +3104,12 @@ def _exportGraph(self, folderPath, fileName):
31043104
if not os.path.isabs(absoluteOnnxPath) or not os.path.isabs(absoluteDataPath):
31053105
raise OSError(f"Error exporting the context to: {absoluteOnnxPath}")
31063106

3107+
# VJUNG: ONNX-Graphsurgeon needs tensors to be in their export types
3108+
constTensors = [tensor for tensor in self.graph.tensors().values() if isinstance(tensor, gs.Constant)]
3109+
for tensor in constTensors:
3110+
if tensor.dtype != tensor.export_dtype:
3111+
tensor.values = tensor.values.astype(tensor.export_dtype)
3112+
31073113
model = gs.export_onnx(self.graph)
31083114

31093115
# Annotate additional information in doc_string of tensors

Makefile

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ CMAKE ?= cmake
4242
LLVM_COMMIT_HASH ?= 1ccb97ef1789b8c574e3fcab0de674e11b189b96
4343
PICOLIBC_COMMIT_HASH ?= 31ff1b3601b379e4cab63837f253f59729ce1fef
4444
PULP_SDK_COMMIT_HASH ?= 7f4f22516157a1b7c55bcbbc72ca81326180b3b4
45-
BANSHEE_COMMIT_HASH ?= 0e105921e77796e83d01c2aa4f4cadfa2005b4d9
4645
MEMPOOL_COMMIT_HASH ?= affd45d94e05e375a6966af6a762deeb182a7bd6
4746
SNITCH_COMMIT_HASH ?= e02cc9e3f24b92d4607455d5345caba3eb6273b2
4847
SOFTHIER_COMMIT_HASH ?= 0 # bowwang: to be updated
@@ -53,7 +52,22 @@ XTL_VERSION ?= 0.7.5
5352
XSIMD_VERSION ?= 13.2.0
5453
XTENSOR_VERSION ?= 0.25.0
5554

56-
RUSTUP_CARGO ?= $$(rustup which cargo)
55+
OS := $(shell uname -s)
56+
ARCH:= $(shell uname -m)
57+
58+
ifeq ($(OS),Linux)
59+
ifeq ($(ARCH),x86_64)
60+
TARGET := x86_64-unknown-linux-gnu
61+
else ifeq ($(ARCH),aarch64)
62+
TARGET := aarch64-unknown-linux-gnu
63+
else
64+
$(error unsupported Linux architecture $(ARCH))
65+
endif
66+
else ifeq ($(OS),Darwin)
67+
TARGET := aarch64-apple-darwin
68+
else
69+
$(error unsupported platform $(OS))
70+
endif
5771

5872
all: toolchain emulators docs echo-bash
5973

@@ -503,11 +517,11 @@ ${TOOLCHAIN_DIR}/banshee:
503517
git submodule update --init --recursive && \
504518
git apply ${TOOLCHAIN_DIR}/banshee.patch
505519

506-
${BANSHEE_INSTALL_DIR}: ${TOOLCHAIN_DIR}/banshee
520+
${BANSHEE_INSTALL_DIR}:
507521
export LLVM_SYS_150_PREFIX=${LLVM_INSTALL_DIR} && \
508-
cd ${TOOLCHAIN_DIR}/banshee/ && \
509-
${RUSTUP_CARGO} clean && \
510-
${RUSTUP_CARGO} install --path . -f
522+
mkdir -p ${BANSHEE_INSTALL_DIR} && cd ${BANSHEE_INSTALL_DIR} && \
523+
curl -LO https://github.com/pulp-platform/banshee/releases/download/v0.5.0-prebuilt/banshee-0.5.0-$(TARGET).tar.gz && \
524+
tar -xzf banshee-0.5.0-$(TARGET).tar.gz --strip-components=1 -C .
511525

512526
banshee: ${BANSHEE_INSTALL_DIR}
513527

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# Deeploy: DNN Compiler for Heterogeneous SoCs
66
</div>
77

8-
[![Documentation Status](https://img.shields.io/github/deployments/pulp-platform/Deeploy/github-pages?logo=readthedocs&logoColor=white&label=Docs
8+
![PyPI](https://img.shields.io/pypi/v/deeploy-pulp)[![Documentation Status](https://img.shields.io/github/deployments/pulp-platform/Deeploy/github-pages?logo=readthedocs&logoColor=white&label=Docs
99
)](https://pulp-platform.github.io/Deeploy/)
1010
[![CI](https://github.com/pulp-platform/Deeploy/actions/workflows/ci-deeploy.yml/badge.svg)](https://github.com/pulp-platform/Deeploy/actions/workflows/ci-deeploy.yml)
1111
[![Deeploy Docker](https://github.com/pulp-platform/Deeploy/actions/workflows/docker-build-deeploy.yml/badge.svg)](https://github.com/pulp-platform/Deeploy/actions/workflows/docker-build-deeploy.yml)
@@ -35,7 +35,7 @@ git submodule update --init --recursive
3535

3636
Installing Deeploy is as simple as running:
3737
```
38-
pip install -e . --extra-index-url=https://pypi.ngc.nvidia.com
38+
pip install -e .
3939
```
4040
However, to run the code generated by Deeploy on a certain target, you need the toolchains and the simulators associated with this platform.
4141

@@ -50,7 +50,7 @@ docker run -it --name deeploy_main -v $(pwd):/app/Deeploy ghcr.io/pulp-platform/
5050
Install Deeploy inside the container in editable mode:
5151
```
5252
cd Deeploy
53-
pip install -e . --extra-index-url=https://pypi.ngc.nvidia.com
53+
pip install -e .
5454
```
5555
Congratulations, you installed Deeploy and its dependencies! Now, to test your installation let's run one simple test on each platform with the following commands:
5656
```

cmake/simulation.cmake

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,13 @@ macro(print_simulation_config)
4242
endmacro()
4343

4444
macro(add_banshee_simulation name)
45+
if(NOT DEFINED ENV{BANSHEE_INSTALL_DIR})
46+
message(FATAL_ERROR "Environment variable BANSHEE_INSTALL_DIR not set")
47+
endif()
48+
set(BANSHEE_EXECUTABLE "$ENV{BANSHEE_INSTALL_DIR}/banshee")
4549
add_custom_target(banshee_${name}
4650
DEPENDS ${name}
47-
COMMAND RUST_MIN_STACK=${banshee_stack_size} banshee
51+
COMMAND RUST_MIN_STACK=${banshee_stack_size} ${BANSHEE_EXECUTABLE}
4852
--num-cores=${num_threads}
4953
--num-clusters=1
5054
--latency

docs/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,4 @@ Deeploy is developed as part of the PULP project, a joint effort between ETH Zur
2424
tutorials/overview
2525
structure
2626
apidocs
27+
releasing

docs/install.md

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,6 @@ pip install -e .
4747

4848
## Testing Framework Installation
4949

50-
Please make sure to use a Rust version that is compatible with LLVM 15, like 1.63.0:
51-
52-
```
53-
sudo snap install rustup --classic
54-
rustup install 1.63.0
55-
rustup default 1.63.0
56-
```
57-
5850
The Makefile expects the environemt variable `CMAKE` to be defined. In case you have no strong preferences, you may run
5951

6052
```
@@ -84,7 +76,5 @@ For example, you can run
8476

8577
```
8678
cd DeeployTest
87-
python testRunner_generic.py -t Tests/Others/SimpleRegression
79+
python testRunner_generic.py -t ./Tests/Kernels/Integer/Add/Regular
8880
```
89-
90-
to run the `simpleRegression` test on your workstation. Various other tests are available and compatibility between tests and platforms is tested in the `.gitlab-ci.yml` file.

0 commit comments

Comments
 (0)