-
Notifications
You must be signed in to change notification settings - Fork 169
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
[Filter/TFLite] Fix delegates deleter usage @open sesame 12/17 16:37 #3617
[Filter/TFLite] Fix delegates deleter usage @open sesame 12/17 16:37 #3617
Conversation
📝 TAOS-CI Version: 1.5.20200925. Thank you for submitting PR #3617. Please a submit 1commit/1PR (one commit per one PR) policy to get comments quickly from reviewers. Your PR must pass all verificiation processes of cibot before starting a review process from reviewers. If you are new member to join this project, please read manuals in documentation folder and wiki page. In order to monitor a progress status of your PR in more detail, visit http://nnstreamer.mooo.com/. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great thanks! I tested the supported delegates including GPU delegate on Android device.
LGTM ✔
@@ -197,10 +197,16 @@ class TFLiteInterpreter | |||
/** @brief cache input and output tensor ptr before invoke */ | |||
int cacheInOutTensorPtr (); | |||
|
|||
/** @brief set delegate for the tflite interpreter */ | |||
void setDelegate (TfLiteDelegate *delegate) | |||
/** @brief get delegate for the tflite interpreter */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May be a minor typo here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the comment - typo fixed in updated patchset
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jvuillaumier, 💯 All CI checkers are successfully verified. Thanks.
On pipeline stop, crash in TFLite filter may be seen with some delegates with log signature: Setting pipeline to NULL ... free(): invalid pointer Pipeline termination procedure is then aborted. TFlite delegates shall be released by specific deleter, provided by their respective interface. TFLite filter implementation manages delegates instance with smart pointers for automatic disposal when interpreter goes out of of scope. Care should be taken to bind relevant delegate deleter to the smart pointer, otherwise trivial deleter is used for the managed pointer which may crash. Signed-off-by: Julien Vuillaumier <julien.vuillaumier@nxp.com>
4787226
to
308da67
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jvuillaumier, 💯 All CI checkers are successfully verified. Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Hello,
This change is a proposal to fix a crash visible on TFLite filter using external delegate - same issue is also present for other delegates except NNAPI that uses appropriate unique_ptr declaration.
XNNPACK, NNAPI and external delegate deletion has been verified. Could not verify GPU delegate as it is not available on my setup.
Thank you
On pipeline stop, crash in TFLite filter may be seen with some
delegates with log signature:
Setting pipeline to NULL ...
free(): invalid pointer
Pipeline termination procedure is then aborted.
TFlite delegates shall be released by specific deleter, provided
by their respective interface.
TFLite filter implementation manages delegates instance with
smart pointers for automatic disposal when interpreter goes out of
of scope.
Care should be taken to bind relevant delegate deleter to the
smart pointer, otherwise trivial deleter is used for the managed
pointer which may crash.
Signed-off-by: Julien Vuillaumier julien.vuillaumier@nxp.com
Self evaluation:
SSAT test suite passed.