开发者
资源

性能采样配置文件

sampler_config_tf.proto文件参数说明如下表所示,该文件所在目录为:AMCT安装目录/amct_tensorflow/proto/sampler_config_tf.proto。

表1 sampler_config_tf.proto参数说明

消息

是否必填

类型

字段

说明

SamplerConfig

-

-

-

性能采样的配置。

optional

AscendSamplerConfig

ascend_sampler_config

昇腾硬件性能采样配置。

AscendSamplerConfig

-

-

-

昇腾硬件性能采样配置。

required

string

soc_version

昇腾硬件芯片型号,当前仅支持:

  • Ascend610
  • SD3403

required

string

input_shape

模型输入数据的shape。

required

DistributeConfig

distribute_config

分布式配置文件。

required

LogLevel

log

性能采样的日志级别,包括null、debug、info、warning、error。

  • 设置为debug,会将性能采样的中间临时文件进行保存,保存路径为amct_log/tempxxx/。
  • 设置为其他值,不保留性能采样中间文件。

optional

AtcConfig

atc

ATC工具使用的透传配置参数。

AtcConfig

-

-

-

ATC工具使用的透传配置参数。

repeated

MapFieldEntry

options

ATC参数选项。

MapFieldEntry

-

-

-

ATC参数选项。

required

string

key

ATC参数选项的key值。

required

string

value

ATC参数选项的value值。

DistributeConfig

required

string

ip

NCS软件包所在服务器IP地址。

required

string

port

NCS软件包所在服务器端口。

基于该文件构造的性能采样配置文件sampler_config.cfg样例如下所示:

ascend_sampler_config: {
    soc_version: "xxx"
    input_shape: "input:32,224,224,3"
    distribute_config:{
       ip:'xx.xx.xx.xx'
       port:'8000'
    }
    log: null
    atc: {
        options: [
            {key: "input_format", value: "NHWC"},
            {key: "mode", value: "1"}
        ]
    }
}