Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ModuleNotFoundError: No module named 'peachpy.x86_64.avx' #203

Open
adamjstewart opened this issue Jun 15, 2021 · 7 comments
Open

ModuleNotFoundError: No module named 'peachpy.x86_64.avx' #203

adamjstewart opened this issue Jun 15, 2021 · 7 comments

Comments

@adamjstewart
Copy link

adamjstewart commented Jun 15, 2021

I'm writing a Spack package for NNPACK. Ideally, I would be able to link to already installed copies of these dependencies instead of having to install them multiple times.

When NNPACK tries to build its dependencies, they fail with errors like:

FAILED: src/x86_64-fma/2d-fourier-8x8.py.o 
cd /tmp/t-astewart/spack-stage/spack-stage-nnpack-master-ogzjpx3yaadxf3cudq6yxmxjnvzmvlzl/spack-build-ogzjpx3 && PYTHONPATH=/tmp/t-astewart/spack-stage/spack-stage-nnpack-master-ogzjpx3yaadxf3cudq6yxmxjnvzmvlzl/spack-src/deps/six:/tmp/t-astewart/spack-stage/spack-stage-nnpack-master-ogzjpx3yaadxf3cudq6yxmxjnvzmvlzl/spack-src/deps/peachpy /home/t-astewart/spack/opt/spack/linux-ubuntu18.04-haswell/gcc-7.5.0/python-3.8.10-owirpnfxjurir472qs6zmrfzcuj7ruiv/bin/python -m peachpy.x86_64 -mabi=sysv -g4 -mimage-format=elf -I/tmp/t-astewart/spack-stage/spack-stage-nnpack-master-ogzjpx3yaadxf3cudq6yxmxjnvzmvlzl/spack-src/src -I/tmp/t-astewart/spack-stage/spack-stage-nnpack-master-ogzjpx3yaadxf3cudq6yxmxjnvzmvlzl/spack-src/src/x86_64-fma -I/tmp/t-astewart/spack-stage/spack-stage-nnpack-master-ogzjpx3yaadxf3cudq6yxmxjnvzmvlzl/spack-src/deps/fp16/include -o /tmp/t-astewart/spack-stage/spack-stage-nnpack-master-ogzjpx3yaadxf3cudq6yxmxjnvzmvlzl/spack-build-ogzjpx3/src/x86_64-fma/2d-fourier-8x8.py.o /tmp/t-astewart/spack-stage/spack-stage-nnpack-master-ogzjpx3yaadxf3cudq6yxmxjnvzmvlzl/spack-src/src/x86_64-fma/2d-fourier-8x8.py
Traceback (most recent call last):
  File "/home/t-astewart/spack/opt/spack/linux-ubuntu18.04-haswell/gcc-7.5.0/python-3.8.10-owirpnfxjurir472qs6zmrfzcuj7ruiv/lib/python3.8/runpy.py", line 185, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "/home/t-astewart/spack/opt/spack/linux-ubuntu18.04-haswell/gcc-7.5.0/python-3.8.10-owirpnfxjurir472qs6zmrfzcuj7ruiv/lib/python3.8/runpy.py", line 144, in _get_module_details
    return _get_module_details(pkg_main_name, error)
  File "/home/t-astewart/spack/opt/spack/linux-ubuntu18.04-haswell/gcc-7.5.0/python-3.8.10-owirpnfxjurir472qs6zmrfzcuj7ruiv/lib/python3.8/runpy.py", line 111, in _get_module_details
    __import__(pkg_name)
  File "/tmp/t-astewart/spack-stage/spack-stage-nnpack-master-ogzjpx3yaadxf3cudq6yxmxjnvzmvlzl/spack-src/deps/peachpy/peachpy/x86_64/__init__.py", line 25, in <module>
    from peachpy.x86_64.function import Function, LocalVariable
  File "/tmp/t-astewart/spack-stage/spack-stage-nnpack-master-ogzjpx3yaadxf3cudq6yxmxjnvzmvlzl/spack-src/deps/peachpy/peachpy/x86_64/function.py", line 16, in <module>
    import peachpy.x86_64.avx
ModuleNotFoundError: No module named 'peachpy.x86_64.avx'

P.S. Would anyone like to be listed as the official maintainer for the NNPACK package? You don't need to know much about Spack, it just gives us someone to ping when a user reports build issues or wants to modify the build recipe.

@adamjstewart adamjstewart changed the title How to build without internet access? Build failure Jun 15, 2021
@adamjstewart
Copy link
Author

This error occurs for me on both Ubuntu 18.04 with GCC 7.5.0 and on macOS 10.15.7 with Apple Clang 12.0.0.

@adamjstewart
Copy link
Author

It looks like peachpy/x86_64/avx.py is supposed to be generated by opcodes. If I build peachpy on its own it works fine. I'm guessing there's something wrong in the CMake configuration and opcodes isn't being used.

@adamjstewart adamjstewart changed the title Build failure ModuleNotFoundError: No module named 'peachpy.x86_64.avx' Jun 17, 2021
@adamjstewart
Copy link
Author

Workaround: if I set -DNNPACK_BACKEND=psimd I can skip the peachpy dependency altogether and get NNPACK to build. I have no idea what the performance consequences of this are.

@adamjstewart
Copy link
Author

I think when PYTHON_PEACHPY_SOURCE_DIR is set, we don't run python setup.py generate. Also, I noticed that the PYTHONPATH gets overridden, so Python can't find my setuptools which is set in a different directory.

@jhw-Dennis
Copy link

Hi I've been stacked by the same problem when building pytorch, which uses NNpack and peachpy as submodules. Do you have any idea to fix this? Thanks!

@redradist
Copy link

Probably it could be related #202
See ... ${CMAKE_CURRENT_LIST_DIR}/src/x86_64-fma) in patch

@KangkangStu
Copy link

Hi I've been stacked by the same problem when building pytorch, which uses NNpack and peachpy as submodules. Do you have any idea to fix this? Thanks!

Hello,I also encountered this issue while installing Pytorch and it has now been solved.You need to execute python setup.py generate under /pytorch/third_party/python-peachpy/ path

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants