[KernelSwift算子优化] 赵世杰-Clike算子优化赛道华为赛题-251300387 - #191
Open
freebeat-boop wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
作品说明
本次提交面向 Ascend 910B(Atlas A2),提供 Task01 SparseAttention、Task02 Indexer 和 Task03 Sinkhorn 三个算子的 AscendC 实现,并补充构建脚本、性能测试脚本及相关文档。三个算子均通过赛事
auto_bench.py正确性检查。优化方案
TQueBind流水优化 gather 搬运,并采用 FP16 Cube 完成 contraction,score 和 softmax 保持 FP32。bmm降低 broadcast matmul 开销,并在 AscendC kernel 中融合 ReLU、权重乘法、head reduction 和 causal mask。4 x 4矩阵在迭代期间驻留 UB。性能测试结果
测试环境为 HiDevLab 平台 Ascend 910B1 A2,三个算子均通过 accuracy 检查。
SparseAttention 和 Indexer 预热 100 次、测量 1000 次;Sinkhorn 因单次执行时间较短,预热 100 次、测量 10000 次,以降低测试波动。
原创声明
赛题参考实现和评测工具来源于 KernelSwift/DLBlas。本次提交中的 AscendC 优化实现、Torch 接入、构建与测试脚本由提交者基于赛题要求独立完成,不包含未经授权复制的第三方参赛代码。