SoftmaxFlash Tiling
Function
Note: This API will be deprecated in the future. Do not use it for new development.
Obtains the tiling parameters required by SoftmaxFlash.
Prototype
- APIs for obtaining the minimum and maximum temporary space required for kernel computation
1uint32_t GetSoftMaxFlashMaxTmpSize(const ge::Shape& srcShape, const uint32_t dataTypeSize, const bool isUpdate, const bool isReuseSource)
1uint32_t GetSoftMaxFlashMinTmpSize(const ge::Shape& srcShape, const uint32_t dataTypeSize, const bool isUpdate, const bool isReuseSource)
- Tiling computation APIs
- Computation API in the AscendC::optiling namespace
1void SoftMaxFlashTilingFunc(const ge::Shape& srcShape, const uint32_t dataTypeSize, const uint32_t localWorkSpaceSize, optiling::SoftMaxTiling& softmaxFlashTiling, const bool isUpdate = false)
- Computation API in the AscendC namespace
1void SoftMaxFlashTilingFunc(const ge::Shape& srcShape, const uint32_t dataTypeSize, const uint32_t localWorkSpaceSize, AscendC::tiling::SoftMaxTiling& softmaxFlashTiling, const bool isUpdate = false)
- Computation API in the AscendC::optiling namespace
Parameters
Parameter |
Input/Output |
Description |
|---|---|---|
srcShape |
Input |
Shape of the input 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. |
Parameter |
Input/Output |
Description |
|---|---|---|
srcShape |
Input |
Shape of the input srcTensor. |
dataTypeSize |
Input |
Data type size of maxTensor and sumTensor involved in computation, for example, half = 2. |
localWorkSpaceSize |
Input |
Size of the remaining space that can be used for SoftmaxFlash computation. The unit is byte. The value of localWorkSpaceSize must be greater than the minimum temporary space size required for computation by the GetSoftMaxFlashMinTmpSize API. |
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 the SoftmaxFlash APIs. The input parameters in the optiling::SoftMaxTiling and AscendC::tiling::SoftMaxTiling formats are supported. |
Returns
GetSoftMaxFlashMaxTmpSize returns the maximum size (in bytes) of the temporary space required by SoftmaxFlash computation.
GetSoftMaxFlashMinTmpSize returns the minimum size (in bytes) of the temporary space required by SoftmaxFlash computation.
Restrictions
None