[KernelSwift算子优化] 程柯雷-Task01 engram_hash-571900729 - #188
Open
Lfan-ke wants to merge 2 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 赛道二 Task01 engram_hash,文件内同时含与参考一致的
Model与优化实现ModelNew,forward内通过 python 调用自实现算子。优化方案:把参考实现十几次 torch 算子启动折成一个融合 kernel,一个线程负责一整行 (layer, token),行内 16 个输出共用的前缀异或只在寄存器里推进一次,不落任何中间张量;另外把宿主侧编译提到
-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):本作品为原创。