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

Add command line option to select -stdlib=libc++ with Xtensa. #47681

Merged

Conversation

advaitjain
Copy link
Member

@advaitjain advaitjain commented Mar 9, 2021

Confirmed that the following two commands build and we see different sizes with and without XTENSA_USE_LIBC=true.

make -f tensorflow/lite/micro/tools/make/Makefile TARGET=xtensa OPTIMIZED_KERNEL_DIR=xtensa TARGET_ARCH=fusion_f1 XTENSA_CORE=F1_190305_swupgrade keyword_benchmark -j8 BUILD_TYPE=release XTENSA_USE_LIBC=true
xt-size tensorflow/lite/micro/tools/make/gen/xtensa_fusion_f1_release/bin/keyword_benchmark

gives:

   text	   data	    bss	    dec	    hex	filename
  84496	    384	  22704	 107584	  1a440	tensorflow/lite/micro/tools/make/gen/xtensa_fusion_f1_release/bin/keyword_benchmark

And

make -f tensorflow/lite/micro/tools/make/Makefile TARGET=xtensa OPTIMIZED_KERNEL_DIR=xtensa TARGET_ARCH=fusion_f1 XTENSA_CORE=F1_190305_swupgrade keyword_benchmark -j8 BUILD_TYPE=release
xt-size tensorflow/lite/micro/tools/make/gen/xtensa_fusion_f1_release/bin/keyword_benchmark

gives:

   text	   data	    bss	    dec	    hex	filename
  66696	  40212	  24856	 131764	  202b4 tensorflow/lite/micro/tools/make/gen/xtensa_fusion_f1_release/bin/keyword_benchmark

Progress towards #47575 and http://b/182209217

Confirmed that the following two commands build and we see different sizes with and without `-stdlib=libc++`.

```
make -f tensorflow/lite/micro/tools/make/Makefile TARGET=xtensa OPTIMIZED_KERNEL_DIR=xtensa TARGET_ARCH=fusion_f1 XTENSA_CORE=F1_190305_swupgrade keyword_benchmark -j8 BUILD_TYPE=release XTENSA_USE_LIBC=true
xt-size tensorflow/lite/micro/tools/make/gen/xtensa_fusion_f1_release/bin/keyword_benchmark
```
gives:
```
   text	   data	    bss	    dec	    hex	filename
  84496	    384	  22704	 107584	  1a440	tensorflow/lite/micro/tools/make/gen/xtensa_fusion_f1_release/bin/keyword_benchmark
```

And
```
make -f tensorflow/lite/micro/tools/make/Makefile TARGET=xtensa OPTIMIZED_KERNEL_DIR=xtensa TARGET_ARCH=fusion_f1 XTENSA_CORE=F1_190305_swupgrade keyword_benchmark -j8 BUILD_TYPE=release
xt-size tensorflow/lite/micro/tools/make/gen/xtensa_fusion_f1_release/bin/keyword_benchmark
```

gives:
```
   text	   data	    bss	    dec	    hex	filename
  66696	  40212	  24856	 131764	  202b4	tensorflow/lite/micro/tools/make/gen/xtensa_fusion_f1_release/bin/keyword_benchmark
```

Progress towards tensorflow#47575 and http://b/182209217
@google-ml-butler google-ml-butler bot added the size:S CL Change Size: Small label Mar 9, 2021
@google-ml-butler
Copy link

Thanks for contributing to TensorFlow Lite Micro.

To keep this process moving along, we'd like to make sure that you have completed the items on this list:

We would like to have a discussion on the Github issue first to determine the best path forward, and then proceed to the PR review.

@google-cla google-cla bot added the cla: yes label Mar 9, 2021
@advaitjain advaitjain added the comp:micro Related to TensorFlow Lite Microcontrollers label Mar 9, 2021
@advaitjain advaitjain requested a review from njeffrie March 9, 2021 20:25
@advaitjain advaitjain added the ready to pull PR ready for merge process label Mar 9, 2021
@google-ml-butler google-ml-butler bot added the kokoro:force-run Tests on submitted change label Mar 9, 2021
@kokoro-team kokoro-team removed the kokoro:force-run Tests on submitted change label Mar 9, 2021
@copybara-service copybara-service bot merged commit 5fb8a4e into tensorflow:master Mar 9, 2021
@advaitjain advaitjain deleted the xtensa-optional-libc++ branch March 10, 2021 18:50
advaitjain added a commit to advaitjain/tensorflow that referenced this pull request Mar 18, 2021
tensorflow#47681 changed the default
back to not using -stdlib=libc++ which meant an expected size increase.
This increase can be avoided at the application level by adding stubs
for the exception code prior to linking the final binary.

We had an (unexpected but completely insignificant) increase in cycles
3 ticks for hifimini and 4 ticks for fusion_f1 from tensorflow#47830
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes comp:micro Related to TensorFlow Lite Microcontrollers ready to pull PR ready for merge process size:S CL Change Size: Small
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants