diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 011ccebadc..9b14c208e5 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -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 diff --git a/.github/workflows/quicktest-dev-pr.yml b/.github/workflows/quicktest-dev-pr.yml index c439041c85..32b95c82a0 100644 --- a/.github/workflows/quicktest-dev-pr.yml +++ b/.github/workflows/quicktest-dev-pr.yml @@ -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 diff --git a/.github/workflows/quicktest-local.yml b/.github/workflows/quicktest-local.yml index e8e1a845ae..83c43b8eec 100644 --- a/.github/workflows/quicktest-local.yml +++ b/.github/workflows/quicktest-local.yml @@ -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 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 98966bb865..8b710595b1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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 diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 591a14b413..7e7b7c08f4 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -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 diff --git a/docker/Dockerfile.finn b/docker/Dockerfile.finn index 4614019134..35331c0b2a 100644 --- a/docker/Dockerfile.finn +++ b/docker/Dockerfile.finn @@ -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 , Yaman Umuroglu " ARG XRT_DEB_VERSION="xrt_202220.2.14.354_22.04-amd64-xrt" @@ -66,7 +66,7 @@ RUN apt-get update && \ unzip \ zip \ locales \ - lsb-core \ + lsb-release \ python3 \ python-is-python3 \ python3-pip \ @@ -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" @@ -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" diff --git a/docker/finn_entrypoint.sh b/docker/finn_entrypoint.sh index 98016f99cc..7b4a08c46e 100644 --- a/docker/finn_entrypoint.sh +++ b/docker/finn_entrypoint.sh @@ -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 : to the docker run command" @@ -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" diff --git a/requirements.txt b/requirements.txt index 19007b68ac..26d456e487 100644 --- a/requirements.txt +++ b/requirements.txt @@ -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 diff --git a/run-docker.sh b/run-docker.sh index dcda41f428..bba1189fac 100755 --- a/run-docker.sh +++ b/run-docker.sh @@ -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) diff --git a/setup-local.sh b/setup-local.sh index a9b25f5f4a..ddaa87944b 100755 --- a/setup-local.sh +++ b/setup-local.sh @@ -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" @@ -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 diff --git a/setup.cfg b/setup.cfg index c9ce06b962..ceb683c40d 100644 --- a/setup.cfg +++ b/setup.cfg @@ -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 diff --git a/src/finn/transformation/general.py b/src/finn/transformation/general.py index b245ee4c90..5c5f3eafdc 100644 --- a/src/finn/transformation/general.py +++ b/src/finn/transformation/general.py @@ -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