GetSpecialBasicConfig

Function

Configures the parameters of the SpecialBasicBlock template and obtains the custom SpecialBasicBlock template. This API is reserved.

Prototype

1
__aicore__ constexpr MatmulConfig GetSpecialBasicConfig(const uint32_t basicM, const uint32_t basicN, const uint32_t basicK, const uint32_t singleCoreM, const uint32_t singleCoreN, const uint32_t singleCoreK, const uint32_t stepM, const uint32_t stepN, const bool intrinsicsLimit = false, const bool batchLoop = false, const BatchMode bmmMode = BatchMode::BATCH_LESS_THAN_L1)

Parameters

All parameters of this API are used to set the parameters of the MatmulConfig structure. The functions of the corresponding parameters are the same.

Table 1 API parameters

Parameter

Input/Output

Description

basicM

Input

Sets the basicM parameter.

Equivalent to the baseM parameter in the TCubeTiling structure. It indicates the length of the M axis of a base block during Matmul computation. The unit is element.

basicN

Input

Sets the basicN parameter.

Equivalent to the baseN parameter in the TCubeTiling structure. It indicates the length of the N axis of a base block during Matmul computation. The unit is element.

basicK

Input

Sets the basicK parameter.

Equivalent to the baseK parameter in the TCubeTiling structure. It indicates the length of the K axis of a base block during Matmul computation. The unit is element.

singleCoreM

Input

Sets the singleCoreM parameter.

Shape size of a single core on the M axis, in elements.

singleCoreN

Input

Sets the singleCoreN parameter.

Shape size of a single core in the N axis, in elements.

singleCoreK

Input

Sets the singleCoreK parameter.

Shape size of a single core in the K axis, in elements.

stepM

Input

Sets the stepM parameter.

A multiple of baseM of the left matrix in the bufferM direction buffered in A1.

stepN

Input

Sets the stepN parameter.

A multiple of baseN of the right matrix in the bufferN direction buffered in B1.

intrinsicsLimit

Input

Sets the intrinsicsCheck parameter.

Whether to enable cyclic data move-in from the Global Memory to L1 Buffer when the inner axis (last axis) of the left or right matrix on a single core is greater than or equal to 65535 (number of elements). For example, for the left matrix A [M, K], if singleCoreK of the inner axis on a single core is greater than 65535 and this parameter is set to true, data is moved in cyclically in the API. Values:

  • false (default): When the inner axis of the left or right matrix on a single core is greater than or equal to 65535, data is not moved in cyclically.
  • true: When the inner axis of the left or right matrix on a single core is greater than or equal to 65535, data is moved in cyclically.

batchLoop

Input

Sets the isNBatch parameter.

Whether to enable multi-batch input and output. This parameter is valid only for BatchMatmul. After this parameter is enabled, only the Norm template is supported, and IterateNBatch needs to be called to implement multi-batch input and output. Values:

  • false (default): disables the multi-batch function.
  • true: enables the multi-batch function.

bmmMode

Input

Sets the batchMode parameter. This parameter is used in the BatchMatmul scenario. For details about BatchMatmul, see Batch Matmul basic functions.

Relationship between the total amount of multi-batch data for input matrices A and B in a BatchMatmul operation and the size of L1 Buffer when the layout type is set to Normal in the BatchMatmul scenario. Values:

  • BatchMode::BATCH_LESS_THAN_L1: Total amount of multi-batch data < Size of L1 Buffer
  • BatchMode::BATCH_LARGE_THAN_L1: Total amount of multi-batch data > Size of L1 Buffer
  • BatchMode::SINGLE_LARGE_THAN_L1: Total amount of single-batch data > Size of L1 Buffer

Restrictions

None