Skip to content

Commit 47698da

Browse files
authored
1.3.2
* Squashed internal changes for 1.3.2 - lyra_codec/README: update benchmark with TF 2.11 OSS numb... by mchinen <[email protected]> - lyra/android_example: Update number of conditioning vectors by mchinen <[email protected]> - lyra_codec/WORKSPACE: upgrade OSS to TensorFlow 2.11 by mchinen <[email protected]> * Use bazelisk for 5.3.2 due to 6.0.0 issue; Run test in CI Don't run tests for android CI since it builds on ubuntu hosts. * bump version to 1.3.2
1 parent 1486761 commit 47698da

File tree

8 files changed

+24
-17
lines changed

8 files changed

+24
-17
lines changed

.bazelversion

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
5.3.2

.github/actions/lyra-builder/action.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,17 @@ runs:
2020
- shell: bash
2121
run: |
2222
export ANDROID_NDK_HOME="$ANDROID_HOME/ndk/21.4.7075529"
23-
bazel build -c opt lyra/cli_example:encoder_main ${{ inputs.build-options }}
23+
if [[ "${{inputs.platform}}" != "android" ]]; then
24+
bazelisk test -c opt lyra/cli_example:encoder_main_lib_test ${{ inputs.build-options }}
25+
fi
26+
bazelisk build -c opt lyra/cli_example:encoder_main ${{ inputs.build-options }}
2427
- shell: bash
2528
run: |
2629
export ANDROID_NDK_HOME="$ANDROID_HOME/ndk/21.4.7075529"
27-
bazel build -c opt lyra/cli_example:decoder_main ${{ inputs.build-options }}
30+
if [[ "${{inputs.platform}}" != "android" ]]; then
31+
bazelisk test -c opt lyra/cli_example:decoder_main_lib_test ${{ inputs.build-options }}
32+
fi
33+
bazelisk build -c opt lyra/cli_example:decoder_main ${{ inputs.build-options }}
2834
- shell: bash
2935
run: |
3036
mkdir action-product

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
shell: bash
1919
run: |
2020
export ANDROID_NDK_HOME="$ANDROID_HOME/ndk/21.4.7075529"
21-
bazel build lyra/android_example:lyra_android_example --config=android_arm64 --copt=-DBENCHMARK
21+
bazelisk build lyra/android_example:lyra_android_example --config=android_arm64 --copt=-DBENCHMARK
2222
- name: Copy artifacts
2323
shell: bash
2424
run: |

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -154,15 +154,15 @@ If you press 'Benchmark', you should see something like the following in logcat
154154
on a Pixel 6 Pro when running the benchmark:
155155

156156
```shell
157-
lyra_benchmark: feature_extractor: max: 0.575 ms min: 0.131 ms mean: 0.139 ms stdev: 0.004 ms
158-
lyra_benchmark: quantizer_quantize: max: 0.304 ms min: 0.105 ms mean: 0.109 ms stdev: 0.002 ms
159-
lyra_benchmark: quantizer_decode: max: 0.103 ms min: 0.025 ms mean: 0.026 ms stdev: 0.000 ms
160-
lyra_benchmark: model_decode: max: 0.462 ms min: 0.187 ms mean: 0.197 ms stdev: 0.001 ms
161-
lyra_benchmark: total: max: 1.160 ms min: 0.452 ms mean: 0.473 ms stdev: 0.009 ms
157+
lyra_benchmark: feature_extractor: max: 1.836 ms min: 0.132 ms mean: 0.153 ms stdev: 0.042 ms
158+
lyra_benchmark: quantizer_quantize: max: 1.042 ms min: 0.120 ms mean: 0.130 ms stdev: 0.028 ms
159+
lyra_benchmark: quantizer_decode: max: 0.103 ms min: 0.026 ms mean: 0.029 ms stdev: 0.003 ms
160+
lyra_benchmark: model_decode: max: 0.820 ms min: 0.191 ms mean: 0.212 ms stdev: 0.031 ms
161+
lyra_benchmark: total: max: 2.536 ms min: 0.471 ms mean: 0.525 ms stdev: 0.088 ms
162162
```
163163

164164
This shows that decoding a 50Hz frame (each frame is 20 milliseconds) takes
165-
0.473 milliseconds on average. So decoding is performed at around 42 (20/0.473)
165+
0.525 milliseconds on average. So decoding is performed at around 38 (20/0.525)
166166
times faster than realtime.
167167

168168
To build your own android app, you can either use the cc_library target outputs

WORKSPACE

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,9 +168,9 @@ maven_install(
168168
git_repository(
169169
name = "org_tensorflow",
170170
remote = "https://github.com/tensorflow/tensorflow.git",
171-
# Below is reproducible and equivalent to `tag = "v2.9.0"`
172-
commit = "8a20d54a3c1bfa38c03ea99a2ad3c1b0a45dfa95",
173-
shallow_since = "1652465115 -0700"
171+
# Below is reproducible and equivalent to `tag = "v2.11.0"`
172+
commit = "d5b57ca93e506df258271ea00fc29cf98383a374",
173+
shallow_since = "1668561432 -0800"
174174
)
175175

176176
# Check bazel version requirement, which is stricter than TensorFlow's.

lyra/android_example/java/com/example/android/lyra/MainActivity.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ public class MainActivity extends AppCompatActivity {
5050

5151
private static final int REQUEST_RECORD_AUDIO_PERMISSION = 200;
5252
private static final int SAMPLE_RATE = 16000;
53+
private static final int LYRA_NUM_RANDOM_FEATURE_VECTORS = 10000;
5354
private static final String[] permissions = {Manifest.permission.RECORD_AUDIO};
5455

5556
private boolean hasStartedDecode = false;
@@ -252,7 +253,7 @@ public void runBenchmark(View view) {
252253
Log.i(TAG, "Starting lyraBenchmark()");
253254
// Example of a call to a C++ lyra method on a background
254255
// thread.
255-
lyraBenchmark(2000, weightsDirectory);
256+
lyraBenchmark(LYRA_NUM_RANDOM_FEATURE_VECTORS, weightsDirectory);
256257
Log.i(TAG, "Finished lyraBenchmark()");
257258
tv.post(() -> tv.setText(R.string.benchmark_finished));
258259
button.post(() -> button.setEnabled(true));

lyra/lyra_config.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const int kVersionMajor = 1;
3131
// |identifier| field needs to be set in lyra_config.textproto to match this.
3232
const int kVersionMinor = 3;
3333
// The micro version is for other things like a release of bugfixes.
34-
const int kVersionMicro = 1;
34+
const int kVersionMicro = 2;
3535

3636
const int kNumFeatures = 64;
3737
const int kNumMelBins = 160;

lyra/tflite_model_wrapper.cc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,8 @@ std::unique_ptr<TfLiteModelWrapper> TfLiteModelWrapper::Create(
6363
if (use_xnn) {
6464
// Enable XXNPack.
6565
auto options = TfLiteXNNPackDelegateOptionsDefault();
66-
if (int8_quantized) {
67-
options.flags |= TFLITE_XNNPACK_DELEGATE_FLAG_QS8;
68-
}
66+
// TODO(b/219786261) Remove once XNNPACK is enabled by default.
67+
options.flags |= TFLITE_XNNPACK_DELEGATE_FLAG_QU8;
6968
options.num_threads = 1;
7069
auto delegate =
7170
std::unique_ptr<TfLiteDelegate, std::function<void(TfLiteDelegate*)> >(

0 commit comments

Comments
 (0)