RT1060 Registration memory overwritten by other functions in TFLite Micro models for Quantized model

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

RT1060 Registration memory overwritten by other functions in TFLite Micro models for Quantized model

412 Views
arseniivanov
Contributor I

Hello, I am encountering an error where some TFLM registrations for operations are getting overwritten during other operations. This only happens for INT8/UINT8 quantized models, meaning that the same models but in floating point finish executing(although very slow) with the expected output.

I have several quantizations in the model, and the first one happens to be the first operation in the model execution graph and executed correctly. Then during a convolution in the 9th step, an operation overwrites that address of the Quantization-registration, and the Pad-registration. Then then the Quantization and it's registration is called again later, we crash.

The application is built on top of the sample "eiq/tflm_label_image" code provided as a template in the MCUExpresso IDE.

Here is the trace of the memory for the quantization registration:

Hardware watchpoint 6: *0x2001f20c

Old value = -1
New value = 1611112375
0x60039770 in tflite::MicroMutableOpResolver<128u>::AddBuiltin (this=0x2001e974, op=tflite::BuiltinOperator_QUANTIZE, registration=..., parser=0x60085b31 <tflite::ParseQuantize(tflite::Operator const*, tflite::ErrorReporter*, tflite::BuiltinDataAllocator*, void**)>) at /home/arseni/NXP/NXP_Workspace/evkbmimxrt1060_tflm_label_image/eiq/tensorflow-lite/tensorflow/lite/micro/micro_mutable_op_resolver.h:622
622 registrations_[registrations_len_] = registration;

Hardware watchpoint 6: *0x2001f20c

Old value = 1611112375
New value = -1
0x6004d7e4 in arm_nn_doubling_high_mult_no_sat (m2=1460898564, m1=-784) at /home/arseni/NXP/NXP_Workspace/evkbmimxrt1060_tflm_label_image/eiq/tensorflow-lite/third_party/cmsis/CMSIS/NN/Include/arm_nnsupportfunctions.h:907
907 mult.long_long = mult.long_long + (int64_t)m1 * m2;

Hardware watchpoint 6: *0x2001f20c

Old value = -1
New value = 0
0x6004d7ea in arm_nn_doubling_high_mult_no_sat (m2=1460898564, m1=166) at /home/arseni/NXP/NXP_Workspace/evkbmimxrt1060_tflm_label_image/eiq/tensorflow-lite/third_party/cmsis/CMSIS/NN/Include/arm_nnsupportfunctions.h:907
907 mult.long_long = mult.long_long + (int64_t)m1 * m2;


Has anyone encountered issues similar to this? What can be done to resolve this?

Labels (1)
0 Kudos
2 Replies

395 Views
arseniivanov
Contributor I

The issue disappears when running with any optimization above O0, root cause of issue still unknown.

0 Kudos

334 Views
Ramon_Vega
NXP TechSupport
NXP TechSupport

Dear @arseniivanov,

If the problem disappears when using any optimization level above -O0, then it is likely that one of the optimization techniques applied by the compiler is solving the problem, could you try using volatile in your code to see if this help with a manual optimization.

Kind regards.

0 Kudos