diff --git a/README.md b/README.md index c86861a30..f13a5f08a 100644 --- a/README.md +++ b/README.md @@ -9,63 +9,64 @@ Currently in its initial phase, the project aims to maintain compatibility with For upstream model users, it provides unified compilation capabilities across multiple backends; for downstream chip manufacturers, it offers examples of Triton ecosystem integration.
Each backend is based on different versions of Triton, and therefore resides in different protected branches. All these protected branches have equal status. -|Branch|Vendor|Backend|Triton version| -|:-----|:-----|:------|:-------------| -|[main](https://github.com/flagos-ai/flagtree/tree/main)|NVIDIA
AMD
x86_64 cpu
ILUVATAR(天数智芯)
Moore Threads(摩尔线程)
KLX
MetaX(沐曦股份)
HYGON(海光信息)|[nvidia](/third_party/nvidia/)
[amd](/third_party/amd/)
[triton-shared](https://github.com/microsoft/triton-shared)
[iluvatar](/third_party/iluvatar/)
[mthreads](/third_party/mthreads/)
[xpu](/third_party/xpu/)
[metax](/third_party/metax/)
[hcu](third_party/hcu/)|3.1
3.1
3.1
3.1
3.1
3.0
3.1
3.0| -|[triton_v3.2.x](https://github.com/flagos-ai/flagtree/tree/triton_v3.2.x)|NVIDIA
AMD
Huawei Ascend(华为昇腾)
Cambricon(寒武纪)|[nvidia](https://github.com/FlagTree/flagtree/tree/triton_v3.2.x/third_party/nvidia/)
[amd](https://github.com/FlagTree/flagtree/tree/triton_v3.2.x/third_party/amd/)
[ascend](https://github.com/FlagTree/flagtree/blob/triton_v3.2.x/third_party/ascend)
[cambricon](https://github.com/FlagTree/flagtree/tree/triton_v3.2.x/third_party/cambricon/)|3.2| -|[triton_v3.3.x](https://github.com/flagos-ai/flagtree/tree/triton_v3.3.x)|NVIDIA
AMD
x86_64 cpu
ARM China(安谋科技)
Tsingmicro(清微智能)
Enflame(燧原)|[nvidia](https://github.com/FlagTree/flagtree/tree/triton_v3.3.x/third_party/nvidia/)
[amd](https://github.com/FlagTree/flagtree/tree/triton_v3.3.x/third_party/amd/)
[triton-shared](https://github.com/microsoft/triton-shared)
[aipu](https://github.com/FlagTree/flagtree/tree/triton_v3.3.x/third_party/aipu/)
[tsingmicro](https://github.com/FlagTree/flagtree/tree/triton_v3.3.x/third_party/tsingmicro/)
[enflame](https://github.com/FlagTree/flagtree/tree/triton_v3.3.x/third_party/enflame/)|3.3| -|[triton_v3.4.x](https://github.com/flagos-ai/flagtree/tree/triton_v3.4.x)|NVIDIA
AMD|[nvidia](https://github.com/FlagTree/flagtree/tree/triton_v3.4.x/third_party/nvidia/)
[amd](https://github.com/FlagTree/flagtree/tree/triton_v3.4.x/third_party/amd/)|3.4| -|[triton_v3.5.x](https://github.com/flagos-ai/flagtree/tree/triton_v3.5.x)|NVIDIA
AMD|[nvidia](https://github.com/FlagTree/flagtree/tree/triton_v3.5.x/third_party/nvidia/)
[amd](https://github.com/FlagTree/flagtree/tree/triton_v3.5.x/third_party/amd/)|3.5| +|Branch|Vendor|Backend|Triton version|Build
from source|Source-free
Installation| +|:-----|:-----|:------|:-------------|:-------------------|:--------------------------| +|[main](https://github.com/flagos-ai/flagtree/tree/main)|NVIDIA
AMD
x86_64 cpu
ILUVATAR(天数智芯)
Moore Threads(摩尔线程)
KLX
MetaX(沐曦股份)
HYGON(海光信息)|[nvidia](/third_party/nvidia/)
[amd](/third_party/amd/)
[triton-shared](https://github.com/microsoft/triton-shared)
[iluvatar](/third_party/iluvatar/)
[mthreads](/third_party/mthreads/)
[xpu](/third_party/xpu/)
[metax](/third_party/metax/)
[hcu](third_party/hcu/)|3.1
3.1
3.1
3.1
3.1
3.0
3.1
3.0|[nvidia](/documents/build.md#nvidia--amd-nvidia--amd)
[amd](/documents/build.md#nvidia--amd-nvidia--amd)
-
[iluvatar](/documents/build.md#iluvatar天数智芯iluvatar)
[mthreads](/documents/build_cn.md#moore-threads摩尔线程mthreads)
[xpu](/documents/build.md#klx-xpu)
-
[hcu](/documents/build.md#hygon海光信息hcu)|[Installation](/README.md#source-free-installation)| +|[triton_v3.2.x](https://github.com/flagos-ai/flagtree/tree/triton_v3.2.x)|NVIDIA
AMD
Huawei Ascend(华为昇腾)
Cambricon(寒武纪)|[nvidia](https://github.com/flagos-ai/FlagTree/tree/triton_v3.2.x/third_party/nvidia/)
[amd](https://github.com/flagos-ai/FlagTree/tree/triton_v3.2.x/third_party/amd/)
[ascend](https://github.com/flagos-ai/FlagTree/blob/triton_v3.2.x/third_party/ascend)
[cambricon](https://github.com/flagos-ai/FlagTree/tree/triton_v3.2.x/third_party/cambricon/)|3.2|[nvidia](/documents/build.md#nvidia--amd-nvidia--amd)
[amd](/documents/build.md#nvidia--amd-nvidia--amd)
[ascend](/documents/build.md#huawei-ascend华为昇腾ascend)
-|[Installation](/README.md#source-free-installation)| +|[triton_v3.3.x](https://github.com/flagos-ai/flagtree/tree/triton_v3.3.x)|NVIDIA
AMD
x86_64 cpu
ARM China(安谋科技)
Tsingmicro(清微智能)
Enflame(燧原)|[nvidia](https://github.com/flagos-ai/FlagTree/tree/triton_v3.3.x/third_party/nvidia/)
[amd](https://github.com/flagos-ai/FlagTree/tree/triton_v3.3.x/third_party/amd/)
[triton-shared](https://github.com/microsoft/triton-shared)
[aipu](https://github.com/flagos-ai/FlagTree/tree/triton_v3.3.x/third_party/aipu/)
[tsingmicro](https://github.com/flagos-ai/FlagTree/tree/triton_v3.3.x/third_party/tsingmicro/)
[enflame](https://github.com/flagos-ai/FlagTree/tree/triton_v3.3.x/third_party/enflame/)|3.3|[nvidia](/documents/build.md#nvidia--amd-nvidia--amd)
[amd](/documents/build.md#nvidia--amd-nvidia--amd)
-
[tsingmicro](/documents/build.md#tsingmicro清微智能tsingmicro)
[enflame](/documents/build.md#enflame燧原enflame)|[Installation](/README.md#source-free-installation)| +|[triton_v3.4.x](https://github.com/flagos-ai/flagtree/tree/triton_v3.4.x)|NVIDIA
AMD
sunrise(曦望芯科)|[nvidia](https://github.com/flagos-ai/FlagTree/tree/triton_v3.4.x/third_party/nvidia/)
[amd](https://github.com/flagos-ai/FlagTree/tree/triton_v3.4.x/third_party/amd/)
[sunrise](https://github.com/flagos-ai/FlagTree/tree/triton_v3.4.x/third_party/sunrise/)|3.4|[nvidia](/documents/build.md#nvidia--amd-nvidia--amd)
[amd](/documents/build.md#nvidia--amd-nvidia--amd)
[sunrise](/documents/build.md#sunrise曦望芯科sunrise)|[Installation](/README.md#source-free-installation)| +|[triton_v3.5.x](https://github.com/flagos-ai/flagtree/tree/triton_v3.5.x)|NVIDIA
AMD|[nvidia](https://github.com/flagos-ai/FlagTree/tree/triton_v3.5.x/third_party/nvidia/)
[amd](https://github.com/flagos-ai/FlagTree/tree/triton_v3.5.x/third_party/amd/)|3.5|[nvidia](/documents/build.md#nvidia--amd-nvidia--amd)
[amd](/documents/build.md#nvidia--amd-nvidia--amd)
|[Installation](/README.md#source-free-installation)| ## Latest News +* 2026/01/23 Added [sunrise](https://github.com/flagos-ai/FlagTree/tree/triton_v3.4.x/third_party/sunrise/) backend integration (based on Triton 3.4), and added CI/CD. * 2026/01/08 Add wiki pages for new features [HINTS](https://github.com/flagos-ai/FlagTree/wiki/HINTS), [TLE](https://github.com/flagos-ai/FlagTree/wiki/TLE), [TLE-Raw](https://github.com/flagos-ai/FlagTree/wiki/EDSL). -* 2025/12/24 Support pull and install [Wheel](/README.md#non-source-installation). -* 2025/12/08 Added [enflame](https://github.com/FlagTree/flagtree/tree/triton_v3.3.x/third_party/enflame/) backend integration (based on Triton 3.3), and added CI/CD. +* 2025/12/24 Support pull and install [Wheel](/README.md#source-free-installation). +* 2025/12/08 Added [enflame](https://github.com/flagos-ai/FlagTree/tree/triton_v3.3.x/third_party/enflame/) backend integration (based on Triton 3.3), and added CI/CD. * 2025/11/26 Add FlagTree_Backend_Specialization Unified Design Document [FlagTree_Backend_Specialization](/documents/decoupling/). * 2025/10/28 Provides offline build support (pre-downloaded dependency packages), improving the build experience when network environment is limited. See usage instructions below. * 2025/09/30 Support flagtree_hints for shared memory on GPGPU. * 2025/09/29 SDK storage migrated to ksyuncs, improving download stability. * 2025/09/25 Support flagtree_hints for ascend backend compilation capability. -* 2025/09/16 Added [hcu](https://github.com/FlagTree/flagtree/tree/main/third_party/hcu/) backend integration (based on Triton 3.0), and added CI/CD. +* 2025/09/16 Added [hcu](https://github.com/flagos-ai/FlagTree/tree/main/third_party/hcu/) backend integration (based on Triton 3.0), and added CI/CD. * 2025/09/09 Forked and modified [llvm-project](https://github.com/FlagTree/llvm-project) to support [FLIR](https://github.com/flagos-ai/flir). * 2025/09/01 Added adaptation for Paddle framework, and added CI/CD. * 2025/08/16 Added adaptation for Beijing Super Cloud Computing Center. * 2025/08/04 Added T*** backend integration (based on Triton 3.1). * 2025/08/01 [FLIR](https://github.com/flagos-ai/flir) supports flagtree_hints for shared memory loading. -* 2025/07/30 Updated [cambricon](https://github.com/FlagTree/flagtree/tree/triton_v3.2.x/third_party/cambricon/) backend (based on Triton 3.2). +* 2025/07/30 Updated [cambricon](https://github.com/flagos-ai/FlagTree/tree/triton_v3.2.x/third_party/cambricon/) backend (based on Triton 3.2). * 2025/07/25 Inspur team added adaptation for OpenAnolis OS. * 2025/07/09 [FLIR](https://github.com/flagos-ai/flir) supports flagtree_hints for Async DMA. * 2025/07/08 Added UnifiedHardware manager for multi-backend compilation. * 2025/07/02 [FlagGems](https://github.com/flagos-ai/FlagGems) LibTuner adapted to triton_v3.3.x version. * 2025/07/02 Added S*** backend integration (based on Triton 3.3). * 2025/06/20 [FLIR](https://github.com/flagos-ai/flir) began supporting MLIR extension functionality. -* 2025/06/06 Added [tsingmicro](https://github.com/FlagTree/flagtree/tree/triton_v3.3.x/third_party/tsingmicro/) backend integration (based on Triton 3.3), and added CI/CD. -* 2025/06/04 Added [ascend](https://github.com/FlagTree/flagtree/blob/triton_v3.2.x/third_party/ascend) backend integration (based on Triton 3.2), and added CI/CD. -* 2025/06/03 Added [metax](https://github.com/FlagTree/flagtree/tree/main/third_party/metax/) backend integration (based on Triton 3.1), and added CI/CD. +* 2025/06/06 Added [tsingmicro](https://github.com/flagos-ai/FlagTree/tree/triton_v3.3.x/third_party/tsingmicro/) backend integration (based on Triton 3.3), and added CI/CD. +* 2025/06/04 Added [ascend](https://github.com/flagos-ai/FlagTree/blob/triton_v3.2.x/third_party/ascend) backend integration (based on Triton 3.2), and added CI/CD. +* 2025/06/03 Added [metax](https://github.com/flagos-ai/FlagTree/tree/main/third_party/metax/) backend integration (based on Triton 3.1), and added CI/CD. * 2025/05/22 FlagGems LibEntry adapted to triton_v3.3.x version. * 2025/05/21 [FLIR](https://github.com/flagos-ai/flir) began supporting conversion functionality to middle layer. -* 2025/04/09 Added [aipu](https://github.com/FlagTree/flagtree/tree/triton_v3.3.x/third_party/aipu/) backend integration (based on Triton 3.3), provided a torch standard extension [example](https://github.com/flagos-ai/flagtree/blob/triton_v3.3.x/third_party/aipu/backend/aipu_torch_dev.cpp), and added CI/CD. +* 2025/04/09 Added [aipu](https://github.com/flagos-ai/FlagTree/tree/triton_v3.3.x/third_party/aipu/) backend integration (based on Triton 3.3), provided a torch standard extension [example](https://github.com/flagos-ai/flagtree/blob/triton_v3.3.x/third_party/aipu/backend/aipu_torch_dev.cpp), and added CI/CD. * 2025/03/26 Integrated security compliance scanning. -* 2025/03/19 Added [xpu](https://github.com/FlagTree/flagtree/tree/main/third_party/xpu/) backend integration (based on Triton 3.0), and added CI/CD. -* 2025/03/19 Added [mthreads](https://github.com/FlagTree/flagtree/tree/main/third_party/mthreads/) backend integration (based on Triton 3.1), and added CI/CD. -* 2025/03/12 Added [iluvatar](https://github.com/FlagTree/flagtree/tree/main/third_party/iluvatar/) backend integration (based on Triton 3.1), and added CI/CD. +* 2025/03/19 Added [xpu](https://github.com/flagos-ai/FlagTree/tree/main/third_party/xpu/) backend integration (based on Triton 3.0), and added CI/CD. +* 2025/03/19 Added [mthreads](https://github.com/flagos-ai/FlagTree/tree/main/third_party/mthreads/) backend integration (based on Triton 3.1), and added CI/CD. +* 2025/03/12 Added [iluvatar](https://github.com/flagos-ai/FlagTree/tree/main/third_party/iluvatar/) backend integration (based on Triton 3.1), and added CI/CD. ## Install from source -Installation dependencies (ensure you use the correct python3.x version): +Installation dependencies (Confirm the correct python3.x version is being used): ```shell apt install zlib1g zlib1g-dev libxml2 libxml2-dev # ubuntu -cd python; python3 -m pip install -r requirements.txt +python3 -m pip install -r python/requirements.txt ``` -Building and Installation (Recommended for environments with good network connectivity): +General building and installation procedure (Recommended for environments with good network connectivity): ```shell # Set FLAGTREE_BACKEND using the backend name from the table above -export FLAGTREE_BACKEND=${backend_name} # nvidia/amd/triton-shared do not set it -cd python # For Triton 3.1, 3.2, 3.3, you need to enter the python directory to build -python3 -m pip install . --no-build-isolation -v # Automatically uninstall triton +export FLAGTREE_BACKEND=${backend_name} # Do not set it on nvidia/amd/triton-shared +cd python # Need to enter the python directory for Triton 3.1/3.2/3.3 +python3 -m pip install . --no-build-isolation -v # Install flagtree and uninstall triton python3 -m pip show flagtree cd ${ANY_OTHER_PATH}; python3 -c 'import triton; print(triton.__path__)' ``` @@ -73,9 +74,9 @@ cd ${ANY_OTHER_PATH}; python3 -c 'import triton; print(triton.__path__)' - [Tips for building](/documents/build.md#tips-for-building) - [Offline build support: pre-downloading dependency packages](/documents/build.md#offline-build-support) -## Non-Source Installation +## Source-free Installation -If you do not wish to build from source, you can directly pull and install whl (supports some backends). +If you do not wish to build from source, you can directly pull and install whl (partial backend support). ```shell # Note: First install PyTorch, then execute the following commands @@ -84,17 +85,18 @@ RES="--index-url=https://resource.flagos.net/repository/flagos-pypi-hosted/simpl --trusted-host=https://resource.flagos.net" ``` -|Backend |Install command
(The version corresponds to the git tag)|Triton
version|Python
version| -|:-------|:-------|:-------|:-------| -|nvidia |python3 -m pip install flagtree==0.4.0 $RES |3.1|3.10
3.11
3.12| -|nvidia |python3 -m pip install flagtree==0.4.0+3.2 $RES |3.2|3.10
3.11
3.12| -|nvidia |python3 -m pip install flagtree==0.4.0+3.3 $RES |3.3|3.10
3.11
3.12| -|nvidia |python3 -m pip install flagtree==0.4.0+3.5 $RES |3.5|3.12| -|iluvatar|python3 -m pip install flagtree==0.4.0+iluvatar3.1 $RES|3.1|3.10| -|mthreads|python3 -m pip install flagtree==0.4.0+mthreads3.1 $RES|3.1|3.10| -|ascend |python3 -m pip install flagtree==0.4.0+ascend3.2 $RES |3.2|3.11| -|hcu |python3 -m pip install flagtree==0.4.0+hcu3.0 $RES |3.0|3.10| -|enflame |python3 -m pip install flagtree==0.4.0+enflame3.3 $RES |3.3|3.10| +|Backend |Install command
(The version corresponds to the git tag)|Triton
version|Python
version|libc.so &
libstdc++.so
version| +|:-------|:-------|:-------|:-------|:-------| +|nvidia |python3 -m pip install flagtree==0.4.0 $RES |3.1|3.10
3.11
3.12|GLIBC_2.30
GLIBCXX_3.4.28
CXXABI_1.3.12| +|nvidia |python3 -m pip install flagtree==0.4.0+3.2 $RES |3.2|3.10
3.11
3.12|GLIBC_2.30
GLIBCXX_3.4.28
CXXABI_1.3.12| +|nvidia |python3 -m pip install flagtree==0.4.0+3.3 $RES |3.3|3.10
3.11
3.12|GLIBC_2.30
GLIBCXX_3.4.28
CXXABI_1.3.12| +|nvidia |python3 -m pip install flagtree==0.4.0+3.5 $RES |3.5|3.12|GLIBC_2.39
GLIBCXX_3.4.33
CXXABI_1.3.15| +|iluvatar|python3 -m pip install flagtree==0.4.0+iluvatar3.1 $RES|3.1|3.10|GLIBC_2.35
GLIBCXX_3.4.30
CXXABI_1.3.13| +|mthreads|python3 -m pip install flagtree==0.4.0+mthreads3.1 $RES|3.1|3.10|GLIBC_2.35
GLIBCXX_3.4.30
CXXABI_1.3.13| +|ascend |python3 -m pip install flagtree==0.4.0+ascend3.2 $RES |3.2|3.11|GLIBC_2.34
GLIBCXX_3.4.24
CXXABI_1.3.11| +|hcu |python3 -m pip install flagtree==0.4.0+hcu3.0 $RES |3.0|3.10|GLIBC_2.35
GLIBCXX_3.4.30
CXXABI_1.3.13| +|enflame |python3 -m pip install flagtree==0.4.0+enflame3.3 $RES |3.3|3.10|GLIBC_2.35
GLIBCXX_3.4.30
CXXABI_1.3.13| +|sunrise |python3 -m pip install flagtree==0.4.0+sunrise3.4 $RES |3.4|3.10|GLIBC_2.39
GLIBCXX_3.4.33
CXXABI_1.3.15| ## Running tests diff --git a/README_cn.md b/README_cn.md index db825cf35..79aebaa99 100644 --- a/README_cn.md +++ b/README_cn.md @@ -9,63 +9,64 @@ FlagTree 是面向多种 AI 芯片的开源、统一编译器,致力于打造 对于上游模型用户,提供多后端的统一编译能力;对于下游芯片厂商,提供 Triton 生态接入范例。
各后端基于不同版本的 Triton 适配,因此位于不同的主干分支,各主干分支均为保护分支且地位相等:
-|主干分支|厂商|后端|Triton 版本| -|:------|:--|:--|:----------| -|[main](https://github.com/flagos-ai/flagtree/tree/main)|NVIDIA
AMD
x86_64 cpu
ILUVATAR(天数智芯)
Moore Threads(摩尔线程)
KLX
MetaX(沐曦股份)
HYGON(海光信息)|[nvidia](/third_party/nvidia/)
[amd](/third_party/amd/)
[triton-shared](https://github.com/microsoft/triton-shared)
[iluvatar](/third_party/iluvatar/)
[mthreads](/third_party/mthreads/)
[xpu](/third_party/xpu/)
[metax](/third_party/metax/)
[hcu](third_party/hcu/)|3.1
3.1
3.1
3.1
3.1
3.0
3.1
3.0| -|[triton_v3.2.x](https://github.com/flagos-ai/flagtree/tree/triton_v3.2.x)|NVIDIA
AMD
Huawei Ascend(华为昇腾)
Cambricon(寒武纪)|[nvidia](https://github.com/FlagTree/flagtree/tree/triton_v3.2.x/third_party/nvidia/)
[amd](https://github.com/FlagTree/flagtree/tree/triton_v3.2.x/third_party/amd/)
[ascend](https://github.com/FlagTree/flagtree/blob/triton_v3.2.x/third_party/ascend)
[cambricon](https://github.com/FlagTree/flagtree/tree/triton_v3.2.x/third_party/cambricon/)|3.2| -|[triton_v3.3.x](https://github.com/flagos-ai/flagtree/tree/triton_v3.3.x)|NVIDIA
AMD
x86_64 cpu
ARM China(安谋科技)
Tsingmicro(清微智能)
Enflame(燧原)|[nvidia](https://github.com/FlagTree/flagtree/tree/triton_v3.3.x/third_party/nvidia/)
[amd](https://github.com/FlagTree/flagtree/tree/triton_v3.3.x/third_party/amd/)
[triton-shared](https://github.com/microsoft/triton-shared)
[aipu](https://github.com/FlagTree/flagtree/tree/triton_v3.3.x/third_party/aipu/)
[tsingmicro](https://github.com/FlagTree/flagtree/tree/triton_v3.3.x/third_party/tsingmicro/)
[enflame](https://github.com/FlagTree/flagtree/tree/triton_v3.3.x/third_party/enflame/)|3.3| -|[triton_v3.4.x](https://github.com/flagos-ai/flagtree/tree/triton_v3.4.x)|NVIDIA
AMD|[nvidia](https://github.com/FlagTree/flagtree/tree/triton_v3.4.x/third_party/nvidia/)
[amd](https://github.com/FlagTree/flagtree/tree/triton_v3.4.x/third_party/amd/)|3.4| -|[triton_v3.5.x](https://github.com/flagos-ai/flagtree/tree/triton_v3.5.x)|NVIDIA
AMD|[nvidia](https://github.com/FlagTree/flagtree/tree/triton_v3.5.x/third_party/nvidia/)
[amd](https://github.com/FlagTree/flagtree/tree/triton_v3.5.x/third_party/amd/)|3.5| +|主干分支|厂商|后端|Triton 版本|源码构建|免源码安装| +|:------|:--|:--|:---------|:------|:--------| +|[main](https://github.com/flagos-ai/flagtree/tree/main)|NVIDIA
AMD
x86_64 cpu
ILUVATAR(天数智芯)
Moore Threads(摩尔线程)
KLX
MetaX(沐曦股份)
HYGON(海光信息)|[nvidia](/third_party/nvidia/)
[amd](/third_party/amd/)
[triton-shared](https://github.com/microsoft/triton-shared)
[iluvatar](/third_party/iluvatar/)
[mthreads](/third_party/mthreads/)
[xpu](/third_party/xpu/)
[metax](/third_party/metax/)
[hcu](third_party/hcu/)|3.1
3.1
3.1
3.1
3.1
3.0
3.1
3.0|[nvidia](/documents/build.md#nvidia--amd-nvidia--amd)
[amd](/documents/build.md#nvidia--amd-nvidia--amd)
-
[iluvatar](/documents/build.md#iluvatar天数智芯iluvatar)
[mthreads](/documents/build_cn.md#moore-threads摩尔线程mthreads)
[xpu](/documents/build.md#klx-xpu)
-
[hcu](/documents/build.md#hygon海光信息hcu)|[免源码安装](/README_cn.md#免源码安装)| +|[triton_v3.2.x](https://github.com/flagos-ai/flagtree/tree/triton_v3.2.x)|NVIDIA
AMD
Huawei Ascend(华为昇腾)
Cambricon(寒武纪)|[nvidia](https://github.com/flagos-ai/FlagTree/tree/triton_v3.2.x/third_party/nvidia/)
[amd](https://github.com/flagos-ai/FlagTree/tree/triton_v3.2.x/third_party/amd/)
[ascend](https://github.com/flagos-ai/FlagTree/blob/triton_v3.2.x/third_party/ascend)
[cambricon](https://github.com/flagos-ai/FlagTree/tree/triton_v3.2.x/third_party/cambricon/)|3.2|[nvidia](/documents/build.md#nvidia--amd-nvidia--amd)
[amd](/documents/build.md#nvidia--amd-nvidia--amd)
[ascend](/documents/build.md#huawei-ascend华为昇腾ascend)
-|[免源码安装](/README_cn.md#免源码安装)| +|[triton_v3.3.x](https://github.com/flagos-ai/flagtree/tree/triton_v3.3.x)|NVIDIA
AMD
x86_64 cpu
ARM China(安谋科技)
Tsingmicro(清微智能)
Enflame(燧原)|[nvidia](https://github.com/flagos-ai/FlagTree/tree/triton_v3.3.x/third_party/nvidia/)
[amd](https://github.com/flagos-ai/FlagTree/tree/triton_v3.3.x/third_party/amd/)
[triton-shared](https://github.com/microsoft/triton-shared)
[aipu](https://github.com/flagos-ai/FlagTree/tree/triton_v3.3.x/third_party/aipu/)
[tsingmicro](https://github.com/flagos-ai/FlagTree/tree/triton_v3.3.x/third_party/tsingmicro/)
[enflame](https://github.com/flagos-ai/FlagTree/tree/triton_v3.3.x/third_party/enflame/)|3.3|[nvidia](/documents/build.md#nvidia--amd-nvidia--amd)
[amd](/documents/build.md#nvidia--amd-nvidia--amd)
-
[tsingmicro](/documents/build.md#tsingmicro清微智能tsingmicro)
[enflame](/documents/build.md#enflame燧原enflame)|[免源码安装](/README_cn.md#免源码安装)| +|[triton_v3.4.x](https://github.com/flagos-ai/flagtree/tree/triton_v3.4.x)|NVIDIA
AMD
sunrise(曦望芯科)|[nvidia](https://github.com/flagos-ai/FlagTree/tree/triton_v3.4.x/third_party/nvidia/)
[amd](https://github.com/flagos-ai/FlagTree/tree/triton_v3.4.x/third_party/amd/)
[sunrise](https://github.com/flagos-ai/FlagTree/tree/triton_v3.4.x/third_party/sunrise/)|3.4|[nvidia](/documents/build.md#nvidia--amd-nvidia--amd)
[amd](/documents/build.md#nvidia--amd-nvidia--amd)
[sunrise](/documents/build.md#sunrise曦望芯科sunrise)|[免源码安装](/README_cn.md#免源码安装)| +|[triton_v3.5.x](https://github.com/flagos-ai/flagtree/tree/triton_v3.5.x)|NVIDIA
AMD|[nvidia](https://github.com/flagos-ai/FlagTree/tree/triton_v3.5.x/third_party/nvidia/)
[amd](https://github.com/flagos-ai/FlagTree/tree/triton_v3.5.x/third_party/amd/)|3.5|[nvidia](/documents/build.md#nvidia--amd-nvidia--amd)
[amd](/documents/build.md#nvidia--amd-nvidia--amd)
|[免源码安装](/README_cn.md#免源码安装)| ## 新特性 +* 2026/01/23 新增接入 [sunrise](https://github.com/flagos-ai/FlagTree/tree/triton_v3.4.x/third_party/sunrise/) 后端(对应 Triton 3.4),加入 CI/CD。 * 2026/01/08 添加 [HINTS](https://github.com/flagos-ai/FlagTree/wiki/HINTS)、[TLE](https://github.com/flagos-ai/FlagTree/wiki/TLE)、[TLE-Raw](https://github.com/flagos-ai/FlagTree/wiki/EDSL) 等新功能 WIKI。 -* 2025/12/24 支持拉取和安装 [Wheel](/README_cn.md#非源码安装)。 -* 2025/12/08 新增接入 [enflame](https://github.com/FlagTree/flagtree/tree/triton_v3.3.x/third_party/enflame/) 后端(对应 Triton 3.3),加入 CI/CD。 +* 2025/12/24 支持拉取和安装 [Wheel](/README_cn.md#免源码安装)。 +* 2025/12/08 新增接入 [enflame](https://github.com/flagos-ai/FlagTree/tree/triton_v3.3.x/third_party/enflame/) 后端(对应 Triton 3.3),加入 CI/CD。 * 2025/11/26 添加 FlagTree 后端特化统一设计文档 [FlagTree_Backend_Specialization](/documents/decoupling/)。 * 2025/10/28 提供离线构建支持(预下载依赖包),改善网络环境受限时的构建体验,使用方法见后文。 * 2025/09/30 在 GPGPU 上支持编译指导 shared memory。 * 2025/09/29 SDK 存储迁移至金山云,大幅提升下载稳定性。 * 2025/09/25 支持编译指导 ascend 的后端编译能力。 -* 2025/09/16 新增接入 [hcu](https://github.com/FlagTree/flagtree/tree/main/third_party/hcu/) 后端(对应 Triton 3.0),加入 CI/CD。 +* 2025/09/16 新增接入 [hcu](https://github.com/flagos-ai/FlagTree/tree/main/third_party/hcu/) 后端(对应 Triton 3.0),加入 CI/CD。 * 2025/09/09 Fork 并修改 [llvm-project](https://github.com/FlagTree/llvm-project),承接 [FLIR](https://github.com/flagos-ai/flir) 的功能。 * 2025/09/01 新增适配 Paddle 框架,加入 CI/CD。 * 2025/08/16 新增适配北京超级云计算中心 AI 智算云。 * 2025/08/04 新增接入 T*** 后端(对应 Triton 3.1)。 * 2025/08/01 [FLIR](https://github.com/flagos-ai/flir) 支持编译指导 shared memory loading。 -* 2025/07/30 更新 [cambricon](https://github.com/FlagTree/flagtree/tree/triton_v3.2.x/third_party/cambricon/) 后端(对应 Triton 3.2)。 +* 2025/07/30 更新 [cambricon](https://github.com/flagos-ai/FlagTree/tree/triton_v3.2.x/third_party/cambricon/) 后端(对应 Triton 3.2)。 * 2025/07/25 浪潮团队新增适配 OpenAnolis 龙蜥操作系统。 * 2025/07/09 [FLIR](https://github.com/flagos-ai/flir) 支持编译指导 Async DMA。 * 2025/07/08 新增多后端编译统一管理模块。 * 2025/07/02 [FlagGems](https://github.com/flagos-ai/FlagGems) LibTuner 适配 triton_v3.3.x 版本。 * 2025/07/02 新增接入 S*** 后端(对应 Triton 3.3)。 * 2025/06/20 [FLIR](https://github.com/flagos-ai/flir) 开始承接 MLIR 扩展功能。 -* 2025/06/06 新增接入 [tsingmicro](https://github.com/FlagTree/flagtree/tree/triton_v3.3.x/third_party/tsingmicro/) 后端(对应 Triton 3.3),加入 CI/CD。 -* 2025/06/04 新增接入 [ascend](https://github.com/FlagTree/flagtree/blob/triton_v3.2.x/third_party/ascend) 后端(对应 Triton 3.2),加入 CI/CD。 -* 2025/06/03 新增接入 [metax](https://github.com/FlagTree/flagtree/tree/main/third_party/metax/) 后端(对应 Triton 3.1),加入 CI/CD。 +* 2025/06/06 新增接入 [tsingmicro](https://github.com/flagos-ai/FlagTree/tree/triton_v3.3.x/third_party/tsingmicro/) 后端(对应 Triton 3.3),加入 CI/CD。 +* 2025/06/04 新增接入 [ascend](https://github.com/flagos-ai/FlagTree/blob/triton_v3.2.x/third_party/ascend) 后端(对应 Triton 3.2),加入 CI/CD。 +* 2025/06/03 新增接入 [metax](https://github.com/flagos-ai/FlagTree/tree/main/third_party/metax/) 后端(对应 Triton 3.1),加入 CI/CD。 * 2025/05/22 [FlagGems](https://github.com/flagos-ai/FlagGems) LibEntry 适配 triton_v3.3.x 版本。 * 2025/05/21 [FLIR](https://github.com/flagos-ai/flir) 开始承接到中间层的转换功能。 -* 2025/04/09 新增接入 [aipu](https://github.com/FlagTree/flagtree/tree/triton_v3.3.x/third_party/aipu/) 后端(对应 Triton 3.3),提供 torch 标准扩展[范例](https://github.com/flagos-ai/flagtree/blob/triton_v3.3.x/third_party/aipu/backend/aipu_torch_dev.cpp),加入 CI/CD。 +* 2025/04/09 新增接入 [aipu](https://github.com/flagos-ai/FlagTree/tree/triton_v3.3.x/third_party/aipu/) 后端(对应 Triton 3.3),提供 torch 标准扩展[范例](https://github.com/flagos-ai/flagtree/blob/triton_v3.3.x/third_party/aipu/backend/aipu_torch_dev.cpp),加入 CI/CD。 * 2025/03/26 接入安全合规扫描。 -* 2025/03/19 新增接入 [xpu](https://github.com/FlagTree/flagtree/tree/main/third_party/xpu/) 后端(对应 Triton 3.0),加入 CI/CD。 -* 2025/03/19 新增接入 [mthreads](https://github.com/FlagTree/flagtree/tree/main/third_party/mthreads/) 后端(对应 Triton 3.1),加入 CI/CD。 -* 2025/03/12 新增接入 [iluvatar](https://github.com/FlagTree/flagtree/tree/main/third_party/iluvatar/) 后端(对应 Triton 3.1),加入 CI/CD。 +* 2025/03/19 新增接入 [xpu](https://github.com/flagos-ai/FlagTree/tree/main/third_party/xpu/) 后端(对应 Triton 3.0),加入 CI/CD。 +* 2025/03/19 新增接入 [mthreads](https://github.com/flagos-ai/FlagTree/tree/main/third_party/mthreads/) 后端(对应 Triton 3.1),加入 CI/CD。 +* 2025/03/12 新增接入 [iluvatar](https://github.com/flagos-ai/FlagTree/tree/main/third_party/iluvatar/) 后端(对应 Triton 3.1),加入 CI/CD。 ## 从源代码安装 安装依赖(注意使用正确的 python3.x 执行): + ```shell apt install zlib1g zlib1g-dev libxml2 libxml2-dev # ubuntu -cd python -python3 -m pip install -r requirements.txt +python3 -m pip install -r python/requirements.txt ``` -构建安装(网络畅通环境下推荐使用): +通用的构建安装方式(网络畅通环境下推荐使用): ```shell # Set FLAGTREE_BACKEND using the backend name from the table above -export FLAGTREE_BACKEND=${backend_name} # nvidia/amd/triton-shared do not set it -cd python # For Triton 3.1, 3.2, 3.3, you need to enter the python directory to build -python3 -m pip install . --no-build-isolation -v # 自动卸载 triton +export FLAGTREE_BACKEND=${backend_name} # Do not set it on nvidia/amd/triton-shared +cd python # Need to enter the python directory for Triton 3.1/3.2/3.3 +python3 -m pip install . --no-build-isolation -v # Install flagtree and uninstall triton python3 -m pip show flagtree cd ${ANY_OTHER_PATH}; python3 -c 'import triton; print(triton.__path__)' ``` @@ -73,7 +74,7 @@ cd ${ANY_OTHER_PATH}; python3 -c 'import triton; print(triton.__path__)' - [从源码构建技巧](/documents/build_cn.md#从源码构建技巧) - [离线构建支持:预下载依赖包](/documents/build_cn.md#离线构建支持) -## 非源码安装 +## 免源码安装 如果不希望从源码安装,可以直接拉取安装 whl(支持部分后端)。 @@ -84,17 +85,18 @@ RES="--index-url=https://resource.flagos.net/repository/flagos-pypi-hosted/simpl --trusted-host=https://resource.flagos.net" ``` -|后端 |安装命令(版本号对应 git tag)|Triton 版本|Python 版本| -|:-------|:--------------------------|:---------|:---------| -|nvidia |python3 -m pip install flagtree==0.4.0 $RES |3.1|3.10
3.11
3.12| -|nvidia |python3 -m pip install flagtree==0.4.0+3.2 $RES |3.2|3.10
3.11
3.12| -|nvidia |python3 -m pip install flagtree==0.4.0+3.3 $RES |3.3|3.10
3.11
3.12| -|nvidia |python3 -m pip install flagtree==0.4.0+3.5 $RES |3.5|3.12| -|iluvatar|python3 -m pip install flagtree==0.4.0+iluvatar3.1 $RES|3.1|3.10| -|mthreads|python3 -m pip install flagtree==0.4.0+mthreads3.1 $RES|3.1|3.10| -|ascend |python3 -m pip install flagtree==0.4.0+ascend3.2 $RES |3.2|3.11| -|hcu |python3 -m pip install flagtree==0.4.0+hcu3.0 $RES |3.0|3.10| -|enflame |python3 -m pip install flagtree==0.4.0+enflame3.3 $RES |3.3|3.10| +|后端 |安装命令(版本号对应 git tag)|Triton 版本|Python 版本|libc.so & libstdc++.so 版本| +|:-------|:--------------------------|:---------|:---------|:----------------------| +|nvidia |python3 -m pip install flagtree==0.4.0 $RES |3.1|3.10
3.11
3.12|GLIBC_2.30
GLIBCXX_3.4.28
CXXABI_1.3.12| +|nvidia |python3 -m pip install flagtree==0.4.0+3.2 $RES |3.2|3.10
3.11
3.12|GLIBC_2.30
GLIBCXX_3.4.28
CXXABI_1.3.12| +|nvidia |python3 -m pip install flagtree==0.4.0+3.3 $RES |3.3|3.10
3.11
3.12|GLIBC_2.30
GLIBCXX_3.4.28
CXXABI_1.3.12| +|nvidia |python3 -m pip install flagtree==0.4.0+3.5 $RES |3.5|3.12|GLIBC_2.39
GLIBCXX_3.4.33
CXXABI_1.3.15| +|iluvatar|python3 -m pip install flagtree==0.4.0+iluvatar3.1 $RES|3.1|3.10|GLIBC_2.35
GLIBCXX_3.4.30
CXXABI_1.3.13| +|mthreads|python3 -m pip install flagtree==0.4.0+mthreads3.1 $RES|3.1|3.10|GLIBC_2.35
GLIBCXX_3.4.30
CXXABI_1.3.13| +|ascend |python3 -m pip install flagtree==0.4.0+ascend3.2 $RES |3.2|3.11|GLIBC_2.34
GLIBCXX_3.4.24
CXXABI_1.3.11| +|hcu |python3 -m pip install flagtree==0.4.0+hcu3.0 $RES |3.0|3.10|GLIBC_2.35
GLIBCXX_3.4.30
CXXABI_1.3.13| +|enflame |python3 -m pip install flagtree==0.4.0+enflame3.3 $RES |3.3|3.10|GLIBC_2.35
GLIBCXX_3.4.30
CXXABI_1.3.13| +|sunrise |python3 -m pip install flagtree==0.4.0+sunrise3.4 $RES |3.4|3.10|GLIBC_2.39
GLIBCXX_3.4.33
CXXABI_1.3.15| ## 运行测试 diff --git a/documents/build.md b/documents/build.md index e666f557b..743a6225d 100644 --- a/documents/build.md +++ b/documents/build.md @@ -7,28 +7,43 @@ Automatic dependency library downloads may be limited by network conditions. You can manually download to the cache directory ~/.flagtree (modifiable via the FLAGTREE_CACHE_DIR environment variable). No need to manually set LLVM environment variables such as LLVM_BUILD_DIR.
Complete build commands for each backend:
-#### ILUVATAR(天数智芯)[iluvatar](https://github.com/FlagTree/flagtree/tree/main/third_party/iluvatar/) +#### ILUVATAR(天数智芯)[iluvatar](https://github.com/flagos-ai/FlagTree/tree/main/third_party/iluvatar/) - Based on Triton 3.1, x64 + +##### 1. Build and run environment + - Recommended: Use Ubuntu 20.04 +##### 2. Manually download the FlagTree dependencies + ```shell mkdir -p ~/.flagtree/iluvatar; cd ~/.flagtree/iluvatar wget https://baai-cp-web.ks3-cn-beijing.ksyuncs.com/trans/iluvatar-llvm18-x86_64_v0.4.0.tar.gz tar zxvf iluvatar-llvm18-x86_64_v0.4.0.tar.gz wget https://baai-cp-web.ks3-cn-beijing.ksyuncs.com/trans/iluvatarTritonPlugin-cpython3.10-glibc2.35-glibcxx3.4.30-cxxabi1.3.13-ubuntu-x86_64_v0.4.0.tar.gz tar zxvf iluvatarTritonPlugin-cpython3.10-glibc2.35-glibcxx3.4.30-cxxabi1.3.13-ubuntu-x86_64_v0.4.0.tar.gz -cd ${YOUR_CODE_DIR}/flagtree/python +``` + +##### 3. Command to build from source + +```shell +cd ${YOUR_CODE_DIR}/FlagTree/python export FLAGTREE_BACKEND=iluvatar python3 -m pip install . --no-build-isolation -v ``` -#### KLX [xpu](https://github.com/FlagTree/flagtree/tree/main/third_party/xpu/) +#### KLX [xpu](https://github.com/flagos-ai/FlagTree/tree/main/third_party/xpu/) - Based on Triton 3.0, x64 + +##### 1. Build and run environment + - Recommended: Use the Docker image (22GB) [ubuntu_2004_x86_64_v30.tar](https://su.bcebos.com/klx-sdk-release-public/xpytorch/docker/ubuntu2004_v030/ubuntu_2004_x86_64_v30.tar) - Contact kunlunxin-support@baidu.com for support +##### 2. Manually download the FlagTree dependencies + ```shell mkdir -p ~/.flagtree/xpu; cd ~/.flagtree/xpu wget https://baai-cp-web.ks3-cn-beijing.ksyuncs.com/trans/XTDK-llvm19-ubuntu2004_x86_64_v0.3.0.tar.gz @@ -37,16 +52,26 @@ wget https://baai-cp-web.ks3-cn-beijing.ksyuncs.com/trans/xre-Linux-x86_64_v0.3. tar zxvf xre-Linux-x86_64_v0.3.0.tar.gz wget https://baai-cp-web.ks3-cn-beijing.ksyuncs.com/trans/xpu-liblaunch_shared_so-ubuntu-x64_v0.3.1.tar.gz tar zxvf xpu-liblaunch_shared_so-ubuntu-x64_v0.3.1.tar.gz -cd ${YOUR_CODE_DIR}/flagtree/python +``` + +##### 3. Command to build from source + +```shell +cd ${YOUR_CODE_DIR}/FlagTree/python export FLAGTREE_BACKEND=xpu python3 -m pip install . --no-build-isolation -v ``` -#### Moore Threads(摩尔线程)[mthreads](https://github.com/FlagTree/flagtree/tree/main/third_party/mthreads/) +#### Moore Threads(摩尔线程)[mthreads](https://github.com/flagos-ai/FlagTree/tree/main/third_party/mthreads/) - Based on Triton 3.1, x64/aarch64 + +##### 1. Build and run environment + - Recommended: Use [Dockerfile-ubuntu22.04-python3.10-mthreads](/dockerfiles/Dockerfile-ubuntu22.04-python3.10-mthreads) +##### 2. Manually download the FlagTree dependencies + ```shell mkdir -p ~/.flagtree/mthreads; cd ~/.flagtree/mthreads # x64 @@ -59,49 +84,78 @@ wget https://baai-cp-web.ks3-cn-beijing.ksyuncs.com/trans/mthreads-llvm19-glibc2 tar zxvf mthreads-llvm19-glibc2.35-glibcxx3.4.30-aarch64_v0.4.0.tar.gz wget https://baai-cp-web.ks3-cn-beijing.ksyuncs.com/trans/mthreadsTritonPlugin-cpython3.10-glibc2.35-glibcxx3.4.30-cxxabi1.3.13-ubuntu-aarch64_v0.4.0.tar.gz tar zxvf mthreadsTritonPlugin-cpython3.10-glibc2.35-glibcxx3.4.30-cxxabi1.3.13-ubuntu-aarch64_v0.4.0.tar.gz -# -cd ${YOUR_CODE_DIR}/flagtree/python +``` + +##### 3. Command to build from source + +```shell +cd ${YOUR_CODE_DIR}/FlagTree/python export FLAGTREE_BACKEND=mthreads python3 -m pip install . --no-build-isolation -v ``` -#### ARM China(安谋科技)[aipu](https://github.com/FlagTree/flagtree/tree/triton_v3.3.x/third_party/aipu/) +#### ARM China(安谋科技)[aipu](https://github.com/flagos-ai/FlagTree/tree/triton_v3.3.x/third_party/aipu/) - Based on Triton 3.3, x64/arm64 + +##### 1. Build and run environment + - Recommended: Use Ubuntu 22.04 + +##### 2. Manually download the FlagTree dependencies + - llvm x64 in the simulated environment, llvm arm64 on the ARM development board ```shell mkdir -p ~/.flagtree/aipu; cd ~/.flagtree/aipu wget https://baai-cp-web.ks3-cn-beijing.ksyuncs.com/trans/llvm-a66376b0-ubuntu-x64-clang16-lld16_v0.4.0.tar.gz tar zxvf llvm-a66376b0-ubuntu-x64-clang16-lld16_v0.4.0.tar.gz -cd ${YOUR_CODE_DIR}/flagtree/python +``` + +##### 3. Command to build from source + +```shell +cd ${YOUR_CODE_DIR}/FlagTree/python git checkout -b triton_v3.3.x origin/triton_v3.3.x export FLAGTREE_BACKEND=aipu python3 -m pip install . --no-build-isolation -v ``` -#### Tsingmicro(清微智能)[tsingmicro](https://github.com/FlagTree/flagtree/tree/triton_v3.3.x/third_party/tsingmicro/) +#### Tsingmicro(清微智能)[tsingmicro](https://github.com/flagos-ai/FlagTree/tree/triton_v3.3.x/third_party/tsingmicro/) - Based on Triton 3.3, x64 + +##### 1. Build and run environment + - Recommended: Use Ubuntu 20.04 + +##### 2. Manually download the FlagTree dependencies + ```shell mkdir -p ~/.flagtree/tsingmicro; cd ~/.flagtree/tsingmicro wget https://baai-cp-web.ks3-cn-beijing.ksyuncs.com/trans/tsingmicro-llvm21-glibc2.30-glibcxx3.4.28-python3.11-x64_v0.2.0.tar.gz tar zxvf tsingmicro-llvm21-glibc2.30-glibcxx3.4.28-python3.11-x64_v0.2.0.tar.gz wget https://baai-cp-web.ks3-cn-beijing.ksyuncs.com/trans/tx8_depends_release_20250814_195126_v0.2.0.tar.gz tar zxvf tx8_depends_release_20250814_195126_v0.2.0.tar.gz -export TX8_DEPS_ROOT=~/.flagtree/tsingmicro/tx8_deps -cd ${YOUR_CODE_DIR}/flagtree/python +``` + +##### 3. Command to build from source + +```shell +cd ${YOUR_CODE_DIR}/FlagTree/python git checkout -b triton_v3.3.x origin/triton_v3.3.x +export TX8_DEPS_ROOT=~/.flagtree/tsingmicro/tx8_deps export FLAGTREE_BACKEND=tsingmicro python3 -m pip install . --no-build-isolation -v ``` -#### Huawei Ascend(华为昇腾)[ascend](https://github.com/FlagTree/flagtree/blob/triton_v3.2.x/third_party/ascend) +#### Huawei Ascend(华为昇腾)[ascend](https://github.com/flagos-ai/FlagTree/blob/triton_v3.2.x/third_party/ascend) - Based on Triton 3.2, aarch64 + +##### 1. Build and run environment + - Recommended: Use [Dockerfile-ubuntu22.04-python3.11-ascend](/dockerfiles/Dockerfile-ubuntu22.04-python3.11-ascend) - After registering an account at https://www.hiascend.com/developer/download/community/result?module=cann, download the cann-toolkit and cann-kernels for the corresponding platform. @@ -115,47 +169,111 @@ chmod +x Ascend-cann-kernels-910b_8.3.RC1.alpha001_linux-aarch64.run # cann-kernels for 910C (A3) chmod +x Atlas-A3-cann-kernels_8.3.RC1.alpha001_linux-aarch64.run ./Atlas-A3-cann-kernels_8.3.RC1.alpha001_linux-aarch64.run --install -# build +``` + +##### 2. Manually download the FlagTree dependencies + +```shell mkdir -p ~/.flagtree/ascend; cd ~/.flagtree/ascend wget https://baai-cp-web.ks3-cn-beijing.ksyuncs.com/trans/llvm-a66376b0-ubuntu-aarch64-python311-compat_v0.3.0.tar.gz tar zxvf llvm-a66376b0-ubuntu-aarch64-python311-compat_v0.3.0.tar.gz -cd ${YOUR_CODE_DIR}/flagtree/python +``` + +##### 3. Command to build from source + +```shell +cd ${YOUR_CODE_DIR}/FlagTree/python git checkout -b triton_v3.2.x origin/triton_v3.2.x export FLAGTREE_BACKEND=ascend python3 -m pip install . --no-build-isolation -v ``` -#### HYGON(海光信息)[hcu](https://github.com/FlagTree/flagtree/tree/main/third_party/hcu/) +#### HYGON(海光信息)[hcu](https://github.com/flagos-ai/FlagTree/tree/main/third_party/hcu/) - Based on Triton 3.0, x64 + +##### 1. Build and run environment + - Recommended: Use [Dockerfile-ubuntu22.04-python3.10-hcu](/dockerfiles/Dockerfile-ubuntu22.04-python3.10-hcu) +##### 2. Manually download the FlagTree dependencies + ```shell mkdir -p ~/.flagtree/hcu; cd ~/.flagtree/hcu wget https://baai-cp-web.ks3-cn-beijing.ksyuncs.com/trans/hcu-llvm20-df0864e-glibc2.35-glibcxx3.4.30-ubuntu-x86_64_v0.3.0.tar.gz tar zxvf hcu-llvm20-df0864e-glibc2.35-glibcxx3.4.30-ubuntu-x86_64_v0.3.0.tar.gz -cd ${YOUR_CODE_DIR}/flagtree/python +``` + +##### 3. Command to build from source + +```shell +cd ${YOUR_CODE_DIR}/FlagTree/python export FLAGTREE_BACKEND=hcu python3 -m pip install . --no-build-isolation -v ``` -#### Enflame(燧原)[enflame](https://github.com/FlagTree/flagtree/tree/triton_v3.3.x/third_party/enflame/) +#### Enflame(燧原)[enflame](https://github.com/flagos-ai/FlagTree/tree/triton_v3.3.x/third_party/enflame/) - Based on Triton 3.3, x64 + +##### 1. Build and run environment + - Recommended: Use the Docker image (2.4GB) https://baai-cp-web.ks3-cn-beijing.ksyuncs.com/trans/enflame-flagtree-0.3.1.tar.gz +##### 2. Manually download the FlagTree dependencies + ```shell mkdir -p ~/.flagtree/enflame; cd ~/.flagtree/enflame wget https://baai-cp-web.ks3-cn-beijing.ksyuncs.com/trans/enflame-llvm21-d752c5b-gcc9-x64_v0.3.0.tar.gz tar zxvf enflame-llvm21-d752c5b-gcc9-x64_v0.3.0.tar.gz -cd ${YOUR_CODE_DIR}/flagtree/python +``` + +##### 3. Command to build from source + +```shell +cd ${YOUR_CODE_DIR}/FlagTree/python export FLAGTREE_BACKEND=enflame python3 -m pip install . --no-build-isolation -v ``` -#### NVIDIA [nvidia](/third_party/nvidia/) +#### sunrise(曦望芯科)[sunrise](https://github.com/flagos-ai/FlagTree/tree/triton_v3.4.x/third_party/sunrise/) + +- Based on Triton 3.4, x64 + +##### 1. Build and run environment + +- Recommended: Use Ubuntu 22.04 + +##### 2. Manually download the FlagTree dependencies + +```shell +mkdir -p ~/.flagtree/sunrise; cd ~/.flagtree/sunrise +wget https://baai-cp-web.ks3-cn-beijing.ksyuncs.com/trans/sunrise-llvm21-glibc2.39-glibcxx3.4.33-x86_64_v0.4.0.tar.gz +tar zxvf sunrise-llvm21-glibc2.39-glibcxx3.4.33-x86_64_v0.4.0.tar.gz +wget https://baai-cp-web.ks3-cn-beijing.ksyuncs.com/trans/sunriseTritonPlugin-cpython3.10-glibc2.39-glibcxx3.4.33-x86_64_v0.4.0.tar.gz +tar zxvf sunriseTritonPlugin-cpython3.10-glibc2.39-glibcxx3.4.33-x86_64_v0.4.0.tar.gz +``` + +##### 3. Command to build from source + +```shell +cd ${YOUR_CODE_DIR}/FlagTree +export TRITON_BUILD_WITH_CLANG_LLD=1 +export TRITON_OFFLINE_BUILD=1 +export TRITON_BUILD_PROTON=OFF +export FLAGTREE_BACKEND=sunrise +python3 -m pip install . --no-build-isolation -v +``` + +#### NVIDIA & AMD [nvidia](/third_party/nvidia/) & [amd](/third_party/amd/) -- To build with default backends nvidia, amd, triton_shared cpu: +- Based on Triton 3.1/3.2/3.3/3.4/3.5, x64/arm64 + +##### 1. Build and run environment + +- Recommended: Use Ubuntu 22.04 + +##### 2. Manually download the LLVM ```shell cd ${YOUR_LLVM_DOWNLOAD_DIR} @@ -184,8 +302,10 @@ export LLVM_INCLUDE_DIRS=$LLVM_SYSPATH/include export LLVM_LIBRARY_DIR=$LLVM_SYSPATH/lib ``` +##### 3. Command to build from source + ```shell -cd ${YOUR_CODE_DIR}/flagtree +cd ${YOUR_CODE_DIR}/FlagTree cd python # For Triton 3.1, 3.2, 3.3, you need to enter the python directory to build git checkout main # For Triton 3.1 git checkout -b triton_v3.2.x origin/triton_v3.2.x # For Triton 3.2 @@ -203,7 +323,7 @@ unset LLVM_SYSPATH LLVM_INCLUDE_DIRS LLVM_LIBRARY_DIR The above introduced how dependencies can be manually downloaded for various FlagTree backends during build time to avoid network environment limitations. Since Triton builds originally come with some dependency packages, we provide pre-downloaded packages that can be manually installed in your environment to prevent getting stuck at the automatic download stage during the build process. ```shell -cd ${YOUR_CODE_DIR}/flagtree/python +cd ${YOUR_CODE_DIR}/FlagTree/python sh README_offline_build.sh x86_64 # View readme # For Triton 3.1 (x64) wget https://baai-cp-web.ks3-cn-beijing.ksyuncs.com/trans/offline-build-pack-triton-3.1.x-linux-x64.zip diff --git a/documents/build_cn.md b/documents/build_cn.md index df9450ca7..11e1c54c9 100644 --- a/documents/build_cn.md +++ b/documents/build_cn.md @@ -7,28 +7,43 @@ 自动下载依赖库的速度可能受限于网络环境,编译前可自行下载至缓存目录 ~/.flagtree(可通过环境变量 FLAGTREE_CACHE_DIR 修改),无需自行设置 LLVM_BUILD_DIR 等环境变量。
各后端完整构建命令如下:
-#### ILUVATAR(天数智芯)[iluvatar](https://github.com/FlagTree/flagtree/tree/main/third_party/iluvatar/) +#### ILUVATAR(天数智芯)[iluvatar](https://github.com/flagos-ai/FlagTree/tree/main/third_party/iluvatar/) - 对应的 Triton 版本为 3.1,基于 x64 平台 + +##### 1. 构建及运行环境 + - 推荐使用 Ubuntu 20.04 +##### 2. 手动下载 FlagTree 依赖库 + ```shell mkdir -p ~/.flagtree/iluvatar; cd ~/.flagtree/iluvatar wget https://baai-cp-web.ks3-cn-beijing.ksyuncs.com/trans/iluvatar-llvm18-x86_64_v0.4.0.tar.gz tar zxvf iluvatar-llvm18-x86_64_v0.4.0.tar.gz wget https://baai-cp-web.ks3-cn-beijing.ksyuncs.com/trans/iluvatarTritonPlugin-cpython3.10-glibc2.35-glibcxx3.4.30-cxxabi1.3.13-ubuntu-x86_64_v0.4.0.tar.gz tar zxvf iluvatarTritonPlugin-cpython3.10-glibc2.35-glibcxx3.4.30-cxxabi1.3.13-ubuntu-x86_64_v0.4.0.tar.gz -cd ${YOUR_CODE_DIR}/flagtree/python +``` + +##### 3. 源码构建命令 + +```shell +cd ${YOUR_CODE_DIR}/FlagTree/python export FLAGTREE_BACKEND=iluvatar python3 -m pip install . --no-build-isolation -v ``` -#### KLX [xpu](https://github.com/FlagTree/flagtree/tree/main/third_party/xpu/) +#### KLX [xpu](https://github.com/flagos-ai/FlagTree/tree/main/third_party/xpu/) - 对应的 Triton 版本为 3.0,基于 x64 平台 + +##### 1. 构建及运行环境 + - 推荐使用镜像(22GB)[ubuntu_2004_x86_64_v30.tar](https://su.bcebos.com/klx-sdk-release-public/xpytorch/docker/ubuntu2004_v030/ubuntu_2004_x86_64_v30.tar) - 联系 kunlunxin-support@baidu.com 可获取进一步支持 +##### 2. 手动下载 FlagTree 依赖库 + ```shell mkdir -p ~/.flagtree/xpu; cd ~/.flagtree/xpu wget https://baai-cp-web.ks3-cn-beijing.ksyuncs.com/trans/XTDK-llvm19-ubuntu2004_x86_64_v0.3.0.tar.gz @@ -37,16 +52,26 @@ wget https://baai-cp-web.ks3-cn-beijing.ksyuncs.com/trans/xre-Linux-x86_64_v0.3. tar zxvf xre-Linux-x86_64_v0.3.0.tar.gz wget https://baai-cp-web.ks3-cn-beijing.ksyuncs.com/trans/xpu-liblaunch_shared_so-ubuntu-x64_v0.3.1.tar.gz tar zxvf xpu-liblaunch_shared_so-ubuntu-x64_v0.3.1.tar.gz -cd ${YOUR_CODE_DIR}/flagtree/python +``` + +##### 3. 源码构建命令 + +```shell +cd ${YOUR_CODE_DIR}/FlagTree/python export FLAGTREE_BACKEND=xpu python3 -m pip install . --no-build-isolation -v ``` -#### Moore Threads(摩尔线程)[mthreads](https://github.com/FlagTree/flagtree/tree/main/third_party/mthreads/) +#### Moore Threads(摩尔线程)[mthreads](https://github.com/flagos-ai/FlagTree/tree/main/third_party/mthreads/) - 对应的 Triton 版本为 3.1,基于 x64/aarch64 平台 + +##### 1. 构建及运行环境 + - 推荐使用镜像 [Dockerfile-ubuntu22.04-python3.10-mthreads](/dockerfiles/Dockerfile-ubuntu22.04-python3.10-mthreads) +##### 2. 手动下载 FlagTree 依赖库 + ```shell mkdir -p ~/.flagtree/mthreads; cd ~/.flagtree/mthreads # x64 @@ -59,49 +84,77 @@ wget https://baai-cp-web.ks3-cn-beijing.ksyuncs.com/trans/mthreads-llvm19-glibc2 tar zxvf mthreads-llvm19-glibc2.35-glibcxx3.4.30-aarch64_v0.4.0.tar.gz wget https://baai-cp-web.ks3-cn-beijing.ksyuncs.com/trans/mthreadsTritonPlugin-cpython3.10-glibc2.35-glibcxx3.4.30-cxxabi1.3.13-ubuntu-aarch64_v0.4.0.tar.gz tar zxvf mthreadsTritonPlugin-cpython3.10-glibc2.35-glibcxx3.4.30-cxxabi1.3.13-ubuntu-aarch64_v0.4.0.tar.gz -# -cd ${YOUR_CODE_DIR}/flagtree/python +``` + +##### 3. 源码构建命令 + +```shell +cd ${YOUR_CODE_DIR}/FlagTree/python export FLAGTREE_BACKEND=mthreads python3 -m pip install . --no-build-isolation -v ``` -#### ARM China(安谋科技)[aipu](https://github.com/FlagTree/flagtree/tree/triton_v3.3.x/third_party/aipu/) +#### ARM China(安谋科技)[aipu](https://github.com/flagos-ai/FlagTree/tree/triton_v3.3.x/third_party/aipu/) - 对应的 Triton 版本为 3.3,基于 x64/arm64 平台 + +##### 1. 构建及运行环境 + - 推荐使用 Ubuntu 22.04 + +##### 2. 手动下载 FlagTree 依赖库 + - 模拟环境中使用 x64 版本的 llvm,在 ARM 开发板上使用 arm64 版本的 llvm ```shell mkdir -p ~/.flagtree/aipu; cd ~/.flagtree/aipu wget https://baai-cp-web.ks3-cn-beijing.ksyuncs.com/trans/llvm-a66376b0-ubuntu-x64-clang16-lld16_v0.4.0.tar.gz tar zxvf llvm-a66376b0-ubuntu-x64-clang16-lld16_v0.4.0.tar.gz -cd ${YOUR_CODE_DIR}/flagtree/python +``` + +##### 3. 源码构建命令 + +```shell +cd ${YOUR_CODE_DIR}/FlagTree/python git checkout -b triton_v3.3.x origin/triton_v3.3.x export FLAGTREE_BACKEND=aipu python3 -m pip install . --no-build-isolation -v ``` -#### Tsingmicro(清微智能)[tsingmicro](https://github.com/FlagTree/flagtree/tree/triton_v3.3.x/third_party/tsingmicro/) +#### Tsingmicro(清微智能)[tsingmicro](https://github.com/flagos-ai/FlagTree/tree/triton_v3.3.x/third_party/tsingmicro/) - 对应的 Triton 版本为 3.3,基于 x64 平台 + +##### 1. 构建及运行环境 + - 推荐使用 Ubuntu 20.04 +##### 2. 手动下载 FlagTree 依赖库 + ```shell mkdir -p ~/.flagtree/tsingmicro; cd ~/.flagtree/tsingmicro wget https://baai-cp-web.ks3-cn-beijing.ksyuncs.com/trans/tsingmicro-llvm21-glibc2.30-glibcxx3.4.28-python3.11-x64_v0.2.0.tar.gz tar zxvf tsingmicro-llvm21-glibc2.30-glibcxx3.4.28-python3.11-x64_v0.2.0.tar.gz wget https://baai-cp-web.ks3-cn-beijing.ksyuncs.com/trans/tx8_depends_release_20250814_195126_v0.2.0.tar.gz tar zxvf tx8_depends_release_20250814_195126_v0.2.0.tar.gz -export TX8_DEPS_ROOT=~/.flagtree/tsingmicro/tx8_deps -cd ${YOUR_CODE_DIR}/flagtree/python +``` + +##### 3. 源码构建命令 + +```shell +cd ${YOUR_CODE_DIR}/FlagTree/python git checkout -b triton_v3.3.x origin/triton_v3.3.x +export TX8_DEPS_ROOT=~/.flagtree/tsingmicro/tx8_deps export FLAGTREE_BACKEND=tsingmicro python3 -m pip install . --no-build-isolation -v ``` -#### Huawei Ascend(华为昇腾)[ascend](https://github.com/FlagTree/flagtree/blob/triton_v3.2.x/third_party/ascend) +#### Huawei Ascend(华为昇腾)[ascend](https://github.com/flagos-ai/FlagTree/blob/triton_v3.2.x/third_party/ascend) - 对应的 Triton 版本为 3.2,基于 aarch64 平台 + +##### 1. 构建及运行环境 + - 推荐使用镜像 [Dockerfile-ubuntu22.04-python3.11-ascend](/dockerfiles/Dockerfile-ubuntu22.04-python3.11-ascend) - 在 https://www.hiascend.com/developer/download/community/result?module=cann 注册账号后下载对应平台的 cann-toolkit、cann-kernels @@ -115,47 +168,111 @@ chmod +x Ascend-cann-kernels-910b_8.3.RC1.alpha001_linux-aarch64.run # cann-kernels for 910C (A3) chmod +x Atlas-A3-cann-kernels_8.3.RC1.alpha001_linux-aarch64.run ./Atlas-A3-cann-kernels_8.3.RC1.alpha001_linux-aarch64.run --install -# build +``` + +##### 2. 手动下载 FlagTree 依赖库 + +```shell mkdir -p ~/.flagtree/ascend; cd ~/.flagtree/ascend wget https://baai-cp-web.ks3-cn-beijing.ksyuncs.com/trans/llvm-a66376b0-ubuntu-aarch64-python311-compat_v0.3.0.tar.gz tar zxvf llvm-a66376b0-ubuntu-aarch64-python311-compat_v0.3.0.tar.gz -cd ${YOUR_CODE_DIR}/flagtree/python +``` + +##### 3. 源码构建命令 + +```shell +cd ${YOUR_CODE_DIR}/FlagTree/python git checkout -b triton_v3.2.x origin/triton_v3.2.x export FLAGTREE_BACKEND=ascend python3 -m pip install . --no-build-isolation -v ``` -#### HYGON(海光信息)[hcu](https://github.com/FlagTree/flagtree/tree/main/third_party/hcu/) +#### HYGON(海光信息)[hcu](https://github.com/flagos-ai/FlagTree/tree/main/third_party/hcu/) - 对应的 Triton 版本为 3.0,基于 x64 平台 + +##### 1. 构建及运行环境 + - 推荐使用镜像 [Dockerfile-ubuntu22.04-python3.10-hcu](/dockerfiles/Dockerfile-ubuntu22.04-python3.10-hcu) +##### 2. 手动下载 FlagTree 依赖库 + ```shell mkdir -p ~/.flagtree/hcu; cd ~/.flagtree/hcu wget https://baai-cp-web.ks3-cn-beijing.ksyuncs.com/trans/hcu-llvm20-df0864e-glibc2.35-glibcxx3.4.30-ubuntu-x86_64_v0.3.0.tar.gz tar zxvf hcu-llvm20-df0864e-glibc2.35-glibcxx3.4.30-ubuntu-x86_64_v0.3.0.tar.gz -cd ${YOUR_CODE_DIR}/flagtree/python +``` + +##### 3. 源码构建命令 + +```shell +cd ${YOUR_CODE_DIR}/FlagTree/python export FLAGTREE_BACKEND=hcu python3 -m pip install . --no-build-isolation -v ``` -#### Enflame(燧原)[enflame](https://github.com/FlagTree/flagtree/tree/triton_v3.3.x/third_party/enflame/) +#### Enflame(燧原)[enflame](https://github.com/flagos-ai/FlagTree/tree/triton_v3.3.x/third_party/enflame/) - 对应的 Triton 版本为 3.3,基于 x64 平台 + +##### 1. 构建及运行环境 + - 推荐使用镜像(2.4GB)https://baai-cp-web.ks3-cn-beijing.ksyuncs.com/trans/enflame-flagtree-0.3.1.tar.gz +##### 2. 手动下载 FlagTree 依赖库 + ```shell mkdir -p ~/.flagtree/enflame; cd ~/.flagtree/enflame wget https://baai-cp-web.ks3-cn-beijing.ksyuncs.com/trans/enflame-llvm21-d752c5b-gcc9-x64_v0.3.0.tar.gz tar zxvf enflame-llvm21-d752c5b-gcc9-x64_v0.3.0.tar.gz -cd ${YOUR_CODE_DIR}/flagtree/python +``` + +##### 3. 源码构建命令 + +```shell +cd ${YOUR_CODE_DIR}/FlagTree/python export FLAGTREE_BACKEND=enflame python3 -m pip install . --no-build-isolation -v ``` -#### NVIDIA [nvidia](/third_party/nvidia/) +#### sunrise(曦望芯科)[sunrise](https://github.com/flagos-ai/FlagTree/tree/triton_v3.4.x/third_party/sunrise/) + +- 对应的 Triton 版本为 3.4,基于 x64 平台 + +##### 1. 构建及运行环境 + +- 推荐使用 Ubuntu 22.04 + +##### 2. 手动下载 FlagTree 依赖库 + +```shell +mkdir -p ~/.flagtree/sunrise; cd ~/.flagtree/sunrise +wget https://baai-cp-web.ks3-cn-beijing.ksyuncs.com/trans/sunrise-llvm21-glibc2.39-glibcxx3.4.33-x86_64_v0.4.0.tar.gz +tar zxvf sunrise-llvm21-glibc2.39-glibcxx3.4.33-x86_64_v0.4.0.tar.gz +wget https://baai-cp-web.ks3-cn-beijing.ksyuncs.com/trans/sunriseTritonPlugin-cpython3.10-glibc2.39-glibcxx3.4.33-x86_64_v0.4.0.tar.gz +tar zxvf sunriseTritonPlugin-cpython3.10-glibc2.39-glibcxx3.4.33-x86_64_v0.4.0.tar.gz +``` + +##### 3. 源码构建命令 + +```shell +cd ${YOUR_CODE_DIR}/FlagTree +export TRITON_BUILD_WITH_CLANG_LLD=1 +export TRITON_OFFLINE_BUILD=1 +export TRITON_BUILD_PROTON=OFF +export FLAGTREE_BACKEND=sunrise +python3 -m pip install . --no-build-isolation -v +``` + +#### NVIDIA & AMD [nvidia](/third_party/nvidia/) & [amd](/third_party/amd/) -- 使用默认的构建命令,可以构建安装 nvidia、amd、triton_shared cpu 后端: +- 对应的 Triton 版本为 3.1/3.2/3.3/3.4/3.5,基于 x64/arm64 平台 + +##### 1. 构建及运行环境 + +- 推荐使用 Ubuntu 22.04 + +##### 2. 手动下载 LLVM 依赖包 ```shell cd ${YOUR_LLVM_DOWNLOAD_DIR} @@ -184,8 +301,10 @@ export LLVM_INCLUDE_DIRS=$LLVM_SYSPATH/include export LLVM_LIBRARY_DIR=$LLVM_SYSPATH/lib ``` +##### 3. 源码构建命令 + ```shell -cd ${YOUR_CODE_DIR}/flagtree +cd ${YOUR_CODE_DIR}/FlagTree cd python # For Triton 3.1, 3.2, 3.3, you need to enter the python directory to build git checkout main # For Triton 3.1 git checkout -b triton_v3.2.x origin/triton_v3.2.x # For Triton 3.2 @@ -203,7 +322,7 @@ unset LLVM_SYSPATH LLVM_INCLUDE_DIRS LLVM_LIBRARY_DIR 上文介绍了构建时 FlagTree 各后端可手动下载依赖包以避免受限于网络环境。但 Triton 构建时原本就带有一些依赖包,因此我们提供预下载包,可以手动安装至环境中,避免在构建时卡在自动下载阶段。 ```shell -cd ${YOUR_CODE_DIR}/flagtree/python +cd ${YOUR_CODE_DIR}/FlagTree/python sh README_offline_build.sh x86_64 # View readme # For Triton 3.1 (x64) wget https://baai-cp-web.ks3-cn-beijing.ksyuncs.com/trans/offline-build-pack-triton-3.1.x-linux-x64.zip