How a Unified Software Stack Enables Rapid LLM Adaptation on Domestic AI Chips

    This article explains the "adaptation gap" between large language models and AI chips, and how a unified software stack—spanning operator libraries, compilers, and communication libraries—enables "day-zero" model adaptation across heterogeneous hardware. It covers three key engineering breakthroughs: full operator coverage across chips, decoupling parallelism from hardware topology, and unified mixed-precision paths, along with practical implications for developers.

    1. The Root Cause: The “Adaptation Gap” Between Models and Chips

    Over the past few years, a typical pattern has emerged in the domestic LLM ecosystem: whenever a new model is released, chip vendors often need weeks or even months to complete adaptation and optimization. The technical reasons behind this time lag are worth a closer look.

    Training and inference of large models fundamentally boil down to executing massive combinations of low-level operators. The problems are:

    1. Inconsistent operator interfaces. Different chip software stacks each define their own operator interfaces and programming models. Running the same model on different hardware requires separately implementing customized versions of operators such as attention computation, normalization, and activation functions.
    2. Inconsistent precision paths. Mainstream model training widely adopts mixed-precision strategies (e.g., combining FP8 with higher-precision formats), while some chips natively support different precision formats in their compute units, requiring extra precision conversion and numerical compensation logic.
    3. Parallelism constrained by hardware topology. Large-scale inference commonly uses tensor parallelism to shard model weights, but certain parallelism implementations are tightly coupled to the number of GPUs per node. Scaling across nodes or across chip clusters requires redesigning the sharding strategy.

    These three factors compound, turning every model release into repeated labor: each chip vendor rewrites code from scratch, consuming enormous manpower while delivering inconsistent adaptation quality.

    2. The Solution: Abstracting the “Common Layer” for Unification

    The core idea explored by the industry is to build a unified intermediate software layer between models and hardware, consolidating previously fragmented implementations into one common codebase. This mirrors the classic “write once, run anywhere” philosophy—just pushed down to the operator and compiler level.

    A typical LLM software stack can be abstracted into four layers:

    1. ┌─────────────────────────────┐
    2. │ Model layer (training/inference frameworks) │
    3. ├─────────────────────────────┤
    4. │ Unified operator library (cross-hardware) │
    5. ├─────────────────────────────┤
    6. │ Compiler + communication library │
    7. ├─────────────────────────────┤
    8. │ Various chip hardware (heterogeneous backends)│
    9. └─────────────────────────────┘

    The value of the unified layer shows up in three areas:

    • Unified operators: A cross-platform operator library covers the full operator needs of common models. When a new model is released, there’s no need to write operators for each piece of hardware—the common implementation works out of the box. Open-source solutions already exist that support automatic operator dispatch and execution across multiple chip backends.
    • Unified compiler: Through intermediate representations (IR) and auto-tuning mechanisms, high-level computation graphs are translated into efficient instructions for different hardware, shielding developers from low-level differences.
    • Unified communication library: A consistent interface for collective communication (AllReduce, AllGather, etc.) frees parallelism strategies from being bound to specific hardware interconnects.

    As a result, new models can achieve basic adaptation on multiple chips on release day—so-called “day-zero adaptation”—which mechanismically solves the “from zero to ten” problem.

    3. Three Engineering Breakthroughs Worth Noting

    Based on recent public technical progress, three key breakthroughs stand out in the real-world deployment of unified software stacks:

    3.1 Full Operator Coverage Across Chips

    True cross-chip capability doesn’t mean demoing a few high-frequency operators—it means covering all operators a model needs at runtime. This demands high backend coverage in the operator library: mainstream chips take the native high-performance path, while uncovered parts automatically fall back to generic implementations, following a “make it run first, then optimize” strategy. This layered approach dramatically shortens the pre-adaptation cycle.

    3.2 Decoupling Parallelism from Hardware Topology

    In traditional implementations, tensor parallelism is often limited by the number of GPUs per node (e.g., at most eight per group). The new approach designs independent parallelism strategies for specific attention grouping structures (such as grouped-query architectures), decoupling computation sharding from physical topology. This allows models to scale flexibly across nodes and chip clusters—particularly important for building large-scale clusters on domestic chips, where cluster sizes and interconnects often differ from standard configurations.

    3.3 Opening Up the Precision Path

    Chips vary widely in their support for low-precision formats (e.g., FP8, FP4). By implementing conversion between mixed precision and higher-precision formats (e.g., BF16) with numerical stabilization in the unified layer, chips that don’t natively support a given low-precision format can still run models designed for it. The conversion involves trade-offs between precision loss and compute overhead, typically handled with general numerical techniques such as loss compensation and dynamic scaling.

    4. A Rational View: Adaptation Done ≠ Optimal Performance

    It must be emphasized that “running” is only the first step. Achieving optimal training throughput or inference latency on a specific chip still requires each vendor to perform deep operator fusion, memory scheduling, and kernel-level optimization tailored to their hardware. The unified software stack solves the usability and adaptation efficiency problem—not the ultimate performance problem.

    To use an analogy: the unified stack paves the road “from zero to ten.” Each vendor’s remaining journey “from ten to one hundred” is acceleration on an already-built road—far less difficult and costly than starting from scratch.

    5. Implications for Developers

    For developers doing engineering work in the LLM space, this trend delivers three practical benefits:

    1. Greater freedom in hardware selection: Once models are decoupled from hardware, workloads can be validated across more chip options without being locked into a single ecosystem.
    2. Lower migration costs: Development based on unified operator interfaces significantly reduces code changes when switching hardware backends.
    3. A clearer optimization path: Guarantee correctness at the common layer first, then tune performance for the target hardware—making the engineering cadence far more controllable.

    From a broader perspective, building a “common intermediate layer” for hardware-software co-design is an unavoidable step toward a mature compute ecosystem. Only when adaptation moves from “manual workshops” to “standardized pipelines” can model innovation and compute supply form a truly positive feedback loop.