| #------------------------------------------------------------------------------- |
| # 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 |
| ) |
| |
| 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 |
| ) |
| endif() |
| |
| 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 |
| ) |
| |
| 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 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 |
| 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 |
| ) |
| endif() |
| |
| 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" |
| ) |
| |
| 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 |
| 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 |
| ) |
| |
| iree_cc_binary( |
| NAME |
| voice_commands_embedded_sync |
| SRCS |
| "voice_commands.c" |
| DEPS |
| ::voice_commands_bytecode_module_dylib_c |
| samples::util::util |
| ) |