Maratyszcza / NNPACK

Acceleration package for neural networks on multi-core CPUs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build fails: No module named peachpy.x86_64

yurivict opened this issue · comments

I'm trying to build it on FreeBSD and it fails:

[20/45] cd /usr/ports/science/nnpack/work/.build && PYTHONPATH=/usr/ports/science/nnpack/work/NNPACK-c039579/deps/six:/usr/ports/science/nnpack/work/NNPACK-c039579/deps/enum: /usr/local/bin/python2.7 -m peachpy.x86_64 -mabi=sysv -g4 -mimage-format=elf -I/usr/ports/science/nnpack/work/NNPACK-c039579/src -I/usr/ports/science/nnpack/work/NNPACK-c039579/src/x86_64-fma -I/usr/local/include -o /usr/ports/science/nnpack/work/.build/src/x86_64-fma/2d-fourier-8x8.py.o /usr/ports/science/nnpack/work/NNPACK-c039579/src/x86_64-fma/2d-fourier-8x8.py
FAILED: src/x86_64-fma/2d-fourier-8x8.py.o 
cd /usr/ports/science/nnpack/work/.build && PYTHONPATH=/usr/ports/science/nnpack/work/NNPACK-c039579/deps/six:/usr/ports/science/nnpack/work/NNPACK-c039579/deps/enum: /usr/local/bin/python2.7 -m peachpy.x86_64 -mabi=sysv -g4 -mimage-format=elf -I/usr/ports/science/nnpack/work/NNPACK-c039579/src -I/usr/ports/science/nnpack/work/NNPACK-c039579/src/x86_64-fma -I/usr/local/include -o /usr/ports/science/nnpack/work/.build/src/x86_64-fma/2d-fourier-8x8.py.o /usr/ports/science/nnpack/work/NNPACK-c039579/src/x86_64-fma/2d-fourier-8x8.py
/usr/local/bin/python2.7: No module named peachpy.x86_64
ninja: build stopped: subcommand failed.

How do you build it? Do you use CMake?

I use cmake w/in the FreeBSD ports framework.
I am trying to create a port.

NNPACK CMake file should download PeachPy and add it to PYTHONPATH, see here, but I see only PYTHONPATH=/usr/ports/science/nnpack/work/NNPACK-c039579/deps/six:/usr/ports/science/nnpack/work/NNPACK-c039579/deps/enum: in your logs. Do you pass -DPYTHON_PEACHPY_SOURCE_DIR to CMake (you shouldn't)? Please paste a complete log, including the commands you type.

PeachPy package is pre-installed, insecure downloads aren't allowed during the package builds.

Did you follow installation instructions in PeachPy README?

yes, setup.py does all the work there.

Try a simple test, e.g. python -c "from peachpy.x86_64 import * ; ADD(eax, 5).encode()"

Actually, /usr/local/bin/python2.7 -c "from peachpy.x86_64 import * ; ADD(eax, 5).encode()" in your case, because this is the Python CMake finds.

py27-peachpy installs x64 and x86 architectures.

$ python2.7 -c "from peachpy.x64 import * ; ADD(eax, 5).encode()"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/local/lib/python2.7/site-packages/peachpy/x64.py", line 8939, in ADD
    origin = inspect.stack() if Function.get_current().collect_origin else None
  File "/usr/local/lib/python2.7/site-packages/peachpy/x64.py", line 625, in get_current
    raise ValueError('No function is active')
ValueError: No function is active
$ python2.7 -c "from peachpy.x86 import * ; ADD(ax, 5).encode()"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/local/lib/python2.7/site-packages/peachpy/x86.py", line 2945, in ADD
    current_function.add_instruction(ArithmeticInstruction('ADD', Operand(destination), Operand(source)))
AttributeError: 'NoneType' object has no attribute 'add_instruction'

PeachPy-0.0.1 is installed using python's distutils.
PeachPy-0.0.1 is what PyPI website suggests: https://pypi.org/project/PeachPy/
It fails with python-3.6 https://bitbucket.org/MDukhan/peachpy/issues/5/fails-with-python-36 so python-2.7 is forced.

DO NOT install PeachPy from PyPI. It is an old version, incompatible with NNPACK. Follow the instructions in PeachPy README

The new version of PeachPy fixed this, thanks!