| # For the generated header files, include the generated directory path. |
| # It is against the c-style recommendation, but we want to create a symlink of |
| # this directory to ml/ml-models for the internal model zoo so all the models |
| # can be built there. |
| include_directories(BEFORE SYSTEM ${CMAKE_CURRENT_BINARY_DIR}) |
| |
| # ------------------------------------------------------------------------------- |
| # Build the mlir bytecode modules with iree-compile. Note the last two flags |
| # are for RVV support. |
| # ------------------------------------------------------------------------------- |
| |
| springbok_modules( |
| NAME |
| mobilenet_v1 |
| SRC |
| "mobilenet_v1_0.25_224_quant.tflite" |
| C_IDENTIFIER |
| "quant_models_mobilenet_v1" |
| FLAGS |
| "-iree-input-type=tosa" |
| "-riscv-v-vector-bits-min=512" |
| "-riscv-v-fixed-length-vector-lmul-max=8" |
| PUBLIC |
| ) |
| |
| springbok_modules( |
| NAME |
| mobilenet_v2 |
| SRC |
| "mobilenet_v2_1.0_224_quant.tflite" |
| C_IDENTIFIER |
| "quant_models_mobilenet_v2" |
| FLAGS |
| "-iree-input-type=tosa" |
| "-riscv-v-vector-bits-min=512" |
| "-riscv-v-fixed-length-vector-lmul-max=8" |
| PUBLIC |
| ) |
| |
| springbok_modules( |
| NAME |
| person_detection |
| SRC |
| "person_detection.tflite" |
| C_IDENTIFIER |
| "quant_models_person_detection" |
| FLAGS |
| "-iree-input-type=tosa" |
| "-riscv-v-vector-bits-min=512" |
| "-riscv-v-fixed-length-vector-lmul-max=8" |
| PUBLIC |
| ) |
| |
| # ------------------------------------------------------------------------------ |
| # Binaries to execute the IREE model input |
| # ------------------------------------------------------------------------------ |
| |
| iree_model_input( |
| NAME |
| mobilenet_quant_input |
| SHAPE |
| "1, 224, 224, 3" |
| SRC |
| "https://storage.googleapis.com/download.tensorflow.org/ \ |
| example_images/YellowLabradorLooking_new.jpg" |
| QUANT |
| ) |
| |
| iree_model_input( |
| NAME |
| person_detection_quant_input |
| SHAPE |
| "1, 96, 96, 1" |
| SRC |
| "https://github.com/tensorflow/tflite-micro/raw/aeac6f39e5c7475cea20c54e86d41e3a38312546/ \ |
| tensorflow/lite/micro/examples/person_detection/testdata/person.bmp" |
| QUANT |
| ) |
| |
| # ------------------------------------------------------------------------------ |
| # Binaries to execute the MLIR bytecode modules |
| # ------------------------------------------------------------------------------ |
| |
| # If the program requires a larger stack size, add |
| # |
| # LINKOPTS |
| # "LINKER:--defsym=__stack_size__=<new stack size>" |
| # |
| # to increase it. |
| |
| iree_cc_binary( |
| NAME |
| mobilenet_v1_bytecode_static |
| SRCS |
| "iree_exec/mobilenet_v1.c" |
| DEPS |
| ::mobilenet_quant_input_c |
| ::mobilenet_v1_bytecode_module_static |
| ::mobilenet_v1_bytecode_module_static_c |
| iree::vm::bytecode_module |
| samples::util::util |
| LINKOPTS |
| "LINKER:--defsym=__stack_size__=300k" |
| ) |
| |
| springbok_test( |
| NAME |
| mobilenet_v1_emitc_static |
| SRCS |
| "iree_exec/mobilenet_v1.c" |
| DEPS |
| ::mobilenet_quant_input_c |
| ::mobilenet_v1_c_module_static_c |
| ::mobilenet_v1_c_module_static_emitc |
| samples::util::util |
| LINKOPTS |
| "LINKER:--defsym=__stack_size__=300k" |
| COPTS |
| "-DBUILD_EMITC" |
| TESTFILES |
| "iree_exec/mobilenet_v1_test.run" |
| "iree_exec/mobilenet_v1_test.filecheck" |
| ) |
| |
| iree_cc_binary( |
| NAME |
| mobilenet_v2_bytecode_static |
| SRCS |
| "iree_exec/mobilenet_v2.c" |
| DEPS |
| ::mobilenet_quant_input_c |
| ::mobilenet_v2_bytecode_module_static |
| ::mobilenet_v2_bytecode_module_static_c |
| iree::vm::bytecode_module |
| samples::util::util |
| LINKOPTS |
| "LINKER:--defsym=__stack_size__=300k" |
| ) |
| |
| springbok_test( |
| NAME |
| mobilenet_v2_emitc_static |
| SRCS |
| "iree_exec/mobilenet_v2.c" |
| DEPS |
| ::mobilenet_quant_input_c |
| ::mobilenet_v2_c_module_static_c |
| ::mobilenet_v2_c_module_static_emitc |
| samples::util::util |
| LINKOPTS |
| "LINKER:--defsym=__stack_size__=300k" |
| COPTS |
| "-DBUILD_EMITC" |
| TESTFILES |
| "iree_exec/mobilenet_v2_test.run" |
| "iree_exec/mobilenet_v2_test.filecheck" |
| ) |
| |
| iree_cc_binary( |
| NAME |
| person_detection_bytecode_static |
| SRCS |
| "iree_exec/person_detection.c" |
| DEPS |
| ::person_detection_bytecode_module_static |
| ::person_detection_bytecode_module_static_c |
| ::person_detection_quant_input_c |
| iree::vm::bytecode_module |
| samples::util::util |
| LINKOPTS |
| "LINKER:--defsym=__stack_size__=128k" |
| ) |
| |
| springbok_test( |
| NAME |
| person_detection_emitc_static |
| SRCS |
| "iree_exec/person_detection.c" |
| DEPS |
| ::person_detection_c_module_static_c |
| ::person_detection_c_module_static_emitc |
| ::person_detection_quant_input_c |
| samples::util::util |
| LINKOPTS |
| "LINKER:--defsym=__stack_size__=128k" |
| COPTS |
| "-DBUILD_EMITC" |
| TESTFILES |
| "iree_exec/person_detection_test.run" |
| "iree_exec/person_detection_test.filecheck" |
| ) |