Skip to content

Fails to import EthosUPartitioner for ARM backend as there is numpy inconsistency with tosa-tools #12991

@tymons

Description

@tymons

🐛 Describe the bug

I am failing to run fresh install for executorch with ARM backend and convert simple model with EthosUPartitioner. My steps are the following:

  1. Create empty environment: virtualenv -p 3.10 ~/.venv
  2. Clone repo: git clone --recurse-submodules https://github.com/pytorch/executorch.git
  3. Run executorch install script: cd executorch && ./install_executorch.sh
  4. Run ARM setup script: examples/arm/setup.sh --i-agree-to-the-contained-eula

Here it complains about numpy inconsistency:

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of t
he following dependency conflicts.                                                                                                          
tosa-tools 1.0.0rc0.post1.dev314+g1e6e452 requires jsonschema, which is not installed.                                                      
tosa-tools-v0-80 0.80.2.dev2+g641f0e2.d20250730 requires jsonschema, which is not installed.                                                
tosa-tools 1.0.0rc0.post1.dev314+g1e6e452 requires flatbuffers==23.5.26, but you have flatbuffers 24.3.25 which is incompatible.            
tosa-tools 1.0.0rc0.post1.dev314+g1e6e452 requires numpy<2, but you have numpy 2.2.6 which is incompatible.                                 
tosa-tools-v0-80 0.80.2.dev2+g641f0e2.d20250730 requires flatbuffers==23.5.26, but you have flatbuffers 24.3.25 which is incompatible.      
tosa-tools-v0-80 0.80.2.dev2+g641f0e2.d20250730 requires numpy<2, but you have numpy 2.2.6 which is incompatible.  
  1. Check import of EthosUPartitioner with python3 -c "from executorch.backends.arm.ethosu_partitioner impo rt EthosUPartitioner"

which gives me an error:

/home/tymons/.venvs/et03/lib/python3.10/site-packages/executorch/exir/dialects/edge/_ops.py:9: UserWarning: pkg_resources is deprecated as a
n API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. 
Refrain from using this package or pin to Setuptools<81.                                                                                    
  import pkg_resources                                                                                                                      
                                                      
A module that was compiled using NumPy 1.x cannot be run in
NumPy 2.2.6 as it may crash. To support both 1.x and 2.x
versions of NumPy, modules must be compiled with NumPy 2.0.
Some module may need to rebuild instead e.g. with 'pybind11>=2.12'.

If you are a user of the module, the easiest solution will be to
downgrade to 'numpy<2' or try to upgrade the affected module.
We expect that some modules will need time to support NumPy 2.

Traceback (most recent call last):  File "<string>", line 1, in <module>
  File "/home/tymons/.venvs/et03/lib/python3.10/site-packages/executorch/backends/arm/ethosu_partitioner.py", line 13, in <module>
    from executorch.backends.arm.ethosu_backend import EthosUBackend
  File "/home/tymons/.venvs/et03/lib/python3.10/site-packages/executorch/backends/arm/ethosu_backend.py", line 17, in <module>
    from executorch.backends.arm.arm_vela import vela_compile
  File "/home/tymons/.venvs/et03/lib/python3.10/site-packages/executorch/backends/arm/arm_vela.py", line 17, in <module>
    from ethosu.vela import vela  # type: ignore
  File "/home/tymons/.venvs/et03/lib/python3.10/site-packages/ethosu/vela/vela.py", line 33, in <module>
    from . import compiler_driver
  File "/home/tymons/.venvs/et03/lib/python3.10/site-packages/ethosu/vela/compiler_driver.py", line 22, in <module>
    from . import graph_optimiser
  File "/home/tymons/.venvs/et03/lib/python3.10/site-packages/ethosu/vela/graph_optimiser.py", line 20, in <module>
    from .graph_optimiser_util import check_format_restrictions
  File "/home/tymons/.venvs/et03/lib/python3.10/site-packages/ethosu/vela/graph_optimiser_util.py", line 30, in <module>
    from .operation_util import create_avgpool_nop
  File "/home/tymons/.venvs/et03/lib/python3.10/site-packages/ethosu/vela/operation_util.py", line 25, in <module>
    from .high_level_command_to_npu_op import ifm_ifm2_correct_order
  File "/home/tymons/.venvs/et03/lib/python3.10/site-packages/ethosu/vela/high_level_command_to_npu_op.py", line 76, in <module>
    from .weight_compressor import NpuWeightTensor
  File "/home/tymons/.venvs/et03/lib/python3.10/site-packages/ethosu/vela/weight_compressor.py", line 45, in <module>
    from ethosu import mlw_codec
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/tymons/.venvs/et03/lib/python3.10/site-packages/executorch/backends/arm/ethosu_partitioner.py", line 13, in <module>
    from executorch.backends.arm.ethosu_backend import EthosUBackend
  File "/home/tymons/.venvs/et03/lib/python3.10/site-packages/executorch/backends/arm/ethosu_backend.py", line 17, in <module>
    from executorch.backends.arm.arm_vela import vela_compile
  File "/home/tymons/.venvs/et03/lib/python3.10/site-packages/executorch/backends/arm/arm_vela.py", line 17, in <module>
    from ethosu.vela import vela  # type: ignore
  File "/home/tymons/.venvs/et03/lib/python3.10/site-packages/ethosu/vela/vela.py", line 33, in <module>
    from . import compiler_driver
  File "/home/tymons/.venvs/et03/lib/python3.10/site-packages/ethosu/vela/compiler_driver.py", line 22, in <module>
    from . import graph_optimiser
  File "/home/tymons/.venvs/et03/lib/python3.10/site-packages/ethosu/vela/graph_optimiser.py", line 20, in <module>
    from .graph_optimiser_util import check_format_restrictions
  File "/home/tymons/.venvs/et03/lib/python3.10/site-packages/ethosu/vela/graph_optimiser_util.py", line 30, in <module>
    from .operation_util import create_avgpool_nop
  File "/home/tymons/.venvs/et03/lib/python3.10/site-packages/ethosu/vela/operation_util.py", line 25, in <module>
    from .high_level_command_to_npu_op import ifm_ifm2_correct_order
  File "/home/tymons/.venvs/et03/lib/python3.10/site-packages/ethosu/vela/high_level_command_to_npu_op.py", line 76, in <module>
    from .weight_compressor import NpuWeightTensor
  File "/home/tymons/.venvs/et03/lib/python3.10/site-packages/ethosu/vela/weight_compressor.py", line 45, in <module>
    from ethosu import mlw_codec
RuntimeError: mlw_codec error: _ARRAY_API not found

Versions

[pip3] executorch==0.8.0a0+b6b7a16
[pip3] numpy==2.2.6
[pip3] nvidia-cublas-cu12==12.6.4.1
[pip3] nvidia-cuda-cupti-cu12==12.6.80
[pip3] nvidia-cuda-nvrtc-cu12==12.6.77
[pip3] nvidia-cuda-runtime-cu12==12.6.77
[pip3] nvidia-cudnn-cu12==9.5.1.17
[pip3] nvidia-cufft-cu12==11.3.0.4
[pip3] nvidia-curand-cu12==10.3.7.77
[pip3] nvidia-cusolver-cu12==11.7.1.2
[pip3] nvidia-cusparse-cu12==12.5.4.2
[pip3] nvidia-cusparselt-cu12==0.6.3
[pip3] nvidia-nccl-cu12==2.26.2
[pip3] nvidia-nvjitlink-cu12==12.6.85
[pip3] nvidia-nvtx-cu12==12.6.77
[pip3] pytorch_tokenizers==0.1.0
[pip3] torch==2.9.0.dev20250725+cpu
[pip3] torchao==0.13.0+git2eb4f9762
[pip3] torchaudio==2.8.0.dev20250725+cpu
[pip3] torchdata==0.11.0
[pip3] torchsr==1.0.4
[pip3] torchtune==0.6.1
[pip3] torchvision==0.24.0.dev20250725+cpu
[pip3] triton==3.3.1
[conda] Could not collect

cc @digantdesai @freddan80 @per @zingo @oscarandersson8218

Metadata

Metadata

Assignees

No one assigned

    Labels

    module: armIssues related to arm backendpartner: armFor backend delegation, kernels, demo, etc. from the 3rd-party partner, Arm

    Type

    Projects

    Status

    To triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions