CANN/asc-devkit:SoftmaxFlash Tiling接口

发布时间:2026/7/17 8:31:52
CANN/asc-devkit:SoftmaxFlash Tiling接口 SoftmaxFlash Tiling接口【免费下载链接】asc-devkit本项目是CANN 推出的昇腾AI处理器专用的算子程序开发语言原生支持C和C标准规范主要由类库和语言扩展层构成提供多层级API满足多维场景算子开发诉求。项目地址: https://gitcode.com/cann/asc-devkit功能说明注意该接口后续即将废弃新开发内容不要使用该接口。用于获取SoftmaxFlash Tiling参数。函数原型获取Kernel接口计算所需最小/最大临时空间的接口uint32_t GetSoftMaxFlashMaxTmpSize(const ge::Shape srcShape, const uint32_t dataTypeSize, const bool isUpdate, const bool isReuseSource)uint32_t GetSoftMaxFlashMinTmpSize(const ge::Shape srcShape, const uint32_t dataTypeSize, const bool isUpdate, const bool isReuseSource)Tiling计算接口AscendC::optiling命名空间下的计算接口void SoftMaxFlashTilingFunc(const ge::Shape srcShape, const uint32_t dataTypeSize, const uint32_t localWorkSpaceSize, optiling::SoftMaxTiling softmaxFlashTiling, const bool isUpdate false)AscendC命名空间下的计算接口void SoftMaxFlashTilingFunc(const ge::Shape srcShape, const uint32_t dataTypeSize, const uint32_t localWorkSpaceSize, AscendC::tiling::SoftMaxTiling softmaxFlashTiling, const bool isUpdate false)参数说明表1SoftmaxFlash GetSoftMaxFlashMaxTmpSize/GetSoftMaxFlashMinTmpSize接口参数列表参数名输入/输出功能srcShape输入输入srcTensor的shape信息。dataTypeSize输入参与计算的maxTensor和sumTensor的数据类型比如half2。isUpdate输入是否开启刷新功能和kernel侧SoftmaxFlash接口一致默认false。isReuseSource输入与kernel侧接口配置保持一致。表2SoftmaxFlash SoftMaxFlashTilingFunc接口参数列表参数名输入/输出功能srcShape输入输入srcTensor的shape信息。dataTypeSize输入参与计算的maxTensor和sumTensor的数据类型比如half2。localWorkSpaceSize输入剩余的可供SoftmaxFlash接口计算的空间大小单位为Byte。localWorkSpaceSize的取值必须大于GetSoftMaxFlashMinTmpSize接口返回的计算所需的最小临时空间大小。isUpdate输入是否开启刷新功能和kernel侧SoftmaxFlash接口一致默认false。softmaxFlashTiling输出输出SoftmaxFlash接口所需的tiling信息支持optiling::SoftMaxTiling形式入参和AscendC::tiling::SoftMaxTiling形式入参。返回值说明GetSoftMaxFlashMaxTmpSize返回SoftmaxFlash接口能完成计算所需最大临时空间大小单位为Byte。GetSoftMaxFlashMinTmpSize返回SoftmaxFlash接口能完成计算所需最小临时空间大小单位为Byte。约束说明无【免费下载链接】asc-devkit本项目是CANN 推出的昇腾AI处理器专用的算子程序开发语言原生支持C和C标准规范主要由类库和语言扩展层构成提供多层级API满足多维场景算子开发诉求。项目地址: https://gitcode.com/cann/asc-devkit创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考