[KernelSwift算子优化] 程柯雷-Task03 norm_fn-571900729 - #190
Open
Lfan-ke wants to merge 3 commits 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.
作品说明:沐曦 C500 上用 Clike 重写 KernelSwift 赛道二 Task03 norm_fn,文件内同时含与参考一致的
Model与优化实现ModelNew,forward内通过 python 调用自实现算子。优化方案:一个 block 负责同一行的 6 个输出,residual 与 RMS 分母整块只过一遍、6 个点积在寄存器里并行累,访存走 float4/uint2 向量化;另外把宿主侧编译提到
-O3(load_inline默认不注入任何-O,pybind 胶水一直是-O0)。性能结果(MetaX C500 / MACA 3.7.0.38 / torch 2.8.0+metax3.7.0.7,官方
benchmarks/ks/auto_bench.py默认参数,连跑三次,均 PASS accuracy):本作品为原创。