Closed PhilippvK closed 1 year ago
An alternative approach would be building the libcmsis-nn
.a (or libmuriscv-nn.a
) on demand when compiling the target software with cmake. However I would prefer to have those libs prebuild to only link against them.
I would like to build cmsis-nn
, muriscv-nn
,... together with the target software instead of pre-building them during mlonmcu setup
as we do not have another choice for non-MLIF platforms (e.g. espidf
and further platforms which might get added in the future). As those libs are quite small the increate of compile time should be negligible.
However to use those features in combination with the tflite-micro-compiler
they needs to be a version of tflmc.exe
built with e.g. muriscvnn
support -> As long as we only execute the pre-interpreter on the host (x86) this should me possible as only one version of muriscvnn.lib
would exists.
As mentioned in #17 a long term goal would be using TFLMC in the target architecture to get more accurate arena estimations and enable target-specific features (e.g. vext
). This would not work out nice with the mentioned workaround...
Closing because not meaningful
There is a flaw iin the current implementation of the
cmsisnn
issue:cmsisnn.lib
which is then passed to thetflm.optimized_kernel_libs
configuration variable.corstone300
FVP) we get into trouble if we also want to use other architectures, as each of them is building a specific static library for CMSISNN.Do achieve this in
mlonmcu setup
builds multiple static libraries leading to the following dependency cache (deps/cache.ini
):target.get_arch()
methodcmsisnn.lib
can not be resolved because it is missing the flagsx86/arm/riscv
anddbg
from the compile stage... -> The actual issueA workaround for this issue is explicitly passing the value of
cmsisnn.lib
via the command line:--config cmsisnn.lib=/tmp/mlonmcu_env/deps/install/cmsisnn_x86_dbg/libmuriscv-nn.a
To tacke the issue we have to resolve one/both of these problems:
Another option which might be feasible is the following:
Instead of the actual value of
cmsisnn.lib
config/cache variable we just pass some sort of reference totflm.optimized_kernel_libs
which is then resolved whentflm.optimized_kernel_libs
is accessed, e.g. inTfLiteFramework.get_cmake_args()
. We should keep this in mind when tackling #15 as this might help to get rid of A. and B..The issue would also apply to
muriscvnn
, as we it would be great if we could use the scalar version on other platforms as well for comparisons.