SetFixPipeClipRelu

Applicability

Product

Supported

Atlas 350 Accelerator Card

x

Atlas A3 training product/Atlas A3 inference product

x

Atlas A2 training product/Atlas A2 inference product

x

Atlas 200I/500 A2 inference product

Atlas inference product AI Core

x

Atlas inference product Vector Core

x

Atlas training product

x

Function Usage

Sets the maximum value of the ClipReLU operation after the real-time quantization during DataCopy (CO1 -> GM).

ClipReLU is calculated as follows: min (clipReluMaxVal, srcData). clipReluMaxVal is the maximum value set by calling this API, and srcData is the source data.

Prototype

1
__aicore__ inline void SetFixPipeClipRelu(uint64_t config)

Parameters

Table 1 Parameters

Parameter

Input/Output

Description

config

Input

clipReluMaxVal, which is the maximum value of the ClipReLU operation. clipReluMaxVal occupies only 0 to 15 bits. It must be greater than 0 and cannot be INF or NAN.

Restrictions

When ReLU is enabled, the ReLU operation is performed before the ClipReLU operation.

Returns

None

Examples

For details about the complete example, see Complete Example.

1
2
uint64_t clipReluMaxVal = 0x3c00;
SetFixPipeClipRelu(clipReluMaxVal); // When ReLU is enabled, the ReLU operation is performed first, then clipping. clipReluMaxVal is the maximum value set through this API.