鲲鹏社区首页
中文
注册
我要评分
文档获取效率
文档正确性
内容完整性
文档易理解
在线提单
论坛求助

特性范围

传播方向及数据类型

表1 Forward传播方向对应的参数数据类型

传播方向

src数据类型

weight数据类型

dst数据类型

bias数据类型

dnnl_forward_training

dnnl_forward_inference

f32

f32

f32

f32

f16

f16

f16

f16

bf16

bf16

bf16

bf16

f16

f16

f32

f16

bf16

bf16

f32

bf16

表2 Backward(dnnl_backward_data类型)传播方向对应的参数数据类型

传播方向

src数据类型

weight数据类型

dst数据类型

bias数据类型

dnnl_backward_data

f32

f32

f32

f32

f16

f16

f16

f16

bf16

bf16

bf16

bf16

f32

f16

f16

f32

f32

bf16

bf16

f32

表3 Backward(dnnl_backward_weights类型)传播方向对应的参数数据类型

传播方向

src数据类型

weight数据类型

dst数据类型

bias数据类型

dnnl_backward_weights

f32

f32

f32

f32

f16

f16

f16

f16

bf16

bf16

bf16

bf16

f16

f32

f16

f16

bf16

f32

bf16

bf16

数据排布

支持2D卷积,输入、输出数据为4D Tensor,src,weights,dst数据排布满足以下组合:

Tensor维度

src数据排布

weights数据排布

dst数据排布

4D

dnnl_abcd

dnnl_abcd

dnnl_abcd

参数约束

传播方向

变量名称

变量解释

变量约束

约束关系

dnnl_forward_training

dnnl_forward_inference

mb

batch

>=1

oh,ow可以缺省,由benchdnn自动推导,也可以由用户设置,但需满足以下关系:

其中,[]表示向下取整。

ic

input channel

>=1

ih

input height

>=1

iw

input width

>=1

oc

output channel

>=1

kh

kernel height

>=1

kw

kernel width

>=1

oh

output height

>=1

ow

output width

>=1

sh

height-wise stride

>=1

sw

width-wise stride

>=1

dh

height-wise dilation

>=0

dw

width-wise dilation

>=0

ph

height padding

>=0

pw

width padding

>=0

DKH

kernel height with dilation

DKH = 1 + (kh-1)×(dh+1)

DKW

kernel width with dilation

DKW = 1 + (kw-1)×(dw+1)

dnnl_backward_data

mb

batch

>=1

oh,ow可以缺省,由benchdnn自动推导,也可以由用户设置,但需满足以下关系:

其中,[]表示向下取整。

ic

input channel

>=1

ih

input height

>=1

iw

input width

>=1

oc

output channel

>=1

kh

kernel height

>=1

kw

kernel width

>=1

oh

output height

>=1

ow

output width

>=1

sh

height-wise stride

>=1

sw

width-wise stride

>=1

dh

height-wise dilation

>=0

dw

width-wise dilation

>=0

ph

height padding

0<=ph<=(kh-1)x(dh+1)

pw

width padding

0<=pw<=(kw-1)x(dw+1)

DKH

kernel height with dilation

DKH = 1 + (kh-1)×(dh+1)

DKW

kernel width with dilation

DKW = 1 + (kw-1)×(dw+1)

dnnl_backward_weights

mb

batch

>=1

ic

input channel

>=1

ih

input height

>=1

iw

input width

>=1

oc

output channel

>=1

kh

kernel height

>=1

kw

kernel width

>=1

oh

output height

>=1

ow

output width

>=1

sh

height-wise stride

>=1

sw

width-wise stride

>=1

dh

height-wise dilation

>=0

dw

width-wise dilation

>=0

ph

height padding

>=0

pw

width padding

>=0

DKH

kernel height with dilation

DKH = 1 + (oh-1)×sh

DKW

kernel width with dilation

DKW = 1 + (ow-1)×sw