Latency for NN deployment information using DL HDL toolbox
1 次查看(过去 30 天)
显示 更早的评论
Hello,
I'm using Deep Learning HDL Toolbox Support Package For Intel FPGA And SoC Devices to implement a Convolutional Neural Network (CNN) on an Intel FPGA. The CNN consists of convolutional layers, activation layers, and fully connected layers. After compiling the entire model with all its layers, I observed that the latency report generated using the command [prediction, speed] = hW.predict(single(inputImg),'Profile','on') only provides information for convolutional and fully connected layers and there is no latency metric provided for activation layers.
I am interested in understanding how the latency is computed in this context and why activation layers do not have a latency metric in the report. Could you please provide more information on this matter?
--------------------------
Software version:
Matlab R2023b
Ubuntu 20.04
---------------------------
0 个评论
回答(1 个)
Bharathi Yogaraj
2023-11-14
When the activation layers are placed after the convolution or fully connected layers, they are fused together to avoid any extra latency. For further details, please refer to the additional information provided: Supported Networks, Layers, Boards, and Tools - MATLAB & Simulink (mathworks.com)
1 个评论
Wang Chen
2023-11-14
Hi Ruben,
Also, to answer your question on "how the latency is computed": the DL Processor is saving the events like the start and end of the each layer into an event memory, and these event data are pulled from FPGA to MATLAB when you turn 'profile', 'on'. These event data contains the actual clock cycle numbers, so the profiler can calculate out the exact cycle time each layer used in the FPGA.
As Bharathi pointed out, activation layers are merged into the previous layer during execution, so they don't cost extra clock cycles, that's why you don't see them in the profiler report.
Thanks,
Wang
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Deep Learning Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!