| #------------------------------------------------------------------------------- | |
| # Build the mlir bytecode modules with iree-translate. Note the last three flags | |
| # are for RVV support. | |
| #------------------------------------------------------------------------------- | |
| springbok_bytecode_module( | |
| NAME | |
| mobilenet_v1_bytecode_module_dylib | |
| SRC | |
| "$ENV{ROOTDIR}/ml/ml-models-public/float_models/mobilenet_v1_0.25_224_float.tflite" | |
| C_IDENTIFIER | |
| "samples_float_model_embedding_mobilenet_v1_bytecode_module_dylib" | |
| FLAGS | |
| "-iree-input-type=tosa" | |
| "-riscv-v-vector-bits-min=512" | |
| "-riscv-v-fixed-length-vector-lmul-max=8" | |
| "-riscv-v-fixed-length-vector-elen-max=32" | |
| PUBLIC | |
| ) | |
| springbok_bytecode_module( | |
| NAME | |
| mnist_bytecode_module_dylib | |
| SRC | |
| "$ENV{ROOTDIR}/toolchain/iree/iree/samples/models/mnist.mlir" | |
| C_IDENTIFIER | |
| "samples_float_model_embedding_mnist_bytecode_module_dylib" | |
| FLAGS | |
| "-iree-input-type=mhlo" | |
| "-riscv-v-vector-bits-min=512" | |
| "-riscv-v-fixed-length-vector-lmul-max=8" | |
| "-riscv-v-fixed-length-vector-elen-max=32" | |
| PUBLIC | |
| ) | |
| if(${BUILD_INTERNAL_MODELS}) | |
| if(NOT ${BUILD_WITH_SPRINGBOK}) | |
| springbok_bytecode_module( | |
| NAME | |
| scenenet_v2_bytecode_module_dylib | |
| SRC | |
| "$ENV{ROOTDIR}/ml/ml-models/float_models/scenenet_v2_float.tflite" | |
| C_IDENTIFIER | |
| "samples_float_model_embedding_scenenet_v2_bytecode_module_dylib" | |
| FLAGS | |
| "-iree-input-type=tosa" | |
| "-riscv-v-vector-bits-min=512" | |
| "-riscv-v-fixed-length-vector-lmul-max=8" | |
| "-riscv-v-fixed-length-vector-elen-max=32" | |
| PUBLIC | |
| ) | |
| springbok_bytecode_module( | |
| NAME | |
| barcode_bytecode_module_dylib | |
| SRC | |
| "$ENV{ROOTDIR}/ml/ml-models/float_models/barcode_float.tflite" | |
| C_IDENTIFIER | |
| "samples_float_model_embedding_barcode_bytecode_module_dylib" | |
| FLAGS | |
| "-iree-input-type=tosa" | |
| "-riscv-v-vector-bits-min=512" | |
| "-riscv-v-fixed-length-vector-lmul-max=8" | |
| "-riscv-v-fixed-length-vector-elen-max=32" | |
| PUBLIC | |
| ) | |
| endif() | |
| springbok_bytecode_module( | |
| NAME | |
| daredevil_bytecode_module_dylib | |
| SRC | |
| "$ENV{ROOTDIR}/ml/ml-models/float_models/daredevil_float.tflite" | |
| C_IDENTIFIER | |
| "samples_float_model_embedding_daredevil_bytecode_module_dylib" | |
| FLAGS | |
| "-iree-input-type=tosa" | |
| "-riscv-v-vector-bits-min=512" | |
| "-riscv-v-fixed-length-vector-lmul-max=8" | |
| "-riscv-v-fixed-length-vector-elen-max=32" | |
| PUBLIC | |
| ) | |
| springbok_bytecode_module( | |
| NAME | |
| fssd_25_8bit_v2_bytecode_module_dylib | |
| SRC | |
| "$ENV{ROOTDIR}/ml/ml-models/float_models/fssd_25_8bit_v2_float.tflite" | |
| C_IDENTIFIER | |
| "samples_float_model_embedding_fssd_25_8bit_v2_bytecode_module_dylib" | |
| FLAGS | |
| "-iree-input-type=tosa" | |
| "-riscv-v-vector-bits-min=512" | |
| "-riscv-v-fixed-length-vector-lmul-max=8" | |
| "-riscv-v-fixed-length-vector-elen-max=32" | |
| PUBLIC | |
| ) | |
| springbok_bytecode_module( | |
| NAME | |
| person_detection_bytecode_module_dylib | |
| SRC | |
| "$ENV{ROOTDIR}/ml/ml-models/float_models/person_detection_float.tflite" | |
| C_IDENTIFIER | |
| "samples_float_model_embedding_person_detection_bytecode_module_dylib" | |
| FLAGS | |
| "-iree-input-type=tosa" | |
| "-riscv-v-vector-bits-min=512" | |
| "-riscv-v-fixed-length-vector-lmul-max=8" | |
| "-riscv-v-fixed-length-vector-elen-max=32" | |
| PUBLIC | |
| ) | |
| springbok_bytecode_module( | |
| NAME | |
| semantic_lift_bytecode_module_dylib | |
| SRC | |
| "$ENV{ROOTDIR}/ml/ml-models/float_models/semantic_lift_float.tflite" | |
| C_IDENTIFIER | |
| "samples_float_model_embedding_semantic_lift_bytecode_module_dylib" | |
| FLAGS | |
| "-iree-input-type=tosa" | |
| "-riscv-v-vector-bits-min=512" | |
| "-riscv-v-fixed-length-vector-lmul-max=8" | |
| "-riscv-v-fixed-length-vector-elen-max=32" | |
| PUBLIC | |
| ) | |
| springbok_bytecode_module( | |
| NAME | |
| voice_commands_bytecode_module_dylib | |
| SRC | |
| "$ENV{ROOTDIR}/ml/ml-models/float_models/voice_commands_float.tflite" | |
| C_IDENTIFIER | |
| "samples_float_model_embedding_voice_commands_bytecode_module_dylib" | |
| FLAGS | |
| "-iree-input-type=tosa" | |
| "-riscv-v-vector-bits-min=512" | |
| "-riscv-v-fixed-length-vector-lmul-max=8" | |
| "-riscv-v-fixed-length-vector-elen-max=32" | |
| PUBLIC | |
| ) | |
| endif(${BUILD_INTERNAL_MODELS}) | |
| #------------------------------------------------------------------------------- | |
| # Binaries to execute the IREE model input | |
| #------------------------------------------------------------------------------- | |
| iree_model_input( | |
| NAME | |
| mobilenet_input | |
| SHAPE | |
| "1, 224, 224, 3" | |
| SRC | |
| "https://storage.googleapis.com/download.tensorflow.org/ \ | |
| example_images/YellowLabradorLooking_new.jpg" | |
| ) | |
| if(${BUILD_INTERNAL_MODELS}) | |
| iree_model_input( | |
| NAME | |
| person_detection_input | |
| SHAPE | |
| "1, 96, 96, 1" | |
| SRC | |
| "https://github.com/tensorflow/tflite-micro/raw/aeac6f39e5c7475cea20c54e86d41e3a38312546/ \ | |
| tensorflow/lite/micro/examples/person_detection/testdata/person.bmp" | |
| ) | |
| endif(${BUILD_INTERNAL_MODELS}) | |
| #------------------------------------------------------------------------------- | |
| # 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. | |
| # Currently only the person_detection model can run with springbok (b/196910893) | |
| iree_cc_binary( | |
| NAME | |
| mobilenet_v1_embedded_sync | |
| SRCS | |
| "mobilenet_v1.c" | |
| DEPS | |
| ::mobilenet_v1_bytecode_module_dylib_c | |
| ::mobilenet_input_c | |
| samples::util::util | |
| LINKOPTS | |
| "LINKER:--defsym=__stack_size__=100k" | |
| ) | |
| iree_cc_binary( | |
| NAME | |
| mnist_embedded_sync | |
| SRCS | |
| "mnist.c" | |
| DEPS | |
| ::mnist_bytecode_module_dylib_c | |
| samples::util::util | |
| LINKOPTS | |
| "LINKER:--defsym=__stack_size__=100k" | |
| ) | |
| if(NOT ${BUILD_INTERNAL_MODELS}) | |
| return() | |
| endif() | |
| if(NOT ${BUILD_WITH_SPRINGBOK}) | |
| iree_cc_binary( | |
| NAME | |
| scenenet_v2_embedded_sync | |
| SRCS | |
| "scenenet_v2.c" | |
| DEPS | |
| ::scenenet_v2_bytecode_module_dylib_c | |
| samples::util::util | |
| ) | |
| iree_cc_binary( | |
| NAME | |
| barcode_embedded_sync | |
| SRCS | |
| "barcode.c" | |
| DEPS | |
| ::barcode_bytecode_module_dylib_c | |
| samples::util::util | |
| LINKOPTS | |
| "LINKER:--defsym=__stack_size__=100k" | |
| ) | |
| endif() | |
| iree_cc_binary( | |
| NAME | |
| daredevil_embedded_sync | |
| SRCS | |
| "daredevil.c" | |
| DEPS | |
| ::daredevil_bytecode_module_dylib_c | |
| samples::util::util | |
| LINKOPTS | |
| "LINKER:--defsym=__stack_size__=100k" | |
| ) | |
| iree_cc_binary( | |
| NAME | |
| fssd_25_8bit_v2_embedded_sync | |
| SRCS | |
| "fssd_25_8bit_v2.c" | |
| DEPS | |
| ::fssd_25_8bit_v2_bytecode_module_dylib_c | |
| samples::util::util | |
| LINKOPTS | |
| "LINKER:--defsym=__stack_size__=100k" | |
| ) | |
| iree_cc_binary( | |
| NAME | |
| person_detection_embedded_sync | |
| SRCS | |
| "person_detection.c" | |
| DEPS | |
| ::person_detection_bytecode_module_dylib_c | |
| ::person_detection_input_c | |
| samples::util::util | |
| LINKOPTS | |
| "LINKER:--defsym=__stack_size__=100k" | |
| ) | |
| iree_cc_binary( | |
| NAME | |
| semantic_lift_embedded_sync | |
| SRCS | |
| "semantic_lift.c" | |
| DEPS | |
| ::semantic_lift_bytecode_module_dylib_c | |
| samples::util::util | |
| LINKOPTS | |
| "LINKER:--defsym=__stack_size__=100k" | |
| ) | |
| iree_cc_binary( | |
| NAME | |
| voice_commands_embedded_sync | |
| SRCS | |
| "voice_commands.c" | |
| DEPS | |
| ::voice_commands_bytecode_module_dylib_c | |
| samples::util::util | |
| LINKOPTS | |
| "LINKER:--defsym=__stack_size__=100k" | |
| ) |