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

l2_pool_2d.cpp doesn't compile on esp32 at the -O2 compiler optimization level #634

Closed
mocleiri opened this issue Oct 28, 2021 · 2 comments

Comments

@mocleiri
Copy link
Contributor

There is a compiler bug that doesn't allow compiling l2_pool_2d.cpp at the -O2 optimization level on esp32.

jcmvbkbc/gcc-xtensa#14

The work around is to compile this file at the -O3 optimization level.

mocleiri/tensorflow-micropython-examples@0967b90

I'm restructuring how I build tflm to use the generator and then compile as part of the micropython build.

Micropython just turned on -O2 for all of the esp32 port: micropython/micropython@549448e

I don't think this is a blocker for me. I just hit it again and decided to report here in case it can be fixed.

I have plans to write some optimized esp32 kernels using the https://github.com/espressif/esp-dsp library so this might just be something that is better fixed that way.

/home/runner/work/tensorflow-micropython-examples/tensorflow-micropython-examples/micropython-modules/microlite/tflm/tensorflow/lite/micro/kernels/l2_pool_2d.cpp: In function 'TfLiteStatus tflite::{anonymous}::L2Eval(TfLiteContext*, TfLiteNode*)':
/home/runner/work/tensorflow-micropython-examples/tensorflow-micropython-examples/micropython-modules/microlite/tflm/tensorflow/lite/micro/kernels/l2_pool_2d.cpp:128:1: error: insn does not satisfy its constraints:
 }
 ^
(insn 753 18 593 28 (set (reg/v:SF 20 f1 [orig:77 sum_squares ] [77])
        (mem/u/c:SF (symbol_ref/u:SI ("*.LC28") [flags 0x2]) [0  S4 A32])) "/home/runner/work/tensorflow-micropython-examples/tensorflow-micropython-examples/micropython-modules/microlite/tflm/tensorflow/lite/kernels/internal/reference/pooling.h":169 47 {movsf_internal}
     (expr_list:REG_EQUAL (const_double:SF 0.0 [0x0.0p+0])
        (nil)))
during RTL pass: postreload
/home/runner/work/tensorflow-micropython-examples/tensorflow-micropython-examples/micropython-modules/microlite/tflm/tensorflow/lite/micro/kernels/l2_pool_2d.cpp:128:1: internal compiler error: in extract_constrain_insn, at recog.c:2210
Please submit a full bug report,
with preprocessed source if appropriate.
@mocleiri
Copy link
Contributor Author

I don't think this is IDF version dependant but I'm compiling using the most recent version 4.4:
142bb32c50fa9875b8b69fa539a2d59559460d72

Pinned in micropython here:
micropython/micropython@64e4bae

@mocleiri
Copy link
Contributor Author

I'm going to close this issue. Currently I plan to try and add an optimized version or at least a different implementation for esp32 that will not trigger the compiler bug.

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

1 participant