Skip to content
Draft
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
2 changes: 1 addition & 1 deletion .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
python-version: '3.12'

- name: Run Lint
uses: pre-commit/action@v3.0.0
2 changes: 1 addition & 1 deletion .github/workflows/quicktest-dev-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:

test:
name: Run quicktest on PR branch
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04

steps:
- name: checkout
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/quicktest-local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:

test:
name: Run quicktest with local installation (no Docker)
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04

steps:
- name: Checkout
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
exclude: '^docs/conf.py'

default_language_version:
python: python3.10
python: python3.12

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
Expand Down
4 changes: 2 additions & 2 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ version: 2

# Set the version of Python and other tools you might need
build:
os: ubuntu-22.04
os: ubuntu-24.04
tools:
python: "3.10"
python: "3.12"

sphinx:
configuration: docs/finn/conf.py
Expand Down
67 changes: 34 additions & 33 deletions docker/Dockerfile.finn
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

FROM ubuntu:jammy-20230126
FROM ubuntu:noble-20240605
LABEL maintainer="Jakoba Petri-Koenig <jakoba.petri-koenig@amd.com>, Yaman Umuroglu <yaman.umuroglu@amd.com>"

ARG XRT_DEB_VERSION="xrt_202220.2.14.354_22.04-amd64-xrt"
Expand Down Expand Up @@ -66,7 +66,7 @@ RUN apt-get update && \
unzip \
zip \
locales \
lsb-core \
lsb-release \
python3 \
python-is-python3 \
python3-pip \
Expand All @@ -77,8 +77,8 @@ RUN apt-get update && \
libboost-dev \
libjansson-dev \
libgetdata-dev \
libtinfo5 \
g++-10 \
libncurses6 \
g++ \
cmake
RUN echo "StrictHostKeyChecking no" >> /etc/ssh/ssh_config
RUN locale-gen "en_US.UTF-8"
Expand All @@ -101,51 +101,52 @@ RUN if [ -z "$SKIP_XRT" ];then \

# versioned Python package requirements for FINN compiler
# these are given in requirements.txt
RUN pip install -r /tmp/requirements.txt
RUN pip install --break-system-packages -r /tmp/requirements.txt
RUN rm /tmp/requirements.txt

# install PyTorch
RUN pip install torch==2.8.0 torchvision==0.23.0 torchaudio==2.8.0 --extra-index-url https://download.pytorch.org/whl/cu126
RUN pip install --break-system-packages torch==2.8.0 torchvision==0.23.0 torchaudio==2.8.0 --extra-index-url https://download.pytorch.org/whl/cu126

# extra Python package dependencies (for testing and interaction)
RUN pip install pygments==2.14.0
RUN pip install ipykernel==6.21.2
RUN pip install jupyter==1.0.0 --ignore-installed
RUN pip install --break-system-packages pygments==2.17.2
RUN pip install --break-system-packages --ignore-installed typing_extensions
RUN pip install --break-system-packages ipykernel==6.29.0
RUN pip install --break-system-packages jupyter==1.0.0
# anyio >= 4.13.0 for jupyter incompatible with pytest 6.2.5 (missing _pytest.scope module, added in pytest 7.0.0)
RUN pip install 'anyio<4.13'
RUN pip install markupsafe==2.0.1
RUN pip install matplotlib==3.7.0 --ignore-installed
RUN pip install pytest-dependency==0.5.1
RUN pip install pytest-xdist[setproctitle]==3.2.0
RUN pip install pytest-parallel==0.1.1
RUN pip install --break-system-packages 'anyio<4.13'
RUN pip install --break-system-packages markupsafe==2.1.5
RUN pip install --break-system-packages matplotlib==3.8.2
RUN pip install --break-system-packages pytest-dependency==0.5.1
RUN pip install --break-system-packages pytest-xdist[setproctitle]==3.2.0
RUN pip install --break-system-packages pytest-parallel==0.1.1
# Beyond version 8.5.0, subsequent Netron calls in a Jupyter notebook cause "Address already in use" errors
RUN pip install netron
RUN pip install pandas==1.5.3
RUN pip install scikit-learn==1.2.1
RUN pip install tqdm==4.64.1
RUN pip install -e git+https://github.com/fbcotter/dataset_loading.git@0.0.4#egg=dataset_loading
RUN pip install --break-system-packages netron
RUN pip install --break-system-packages pandas==2.1.4
RUN pip install --break-system-packages scikit-learn==1.4.0
RUN pip install --break-system-packages tqdm==4.64.1
RUN pip install --break-system-packages git+https://github.com/fbcotter/dataset_loading.git@0.0.4#egg=dataset_loading
# these versions of pytest and associated plugins allow for stable collection of
# test reports and code coverage reports in HTML
RUN pip install pytest==6.2.5
RUN pip install pytest-metadata==1.7.0
RUN pip install pytest-html==3.0.0
RUN pip install pytest-html-merger==0.0.8
RUN pip install pytest-cov==4.1.0
RUN pip install pyyaml==6.0.1
RUN pip install --break-system-packages pytest==7.4.4
RUN pip install --break-system-packages pytest-metadata==1.7.0
RUN pip install --break-system-packages pytest-html==3.0.0
RUN pip install --break-system-packages pytest-html-merger==0.0.8
RUN pip install --break-system-packages pytest-cov==4.1.0
RUN pip install --break-system-packages pyyaml==6.0.1

# extra dependencies from other FINN deps
# installed in Docker image to make entrypoint script go faster
# finn-experimental
RUN pip install deap==1.3.1
RUN pip install mip==1.13.0
RUN pip install networkx==2.8
RUN pip install --break-system-packages deap==1.4.1
RUN pip install --break-system-packages mip==1.13.0
RUN pip install --break-system-packages networkx==2.8
# brevitas
RUN pip install future-annotations==1.0.0
RUN pip install dependencies==2.0.1
RUN pip install tokenize-rt==4.2.1
RUN pip install --break-system-packages future-annotations==1.0.0
RUN pip install --break-system-packages dependencies==2.0.1
RUN pip install --break-system-packages tokenize-rt==4.2.1

# assure that we have the right setuptools version
RUN pip install setuptools==68.2.2
RUN pip install --break-system-packages setuptools==68.2.2

# extra environment variables for FINN compiler
ENV VIVADO_IP_CACHE "/tmp/vivado_ip_cache"
Expand Down
11 changes: 5 additions & 6 deletions docker/finn_entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,18 +63,18 @@ _qonnx_pyproj_toml="${FINN_ROOT}/deps/qonnx/pyproject.toml"
_qonnx_pyproj_tmp="${FINN_ROOT}/deps/qonnx/pyproject.tmp"
mv "$_qonnx_pyproj_toml" "$_qonnx_pyproj_tmp"
trap 'mv "$_qonnx_pyproj_tmp" "$_qonnx_pyproj_toml" 2>/dev/null || true' EXIT
pip install --user -e "${FINN_ROOT}/deps/qonnx"
pip install --break-system-packages --user -e "${FINN_ROOT}/deps/qonnx"
mv "$_qonnx_pyproj_tmp" "$_qonnx_pyproj_toml"
trap - EXIT

# finn-experimental
pip install --user -e "${FINN_ROOT}/deps/finn-experimental"
pip install --break-system-packages --user -e "${FINN_ROOT}/deps/finn-experimental"
# brevitas
pip install --user -e "${FINN_ROOT}/deps/brevitas"
pip install --break-system-packages --user -e "${FINN_ROOT}/deps/brevitas"

if [ -f "${FINN_ROOT}/setup.py" ];then
# run pip install for finn
pip install --user -e "${FINN_ROOT}"
pip install --break-system-packages --user -e "${FINN_ROOT}"
else
recho "Unable to find FINN source code in ${FINN_ROOT}"
recho "Ensure you have passed -v <path-to-finn-repo>:<path-to-finn-repo> to the docker run command"
Expand All @@ -93,8 +93,7 @@ if [ -f "$VITIS_PATH/settings64.sh" ];then
source "$XILINX_XRT/setup.sh" || true
gecho "Found XRT at $XILINX_XRT"
else
recho "XRT not found on $XILINX_XRT, did you skip the download or did the installation fail?"
exit -1
yecho "XRT not found on $XILINX_XRT, Alveo U-series devices (U250, U280, U50, U55C, etc.) functionality will not be available."
fi
else
yecho "Unable to find $VITIS_PATH/settings64.sh"
Expand Down
16 changes: 8 additions & 8 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@ clize==5.0.1
dataclasses-json==0.5.7
gspread==3.6.0
importlib-resources==6.1.0
ipython==8.12.2
numpy==1.24.1
onnx==1.17.0
ipython==8.18.1
numpy==1.26.4
onnx==1.21.0
onnxoptimizer
onnxruntime==1.18.1
onnxruntime==1.26.0
onnxscript==0.6.2
pre-commit==3.3.2
pre-commit==3.5.0
protobuf==5.29.6
psutil==5.9.4
pybind11==2.10.0
pyscaffold==4.6
pybind11==2.11.1
pyscaffold==4.5
pytest-forked==1.6.0
scipy==1.10.1
scipy==1.11.4
setupext-janitor>=1.1.2
sigtools==4.0.1
toposort==1.7.0
Expand Down
4 changes: 2 additions & 2 deletions run-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ if [ -z "$PLATFORM_REPO_PATHS" ];then
fi

if [ -z "$V80PP_DEB_PACKAGE" ];then
recho "Please set V80PP_DEB_PACKAGE pointing to the SLASH v80++ .deb package."
recho "This is required to be able to use the Alveo V80 card."
yecho "Please set V80PP_DEB_PACKAGE pointing to the SLASH v80++ .deb package."
yecho "This is required to be able to use the Alveo V80 card."
fi

DOCKER_GID=$(id -g)
Expand Down
14 changes: 7 additions & 7 deletions setup-local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,14 @@ echo ""
# Step 1: Check prerequisites
gecho "Step 1: Checking prerequisites..."

# Check Python version (require 3.10+)
# Check Python version (require 3.12+)
PYTHON_VERSION=$(python3 --version 2>&1 | cut -d' ' -f2)
PYTHON_MAJOR=$(echo $PYTHON_VERSION | cut -d'.' -f1)
PYTHON_MINOR=$(echo $PYTHON_VERSION | cut -d'.' -f2)

if [[ $PYTHON_MAJOR -lt 3 ]] || [[ $PYTHON_MAJOR -eq 3 && $PYTHON_MINOR -lt 10 ]]; then
recho "Python 3.10 or higher required, found $PYTHON_VERSION"
recho "Set FINN_PYTHON to point to a Python 3.10+ interpreter"
if [[ $PYTHON_MAJOR -lt 3 ]] || [[ $PYTHON_MAJOR -eq 3 && $PYTHON_MINOR -lt 12 ]]; then
recho "Python 3.12 or higher required, found $PYTHON_VERSION"
recho "Set FINN_PYTHON to point to a Python 3.12+ interpreter"
exit 1
fi
gecho " Python $PYTHON_VERSION - OK"
Expand Down Expand Up @@ -158,10 +158,10 @@ if [ -d "$VENV_DIR" ]; then
yecho "Virtual environment already exists at $VENV_DIR"
yecho "Reusing existing environment. Delete .venv to start fresh."
else
# Use FINN_PYTHON if set, otherwise look for Python 3.10
# Use FINN_PYTHON if set, otherwise look for Python 3.12
if [ -z "$FINN_PYTHON" ]; then
if [ -x "/usr/bin/python3.10" ]; then
FINN_PYTHON="/usr/bin/python3.10"
if [ -x "/usr/bin/python3.12" ]; then
FINN_PYTHON="/usr/bin/python3.12"
else
FINN_PYTHON="python3"
fi
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ package_dir =
# The usage of test_requires is discouraged, see `Dependency Management` docs
# tests_require = pytest; pytest-cov
# Require a specific Python version, e.g. Python 2.7 or >= 3.4
# python_requires = >=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*
python_requires = >=3.12

[options.packages.find]
where = src
Expand Down
2 changes: 1 addition & 1 deletion src/finn/transformation/general.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import warnings

# Protobuf onnx graph node type
from onnx import AttributeProto, NodeProto, mapping # noqa
from onnx import AttributeProto
from qonnx.custom_op.registry import getCustomOp, is_custom_op
from qonnx.transformation.base import Transformation

Expand Down
Loading