diff --git a/README.en.md b/README.en.md index 441a5178b0cf9108476ff31e3e89e15305371e03..c7d18d9ecc6c995ffe6e6c6bf81e374a9fa4bc79 100644 --- a/README.en.md +++ b/README.en.md @@ -4,30 +4,18 @@ Triton-CPU is a branch to build a CPU backend for Triton. #### Software Architecture -Software architecture description +AArch64 #### Installation - -1. xxxx -2. xxxx -3. xxxx - -#### Instructions - -1. xxxx -2. xxxx -3. xxxx +1. yum install triton-cpu #### Contribution - 1. Fork the repository 2. Create Feat_xxx branch 3. Commit your code 4. Create Pull Request - #### Gitee Feature - 1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md 2. Gitee blog [blog.gitee.com](https://blog.gitee.com) 3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore) diff --git a/README.md b/README.md index b51c4e1b228b62dc3a66396d3aee37d6d5ebb14b..a10aee2dc8910440d64c1d4a9af9b4893b0f4c6d 100644 --- a/README.md +++ b/README.md @@ -4,31 +4,18 @@ Triton-CPU is a branch to build a CPU backend for Triton. #### 软件架构 -软件架构说明 - +AArch64 #### 安装教程 - -1. xxxx -2. xxxx -3. xxxx - -#### 使用说明 - -1. xxxx -2. xxxx -3. xxxx +1. yum install triton-cpu #### 参与贡献 - 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 上的优秀开源项目 diff --git a/llvmorg-19.1.7.tar.gz.00 b/llvmorg-19.1.7.tar.gz.00 new file mode 100644 index 0000000000000000000000000000000000000000..e2f5094345ac373ec3c87205ebb315048bdc89bc Binary files /dev/null and b/llvmorg-19.1.7.tar.gz.00 differ diff --git a/llvmorg-19.1.7.tar.gz.01 b/llvmorg-19.1.7.tar.gz.01 new file mode 100644 index 0000000000000000000000000000000000000000..a861fe6cf045d93c3faee99c374fa79a83eddbaa Binary files /dev/null and b/llvmorg-19.1.7.tar.gz.01 differ diff --git a/llvmorg-19.1.7.tar.gz.02 b/llvmorg-19.1.7.tar.gz.02 new file mode 100644 index 0000000000000000000000000000000000000000..f56e1e7dbb5e5987543304312007ca430ed684f1 Binary files /dev/null and b/llvmorg-19.1.7.tar.gz.02 differ diff --git a/triton-cpu-3.0.0-v1.tar.gz b/triton-cpu-3.0.0-v1.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..a0bdc83ea008ec3e6605911135767d859623fc7d Binary files /dev/null and b/triton-cpu-3.0.0-v1.tar.gz differ diff --git a/triton-cpu.spec b/triton-cpu.spec new file mode 100644 index 0000000000000000000000000000000000000000..ac596b5ff0d44aa5ea6cbdbe144c7659d6642f5b --- /dev/null +++ b/triton-cpu.spec @@ -0,0 +1,64 @@ +Name: triton-cpu +Version: 3.0.0 +Release: 1 +Summary: A CPU backend for Triton. +License: MIT +URL: https://gitee.com/openeuler/triton-cpu +Source0: https://gitee.com/openeuler/triton-cpu/repository/archive/%{name}-%{version}-v1.tar.gz +Source1: triton-downloads.tar.gz +Source2: llvmorg-19.1.7.tar.gz.00 +Source3: llvmorg-19.1.7.tar.gz.01 +Source4: llvmorg-19.1.7.tar.gz.02 + +ExclusiveArch: aarch64 +BuildRequires: python3-devel, python3-pip, python3-wheel, python3-lit, python3-pybind11 +BuildRequires: python3-setuptools >= 40.8.0 +BuildRequires: cmake >= 3.18, cmake < 4.0 +BuildRequires: ninja-build >= 1.11.1 +BuildRequires: git, gcc, gcc-c++, zlib-devel + +%description +Triton-CPU is a branch to build a CPU backend for Triton. + +%global debug_package %{nil} + +%prep +tar -zxf %{_sourcedir}/%{name}-%{version}-v1.tar.gz +unzip -q %{name}/sleef.zip -d %{name}/third_party/ +tar -zxf %{_sourcedir}/triton-downloads.tar.gz +mkdir %{name}/third_party/nvidia/backend/bin +cp -r .triton/nvidia/bin/* %{name}/third_party/nvidia/backend/bin +mkdir %{name}/third_party/nvidia/backend/include +cp -r .triton/nvidia/include/* %{name}/third_party/nvidia/backend/include +cat %{_sourcedir}/llvmorg-19.1.7.tar.gz.* | tar -zxf - +cd llvm-project-llvmorg-19.1.7/ +mkdir build && cd build +cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=ON ../llvm -DLLVM_ENABLE_PROJECTS="clang;mlir;llvm;lld" -DLLVM_TARGETS_TO_BUILD="AArch64;NVPTX;AMDGPU" -DLLVM_DEFAULT_TARGET_TRIPLE="aarch64-openEuler-linux" +ninja + +%build + +%install +export LLVM_BUILD_DIR=%{_builddir}/llvm-project-llvmorg-19.1.7/build +export LLVM_INCLUDE_DIRS=$LLVM_BUILD_DIR/include +export LLVM_LIBRARY_DIR=$LLVM_BUILD_DIR/lib +export LLVM_SYSPATH=$LLVM_BUILD_DIR +export PATH=$LLVM_BUILD_DIR/bin:$PATH +export TRITON_BUILD_WITH_CLANG_LLD=true +export TRITON_HOME=%{_builddir} +export TRITON_OFFLINE_BUILD=true +export PYBIND11_SYSPATH=$TRITON_HOME/.triton/pybind11/pybind11-2.13.1 +export JSON_SYSPATH=$TRITON_HOME/.triton/json +cd %{_builddir}/%{name} +pip install python/ --no-build-isolation --prefix=%{buildroot}%{_prefix} + +%files -n %{name} +%{_bindir}/proton +%{_bindir}/proton-viewer +%{python3_sitearch}/triton-%{version}.dist-info +%{python3_sitearch}/triton + +%changelog +* Fri May 9 2025 huangkaiyao - 3.0.0-1 +- Package init + diff --git a/triton-downloads.tar.gz b/triton-downloads.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..c216aa26dbd15f5eb2c311fdd04a7648e3a86b8e Binary files /dev/null and b/triton-downloads.tar.gz differ