Skip to content

Use arm_embedded_module to simplify the runner in app_main - #19

Open
christophe0606 wants to merge 1 commit into
Arm-Examples:mainfrom
christophe0606:embedded_module
Open

christophe0606 wants to merge 1 commit into
Arm-Examples:mainfrom
christophe0606:embedded_module

Conversation

@christophe0606

@christophe0606 christophe0606 commented Sep 9, 2026

Copy link
Copy Markdown

Use the class EmbeddedModule to simplify the runner in app_main.

EmbeddedModule is derived from executorch Module class but removes all the POSIX related APIs that are not useful on embedded device and prevent Module from being built for embedded devices.

MatthiasHertelArm pushed a commit that referenced this pull request Sep 10, 2026
Ported from PR #19 by Christophe Favergeon. EmbeddedModule is ExecuTorch's
Module class without the POSIX file loading, so program loading, planned
memory and execution leave app_main.cpp. Unlike the PR, the input tensor
wraps a static buffer through TensorImpl instead of make_tensor_ptr: the
pack's Extension Tensor component pulls in tensor_ptr_maker.cpp, which
needs std::random_device and does not build with the LLVM embedded
toolchain. The pool sizes stay overridable by the board layer. Verified
on the FVP with CLANG.
@MatthiasHertelArm

Copy link
Copy Markdown
Contributor

Thanks. main has been restructured (three-step flow, solution renamed to cmsis-executorch, scripts/gen_components.py replaced by create_ai_layer.py), so this PR cannot merge as is. I ported it: commit a2803f7 ("Run the model through EmbeddedModule") on main adds src/arm_embedded_module.{cpp,hpp} unchanged and rewrites app_main.cpp around EmbeddedModule::forward(). Two deltas: the input tensor wraps a static buffer through TensorImpl instead of make_tensor_ptr, because the pack's Extension Tensor component pulls in tensor_ptr_maker.cpp, which needs std::random_device and does not build with the LLVM embedded toolchain (--toolchain CLANG, the only way to link this on macOS); and the pool sizes stay overridable by the board layer. The RTE/ files this PR carries are committed on main now (commit 4a8c447). Verified on the FVP with CLANG and by CI with AC6. If the port covers what you needed, please close this PR.

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.

2 participants