NVDLA compiler

NVDLA是NVIDIA提供的免费开放式深度学习加速器架构,支持可扩展性和高度可配置性。NVDLA软件生态包括训练基础设施和编译器,用于将模型优化并转换为硬件指令。NVDLA编译器能够从源代码构建,用于神经网络优化和创建硬件指令列表。通过指定的选项,如计算精度和平台配置,可以使用编译器将模型转换为.nvdla文件,以便在设备上运行推理任务。
摘要由CSDN通过智能技术生成

NVDLA简介

nvdia深度学习加速器(NVDLA)是一种免费开放式架构,具有可扩展性,高度可配置性,旨在简化集成和可移植性。NVDLA软件生态系统包括一个设备上的软件堆栈(开源版本的一部分),一个完整的培训基础架构,用于构建包含深度学习的新模型,以及将现有模型转换为可在设备上使用的形式的解析器软件。可以提供其自己的硬件平台以及软件内核:

NVDLA可以加速神经网络推理工作,可分两步完成

  1. 针对DLA硬件优化训练有素的神经网络,并将图形转换为DLA HW指令。转换后的图形将保存到称为可加载的平面缓冲区文件中。使用NVDLA编译器可以实现此目的,并且可以在主机系统上脱机执行。
  2. 使用步骤1中的可加载程序在DLA上运行推理作业。这是使用NVDLA运行时实现的,并在目标系统上执行

NVDLA Compiler

NVDLA编译器用于为DLA HW体系结构优化神经网络,并创建HW指令列表以在DLA上运行推理。NVDLA编译器可以从源代码构建,也可以直接使用预编译的二进制文件

root@6b9d78f7dd:# ./nvdla_compiler -h
Usage: ./nvdla_compiler [-options] --prototxt <prototxt_file> --caffemodel <caffemodel_file>
where options include:
    -h                                                          print this help message
    -o <outputpath>                                             outputs wisdom files in 'outputpath' directory
    --profile <basic|default|performance|fast-math>             computation profile (default: fast-math)
    --cprecision <fp16|int8>                                    compute precision (default: fp16)
    --configtarget <opendla-full|opendla-large|opendla-small>   target platform (default: nv_full)
    --calibtable <int8 calib file>                              calibration table for INT8 networks (default: 0.00787)
    --quantizationMode <per-kernel|per-filter>                  quantization mode for INT8 (default: per-kernel)
    --batch                                                     batch size (default: 1)
    --informat <ncxhwx|nchw|nhwc>                               input data format (default: nhwc)

转换example(以resnet50 nv_full int8 为例)

 

./nvdla_compiler --prototxt ResNet-50-deploy.prototxt --caffemodel ResNet-50-model.caffemodel -o . --profile fast-math --cprecision int8 --configtarget nv_full --calibtable resnet50.json --quantizationMode per-filter --batch 1 --informat nhwc

输出

一旦编译成功,它将在使用-o参数指定的输出目录中生成.nvdla文件。例如,在上述情况下,它将在curren目录中生成fast-math.nvdla

 

如果需要自行编译nvdla_compiler 

cd umd
export TOP={sw-repo-root}/umd
make compiler

Note :
使用sdk中默认的libprotobuf.a可能链接会报错,这个需要根据自己的环境重新编译一下protobuf,命令如下
./configure --enable-shared
make
make check
sudo make install
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值