FlagTree  by flagos-ai

Unified AI compiler for diverse hardware backends

Created 1 year ago
275 stars

Top 94.0% on SourcePulse

GitHubView on GitHub
Project Summary

FlagTree provides a unified compiler for multiple AI chip backends, forking from Triton-Lang to address AI hardware fragmentation. It targets developers and chip manufacturers seeking a "develop once, run anywhere" workflow across diverse accelerators, aiming to unlock hardware performance and reduce the cost of porting and maintaining AI workloads. The project fosters an open ecosystem by unifying model, system, and chip layers.

How It Works

FlagTree extends Triton with a unified compilation approach for various AI accelerators. It achieves multi-backend support by maintaining distinct branches for different Triton versions and hardware vendors, enabling compatibility and rapid implementation of single-repository multi-backend solutions. This layered extension, known as TLE (Triton Language Extensions), offers progressive abstraction from portable usage to hardware-oriented tuning (Lite/Struct/Raw), improving coverage for multi-device and backend-specific scenarios.

Quick Start & Requirements

Installation can be performed from source or via pre-built wheels.

  • From Source: Requires apt update; apt install zlib1g zlib1g-dev libxml2 libxml2-dev. General procedure involves setting FLAGTREE_BACKEND and running python3 -m pip install . --no-build-isolation -v.
  • Pre-built Wheels: Requires PyTorch installation first. Commands like python3.12 -m pip install flagtree===0.5.0 $RES --index-url=https://resource.flagos.net/repository/flagos-pypi-hosted/simple are used, with specific Python, GLIBC, and CXXABI version requirements detailed per backend.
  • Documentation: Links to TLE Wiki and TLE-Raw Wiki are available for detailed design and APIs.

Highlighted Details

  • Supports numerous AI chip backends including NVIDIA, AMD, Intel CPUs, Huawei Ascend, Moore Threads, Cambricon, and others, integrated with various Triton versions (3.0-3.6).
  • Triton Language Extensions (TLE) provide progressive abstraction (Lite/Struct/Raw) for hardware-specific tuning and distributed execution control.
  • Claims performance improvements on real-world models (e.g., mm operator in Qwen) without modifying Triton operator code.
  • Active development with frequent updates integrating new backends and upgrading Triton versions, as evidenced by the "Latest News" section.

Maintenance & Community

The project appears actively maintained, with recent updates (May 2026) showing continuous integration of new backends and Triton version upgrades. Specific community links (Discord/Slack) or notable contributors are not detailed in the provided README.

Licensing & Compatibility

FlagTree is licensed under the MIT license, which is permissive and generally compatible with commercial use and closed-source linking.

Limitations & Caveats

The project is described as being in its "initial phase." While aiming for broad compatibility, the multi-backend approach necessitates careful management of specific Triton versions and associated dependencies (GLIBC, CXXABI) when using pre-built wheels, potentially leading to environment compatibility challenges if not managed precisely.

Health Check
Last Commit

10 hours ago

Responsiveness

Inactive

Pull Requests (30d)
60
Issues (30d)
4
Star History
27 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.