SetFixPipeConfig
Product Support
Product |
Supported |
|---|---|
√ |
|
√ |
|
√ |
|
x |
|
x |
|
x |
Function
Sets the tensor quantization parameters for in-line quantization during DataCopy (CO1->GM or CO1->A1).
Prototype
1 2 3 4 | 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) |
Parameters
Parameter |
Description |
|---|---|
T |
Data type of the operand. |
setRelu |
For one tensor, when setRelu is set to true, reluPre needs to be set. Otherwise, quantPre needs to be set. Currently, only false is supported. |
Parameter |
Input/Output |
Meaning |
|---|---|---|
reluPre |
Input |
Source operand, ReLU tensor. Type: LocalTensor. Supported TPosition: C2PIPE2GM. reluPre is reserved for future use. You can pass an empty LocalTensor. |
quantPre |
Input |
Source operand, quantization tensor, a tensor involved in compute during quantization. Type: LocalTensor. Supported TPosition: C2PIPE2GM. |
isUnitFlag |
Input |
UnitFlag configuration item. The type is bool. Reserved for future use. Retain the default value false. |
preData |
Input |
Used to set a tensor. A switch can be used to control whether the tensor is a ReLU tensor or quantization tensor. The supported TPosition is C2PIPE2GM. Currently, only the quantization tensor can be passed. |
Restrictions
quantPre and reluPre must be tensors on the Fixpipe Buffer.
Returns
None
Example
For details, see the complete example.
1 2 3 4 5 6 7 8 | __aicore__inline void SetFPC(const LocalTensor <int32_t>& reluPreTensor, const LocalTensor <int32_t>& quantPreTensor) { // reluPreTensor is an empty tensor. AscendC::SetFixPipeConfig<int32_t>(reluPreTensor, quantPreTensor); // Equivalent calling: // AscendC::SetFixPipeConfig<int32_t>(quantPreTensor); } |