Reproduce microtvm-blogpost-eval

Hi @areusch

I am trying to reproduce microtvm-blogpost-eval. Installing VM and logging in is very smooth. But when I follow Running stadalone and build the binary with Zephyr commands west build -b nucleo_f746zg, I see a fatal error attached below:

FAILED: zephyr/zephyr_prebuilt.elf zephyr/zephyr_prebuilt.map 
: && ccache /home/vagrant/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-g++   zephyr/CMakeFiles/zephyr_prebuilt.dir/misc/empty_file.c.obj -o zephyr/zephyr_prebuilt.elf  -Wl,-T  zephyr/linker.cmd  -Wl,-Map=/home/ruoyu/lib/microtvm-blogpost-eval/standalone/build/zephyr/zephyr_prebuilt.map  -Wl,--whole-archive  app/libapp.a  zephyr/libzephyr.a  zephyr/arch/common/libarch__common.a  zephyr/arch/arch/arm/core/aarch32/libarch__arm__core__aarch32.a  zephyr/arch/arch/arm/core/aarch32/cortex_m/libarch__arm__core__aarch32__cortex_m.a  zephyr/arch/arch/arm/core/aarch32/cortex_m/mpu/libarch__arm__core__aarch32__cortex_m__mpu.a  zephyr/lib/libc/newlib/liblib__libc__newlib.a  zephyr/lib/posix/liblib__posix.a  zephyr/soc/arm/common/cortex_m/libsoc__arm__common__cortex_m.a  zephyr/drivers/gpio/libdrivers__gpio.a  zephyr/drivers/serial/libdrivers__serial.a  modules/stm32/stm32cube/lib..__modules__hal__stm32__stm32cube.a  -Wl,--no-whole-archive  zephyr/kernel/libkernel.a  zephyr/CMakeFiles/offsets.dir/./arch/arm/core/offsets/offsets.c.obj  -L"/home/vagrant/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/10.2.0/thumb/v7e-m+fp/hard"  -L/home/ruoyu/lib/microtvm-blogpost-eval/standalone/build/zephyr  -lgcc  zephyr/arch/common/libisr_tables.a  -mcpu=cortex-m7  -mthumb  -mabi=aapcs  -mfpu=fpv5-sp-d16  -Wl,--gc-sections  -Wl,--build-id=none  -Wl,--sort-common=descending  -Wl,--sort-section=alignment  -Wl,-u,_OffsetAbsSyms  -Wl,-u,_ConfigAbsSyms  -nostdlib  -static  -no-pie  -Wl,-X  -Wl,-N  -Wl,--orphan-handling=warn  -lm  -Wl,-lc  -L"/home/vagrant/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi"/lib/thumb/v7e-m+fp/hard  -Wl,-lgcc  -lc  -specs=nano.specs && cd /home/ruoyu/lib/microtvm-blogpost-eval/standalone/build/zephyr && /usr/bin/cmake -E echo
/home/vagrant/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/10.2.0/../../../../arm-zephyr-eabi/bin/ld: zephyr/zephyr_prebuilt.elf section `bss' will not fit in region `SRAM'
/home/vagrant/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/10.2.0/../../../../arm-zephyr-eabi/bin/ld: section .intList VMA [0000000020050000,00000000200500c7] overlaps section bss VMA [00000000200101f0,00000000200749ad]
/home/vagrant/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/10.2.0/../../../../arm-zephyr-eabi/bin/ld: region `SRAM' overflowed by 156160 bytes
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
FATAL ERROR: command exited with status 1: /usr/bin/cmake --build /home/ruoyu/lib/microtvm-blogpost-eval/standalone/build

Thank you in advance and any suggestion is appreciated

@wuruoyu apologies for missing this post. Could I ask which branch of microtvm-blogpost-eval? The microTVM blogpost is pretty old with respect to microTVM’s evolution in the past year, so reproducing that blogpost requires using an old version of TVM. The experimental-blogpost branch should contain a version of TVM pinned to a working revision.

Performance-wise, we hope to publish some more modern instructions to evaluate microTVM’s performance soon. Stay tuned!

Andrew

1 Like

@areusch When will you share some more modern instructions to evaluate microTVM’s performance?

hi @JKANG94 thanks for posting up here! there are a bunch of changes in-flight which will dramatically affect the performance of microTVM:

We will loop back to this when they land.

@areusch hi, I tune the mnist model just like: Autotuning with micro TVM — tvm 0.8.dev0 documentation, but I can’t get better performance. Is there any demo using autoschedule autotuning the model?

@JKANG94 thanks for your reply! could you post some more detail? there are a couple of different places this could go wrong, so i’d want to look at the tuning logs, the script you’re using, and perhaps some logs. i’d like to update the tutorial to point out common problems with these things, so it’d be great to take a look at what you’re seeing!

@areusch Can tvmmicro use autoschedule to tune the model? Is there any demo?

@JKANG94 we haven’t tried microTVM with AutoScheduler yet. However, we expect this should be possible.

tvm.auto_scheduler.RPCRunner(key, host, port, priority=1, n_parallel=1, timeout=10, number=3, repeat=1, min_repeat_ms=100, cooldown_interval=0.0, enable_cpu_cache_flush=False)

tvm.autotvm.measure.measure_methods.RPCRunner(key, host, port, priority=1, timeout=10, n_parallel=None, number=4, repeat=3, min_repeat_ms=0, cooldown_interval=0.1, enable_cpu_cache_flush=False, module_loader=None)

tvm.autotvm.measure.measure_methods.RPCRunne has module_loader parameter, however tvm.auto_scheduler.RPCRunner has not module_loader parameter,How we use tvm.micro.AutoTvmModuleLoader

module_loader = tvm.micro.AutoTvmModuleLoader( template_project_dir=pathlib.Path(tvm.micro.get_microtvm_template_projects(“zephyr”)), project_options={ “zephyr_board”: BOARD, “west_cmd”: “west”, “verbose”: False, “project_type”: “host_driven”, }, )

builder = auto_scheduler.LocalBuilder( n_parallel=1, build_func=tvm.micro.autotvm_build_func, ) runner = auto_scheduler.LocalRunner(number=1, repeat=1, timeout=100)

@f00248449 right so AutoScheduler unfortunately uses a different runner infrastructure from AutoTVM. some porting is needed. here’s the analogous line in the auto_scheduler runner infra, but it may be a little more painful with that API to thread the ModuleLoader through.

If I want to use auto_scheduler to connect to the micro TVM, is there any solution to this problem? Can you provide detailed guidance?

Right now I don’t have anything more specific to offer than the above link. Happy to review a PR or suggestion of an approach if you’d like to investigate. However, at this point there are a lot of things on my plate so I likely won’t be able to take this up til the new year.