Skip to content

Conversation

@jacobrosenthal
Copy link
Contributor

@jacobrosenthal jacobrosenthal commented Nov 18, 2020

I saw a ticket come through on tflite worrying about assert debug costs if you dont use the release build and I thought... hrmm. Are we building with those flags?
tensorflow/tensorflow#44863 (comment)

Doesnt seem like it, so adding these two defines
https://github.com/tensorflow/tensorflow/blob/acd6f26bbaa2f747b88bfd480c6d607b4836b9ef/tensorflow/lite/micro/tools/make/Makefile#L200

drops 18812 bytes
I havent checked the cycle count, but that would be interesting

$ cargo +nightly size --release --example magic_wand --features="tf"
    Finished release [optimized + debuginfo] target(s) in 52.70s
   text    data     bss     dec     hex filename
 125884     172      16  126072   1ec78 magic_wand
$ cargo +nightly size --release --example magic_wand --features="tf"
    Finished release [optimized + debuginfo] target(s) in 0.31s
   text    data     bss     dec     hex filename
 107072     172      16  107260   1a2fc magic_wand

@wangtz
Copy link

wangtz commented Nov 23, 2020

Hi Jacob,

Your project looks great! Thanks for working on this.

FYI These two flags are for release builds, with them you won't be able to catch DCHECK failures and see other debug log information if needed. This means that you don't get any console output upon failures, for example when the arena is too small for the model. It might make sense to be able to overwrite them when needed.

@jacobrosenthal
Copy link
Contributor Author

Greetings thanks for stopping by @wangtz Please keep us and c linking workflow in mind in upstream :)

Im just a consumer, @richardeoin and @Recognition2 have the commits.

I dont think we utilize or export the DCHECK stuff so shouldnt be a problem, but we can also match on std::env::var("PROFILE") for debug and release to enable conditionally instead.

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