blob: ea4ff168ba3b1120634f716a0ed2a82238c99e17 [file] [log] [blame]
#-------------------------------------------------------------------------------
# Build the mlir bytecode modules with iree-compile. Note the last two flags
# are for RVV support.
#-------------------------------------------------------------------------------
springbok_modules(
NAME
mobilenet_v1
SRC
"$ENV{ROOTDIR}/ml/ml-models-public/quant_models/mobilenet_v1_0.25_224_quant.tflite"
C_IDENTIFIER
"samples_quant_model_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
"$ENV{ROOTDIR}/ml/ml-models-public/quant_models/mobilenet_v2_1.0_224_quant.tflite"
C_IDENTIFIER
"samples_quant_model_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
"$ENV{ROOTDIR}/ml/ml-models-public/quant_models/person_detection.tflite"
C_IDENTIFIER
"samples_quant_model_person_detection"
FLAGS
"-iree-input-type=tosa"
"-riscv-v-vector-bits-min=512"
"-riscv-v-fixed-length-vector-lmul-max=8"
PUBLIC
)
if(${BUILD_INTERNAL_MODELS})
springbok_modules(
NAME
barcode
SRC
"$ENV{ROOTDIR}/ml/ml-models/quant_models/barcode_quant.tflite"
C_IDENTIFIER
"samples_quant_model_barcode"
FLAGS
"-iree-input-type=tosa"
"-riscv-v-vector-bits-min=512"
"-riscv-v-fixed-length-vector-lmul-max=8"
PUBLIC
)
springbok_modules(
NAME
daredevil
SRC
"$ENV{ROOTDIR}/ml/ml-models/quant_models/daredevil_quant.tflite"
C_IDENTIFIER
"samples_quant_model_daredevil"
FLAGS
"-iree-input-type=tosa"
"-riscv-v-vector-bits-min=512"
"-riscv-v-fixed-length-vector-lmul-max=8"
PUBLIC
)
springbok_modules(
NAME
fssd_25_8bit_v2
SRC
"$ENV{ROOTDIR}/ml/ml-models/quant_models/fssd_25_8bit_v2_quant.tflite"
C_IDENTIFIER
"samples_quant_model_fssd_25_8bit_v2"
FLAGS
"-iree-input-type=tosa"
"-riscv-v-vector-bits-min=512"
"-riscv-v-fixed-length-vector-lmul-max=8"
PUBLIC
)
springbok_modules(
NAME
scenenet_v2
SRC
"$ENV{ROOTDIR}/ml/ml-models/quant_models/scenenet_v2_quant.tflite"
C_IDENTIFIER
"samples_quant_model_scenenet_v2"
FLAGS
"-iree-input-type=tosa"
"-riscv-v-vector-bits-min=512"
"-riscv-v-fixed-length-vector-lmul-max=8"
PUBLIC
)
springbok_modules(
NAME
semantic_lift
SRC
"$ENV{ROOTDIR}/ml/ml-models/quant_models/semantic_lift_quant.tflite"
C_IDENTIFIER
"samples_quant_model_semantic_lift"
FLAGS
"-iree-input-type=tosa"
"-riscv-v-vector-bits-min=512"
"-riscv-v-fixed-length-vector-lmul-max=8"
PUBLIC
)
springbok_modules(
NAME
voice_commands
SRC
"$ENV{ROOTDIR}/ml/ml-models/quant_models/voice_commands_quant.tflite"
C_IDENTIFIER
"samples_quant_model_voice_commands"
FLAGS
"-iree-input-type=tosa"
"-riscv-v-vector-bits-min=512"
"-riscv-v-fixed-length-vector-lmul-max=8"
PUBLIC
)
endif(${BUILD_INTERNAL_MODELS})
#-------------------------------------------------------------------------------
# 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
)
if(${BUILD_INTERNAL_MODELS})
iree_model_input(
NAME
daredevil_quant_input
SHAPE
"1, 15360, 1"
SRC
"$ENV{ROOTDIR}/ml/ml-models/test_data/golden_whistle.wav"
QUANT
)
iree_model_input(
NAME
fssd_quant_input
SHAPE
"1, 480, 640, 1"
SRC
"$ENV{ROOTDIR}/sw/vec_iree/samples/risp4ml/test_data/faces_480x640_uint8_numpy_bayer.bin"
QUANT
)
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.
iree_cc_binary(
NAME
mobilenet_v1_bytecode_static
SRCS
"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"
)
iree_cc_binary(
NAME
mobilenet_v1_emitc_static
SRCS
"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"
)
iree_cc_binary(
NAME
mobilenet_v2_bytecode_static
SRCS
"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"
)
iree_cc_binary(
NAME
mobilenet_v2_emitc_static
SRCS
"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"
)
iree_cc_binary(
NAME
person_detection_bytecode_static
SRCS
"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"
)
iree_cc_binary(
NAME
person_detection_emitc_static
SRCS
"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"
)
if(NOT ${BUILD_INTERNAL_MODELS})
return()
endif()
iree_cc_binary(
NAME
barcode_bytecode_static
SRCS
"barcode.c"
DEPS
::barcode_bytecode_module_static
::barcode_bytecode_module_static_c
iree::vm::bytecode_module
samples::util::util
LINKOPTS
"LINKER:--defsym=__stack_size__=200k"
)
iree_cc_binary(
NAME
barcode_emitc_static
SRCS
"barcode.c"
DEPS
::barcode_c_module_static_c
::barcode_c_module_static_emitc
samples::util::util
LINKOPTS
"LINKER:--defsym=__stack_size__=200k"
COPTS
"-DBUILD_EMITC"
)
iree_cc_binary(
NAME
daredevil_bytecode_static
SRCS
"daredevil.c"
DEPS
::daredevil_bytecode_module_static
::daredevil_bytecode_module_static_c
::daredevil_quant_input_c
iree::vm::bytecode_module
samples::audio_prep::mfcc
samples::util::util
LINKOPTS
"LINKER:--defsym=__stack_size__=300k"
)
iree_cc_binary(
NAME
daredevil_emitc_static
SRCS
"daredevil.c"
DEPS
::daredevil_c_module_static_c
::daredevil_c_module_static_emitc
::daredevil_quant_input_c
samples::audio_prep::mfcc
samples::util::util
LINKOPTS
"LINKER:--defsym=__stack_size__=300k"
COPTS
"-DBUILD_EMITC"
)
iree_cc_binary(
NAME
fssd_25_8bit_v2_bytecode_static
SRCS
"fssd_25_8bit_v2.c"
DEPS
::fssd_quant_input_c
::fssd_25_8bit_v2_bytecode_module_static
::fssd_25_8bit_v2_bytecode_module_static_c
iree::vm::bytecode_module
samples::risp4ml::pipeline::pipeline
samples::util::util
LINKOPTS
"LINKER:--defsym=__stack_size__=300k"
)
iree_cc_binary(
NAME
fssd_25_8bit_v2_emitc_static
SRCS
"fssd_25_8bit_v2.c"
DEPS
::fssd_quant_input_c
::fssd_25_8bit_v2_c_module_static_c
::fssd_25_8bit_v2_c_module_static_emitc
samples::risp4ml::pipeline::pipeline
samples::util::util
LINKOPTS
"LINKER:--defsym=__stack_size__=300k"
COPTS
"-DBUILD_EMITC"
)
iree_cc_binary(
NAME
scenenet_v2_bytecode_static
SRCS
"scenenet_v2.c"
DEPS
::scenenet_v2_bytecode_module_static
::scenenet_v2_bytecode_module_static_c
iree::vm::bytecode_module
samples::util::util
LINKOPTS
"LINKER:--defsym=__stack_size__=300k"
)
iree_cc_binary(
NAME
scenenet_v2_emitc_static
SRCS
"scenenet_v2.c"
DEPS
::scenenet_v2_c_module_static_c
::scenenet_v2_c_module_static_emitc
samples::util::util
LINKOPTS
"LINKER:--defsym=__stack_size__=300k"
COPTS
"-DBUILD_EMITC"
)
iree_cc_binary(
NAME
semantic_lift_bytecode_static
SRCS
"semantic_lift.c"
DEPS
::semantic_lift_bytecode_module_static
::semantic_lift_bytecode_module_static_c
iree::vm::bytecode_module
samples::util::util
LINKOPTS
"LINKER:--defsym=__stack_size__=300k"
)
iree_cc_binary(
NAME
semantic_lift_emitc_static
SRCS
"semantic_lift.c"
DEPS
::semantic_lift_c_module_static_c
::semantic_lift_c_module_static_emitc
samples::util::util
LINKOPTS
"LINKER:--defsym=__stack_size__=300k"
COPTS
"-DBUILD_EMITC"
)
iree_cc_binary(
NAME
voice_commands_bytecode_static
SRCS
"voice_commands.c"
DEPS
::voice_commands_bytecode_module_static
::voice_commands_bytecode_module_static_c
iree::vm::bytecode_module
samples::util::util
LINKOPTS
"LINKER:--defsym=__stack_size__=250k"
)
iree_cc_binary(
NAME
voice_commands_emitc_static
SRCS
"voice_commands.c"
DEPS
::voice_commands_c_module_static_c
::voice_commands_c_module_static_emitc
samples::util::util
LINKOPTS
"LINKER:--defsym=__stack_size__=250k"
COPTS
"-DBUILD_EMITC"
)