diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000000000000000000000000000000000000..f087b429e2f81a9f37b28a8308e2210f84df6c9b --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +*.tar.gz filter=lfs diff=lfs merge=lfs -text diff --git a/.lfsconfig b/.lfsconfig new file mode 100644 index 0000000000000000000000000000000000000000..e3a61b03d6e0b3a8f65d229c08466adef1eec2f9 --- /dev/null +++ b/.lfsconfig @@ -0,0 +1,2 @@ +[lfs] + url = https://artlfs.openeuler.openatom.cn/src-openEuler/triton-cpu 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/llvm-project.tar.gz b/llvm-project.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..04d274dfc96ab0829fa67813bd60be57d2a8bc53 --- /dev/null +++ b/llvm-project.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:93d332a3a649737ae765c0a4e812731be93d2d125d5dac0eb4193d5ca321d7ad +size 224484361 diff --git a/triton-cpu-3.0.0-v2.tar.gz b/triton-cpu-3.0.0-v2.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..5a6ac3e72f71fc171adf6707ff685c0bc5ea617d --- /dev/null +++ b/triton-cpu-3.0.0-v2.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9e66238de362abf9cc7cf1720b220dcb7b54f9f548cfdf9cc874e0eb07c2fa86 +size 7002446 diff --git a/triton-cpu.spec b/triton-cpu.spec new file mode 100644 index 0000000000000000000000000000000000000000..393e247324f56548abdd0813934b20b4c1494577 --- /dev/null +++ b/triton-cpu.spec @@ -0,0 +1,65 @@ +Name: triton-cpu +Version: 3.0.0 +Release: 3 +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}-v2.tar.gz +Source1: triton-downloads.tar.gz +Source2: llvm-project.tar.gz + +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: llvm-toolset-19-clang, 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}-v2.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 +tar -zxf %{_sourcedir}/llvm-project.tar.gz + +%build +cd %{_builddir}/llvm-project/ +mkdir build && cd build +cmake -G Ninja -DCMAKE_C_COMPILER=/opt/openEuler/llvm-toolset-19/root/usr/bin/clang -DCMAKE_CXX_COMPILER=/opt/openEuler/llvm-toolset-19/root/usr/bin/clang++ -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=ON ../llvm -DLLVM_ENABLE_PROJECTS="clang;compiler-rt;mlir;llvm;lld" -DLLVM_TARGETS_TO_BUILD="AArch64;NVPTX;AMDGPU" -DLLVM_DEFAULT_TARGET_TRIPLE="aarch64-openEuler-linux" +ninja + +%install +export LLVM_BUILD_DIR=%{_builddir}/llvm-project/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 +* Thu May 29 2025 huangkaiyao - 3.0.0-3 +- Add SME/SVE matrix operation support +* Tue May 20 2025 huangkaiyao - 3.0.0-2 +- Move large files to git-lfs +* 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..c13862452d8c4b71dab56d13a5b322a2d20fc23c --- /dev/null +++ b/triton-downloads.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c9a40c1e23e71e3f1b98e3173044111441b0b9cd53808b5333b0cb2f394fcb62 +size 43321953