FlagTree
FlagTree (the Triton fork) is the default compiler in runtime and app images. It is built from source into per-backend wheels, rather than installed from a vendor’s wheel.
Why source-built
The vendor wheels carry defects a source build closes:
- Old glibc links — MetaX’s was built on Ubuntu 24.04 and linked
libtriton.soagainstGLIBC_2.38/GLIBCXX_3.4.32, which abort on 22.04 nodes beforemain(). - Debug bloat — the current MetaX wheel ships 793.7 MB of
libtriton.sodebug sections against ~218 MB for the release build here. - No provenance — vendor wheels carry no
Source-Commit.
A source build also gives an A/B baseline against the vendor’s wheel.
Build shape
Each backend has its own Containerfile beside packaging/flagtree/backends.yaml
(13 backends). The build splits into two stages:
--target builder— everything that does not depend on the FlagTree ref: the apt toolchain, the interpreter, and the prebuilt LLVM/plugin/triton toolkits staged into FlagTree’s offline cache. This stage is published, so a warm build only pays for the clone and the compile.- default target — clones the ref and compiles on top of the published stage.
Eleven backends start from a bare ubuntu:22.04 (old glibc, so libtriton.so
loads on 22.04 nodes); the ascend pair starts from its own runtime image because
the Ascend build needs CANN on the build machine.
Two hard gates back the “reproducible” claim: an objdump gate fails the build on
any 22.04-incompatible symbol, and the smoke test requires the Source-Commit
metadata carrier.
Daily line
A daily workflow publishes one wheel per day per backend, as a separate
distribution per backend (flagtree-nvidia, flagtree-metax, …). The version
is <version_base>.dev<UTC date>, placed in the public segment so a plain
pip install flagtree keeps resolving to the release while “newest daily” is a
plain version comparison.
The commit a daily was built from is in its metadata
(Project-URL: Source-Commit), never the filename.
Full rationale
- packaging/flagtree/DESIGN.md — the decisions, maintainer-facing.
- packaging/flagtree/README.md — how to run each builder, per-backend.
- packaging/flagtree/backends.yaml — the build-line facts.
Last updated 02 Nov 2026, 07:43 +0800.