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

Build error about ExecuTorch on ARM Cortex-M55 + Ethos-U55 #1123

Closed
kris-himax opened this issue Nov 1, 2023 · 3 comments
Closed

Build error about ExecuTorch on ARM Cortex-M55 + Ethos-U55 #1123

kris-himax opened this issue Nov 1, 2023 · 3 comments
Assignees
Labels
partner: arm For backend delegation, kernels, demo, etc. from the 3rd-party partner, Arm triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module

Comments

@kris-himax
Copy link

kris-himax commented Nov 1, 2023

Hi,

I follow the ExecuTorch on ARM Cortex-M55 + Ethos-U55 example work flow to do ./run.sh [same-optional-scratch-dir-as-before].

But face the error like,

/tmp/ccFX9kwp.s: Assembler messages:
/tmp/ccFX9kwp.s:87: Error: syntax error -- `vcvtne.f64.f32 d0,s0'
make[2]: *** [kernels/portable/CMakeFiles/portable_kernels.dir/build.make:1322: kernels/portable/CMakeFiles/portable_kernels.dir/cpu/op_remainder.cpp.obj] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/Makefile2:247: kernels/portable/CMakeFiles/portable_kernels.dir/all] Error 2
make: *** [Makefile:91: all] Error 2

Hi, @cccclai
It seems like build portable_kernels.dir/cpu/op_remainder.cpp face error, while execute the following cmake command at ./run.sh .

cmake                                                 \
        -DBUCK2=${buck2}                                  \
        -DEXECUTORCH_BUILD_XNNPACK=OFF                    \
        -DEXECUTORCH_BUILD_GFLAGS=OFF                     \
        -DEXECUTORCH_BUILD_EXECUTOR_RUNNER=OFF            \
        -DEXECUTORCH_BUILD_HOST_TARGETS=OFF               \
        -DEXECUTORCH_BUILD_SDK=OFF                        \
        -DEXECUTORCH_BUILD_ARM_BAREMETAL=ON               \
        -DCMAKE_BUILD_TYPE=Release                        \
        -DEXECUTORCH_ENABLE_LOGGING=ON                    \
        -DEXECUTORCH_SELECT_OPS_LIST="aten::_softmax.out" \
        -DFLATC_EXECUTABLE="$(which flatc)"               \
        -DCMAKE_TOOLCHAIN_FILE="${toolchain_cmake}"       \
        "${et_root_dir}"

How can I fix it?

Screenshot from 2023-11-01 17-25-32

OS: Linux Ubuntu 20.04.4 LTS x86_64
buck2 version: 2023-07-18 (buck2-x86_64-unknown-linux-musl.zst)
cmake version 3.27.7
python version: 3.10.13
executorch: tag 0.1.0

Thanks,
Kris

@cccclai cccclai added the partner: arm For backend delegation, kernels, demo, etc. from the 3rd-party partner, Arm label Nov 1, 2023
@digantdesai
Copy link
Contributor

digantdesai commented Nov 2, 2023

hmm, I am assuming you are using the armv7 baremetal toolchain from here - https://pytorch.org/executorch/stable/executorch-arm-delegate-tutorial.html#download-and-install-the-arm-gnu-aarch32-bare-metal-toolchain

Also can you share full compiler cmdline for generating this object file? Thanks!

@digantdesai digantdesai self-assigned this Nov 2, 2023
@kris-himax
Copy link
Author

Hi,
Yes, I use https://pytorch.org/executorch/stable/executorch-arm-delegate-tutorial.html#download-and-install-the-arm-gnu-aarch32-bare-metal-toolchain about 'https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu/12.3.rel1/binrel/arm-gnu-toolchain-12.3.rel1-x86_64-arm-none-eabi.tar.xz'.
And I use command

cd executorch
mkdir build_arm_test
cd build_arm_test
export PATH="/home/kris/Desktop/2023_11_1_executorch_py_3_10/executorch/third-party/flatbuffers/cmake-out:${PATH}"
/home/kris/Desktop/2023_11_1_executorch_py_3_10/executorch/build/install_flatc.sh
toolchain_cmake=../examples/arm/ethos-u-setup/arm-none-eabi-gcc.cmake
cmake                                                     -DBUCK2="/tmp/buck2"                                      -DEXECUTORCH_BUILD_XNNPACK=OFF                        -DEXECUTORCH_BUILD_GFLAGS=OFF                         -DEXECUTORCH_BUILD_EXECUTOR_RUNNER=OFF                -DEXECUTORCH_BUILD_HOST_TARGETS=OFF                   -DEXECUTORCH_BUILD_ARM_BAREMETAL=ON                   -DCMAKE_BUILD_TYPE=Release                            -DEXECUTORCH_ENABLE_LOGGING=ON                        -DEXECUTORCH_SELECT_OPS_LIST="aten::_softmax.out"     -DFLATC_EXECUTABLE="$(which flatc)"                   -DCMAKE_TOOLCHAIN_FILE="${toolchain_cmake}"           ../

cmake --build . -- -j8

face build error.

But I use

./examples/arm/run.sh '/home/kris/Desktop/2023_11_1_executorch_py_3_10/executorch/examples/arm/ethos-u-scratch' 

It can build success, run example smoothly.

@digantdesai
Copy link
Contributor

Glad you have the version with the script working. 👍

Can you check the compiler flags for that object, I suspect either something is missing or different, here is what I have,

# a snipped from a build with VERBOSE=1 
arm-none-eabi-g++                                                                     \
        -DET_ENABLE_PROGRAM_VERIFICATION=0                                            \
        -DNDEBUG                                                                      \
        -I<home>/executorch/..                                                        \
        -Os                                                                           \
        -ffunction-sections                                                           \
        -fdata-sections                                                               \
        -fno-exceptions                                                               \
        -fno-rtti                                                                     \
        -s                                                                            \
        -mcpu=cortex-m55                                                              \
        -mthumb                                                                       \
        -fno-unwind-tables                                                            \
        -fno-rtti                                                                     \
        -fno-exceptions                                                               \
        -fdata-sections                                                               \
        -ffunction-sections                                                           \
        -mfloat-abi=hard                                                              \
        -Wno-psabi                                                                    \
        -Wno-deprecated-declarations                                                  \
        -fPIC                                                                         \
        -std=gnu++14                                                                  \
        -MD                                                                           \
        -MT kernels/portable/CMakeFiles/portable_kernels.dir/cpu/op_remainder.cpp.obj \
        -MF CMakeFiles/portable_kernels.dir/cpu/op_remainder.cpp.obj.d                \
        -o CMakeFiles/portable_kernels.dir/cpu/op_remainder.cpp.obj                   \
        -c <home>/executorch/kernels/portable/cpu/op_remainder.cpp
# builds successfully

# inspecting the generated obj file for op_remainder.cpp
arm-none-eabi-objdump -dw <build>/kernels/portable/CMakeFiles/portable_kernels.dir/cpu/op_remainder.cpp.obj | grep "vcvtne.f64.f32"
40:   eeb7 0ac0       vcvtne.f64.f32  d0, s0 # the instruction which was failing for you

@digantdesai digantdesai added the triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module label Nov 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
partner: arm For backend delegation, kernels, demo, etc. from the 3rd-party partner, Arm triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module
Projects
None yet
Development

No branches or pull requests

3 participants