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

Raspberry Pie 4 #31744

Closed
shijunti19 opened this issue Aug 19, 2019 · 5 comments
Closed

Raspberry Pie 4 #31744

shijunti19 opened this issue Aug 19, 2019 · 5 comments
Assignees
Labels
comp:lite TF Lite related issues stat:awaiting response Status - Awaiting response from author

Comments

@shijunti19
Copy link

Raspberry Pie 4

System information

  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04):
  • Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device:
  • TensorFlow installed from (source or binary):
  • TensorFlow version:
  • Python version:
  • Installed using virtualenv? pip? conda?:
  • Bazel version (if compiling from source):
  • GCC/Compiler version (if compiling from source):
  • CUDA/cuDNN version:
  • GPU model and memory:

Describe the problem
pi@raspberrypi:/xiaolu/u/soft/tensorflow $ sudo ./tensorflow/lite/tools/make/build_rpi_lib.sh

  • set -e
    +++ dirname ./tensorflow/lite/tools/make/build_rpi_lib.sh
    ++ cd ./tensorflow/lite/tools/make
    ++ pwd
  • SCRIPT_DIR=/xiaolu/u/soft/tensorflow/tensorflow/lite/tools/make
  • TENSORFLOW_DIR=/xiaolu/u/soft/tensorflow/tensorflow/lite/tools/make/../../../..
  • make -j 4 TARGET=rpi -C /xiaolu/u/soft/tensorflow/tensorflow/lite/tools/make/../../../.. -f tensorflow/lite/tools/make/Makefile -latomic
    make: 进入目录“/xiaolu/u/soft/tensorflow”
    arm-linux-gnueabihf-g++ -O3 -DNDEBUG -fPIC --std=c++11 -march=armv7-a -mfpu=neon-vfpv4 -funsafe-math-optimizations -ftree-vectorize -fPIC -I. -I/xiaolu/u/soft/tensorflow/tensorflow/lite/tools/make/../../../../../ -I/xiaolu/u/soft/tensorflow/tensorflow/lite/tools/make/../../../../../../ -I/xiaolu/u/soft/tensorflow/tensorflow/lite/tools/make/downloads/ -I/xiaolu/u/soft/tensorflow/tensorflow/lite/tools/make/downloads/eigen -I/xiaolu/u/soft/tensorflow/tensorflow/lite/tools/make/downloads/absl -I/xiaolu/u/soft/tensorflow/tensorflow/lite/tools/make/downloads/gemmlowp -I/xiaolu/u/soft/tensorflow/tensorflow/lite/tools/make/downloads/neon_2_sse -I/xiaolu/u/soft/tensorflow/tensorflow/lite/tools/make/downloads/farmhash/src -I/xiaolu/u/soft/tensorflow/tensorflow/lite/tools/make/downloads/flatbuffers/include -I -I/usr/local/include -c tensorflow/lite/experimental/ruy/kernel_arm32.cc -o /xiaolu/u/soft/tensorflow/tensorflow/lite/tools/make/gen/rpi_armv7l/obj/tensorflow/lite/experimental/ruy/kernel_arm32.o
    /tmp/ccIPb9CY.s: Assembler messages:
    /tmp/ccIPb9CY.s:451: 错误:Neon quad precision register expected -- `vld1.32 q11,[r2]'
    make: *** [tensorflow/lite/tools/make/Makefile:244:/xiaolu/u/soft/tensorflow/tensorflow/lite/tools/make/gen/rpi_armv7l/obj/tensorflow/lite/experimental/ruy/kernel_arm32.o] 错误 1
    make: 离开目录“/xiaolu/u/soft/tensorflow”

Provide the exact sequence of commands / steps that you executed before running into the problem

Any other info / logs
Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached.

@shijunti19
Copy link
Author

I have the same problem with cross-compiling with Ubuntu on Windows

/tmp/ccuFx1oC.s: Assembler messages:
/tmp/ccuFx1oC.s:455: Error: Neon quad precision register expected -- `vld1.32 q11,[r2]'
tensorflow/lite/tools/make/Makefile:244: recipe for target '/mnt/z/linux/tensorflow/tensorflow/lite/tools/make/gen/rpi_armv7l/obj/tensorflow/lite/experimental/ruy/kernel_arm32.o' failed
make: *** [/mnt/z/linux/tensorflow/tensorflow/lite/tools/make/gen/rpi_armv7l/obj/tensorflow/lite/experimental/ruy/kernel_arm32.o] Error 1

@paulbauriegel
Copy link

Having the same problem under Ubuntu 19.04 when cross-compiling with Docker:

Dockerfile
FROM tensorflow/tensorflow:nightly-devel

USER root

RUN apt-get update && \
    apt-get install -y --no-install-recommends \
    build-essential \
    crossbuild-essential-armhf \
    git

RUN git clone https://github.com/tensorflow/tensorflow

RUN ./tensorflow/tensorflow/lite/tools/make/download_dependencies.sh

WORKDIR ./tensorflow
RUN ./tensorflow/lite/tools/make/build_rpi_lib.sh

@wangtz
Copy link
Member

wangtz commented Aug 20, 2019

Looks like Ruy was using something unsupported on RasberryPi.

@gadagashwini-zz gadagashwini-zz added comp:lite TF Lite related issues stat:awaiting response Status - Awaiting response from author labels Aug 20, 2019
@bjacob
Copy link
Contributor

bjacob commented Aug 20, 2019

It's not a hardware issue, it's an assembler syntax issue. One line of asm is sloppy and had been accidentally accepted by the android toolchain, but the RPi toolchain is being more rigorous here. The fix should be below. We're submitting this internally so you can expect this to be working soon, but always interesting to hear a confirmation.

diff --git a/tensorflow/lite/experimental/ruy/kernel_arm32.cc b/tensorflow/lite/experimental/ruy/kernel_arm32.cc
--- a/tensorflow/lite/experimental/ruy/kernel_arm32.cc
+++ b/tensorflow/lite/experimental/ruy/kernel_arm32.cc
@@ -947,7 +947,7 @@ void Kernel8bitNeonOutOfOrder(const Kern
         "ldr r5, [%[params], #" RUY_STR(RUY_OFFSET_RHS_ZERO_POINT) "]\n"
 
         // Load 4 lhs_sums values.
-        "vld1.32 q11, [r2]\n"
+        "vld1.32 {d22, d23}, [r2]\n"
         "vdup.32 d13, r5\n" // rhs_zero_point
 
         // Compute lhs_sums * rhs_zero_point.

tensorflow-copybara pushed a commit that referenced this issue Aug 20, 2019
#31744

PiperOrigin-RevId: 264374754
@paulbauriegel
Copy link

@bjacob Thanks for the fix. I can confirm that the patch works for my setup.

@bjacob bjacob closed this as completed Aug 20, 2019
g19fanatic pushed a commit to g19fanatic/tensorflow that referenced this issue Aug 20, 2019
bjacob added a commit to google/ruy that referenced this issue Mar 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:lite TF Lite related issues stat:awaiting response Status - Awaiting response from author
Projects
None yet
Development

No branches or pull requests

5 participants