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

FP16 python module error at make #219

Open
agoston-mc opened this issue May 30, 2024 · 2 comments
Open

FP16 python module error at make #219

agoston-mc opened this issue May 30, 2024 · 2 comments

Comments

@agoston-mc
Copy link

agoston-mc commented May 30, 2024

Since the update to FP16, the NNPACK install fails on latest, as in the build process "Generating src/x86_64-fma/blas/shdotxf.py.o" would use the python module fp16.avx, which is no longer generated in FP16.

build process:

git clone https://github.com/Maratyszcza/NNPACK NNPACK
git clone https://github.com/Maratyszcza/pthreadpool  NNPACK/pthreadpool

mkdir -p NNPACK/build
cd NNPACK/build
cmake -DCMAKE_INSTALL_PREFIX:PATH=. -DNNPACK_INFERENCE_ONLY=OFF -DNNPACK_CONVOLUTION_ONLY=OFF -DNNPACK_BUILD_TESTS=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DPTHREADPOOL_SOURCE_DIR=pthreadpool ..
make -j4

The make error I get:

[  1%] Building C object deps/pthreadpool/CMakeFiles/pthreadpool.dir/src/legacy-api.c.o
[  2%] Building C object deps/pthreadpool/CMakeFiles/pthreadpool.dir/src/portable-api.c.o
[  3%] Building C object deps/cpuinfo/CMakeFiles/cpuinfo_internals.dir/src/api.c.o
[  4%] Building C object deps/cpuinfo/CMakeFiles/cpuinfo.dir/src/api.c.o
[  6%] Building C object deps/cpuinfo/CMakeFiles/cpuinfo.dir/src/cache.c.o
[  7%] Building C object deps/cpuinfo/CMakeFiles/cpuinfo_internals.dir/src/cache.c.o
[  8%] Building C object deps/pthreadpool/CMakeFiles/pthreadpool.dir/src/memory.c.o
[ 10%] Building C object deps/cpuinfo/CMakeFiles/cpuinfo_internals.dir/src/init.c.o
[ 10%] Building C object deps/cpuinfo/CMakeFiles/cpuinfo.dir/src/init.c.o
[ 12%] Building C object deps/pthreadpool/CMakeFiles/pthreadpool.dir/src/pthreads.c.o
[ 13%] Building C object deps/cpuinfo/CMakeFiles/cpuinfo.dir/src/log.c.o
[ 14%] Building C object deps/cpuinfo/CMakeFiles/cpuinfo_internals.dir/src/log.c.o
[ 15%] Building C object deps/cpuinfo/CMakeFiles/cpuinfo_internals.dir/src/x86/init.c.o
[ 16%] Building C object deps/cpuinfo/CMakeFiles/cpuinfo.dir/src/x86/init.c.o
[ 18%] Building C object deps/pthreadpool/CMakeFiles/pthreadpool.dir/src/fastpath.c.o
[ 20%] Building C object deps/cpuinfo/CMakeFiles/cpuinfo.dir/src/x86/info.c.o
[ 20%] Building C object deps/cpuinfo/CMakeFiles/cpuinfo_internals.dir/src/x86/info.c.o
[ 22%] Building C object deps/cpuinfo/CMakeFiles/cpuinfo.dir/src/x86/vendor.c.o
[ 22%] Building C object deps/cpuinfo/CMakeFiles/cpuinfo_internals.dir/src/x86/vendor.c.o
[ 24%] Building C object deps/cpuinfo/CMakeFiles/cpuinfo.dir/src/x86/uarch.c.o
[ 25%] Building C object deps/cpuinfo/CMakeFiles/cpuinfo_internals.dir/src/x86/uarch.c.o
[ 26%] Building C object deps/cpuinfo/CMakeFiles/cpuinfo.dir/src/x86/name.c.o
[ 27%] Building C object deps/cpuinfo/CMakeFiles/cpuinfo.dir/src/x86/topology.c.o
[ 28%] Building C object deps/cpuinfo/CMakeFiles/cpuinfo_internals.dir/src/x86/name.c.o
[ 30%] Building C object deps/cpuinfo/CMakeFiles/cpuinfo.dir/src/x86/isa.c.o
[ 31%] Building C object deps/cpuinfo/CMakeFiles/cpuinfo.dir/src/x86/cache/init.c.o
[ 32%] Building C object deps/cpuinfo/CMakeFiles/cpuinfo_internals.dir/src/x86/topology.c.o
[ 34%] Building C object deps/cpuinfo/CMakeFiles/cpuinfo.dir/src/x86/cache/descriptor.c.o
[ 34%] Building C object deps/cpuinfo/CMakeFiles/cpuinfo_internals.dir/src/x86/isa.c.o
[ 36%] Linking C static library libpthreadpool.a
[ 37%] Building C object deps/cpuinfo/CMakeFiles/cpuinfo_internals.dir/src/x86/cache/init.c.o
[ 38%] Building C object deps/cpuinfo/CMakeFiles/cpuinfo_internals.dir/src/x86/cache/descriptor.c.o
[ 39%] Building C object deps/cpuinfo/CMakeFiles/cpuinfo.dir/src/x86/cache/deterministic.c.o
[ 40%] Building C object deps/cpuinfo/CMakeFiles/cpuinfo_internals.dir/src/x86/cache/deterministic.c.o
[ 40%] Built target pthreadpool
[ 42%] Building C object deps/cpuinfo/CMakeFiles/cpuinfo_internals.dir/src/x86/linux/init.c.o
[ 43%] Building C object deps/cpuinfo/CMakeFiles/cpuinfo_internals.dir/src/x86/linux/cpuinfo.c.o
[ 44%] Building C object deps/cpuinfo/CMakeFiles/cpuinfo.dir/src/x86/linux/init.c.o
[ 45%] Building C object CMakeFiles/nnpack_reference_layers.dir/src/ref/convolution-output.c.o
[ 46%] Building C object deps/cpuinfo/CMakeFiles/cpuinfo_internals.dir/src/linux/smallfile.c.o
[ 48%] Building C object deps/cpuinfo/CMakeFiles/cpuinfo_internals.dir/src/linux/multiline.c.o
[ 49%] Building C object CMakeFiles/nnpack_reference_layers.dir/src/ref/convolution-input-gradient.c.o
[ 50%] Building C object deps/cpuinfo/CMakeFiles/cpuinfo.dir/src/x86/linux/cpuinfo.c.o
[ 51%] Building C object CMakeFiles/nnpack_reference_layers.dir/src/ref/convolution-kernel.c.o
[ 53%] Building C object deps/cpuinfo/CMakeFiles/cpuinfo_internals.dir/src/linux/cpulist.c.o
[ 54%] Building C object CMakeFiles/nnpack_reference_layers.dir/src/ref/fully-connected-output.c.o
[ 55%] Building C object CMakeFiles/nnpack_reference_layers.dir/src/ref/max-pooling-output.c.o
[ 56%] Building C object deps/cpuinfo/CMakeFiles/cpuinfo.dir/src/linux/smallfile.c.o
[ 57%] Building C object deps/cpuinfo/CMakeFiles/cpuinfo_internals.dir/src/linux/processors.c.o
[ 59%] Building C object CMakeFiles/nnpack_reference_layers.dir/src/ref/softmax-output.c.o
[ 60%] Building C object CMakeFiles/nnpack_reference_layers.dir/src/ref/relu-output.c.o
[ 61%] Building C object deps/cpuinfo/CMakeFiles/cpuinfo.dir/src/linux/multiline.c.o
[ 62%] Building C object CMakeFiles/nnpack_reference_layers.dir/src/ref/relu-input-gradient.c.o
[ 63%] Building C object deps/cpuinfo/CMakeFiles/cpuinfo.dir/src/linux/cpulist.c.o
[ 65%] Building C object deps/cpuinfo/CMakeFiles/cpuinfo.dir/src/linux/processors.c.o
[ 66%] Linking C static library libcpuinfo_internals.a
[ 67%] Linking C static library libnnpack_reference_layers.a
[ 68%] Linking C static library libcpuinfo.a
[ 68%] Built target cpuinfo_internals
[ 68%] Built target nnpack_reference_layers
[ 68%] Built target cpuinfo
[ 69%] Generating src/x86_64-fma/2d-fourier-8x8.py.o
[ 71%] Generating src/x86_64-fma/2d-fourier-16x16.py.o
[ 72%] Generating src/x86_64-fma/2d-winograd-8x8-3x3.py.o
[ 73%] Generating src/x86_64-fma/blas/s8gemm.py.o
[ 74%] Generating src/x86_64-fma/blas/c8gemm.py.o
[ 75%] Generating src/x86_64-fma/blas/s4c6gemm.py.o
[ 77%] Generating src/x86_64-fma/blas/conv1x1.py.o
[ 78%] Generating src/x86_64-fma/blas/sgemm.py.o
[ 79%] Generating src/x86_64-fma/max-pooling.py.o
[ 80%] Generating src/x86_64-fma/relu.py.o
[ 81%] Generating src/x86_64-fma/softmax.py.o
[ 83%] Generating src/x86_64-fma/blas/sdotxf.py.o
[ 84%] Generating src/x86_64-fma/blas/shdotxf.py.o
Traceback (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/home/ad.adasworks.com/agoston.czobor/NNPACK/deps/peachpy/peachpy/x86_64/__main__.py", line 282, in <module>
    main()
  File "/home/ad.adasworks.com/agoston.czobor/NNPACK/deps/peachpy/peachpy/x86_64/__main__.py", line 269, in main
    execute_script(writers, options.input[0])
  File "/home/ad.adasworks.com/agoston.czobor/NNPACK/deps/peachpy/peachpy/x86_64/__main__.py", line 199, in execute_script
    with writer:
  File "/home/ad.adasworks.com/agoston.czobor/NNPACK/deps/peachpy/peachpy/x86_64/__main__.py", line 200, in execute_script
    execute_script(writers, source_filename)
  File "/home/ad.adasworks.com/agoston.czobor/NNPACK/deps/peachpy/peachpy/x86_64/__main__.py", line 204, in execute_script
    exec(code, globals())
  File "/home/ad.adasworks.com/agoston.czobor/NNPACK/src/x86_64-fma/blas/shdotxf.py", line 4, in <module>
    from fp16.avx import fp16_alt_xmm_to_fp32_xmm
ModuleNotFoundError: No module named 'fp16.avx'
make[2]: *** [CMakeFiles/nnpack.dir/build.make:188: src/x86_64-fma/blas/shdotxf.py.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:175: CMakeFiles/nnpack.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
@justin-Kor
Copy link

I also get the same error.

@Maratyszcza
Please give me some advice.

@justin-Kor
Copy link

justin-Kor commented Jun 11, 2024

If you comment out only the relevant code as shown below, it will build normally.
@Maratyszcza
Please check for build errors.


image

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

2 participants