From 428a8d54f574a73804274e53e61f711aebc25a0a Mon Sep 17 00:00:00 2001 From: Raul Farkas Date: Mon, 16 Jan 2023 16:52:18 +0000 Subject: MLBEDSW-6982: Move to setup.cfg and pyproject.toml - Move all static information from setup.py to newly added pyproject.toml - Add setup.cfg used for static information that cannot be added to pyproject.toml due to it still being in beta. - Modify mlw_codec to to throw a real python exception when importing NumPy arrays instead of just printing them to stdout. - Surround mlw_codec import with try catch statement to catch NumPy C API mismatch errors and throw them again with a more detailed message. - Update README.md with documentation about known issue with changing used NumPy version after installing ethos-u-vela. Change-Id: I1eeee5536be7c1744e30d6088f7069fbb1403e06 Signed-off-by: Raul Farkas --- README.md | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) (limited to 'README.md') diff --git a/README.md b/README.md index ecd13228..974b0b63 100644 --- a/README.md +++ b/README.md @@ -189,6 +189,66 @@ Some example networks that contain quantised operators which can be compiled by Vela to run on the Ethos-U NPU can be found at: +## Known Issues + +### 1. NumPy C API version change + +Once ethos-u-vela is installed, the user might want to install a different NumPy +version that is still within the dependency constraints defined in pyproject.toml. + +In some scenarios, doing so might prevent ethos-u-vela from functioning as +expected due to incompatibilities between the installed NumPy C headers used in +the mlw_codec and the current version of NumPy. + +**Example scenario:** + +In the ethos-u-vela source directory, run: + +```bash +virtualenv -p 3.8 venv +. venv/bin/activate +pip install ethos-u-vela +``` + +Next, install a different NumPy version (e.g. 1.21.3) + +```bash +pip install numpy==1.21.3 --force +``` + +Finally, run ethos-u-vela. You might get an error similar to this: + +``` +ImportError: NumPy C API version mismatch +(Build-time version: 0x10, Run-time version: 0xe) +This is a known issue most likely caused by a change in the API version in +NumPy after installing ethos-u-vela. +``` + +#### Solution + +In order for ethos-u-vela to work with an older version of NumPy that uses +different C APIs, you will need to install the desired NumPy version first, and +then build ethos-u-vela with that specific NumPy version: + +1) Uninstall ethos-u-vela and install the desired version of NumPy + ``` + pip uninstall ethos-u-vela + pip install numpy==1.21.3 --force + ``` + +2) Install required build dependencies + ``` + pip install "setuptools_scm[toml]<6" wheel + ``` + +3) Install ethos-u-vela without build isolation. Not using build isolation + ensures that the correct version of NumPy is used when copying the C headers + in mlw_codec during the build process. + ``` + pip install ethos-u-vela --no-build-isolation --no-cache-dir + ``` + ## APIs Please see [Vela External APIs](API.md). -- cgit v1.2.1