开源软件名称:akg
开源软件地址:https://gitee.com/mindspore/akg
开源软件介绍:
View English AKG简述AKG(Auto Kernel Generator)对深度神经网络中的算子进行优化,并提供特定模式下的算子自动融合功能。AKG与MindSpore的图算融合功能协同工作,可提升在不同硬件后端上运行网络的性能。 AKG由三个基本的优化模块组成:规范化、自动调度和后端优化。 规范化: 为了解决polyhedral表达能力的局限性(只能处理静态的线性程序),需要首先对计算公式IR进行规范化。规范化模块中的优化主要包括自动运算符inline、自动循环融合和公共子表达式优化等。 自动调度: 自动调度模块基于polyhedral技术,主要包括自动向量化、自动切分、thread/block映射、依赖分析和数据搬移等。 后端优化: 后端优化模块的优化主要包括TensorCore使能、双缓冲区、内存展开和同步指令插入等。
硬件后端支持当前支持Ascend910 、NVIDIA V100/A100 和CPU 等,更多硬件后端支持待开发。 构建从MindSpore侧构建详细细节请参考MindSpore README.md。 独立构建我们建议您从MindSpore侧构建运行AKG代码,但同时为了方便开发,我们提供了独立编译运行AKG的方式。详细的编译依赖请参考MindSpore安装指南。 构建Ascend910版本 在下载代码前需安装git-lfs软件。 git clone https://gitee.com/mindspore/akg.gitcd akgbash build.sh -e ascend -j8 构建GPU版本 git clone https://gitee.com/mindspore/akg.gitcd akgbash build.sh -e gpu -j8 构建CPU版本 git clone https://gitee.com/mindspore/akg.gitcd akgbash build.sh -e cpu -j8
运行- 设置环境变量
Ascend910 cd testssource ./test_env.sh NVIDIA V100/A100 cd testssource ./test_env.sh gpu CPU cd testssource ./test_env.sh cpu
- 运行测试用例
cd tests/stpython run.py -e gpu -o add -l level0 # 执行GPU Add算子的level0用例 使用说明可以python run.py -h 查看. 使用测试文件: cd tests/st/ops/pytest -s test_abs.py -m "level0 and platform_x86_ascend_training" # 运行Ascend level0测试用例 cd tests/st/ops/pytest -s test_abs.py -m "level0 and platform_x86_gpu_training" # 运行GPU level0测试用例 cd tests/st/ops/pytest -s test_abs.py -m "level0 and platform_x86_cpu" # 运行CPU level0测试用例
使用AKG生成高性能算子见Wiki。 贡献欢迎您的贡献,具体细节请参考MindSpore贡献者Wiki。 版本说明版本说明详见RELEASE。 许可证Apache License 2.0。 |
请发表评论