Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autotiler CNN Kernel Code Error #409

Open
cweekiat opened this issue Jan 31, 2024 · 1 comment
Open

Autotiler CNN Kernel Code Error #409

cweekiat opened this issue Jan 31, 2024 · 1 comment

Comments

@cweekiat
Copy link

cweekiat commented Jan 31, 2024

Hi,

I am trying to deploy an object detection model on the AI-deck.

I have a Yolov8n model which I exported as .tflite format. The tflite model is quantised using NNTool.

When I try to compile the files, I received the following error message:

BUILD_MODEL_SQ8BIT/detectionKernels.c: In function 'S249_Concat':
BUILD_MODEL_SQ8BIT/detectionKernels.c:15049:2: error: unknown type name 'CNN_Concat_Width_Arg_T'
  CNN_Concat_Width_Arg_T S_KerArg0, *KerArg0 = &S_KerArg0;
  ^~~~~~~~~~~~~~~~~~~~~~
BUILD_MODEL_SQ8BIT/detectionKernels.c:15095:9: error: request for member 'W1' in something not a structure or union
  KerArg0->W1 = (unsigned short int) (784);
         ^~
BUILD_MODEL_SQ8BIT/detectionKernels.c:15096:9: error: request for member 'W2' in something not a structure or union
  KerArg0->W2 = (unsigned short int) (196);
         ^~
BUILD_MODEL_SQ8BIT/detectionKernels.c:15097:9: error: request for member 'W3' in something not a structure or union
  KerArg0->W3 = (unsigned short int) (49);
         ^~
BUILD_MODEL_SQ8BIT/detectionKernels.c:15098:9: error: request for member 'W4' in something not a structure or union
  KerArg0->W4 = (unsigned short int) (0);
         ^~
BUILD_MODEL_SQ8BIT/detectionKernels.c:15099:9: error: request for member 'DataSize' in something not a structure or union
  KerArg0->DataSize = (unsigned char) (1);
         ^~
BUILD_MODEL_SQ8BIT/detectionKernels.c:15144:10: error: request for member 'In1' in something not a structure or union
   KerArg0->In1 = (char *__restrict__) (detection_L1_Memory+0+6272*((T0Ind_Total)%2));
          ^~
BUILD_MODEL_SQ8BIT/detectionKernels.c:15145:10: error: request for member 'In2' in something not a structure or union
   KerArg0->In2 = (char *__restrict__) (detection_L1_Memory+12544+1568*((T0Ind_Total)%2));
          ^~
BUILD_MODEL_SQ8BIT/detectionKernels.c:15146:10: error: request for member 'In3' in something not a structure or union
   KerArg0->In3 = (char *__restrict__) (detection_L1_Memory+15680+392*((T0Ind_Total)%2));
          ^~
BUILD_MODEL_SQ8BIT/detectionKernels.c:15147:10: error: request for member 'Out' in something not a structure or union
   KerArg0->Out = (char *__restrict__) (detection_L1_Memory+16464+8232*((T0Ind_Total)%2));
          ^~
BUILD_MODEL_SQ8BIT/detectionKernels.c:15148:10: error: request for member 'H' in something not a structure or union
   KerArg0->H = (unsigned short int) (T0Ind_Last?2:8);
          ^~
In file included from /gap_sdk/tools/autotiler_v3/Emulation/at_api.h:23:0,
                 from /gap_sdk/tools/autotiler_v3/Emulation/Gap.h:33,
                 from BUILD_MODEL_SQ8BIT/detectionKernels.h:5,
                 from BUILD_MODEL_SQ8BIT/detectionKernels.c:1:
BUILD_MODEL_SQ8BIT/detectionKernels.c:15149:33: error: 'CNN_Concat_Width' undeclared (first use in this function); did you mean 'CNN_Copy_void'?
   AT_FORK(gap_ncore(), (void *) CNN_Concat_Width, (void *) KerArg0);
                                 ^
/gap_sdk/tools/autotiler_v3/Emulation/at_api_pmsis.h:634:83: note: in definition of macro 'AT_FORK'
 #define AT_FORK(nb_cores,entry,arg) pi_cl_team_fork((nb_cores),(AT_FORK_FUN_TYPE)(entry),(AT_FORK_ARG_TYPE)(arg))
                                                                                   ^~~~~
BUILD_MODEL_SQ8BIT/detectionKernels.c:15149:33: note: each undeclared identifier is reported only once for each function it appears in
   AT_FORK(gap_ncore(), (void *) CNN_Concat_Width, (void *) KerArg0);
                                 ^
/gap_sdk/tools/autotiler_v3/Emulation/at_api_pmsis.h:634:83: note: in definition of macro 'AT_FORK'
 #define AT_FORK(nb_cores,entry,arg) pi_cl_team_fork((nb_cores),(AT_FORK_FUN_TYPE)(entry),(AT_FORK_ARG_TYPE)(arg))
                                                                                   ^~~~~
make: *** [/gap_sdk/rtos/freeRTOS/vendors/gwt/rules/freeRTOS_rules.mk:379: /module/examples/ai/detection/BUILD/GAP8_V2/GCC_RISCV_FREERTOS/BUILD_MODEL_SQ8BIT/detectionKernels.o] Error 1

Can you provide some assistance please?

nntool_script:

set log_level INFO
adjust
fusions -a expression_matcher 
fusions --scale8
aquant --force_width 8 --scheme SQ8 --transpose safmc_data/*
set input_norm_func 'x:(x-128)*2.00787401'

#set graph_produce_node_names true
#set graph_produce_operinfos true
#set graph_monitor_cycles true
#set l3_flash_device AT_MEM_L3_HFLASH
#set l3_ram_device AT_MEM_L3_HRAM
qshow 0
save_state 
@cweekiat
Copy link
Author

FYI: I am using the GAP_SDK environment in the AI-deck docker container.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant