Open PhilippvK opened 2 years ago
@rafzi I think the exec_timeout
you implemented in the old mlonmcu
would be suitable for this. However I would like to offer you to add it to the new codebase by yourself whenever you start working with it. This does not need to be very soon.
yes, that function was intended for exactly that purpose.
a small annoyance with it is that you have to account for broken object identity between objects: https://gitlab.lrz.de/de-tum-ei-eda-esl/ml_on_mcu/-/blob/master/tvm/plan_memory.py#L8
an option was multiprocessing.dummy, which uses threading instread of processes, but i decided against it, because there was some compatibility issue between platforms.
I recently implemented it on my dev branch. It works most of the time, but in some weird special cases, it causes random freezes. If we decide to implement this for all components, it should be marked experimental and should be turned off by default.
There are several situations where it would make sense to time-out a Python function after some defined period:
While some components offer ways to manage timeouts by themselves (i.e.
corstone300
) it would still be great to have a consistent API for such thingsActually Target-related timeouts are already part of of MLonMCU codebase but currently
raise NotImplementedError
.