SoftmaxFlash

Function Description

Note: This API will be deprecated in the future. Do not use it for new development.

Obtains the SoftmaxFlash tiling parameters.

Prototype

1
uint32_t GetSoftMaxFlashMaxTmpSize(const ge::Shape& srcShape, const uint32_t dataTypeSize, const bool isUpdate, const bool isReuseSource)
1
uint32_t GetSoftMaxFlashMinTmpSize(const ge::Shape& srcShape, const uint32_t dataTypeSize, const bool isUpdate, const bool isReuseSource)
1
void SoftMaxFlashTilingFunc(const ge::Shape srcShape&, const uint32_t dataTypeSize, const uint32_t localWorkSpaceSize, optiling::SoftMaxTiling& softmaxFlashTiling, const bool isUpdate = false)

Parameters

Table 1 SoftmaxFlash GetSoftMaxFlashMaxTmpSize/GetSoftMaxFlashMinTmpSize parameters

API

Input/Output

Function

srcShape

Input

Input shape of srcTensor.

dataTypeSize

Input

Data type size of maxTensor and sumTensor involved in computation, for example, half = 2.

isUpdate

Input

Whether to enable the refresh function. The value must be consistent with that of the SoftmaxFlash in the kernel. The default value is false.

isReuseSource

Input

The value must be the same as the API configuration in the kernel.

Table 2 SoftmaxFlash SoftMaxFlashTilingFunc parameters

API

Input/Output

Function

srcShape

Input

Input shape of srcTensor.

localWorkSpaceSize

Input

Size of the remaining space that can be used for SoftmaxFlash computation. The unit is byte.

dataTypeSize

Input

Data type size of maxTensor and sumTensor involved in computation, for example, half = 2.

isUpdate

Input

Whether to enable the refresh function. The value must be consistent with that of the SoftmaxFlash in the kernel. The default value is false.

softmaxFlashTiling

Output

Tiling information required by SoftmaxFlash.

Returns

GetSoftMaxFlashMaxTmpSize returns the maximum size (in bytes) of the temporary space required for softmaxflash computation.

GetSoftMaxFlashMinTmpSize returns the minimum size (in bytes) of the temporary space required for softmaxflash computation.