主要内容

深度学习网络的性能评估

为了减少设计满足性能要求的自定义深度学习网络所需的时间,在部署网络之前,需要分析层级延迟。比较自定义位流处理器配置上的深度学习网络性能和参考(发货)位流处理器配置上的性能。

学习如何使用表中数据中的信息估计性能函数计算网络性能,请参阅配置文件推断运行

针对定制处理器配置评估定制深度学习网络的性能

此示例显示如何计算自定义处理器配置的深度学习网络的性能。

  1. 在当前工作文件夹中创建一个名为getLogoNetwork.m。在文件中,输入:

    作用网= getLogoNetwork ()如果~ isfile (“LogoNet.mat”)网址=“//www.tianjin-qmedu.com/万博1manbetxsupportfiles/gpucoder/cnn_models/logo_detection/LogoNet.mat”;websave (“LogoNet.mat”,网址);结束data =负载(“LogoNet.mat”); net=data.net;结束

    调用函数并将结果保存在snet

    snet=getlogonnetwork;
  2. 创建一个dlhdl。ProcessorConfig对象。

    hPC = dlhdl.ProcessorConfig;
  3. 调用估计性能snet检索LogoNet网络的层延迟和性能。

    hPC.estimatePerformance (snet)
    创建了3个内存区域。深度学习处理器估计器性能结果LastFrameLatency(周期)LastFrameLatency(秒)FramesNum总延迟帧/秒-------------------------网络39853460 0.19927 139853460 5.0 conv_1 6825287 0.03413 maxpool_1 3755088 0.01878 conv_2 10440701 0.05220 maxpool_2 1447840 0.00724 conv_3 9393397 0.04697 maxpool_3 1765856 0.00883 conv_4 1770484 0.00885 maxpool_4 28098 0.00014 fc U 1 26422 fc_2 1692532 0.00846 fc_3 89293 0.00045*DL处理器的时钟频率为:200MHz

    了解由返回的参数和值的步骤估计性能,看到。

基于自定义处理器配置的深度学习网络性能评估

通过比较自定义位流配置与参考(发货)位流配置的性能,对深度学习网络的性能进行基准测试。使用比较结果来调整您的自定义深度学习处理器参数,以实现最佳性能。

在本例中比较的是ResNet-18的性能zcu102_single位流配置为默认自定义位流配置的性能。

先决条件

  • 用于Xilinx FPGA和SoC的深度学习HDL工具万博1manbetx箱™支持包

  • 深度学习工具箱™

  • 深度学习HDL工具箱™

  • ResNet-18网络的深度学习工具箱模型

负荷预训练网络

加载预训练网络。

snet = resnet18;

检索zcu102_单比特流配置

检索zcu102_single位流配置,使用dlhdl。ProcessorConfig对象有关详细信息,请参阅dlhdl。ProcessorConfig. 要了解处理器配置的可修改参数,请参阅getModulePropertysetModuleProperty

hPC_shipping=dlhdl.ProcessorConfig(“比特流”“zcu102_单个”
hPC_shipping=处理模块“conv”模块生成:“on”LRNBlockGeneration:“on”ConvThreadNumber:16 InputMemorySize:[227 227 3]OutputMemorySize:[227 227 227 3]功能大小限制:2048处理模块“fc”模块生成:“on”SoftmaxBlockGeneration:“off”FCThreadNumber:4 InputMemorySize:25088 OutputMemorySize:4096处理模块“加法器"ModuleGeneration:'on'InputMemorySize:40 OutputMemorySize:40处理器顶级属性RunTimeControl:'register'InputDataInterface:'External Memory'OutputDataInterface:'External Memory'处理器DataType:'single'系统级属性TargetPlatform:'Xilinx Zynq UltraScale+MPSoC ZCU102评估套件'目标频率:220SynthesisTool:“Xilinx Vivado”引用设计:“AXI流DDR内存访问:3-AXIM”SynthesisToLChipFamily:“Zynq UltraScale+”SynthesisToLDeviceName:“xczu9eg-ffvb1156-2-e”SynthesisToLPackageName:“SynthesisToLSpeedValue:”

估计ResNet-18性能zcu102_single位流配置

估计对ResNet-18 DAG网络的性能进行了分析估计性能的函数dlhdl。ProcessorConfig对象。该函数以帧/秒(frames /s)为单位返回估计的层延迟、网络延迟和网络性能。

hPC_shipping.estimatePerformance (snet)
###优化系列网络:将“nnet.cnn.layer.BatchNormalizationLayer”融合为“nnet.cnn.layer.Convolution2DLayer”###注意:类型为“nnet.cnn.layer.ImageInputLayer”的“数据”层在软件中实现。###注意:类型为“nnet.cnn.layer.ClassificationOutputLayer”的“ClassificationLayer”层在软件中实现tware.深度学习处理器估计器性能结果LastFrameLatency(周期)LastFrameLatency(秒)网络23634966 0.10743 1 23634966 6 6 9.3 9.3 9.3 3)美国大学校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园乌鲁尔10.0024 6 0.0 0 0.0360 0.0.00347 0.10 10 10.7 7 7 0.7 7 7 10.7 7 7 10.7 7 7 10.7 7 7 10.7 7 7 7 10.7 7 7 0.7 7 7 7 7 0.0 0 0 0.0 0 0 0 0 0 0 0.00 418 0.0 0 0 0 0 0.0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0分公司2A 509261 0.00231分公司2B 905421 0.00412分公司20.00万2 0.00万2 0.00万2 0.00万2 0.00万2 0.00万2 0.00万4 0.00万2 0.00万4 0.00万4 0.000万4 0.00万4 0.00万4 0.00万4 0.00万4 4 0.00万2 0.00万2 0.00万2 0.00万4万2 0.00万2 0.00万4万4 4万2 0.00万2 0.00万4万4万4万4 4 4 4 4 0.00万2 0.00万4 4 4万4万4万2 0.00万2 0.00万0.00万0.00万4万4 4 4 4 4 4 4 4 4 4 4 4万2 0.0.00万2 0.00万2 0.00万2 0 0.00万2 2 2 2 2 2 0.0 0.00万0.0.00万2 0.0.00万4 4 4 4 4 4 4 4 4 Uuuu res5b_uBranch2b 2005197 0.00911 uuuuuuuuuuuuuuuuuuuuuu5b 26368 0.00012 uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu025 uuuuuuuFC1000 207852 0.00094*DL处理器的时钟频率为:220MHz

创建自定义处理器配置

要创建自定义处理器配置,请使用dlhdl。ProcessorConfig对象有关详细信息,请参阅dlhdl。ProcessorConfig. 要了解处理器配置的可修改参数,请参阅getModulePropertysetModuleProperty

hPC_custom = dlhdl。ProcessorConfig
hPC_custom=处理模块“conv”模块生成:“on”LRNBlockGeneration:“on”ConvThreadNumber:16 InputMemorySize:[227 227 3]OutputMemorySize:[227 227 227 3]功能大小限制:2048处理模块“fc”模块生成:“on”SoftmaxBlockGeneration:“off”FCThreadNumber:4 InputMemorySize:25088 OutputMemorySize:4096处理模块“加法器"ModuleGeneration:'on'InputMemorySize:40 OutputMemorySize:40处理器顶级属性运行时控件:'register'InputDataInterface:'External Memory'OutputDataInterface:'External Memory'处理器数据类型:'single'系统级属性TargetPlatform:'Xilinx Zynq UltraScale+MPSoC ZCU102评估套件'目标频率:200SynthesisTool:“Xilinx Vivado”引用设计:“AXI流DDR内存访问:3-AXIM”SynthesisToLChipFamily:“Zynq UltraScale+”SynthesisToLDeviceName:“xczu9eg-ffvb1156-2-e”SynthesisToLPackageName:“SynthesisToLSpeedValue:”

估计自定义比特流配置的ResNet-18性能

估计对ResNet-18 DAG网络的性能进行了分析估计性能的函数dlhdl。ProcessorConfig对象。该函数以帧/秒(frames /s)为单位返回估计的层延迟、网络延迟和网络性能。

hPC_custom.estimatePerformance (snet)
###优化系列网络:将“nnet.cnn.layer.BatchNormalizationLayer”融合为“nnet.cnn.layer.Convolution2DLayer”####注意:类型为“nnet.cnn.layer.ImageInputLayer”的层“数据”在软件中实现。#注意:类型为“nnet.cnn.layer.ClassificationOutputLayer”的层“ClassificationLayer\u predictions”在软件中实现。深度学习处理器估计器性能结果LastFrameLatency(周期)LastFrameLatency(秒)FramesUMM总延迟帧/秒-------------------------网络21219873 0.10610 1 21219873 9.4_uuuuuuuuuuuuuconv1 2165372 0.01083_uuuuuuuuuuuuuuuuuuuuuuuuuuu池1 646226 0.00323_uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu2a_2a_2a_9662210.00483_uuu2a_2b.00483____10.00270 0.0 0.0 0.0 0.0 0.0 0 0.7 7 7 7 7 7 0.0 0 0.0 0 0.0 0.0 0.0 0.0 0 0.0 0 0.0 0 0 0.0 0 0 0 0.0 0 0 0 0 0.0 0 0 0 0 0 0 0.0 0 0 0 0 0 0.0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0分公司2A 509261 0.00255分公司2B 905421 0.00453____2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Uuuuuuuuuuu res5b_uuubranch2b 1415373 0.00708 uuuuuuuuuuuuuuuuuuuuuu5b 26368 0.00013 uuuuuuuuuuuuuuuuuu池554594 0.00027 uuuuuuuu fc1000 207351 0.00104*DL处理器的时钟频率为:200MHz

使用自定义位流配置时,使用ResNet-18网络的性能低于使用自定义位流配置时的性能zcu102_single比特流配置。自定义位流配置和zcu102_single比特流配置是目标频率。

修改自定义处理器配置

修改自定义处理器配置以增加目标频率。要了解处理器配置的可修改参数,请参阅dlhdl。ProcessorConfig

hPC_custom.TargetFrequency=220;hPC_定制
hPC_custom =处理模块”conv“ModuleGeneration:‘“LRNBlockGeneration:”“ConvThreadNumber: 16 InputMemorySize: [227 227 3] OutputMemorySize: [227 227 3] FeatureSizeLimit: 2048处理模块“俱乐部”ModuleGeneration:”“SoftmaxBlockGeneration:‘off’FCThreadNumber: 4 InputMemorySize: 25088 OutputMemorySize:4096 Processing Module "adder" ModuleGeneration: 'on' InputMemorySize: 40 OutputMemorySize: 40 Processor Top Level Properties RunTimeControl: 'register' InputDataInterface: 'External Memory' OutputDataInterface: 'External Memory' ProcessorDataType: 'single' System Level Properties'Xilinx Zynq UltraScale+ MPSoC ZCU102 Evaluation Kit' TargetFrequency: 220 SynthesisTool: 'Xilinx Vivado' ReferenceDesign: ' axio - stream DDR Memory Access: 3-AXIM' synthesistolchipfamily: 'Zynq UltraScale+' synthesistoldevicename: 'xczu9e -ffvb1156-2-e' synthesistolpackagename: " synthesistolspeedvalue: "

重新评估修改的自定义比特流配置的ResNet-18性能

在修改后的自定义比特流配置上估计ResNet-18 DAG网络的性能。

hPC_custom.estimatePerformance (snet)
###优化系列网络:将“nnet.cnn.layer.BatchNormalizationLayer”融合为“nnet.cnn.layer.Convolution2DLayer”###注意:类型为“nnet.cnn.layer.ImageInputLayer”的“数据”层在软件中实现。###注意:类型为“nnet.cnn.layer.ClassificationOutputLayer”的“ClassificationLayer”层在软件中实现tware.深度学习处理器估计器性能结果LastFrameLatency(周期)LastFrameLatency(秒)网络23634966 0.10743 1 23634966 6 6 9.3 9.3 9.3 3)美国大学校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园校园乌鲁尔10.0024 6 0.0 0 0.0360 0.0.00347 0.10 10 10.7 7 7 0.7 7 7 10.7 7 7 10.7 7 7 10.7 7 7 10.7 7 7 7 10.7 7 7 0.7 7 7 7 7 0.0 0 0 0.0 0 0 0 0 0 0 0.00 418 0.0 0 0 0 0 0.0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0分公司2A 509261 0.00231分公司2B 905421 0.00412分公司20.00万2 0.00万2 0.00万2 0.00万2 0.00万2 0.00万2 0.00万4 0.00万2 0.00万4 0.00万4 0.000万4 0.00万4 0.00万4 0.00万4 0.00万4 4 0.00万2 0.00万2 0.00万2 0.00万4万2 0.00万2 0.00万4万4 4万2 0.00万2 0.00万4万4万4万4 4 4 4 4 0.00万2 0.00万4 4 4万4万4万2 0.00万2 0.00万0.00万0.00万4万4 4 4 4 4 4 4 4 4 4 4 4万2 0.0.00万2 0.00万2 0.00万2 0 0.00万2 2 2 2 2 2 0.0 0.00万0.0.00万2 0.0.00万4 4 4 4 4 4 4 4 4 Uuuu res5b_uBranch2b 2005197 0.00911 uuuuuuuuuuuuuuuuuuuuuu5b 26368 0.00012 uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu025 uuuuuuuFC1000 207852 0.00094*DL处理器的时钟频率为:220MHz

另请参阅

||||

相关话题