OE Agent“天工”新版本发布,请前往论坛顶部查看,欢迎试用并反馈~
查看OE-Skills
专栏算法工具链【地平线J6工具链入门教程】J6 BPU Gemm类算子高精度透传说明

【地平线J6工具链入门教程】J6 BPU Gemm类算子高精度透传说明

芯链情报局2026-07-02
31
0

在 J6 BPU 内部,TAE 硬件作为张量加速引擎,主要用于 Conv、ConvTranspose、MatMul、Linear 等 Gemm 类算子的计算加速。J6 不同计算平台 TAE 支持的输入、输出精度类型如下:

TAE输入

TAE输出(模型中间层)

TAE输出(模型输出层)

J6E/M

双int8、int8+int16

int8、int16

int8、int16、int32

双int16

int8、int16

int8、int16

J6P/H

双int8、int8+int16

int8、int16、float16

int8、int16、float16、float32

双int16

int8、int16、float16

int8、int16float16

J6B系列

双int8、int8+int16

int8、int16、float16

int8、int16、float16、float32

双int16

int8、int16、float16

int8、int16float16

如上表所示,当 Gemm 类算子位于模型输出层时,TAE 支持 int32 或 float32 的高精度输出。不过需要注意的是:

  1. 当 TAE 下游为 Reshape/Transpose/Concat 时,Pytorch 模型需要把 DequantStub 紧邻地插入在 Gemm 类算子后面,才能透传 TAE 的高精度输出(如下表A、C),否则会导致 TAE 回退 int8 低精度(如下表B、D);

  2. 当 TAE 下游为 ReLU 时,由于 J6 支持 ConvReLU 算子融合,因此能保持 TAE 高精度输出(如下表E、F)。
  3. 当模型为 ONNX 模型,以上 case 全部支持 TAE 高精度透传,无需特殊配置。

序号

Pytorch模型q/dq插入位置

TAE输出

A

alt text

高精度

B

alt text

int8

C
alt text

高精度

D

alt text

int8

E

alt text

高精度

F

alt text

高精度

算法工具链
官方教程征程6
评论0
0/600