STT-tensorflow/tensorflow/lite/micro/benchmarks/BUILD
Nick Kreeger d8881eb71d Add a memory threshold allocation test for the Keyword model.
This new test ensures that TF Micro does not regress current allocations (on x86-64 systems) for a canonical model. As RAM reduction changes are introduced, the values in this test can be updated from the console log of this test.

Current output for the keyword model:
Testing TestKeywordModelMemoryThreshold
[RecordingMicroAllocator] Arena allocation total 21440 bytes
[RecordingMicroAllocator] Arena allocation head 672 bytes
[RecordingMicroAllocator] Arena allocation tail 20768 bytes
[RecordingMicroAllocator] 'TfLiteTensor struct allocation' used 6048 bytes (requested 6048 bytes 54 times)
[RecordingMicroAllocator] 'TfLiteTensor quantization data allocations' used 2160 bytes (requested 2160 bytes 162 times)
[RecordingMicroAllocator] 'NodeAndRegistration struct allocation' used 1200 bytes (requested 1200 bytes 15 times)
[RecordingMicroAllocator] 'Operator runtime data allocation' used 148 bytes (requested 148 bytes 13 times)

PiperOrigin-RevId: 315958032
Change-Id: I226f6a01aa555970805388632559241a41ff8342
2020-06-11 12:54:09 -07:00

92 lines
2.4 KiB
Python

licenses(["notice"]) # Apache 2.0
package_group(
name = "micro_top_level",
packages = ["//tensorflow/lite/micro"],
)
cc_library(
name = "micro_benchmark",
hdrs = [
"micro_benchmark.h",
],
deps = [
"//tensorflow/lite/micro:micro_error_reporter",
"//tensorflow/lite/micro:micro_framework",
"//tensorflow/lite/micro:micro_time",
"//tensorflow/lite/micro:op_resolvers",
],
)
cc_binary(
name = "conv_benchmark",
srcs = [
"conv_benchmark.cc",
],
deps = [
"//tensorflow/lite/c:common",
"//tensorflow/lite/micro:micro_time",
"//tensorflow/lite/micro/kernels:micro_ops",
"//tensorflow/lite/micro/testing:micro_test",
],
)
cc_binary(
name = "depthwise_conv_benchmark",
srcs = [
"depthwise_conv_benchmark.cc",
],
deps = [
"//tensorflow/lite/c:common",
"//tensorflow/lite/micro:micro_time",
"//tensorflow/lite/micro/kernels:micro_ops",
"//tensorflow/lite/micro/testing:micro_test",
],
)
cc_library(
name = "keyword_scrambled_model_data",
srcs = [
"keyword_scrambled_model_data.cc",
],
hdrs = [
"keyword_scrambled_model_data.h",
],
visibility = [
":micro_top_level",
],
)
cc_binary(
name = "keyword_benchmark",
srcs = ["keyword_benchmark.cc"],
deps = [
":keyword_scrambled_model_data",
":micro_benchmark",
"//tensorflow/lite/c:common",
"//tensorflow/lite/micro:micro_error_reporter",
"//tensorflow/lite/micro:micro_framework",
"//tensorflow/lite/micro:op_resolvers",
"//tensorflow/lite/micro/kernels:micro_ops",
],
)
cc_binary(
name = "person_detection_benchmark",
srcs = ["person_detection_benchmark.cc"],
deps = [
":micro_benchmark",
"//tensorflow/lite:schema_fbs_version",
"//tensorflow/lite/c:common",
"//tensorflow/lite/micro:micro_error_reporter",
"//tensorflow/lite/micro:micro_framework",
"//tensorflow/lite/micro:micro_utils",
"//tensorflow/lite/micro:op_resolvers",
"//tensorflow/lite/micro/examples/person_detection:model_settings",
"//tensorflow/lite/micro/examples/person_detection:person_detect_model_data",
"//tensorflow/lite/micro/examples/person_detection:simple_images_test_data",
"//tensorflow/lite/micro/kernels:micro_ops",
"//tensorflow/lite/schema:schema_fbs",
],
)