在 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、int16、float16 | |
J6B系列 | 双int8、int8+int16 | int8、int16、float16 | int8、int16、float16、float32 |
双int16 | int8、int16、float16 | int8、int16、float16 |
如上表所示,当 Gemm 类算子位于模型输出层时,TAE 支持 int32 或 float32 的高精度输出。不过需要注意的是:
当 TAE 下游为 Reshape/Transpose/Concat 时,Pytorch 模型需要把 DequantStub 紧邻地插入在 Gemm 类算子后面,才能透传 TAE 的高精度输出(如下表A、C),否则会导致 TAE 回退 int8 低精度(如下表B、D);
- 当 TAE 下游为 ReLU 时,由于 J6 支持 ConvReLU 算子融合,因此能保持 TAE 高精度输出(如下表E、F)。
当模型为 ONNX 模型,以上 case 全部支持 TAE 高精度透传,无需特殊配置。
序号 | Pytorch模型q/dq插入位置 | TAE输出 |
|---|---|---|
A | ![]() | 高精度 |
B | ![]() | int8 |
C | ![]() | 高精度 |
D | ![]() | int8 |
E | ![]() | 高精度 |
F | ![]() | 高精度 |






