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

Fix Zephyr flashing on physical hardware, busted in #7813 #7853

Merged
merged 1 commit into from
Apr 15, 2021

Conversation

areusch
Copy link
Contributor

@areusch areusch commented Apr 15, 2021

@gromero looks like I missed this in reviewing your change, and unfortunately no way to test this in CI at main right now.

@tqchen tqchen merged commit 1ebfafd into apache:main Apr 15, 2021
@gromero
Copy link
Contributor

gromero commented Apr 15, 2021

@areusch oh okay. Thanks for fixing it!

So, what happened here was that I've indeed tested an early version of my change with STM32 disco board, but then I did additional changes and checked it again, but got the following error:

Model Version: 3
Cannot find config for target=c -keys=cpu -link-params=0 -march=armv7e-m -mcpu=cortex-m7 -model=stm32f746xx -runtime=c -system-lib=1, workload=('dense_pack.x86', ('TENSOR', (1, 16), 'float32'), ('TENSOR', (1, 16), 'float32'), None, 'float32'). A fallback configuration is used, which may bring great performance regression.
Cannot find config for target=c -keys=cpu -link-params=0 -march=armv7e-m -mcpu=cortex-m7 -model=stm32f746xx -runtime=c -system-lib=1, workload=('dense_pack.x86', ('TENSOR', (1, 16), 'float32'), ('TENSOR', (16, 16), 'float32'), None, 'float32'). A fallback configuration is used, which may bring great performance regression.
Cannot find config for target=c -keys=cpu -link-params=0 -march=armv7e-m -mcpu=cortex-m7 -model=stm32f746xx -runtime=c -system-lib=1, workload=('dense_pack.x86', ('TENSOR', (1, 1), 'float32'), ('TENSOR', (16, 1), 'float32'), None, 'float32'). A fallback configuration is used, which may bring great performance regression.
./micro_tflite_disco_head.py:202: DeprecationWarning: legacy graph executor behavior of producing json / lib / params will be removed in the next release. Please see documents of tvm.contrib.graph_executor.GraphModule for the  new recommended usage.
  graph, c_mod, c_params = relay.build(mod, target=TARGET, params=params)
Including boilerplate (Zephyr base): /home/gromero/zephyrproject/zephyr/cmake/app/boilerplate.cmake
In file included from <command-line>:
/home/gromero/zephyrproject/zephyr/boards/arm/stm32f746g_disco/stm32f746g_disco.dts:9:10: fatal error: st/f7/stm32f746nghx-pinctrl.dtsi: No such file or directory
    9 | #include <st/f7/stm32f746nghx-pinctrl.dtsi>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
CMake Error at /home/gromero/zephyrproject/zephyr/cmake/dts.cmake:156 (message):
  command failed with return code: 1
Call Stack (most recent call first):
  /home/gromero/zephyrproject/zephyr/cmake/app/boilerplate.cmake:535 (include)
  /home/gromero/zephyrproject/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:24 (include)
  /home/gromero/zephyrproject/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:35 (include_boilerplate)
  CMakeLists.txt:3 (find_package)


Traceback (most recent call last):
  File "./micro_tflite_disco_head.py", line 242, in <module>
    micro_binary = tvm.micro.build_static_runtime(
  File "/home/gromero/git/tvm/python/tvm/micro/build.py", line 240, in build_static_runtime
    libs.append(compiler.library(lib_build_dir, lib_srcs, compiler_options["lib_opts"]))
  File "/home/gromero/git/tvm/python/tvm/micro/contrib/zephyr.py", line 209, in library
    self._subprocess_env.run(
  File "/home/gromero/git/tvm/python/tvm/micro/contrib/zephyr.py", line 60, in run
    return subprocess.check_output(cmd, env=env, **kw, universal_newlines=True)
  File "/usr/lib/python3.8/subprocess.py", line 411, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/usr/lib/python3.8/subprocess.py", line 512, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['cmake', '..', '-DBOARD=stm32f746g_disco', '-DEXTRA_CFLAGS=-Wno-error=incompatible-pointer-types -Wno-unused-variable -fno-builtin', "-DEXTRA_CXXFLAGS=-std=c++11 -Wall -Werror '-DDMLC_USE_LOGGING_LIBRARY=<tvm/runtime/logging.h>' -Wno-unused-variable", '-DEXTRA_LDFLAGS=-std=c++11']' returned non-zero exit status 1.

Skimming through it I attributed it to a Zephyr 2.5.0 change which I stashed to look later and then kind forgot to return to it, focusing on the CI issues I had on the submitting the 7813 PR, sorry about that.

I'm wondering on which board you hit the regression first. Was that a disco board or the Nordic (nRF)?

Anyway, I need to think of some way to avoid that kind of regression since it's happening too often recently...

@gromero
Copy link
Contributor

gromero commented Apr 15, 2021

So, what happened here was that I've indeed tested an early version of my change with STM32 disco board, but then I did additional changes and checked it again, but got the following error:

Model Version: 3
Cannot find config for target=c -keys=cpu -link-params=0 -march=armv7e-m -mcpu=cortex-m7 -model=stm32f746xx -runtime=c -system-lib=1, workload=('dense_pack.x86', ('TENSOR', (1, 16), 'float32'), ('TENSOR', (1, 16), 'float32'), None, 'float32'). A fallback configuration is used, which may bring great performance regression.
Cannot find config for target=c -keys=cpu -link-params=0 -march=armv7e-m -mcpu=cortex-m7 -model=stm32f746xx -runtime=c -system-lib=1, workload=('dense_pack.x86', ('TENSOR', (1, 16), 'float32'), ('TENSOR', (16, 16), 'float32'), None, 'float32'). A fallback configuration is used, which may bring great performance regression.
Cannot find config for target=c -keys=cpu -link-params=0 -march=armv7e-m -mcpu=cortex-m7 -model=stm32f746xx -runtime=c -system-lib=1, workload=('dense_pack.x86', ('TENSOR', (1, 1), 'float32'), ('TENSOR', (16, 1), 'float32'), None, 'float32'). A fallback configuration is used, which may bring great performance regression.
./micro_tflite_disco_head.py:202: DeprecationWarning: legacy graph executor behavior of producing json / lib / params will be removed in the next release. Please see documents of tvm.contrib.graph_executor.GraphModule for the  new recommended usage.
  graph, c_mod, c_params = relay.build(mod, target=TARGET, params=params)
Including boilerplate (Zephyr base): /home/gromero/zephyrproject/zephyr/cmake/app/boilerplate.cmake
In file included from <command-line>:
/home/gromero/zephyrproject/zephyr/boards/arm/stm32f746g_disco/stm32f746g_disco.dts:9:10: fatal error: st/f7/stm32f746nghx-pinctrl.dtsi: No such file or directory
    9 | #include <st/f7/stm32f746nghx-pinctrl.dtsi>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
CMake Error at /home/gromero/zephyrproject/zephyr/cmake/dts.cmake:156 (message):
  command failed with return code: 1
Call Stack (most recent call first):
  /home/gromero/zephyrproject/zephyr/cmake/app/boilerplate.cmake:535 (include)
  /home/gromero/zephyrproject/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:24 (include)
  /home/gromero/zephyrproject/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:35 (include_boilerplate)
  CMakeLists.txt:3 (find_package)


Traceback (most recent call last):
  File "./micro_tflite_disco_head.py", line 242, in <module>
    micro_binary = tvm.micro.build_static_runtime(
  File "/home/gromero/git/tvm/python/tvm/micro/build.py", line 240, in build_static_runtime
    libs.append(compiler.library(lib_build_dir, lib_srcs, compiler_options["lib_opts"]))
  File "/home/gromero/git/tvm/python/tvm/micro/contrib/zephyr.py", line 209, in library
    self._subprocess_env.run(
  File "/home/gromero/git/tvm/python/tvm/micro/contrib/zephyr.py", line 60, in run
    return subprocess.check_output(cmd, env=env, **kw, universal_newlines=True)
  File "/usr/lib/python3.8/subprocess.py", line 411, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/usr/lib/python3.8/subprocess.py", line 512, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['cmake', '..', '-DBOARD=stm32f746g_disco', '-DEXTRA_CFLAGS=-Wno-error=incompatible-pointer-types -Wno-unused-variable -fno-builtin', "-DEXTRA_CXXFLAGS=-std=c++11 -Wall -Werror '-DDMLC_USE_LOGGING_LIBRARY=<tvm/runtime/logging.h>' -Wno-unused-variable", '-DEXTRA_LDFLAGS=-std=c++11']' returned non-zero exit status 1.

For the records, that error happens because on Zephyr 2.5.0 the *-pinctrl.dtsi files, like stm32f746nghx-pinctrl.dtsi, moved to a different location under HAL files, so running $ west update resolved it.

@areusch
Copy link
Contributor Author

areusch commented Apr 15, 2021

@gromero glad you resolved it. did you need to do this with the reference VM, or just on your box?

mehrdadh pushed a commit to mehrdadh/tvm that referenced this pull request Apr 22, 2021
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request May 6, 2021
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request May 6, 2021
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request May 6, 2021
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

Successfully merging this pull request may close these issues.

3 participants