diff --git a/ACPO.spec b/ACPO.spec new file mode 100644 index 0000000000000000000000000000000000000000..3b2e94fdadfad351e1c838590f3f75b6add846f3 --- /dev/null +++ b/ACPO.spec @@ -0,0 +1,33 @@ +Name: ACPO +Version: 1.0 +License: Apache License 2.0 +Release: 1 +Summary: ACPO model source +URL: https://github.com/Huawei-CPLLab/ACPO/ +Source0: https://github.com/Huawei-CPLLab/ACPO/archive/refs/tags/v1.0.zip +BuildArch: noarch + +#build requires +Requires: python3-devel +Requires: python3-setuptools +Requires: python3-pip +Requires: python3-wheel + +%description +The ACPO framework is designed to easily integrate ML models within a compiler framework +and provide useful tools for training and analysis of ML models for use in a compiler. +It comes together with examples of different models that were deployed in an LLVM-based compiler. + +%prep +%autosetup -n %{name} + +%install +mkdir -p %{buildroot}/%{python3_sitelib} +cp -r %{_builddir}/%{name} %{buildroot}/%{python3_sitelib} + +%files +/%{python3_sitelib}/%{name}/* + +%changelog +* Mon Oct 28 2024 wangziming - 1.0-1 +- Package init diff --git a/README.md b/README.md index ac67ddd3caf3ca25eef9c8097c20adec64793217..47f5c32e1e8c7eec4d36bafb91c37cb57e578e83 100644 --- a/README.md +++ b/README.md @@ -4,20 +4,28 @@ 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. xxxx -2. xxxx -3. xxxx +1. 软件依赖python环境运行。 +2. 训练请到ACPO-model目录下pip install -r requirements.txt安装相应包。 +3. 使能编译器推理模型请到软件根目录下pip install -r requirements.txt安装相应包。 #### 使用说明 -1. xxxx -2. xxxx -3. xxxx +1. 模型训练:软件根目录下 + cd ACPO-model/src + 运行命令:python3 train.py --configuration(config具体参考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 #### 参与贡献 @@ -26,7 +34,6 @@ ACPO(AI-Enabled Compiler-Driven Program Optimization) is a novel framework to pr 3. 提交代码 4. 新建 Pull Request - #### 特技 1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md diff --git a/v1.0.zip b/v1.0.zip new file mode 100644 index 0000000000000000000000000000000000000000..3074c806b1b922463464d3c58a74bce0006246f2 Binary files /dev/null and b/v1.0.zip differ