LogN Scaling

Description

Generally, a scaling coefficient of the Zoom function in the foregoing formula is specified by the parameter qkScale. You can enable this function when you want to use the logN scaling function.

How to Enable

Set scaleType to SCALE_TYPE_LOGN.

Pass logN as the input tensor.

Set kernelType to KERNELTYPE_HIGH_PRECISION.

Constraints

  • To enable the logN function, set scaleType to SCALE_TYPE_LOGN and calcType to DECODER (incremental phase) or PA_ENCODER (full phase). For the Atlas A2 training products/Atlas A2 inference products and Atlas A3 inference products/Atlas A3 training products, if calcType is set to PA_ENCODER, kernelType must be set to KERNELTYPE_HIGH_PRECISION.
  • The logN function and the quantization scenario cannot be enabled at the same time.
  • If inputLayout is set to TYPE_BNSD, scaleType must be set to SCALE_TYPE_TOR (LogN scaling is not supported).