ACPO/README.md
2024-10-29 21:01:25 +08:00

45 lines
2.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# ACPO
#### 介绍
ACPO(AI-Enabled Compiler-Driven Program Optimization) is a novel framework to provide LLVM with simple and comprehensive tools to benefit from employing ML models for different optimization passes.
#### 软件架构
软件依赖python环境
#### 安装教程
1. 软件依赖python环境运行。
2. 训练请到ACPO-model目录下pip install -r requirements.txt安装相应包。
3. 使能编译器推理模型请到软件根目录下pip install -r requirements.txt安装相应包。
#### 使用说明
1. 模型训练:软件根目录下
cd ACPO-model/src
运行命令python3 train.py --configurationconfig具体参考src目录下的README.md可进行多个config配置
参数调整可通过配置doc/config目录下user_train_config.json或.yaml进行配置test目录下提供适配样例
模型调整:在/src/models.py中调整模型
2. LLVM端到端使用ACPO
将保存好的模型相关文件保存在models目录中
安装LLVM并编译ACPO LLVM侧相关代码
在运行推理前设置环境变量export ACPO_DIR=/your_ACPO_addr
以inline model测试为例
AOT使用预编译好的模型测试命令clang -O3 -mllvm -enable-acpo-fi-aot -mllvm -acpo-verbose-fi -lm test.c
实时推理测试命令clang -O3 -mllvm -enable-acpo-fi -mllvm -acpo-verbose-fi -lm test.c
#### 参与贡献
1. Fork 本仓库
2. 新建 Feat_xxx 分支
3. 提交代码
4. 新建 Pull Request
#### 特技
1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md
2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com)
3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目
4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目
5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help)
6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)