[KUNLUNXIN] Xpu/triton 3.6 migration (#800)
[XPU] Add backend-owned source overrides
[XPU] Align the vendored frontend with Triton 3.6
[XPU] Sync dialect and analysis with Triton 3.6
[XPU] Update LLVM lowering for Triton 3.6
[XPU] Update SDNN objects to v0.3.6.4.0
[XPU] Fix size-one make range lowering
[BUILD] Avoid duplicate backend spec objects
[XPU] Fix Triton 3.6 frontend compatibility
[XPU] Complete Triton 3.6 compatibility fixes
[DOC] Record XPU Triton 3.6 validation
[XPU] Fix packaged launcher library path
[XPU] Fall back from invalid AABS configs
[XPU] Align reduction scratch offset reuse
[DOC] Update XPU Triton 3.6 validation
[XPU] Apply yapf formatting to compat test
[XPU] Handle non-power-of-two constancy
[XPU] Move constancy fallback to backend overlay
Keep the shared elementwise lowering assertion intact and apply the non-power-of-two fallback through the XPU spec header overlay. Record the vendored override and add a focused compatibility test.
[Enflame] Keep constancy fallback in backend overlay
[CI] Preserve Enflame GCU400 unit-test diagnostics
[CI] Trigger Enflame diagnostics on backend change
[CI] Allow manual Enflame diagnostic runs
[CI] Remove temporary Enflame diagnostics
Revert “[Enflame] Keep constancy fallback in backend overlay”
This reverts commit 5896057cb141067ee1a46ee5285f7317bb143a73.
- [XPU] Move source overrides to backend CMake
Co-authored-by: dongjibin1996 dongjibin1996@users.noreply.github.com
版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9
京公网安备 11010802047560号
FlagTree 是 FlagOS 的一部分。 FlagOS 是一个面向多元AI芯片的开源、统一系统软件栈,旨在打通模型、系统与芯片层,培育开放协作的生态系统。 它支持 “一次开发,多芯运行” 的工作流,兼容多样化的 AI 加速芯片。 它释放硬件性能潜力,消除各类 AI 芯片专用软件栈之间的碎片化问题,并大幅降低大模型在多种 AI 硬件移植与维护的成本。
FlagTree 是面向多种 AI 芯片的开源、统一编译器。 FlagTree 致力于打造多元 AI 芯片编译器及相关工具平台,发展和壮大 Triton 上下游生态。 项目当前处于初期,目标是兼容现有适配方案,统一代码仓库,快速实现单仓库多后端支持。 对于上游模型用户,提供多后端的统一编译能力; 对于下游芯片厂商,提供 Triton 生态接入范例。
多后端支持
各后端基于不同版本的 Triton 适配,因此位于不同的主干分支。 各主干分支均为保护分支且地位相等,表格中所有后端均搭建了 CI/CD Runner。 有些后端适配了多个 Triton 版本,表格中仅展示最新版本。
NVIDIA TileIR
AMD
Enflame(燧原)
HYGON(海光信息)
Moore Threads(摩尔线程)
DAMO ACADEMY(阿里达摩院)
Huixi(辉羲智能)
MetaX(沐曦股份)
Sunrise(曦望芯科)
KLX
ILUVATAR(天数智芯)
tileir
amd
enflame
hcu
mthreads
damoacademy
rpu
metax
sunrise
xpu
iluvatar
install tileir
-
install enflame
install hcu
install mthreads
-
install rpu
install metax
install sunrise
install xpu
install iluvatar
Tsingmicro(清微智能)
ARM64 cpu
x86_64 cpu
tsingmicro
cpu
triton-shared
install tsingmicro
install cpu
-
FlagTree 的扩展组件当前在部分后端可用:
enflame
TLE-Struct GPU
TLE-Raw
HINTS
sunrise
hcu
iluvatar
TLE-Struct GPU
FLIR
HINTS
TLE-Struct DSA
FLIR
HINTS
TLE(Triton Language Extensions)简介
如果要在 nvidia 后端使用 TLE 语言扩展,请使用 main 分支。 其他后端的 TLE 支持分支详见上面的表格。
Triton 在算子开发效率方面表现突出,但在多元 AI 芯片适配和更深层性能调优场景下,往往需要对分布式执行、内存访问模式和硬件相关原语提供更显式的控制。 TLE 以分层方式扩展 Triton,在保持现有 Triton 工作流兼容性的同时补齐这部分能力。
TLE 的主要优势包括:
Lite/Struct/Raw)。详细设计、API 与示例请参考 TLE Wiki 和 TLE-Raw Wiki。
性能改进
无需修改任何 Triton 算子代码,FlagTree 可在实际模型中的某些形状上获得性能增益。 下面以 Qwen 模型中调用的一些形状下的 mm 算子为例,展示 FlagTree 在不同芯片上的性能增益。
新特性
环境准备
避免环境匹配问题的最佳实践是使用 用户手册 中推荐的镜像。
从源码安装
安装依赖(注意使用正确的 python3.x 执行):
通用的构建安装方式(网络畅通环境下推荐使用):
安装
flagtree后,可通过下列命令查看:免源码安装
参见 用户手册。
关于贡献
欢迎参与 FlagTree 的开发并贡献代码,详情参见 CONTRIBUTING.md。
许可证
FlagTree 使用 MIT license。