专栏算法工具链模型最后一层relu/interpret/concat算子无法优化到BPU上

模型最后一层relu/interpret/concat算子无法优化到BPU上

已解决
shaun2021-04-27
132
3

多次尝试发现最后一层如果有relu或者interpret/concat算子的话检测无法优化到BPU,这两个算子在中间层可以优化到BPU中。

使用pytorch1.6

relu为self.relu = nn.ReLU(inplace=True)

interpret为torch.nn.functional.interpolate()

concat为torch.cat

算法工具链
评论1
0/1000
  • 芯链情报局
    Lv.4

    你好,模型中部的 relu 等算子会被融合进上层 conv 中,尾部为了保证模型的高精度输出,不会做算子融合

    2021-04-27
    0
    2
    • shaun回复芯链情报局:

      尾部除了conv操作其它的都不做融合吗?如果最后一个算子在cpu上执行对速度影响大吗?

      2021-04-27
      0
    • admin回复shaun:

      尾部relu没有融合的原因是为了保持精度int32,,不然精度掉点严重。一层还好,影响比较大的是中间突然冒出来一层cpu

      2021-04-27
      0