SetFixPipeConfig
产品支持情况
功能说明
DataCopy(CO1->GM、CO1->A1)过程中进行随路量化时,通过调用该接口设置量化流程中tensor量化参数。
函数原型
template <typename T>
__aicore__ inline void SetFixPipeConfig(const LocalTensor<T>& reluPre, const LocalTensor<T>& quantPre, bool isUnitFlag = false)
template <typename T, bool setRelu = false>
__aicore__ inline void SetFixPipeConfig(const LocalTensor<T>& preData, bool isUnitFlag = false)
参数说明
表 1 模板参数说明
针对设置一个tensor的情况,当setRelu为true时,设置reluPre;反之设置quantPre。当前仅支持设置为false。 |
表 2 参数说明
源操作数,quant tensor,量化操作时参与计算的tensor,类型为LocalTensor,支持的TPosition为C2PIPE2GM。 |
||
支持设置一个Tensor,通过开关控制是relu Tensor还是quant Tensor,支持的TPosition为C2PIPE2GM。当前仅支持传入quant Tensor。 |
约束说明
quantPre和reluPre必须是Fixpipe Buffer上的Tensor。
返回值说明
无
调用示例
完整示例可参考完整示例。
__aicore__inline void SetFPC(const LocalTensor <int32_t>& reluPreTensor, const LocalTensor <int32_t>& quantPreTensor)
{
// reluPreTensor为空tensor
AscendC::SetFixPipeConfig<int32_t>(reluPreTensor, quantPreTensor);
// 等效调用:
// AscendC::SetFixPipeConfig<int32_t>(quantPreTensor);
}