VeriSilicon / TIM-VX

VeriSilicon Tensor Interface Module
Other
216 stars 85 forks source link

双向LSTM算子内部创建的Tensor对量化参数处理有问题 #647

Closed xie-oritek closed 9 months ago

xie-oritek commented 10 months ago

https://github.com/VeriSilicon/TIM-VX/blob/61ea0091ca8e8a84d408e728269de4a449882fa7/src/tim/vx/ops/bidirectional_sequence_lstm.cc#L157-L158

当输入输出的Tensor有量化参数时,需要同步将量化参数拷贝到第一个reverse的输出和第二个reverse的输入

sunshinemyson commented 10 months ago

@xie-oritek ,

你没有测试用例呢?我们好分析验证。谢谢

xie-oritek commented 10 months ago

lstm_allinput_bi.zip 上面是使用trace功能导出的用例

sunshinemyson commented 10 months ago

@xie-oritek ,

收到,我们会安排人手调查一下。

chxin66 commented 10 months ago

https://github.com/VeriSilicon/TIM-VX/blob/61ea0091ca8e8a84d408e728269de4a449882fa7/src/tim/vx/ops/bidirectional_sequence_lstm.cc#L157-L158

当输入输出的Tensor有量化参数时,需要同步将量化参数拷贝到第一个reverse的输出和第二个reverse的输入

量化参数问题fix了,已经上了pr,但是还会报错E [/home/chenxin/TIM-VX/src/tim/vx/internal/src/ops/vsi_nn_op_eltwise.c:op_check_add:456]Inputs/Outputs data type not support: ASYM UINT8, FLOAT32 case中lstm绑定的tensor类型除了input为u8,其他均为f32,可能case有点问题

sunshinemyson commented 10 months ago

@xie-oritek , https://github.com/VeriSilicon/tflite-vx-delegate/blob/main/op_map.cc#L2392 之处的数据格式可以参考这里的实现。