Skip to content
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

build in release mode #17

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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