Adapting Trillion-Scale MoE Models Across Heterogeneous AI Chips: Technical Breakthroughs and Engineering Practices
As large language models scale to trillions of parameters, a single type of underlying hardware can no longer meet the diverse demands of large-scale inference deployment. This article examines the Day0 adaptation of a 284B-parameter MoE model—featuring 13B activated parameters and a 1M-token context window—across more than 8 mainstream AI chips, covering key technical challenges such as hybrid attention operator reconstruction, manifold-constrained hyper-connections, FP8 mixed-precision scheduling, and long-context memory management, as well as the outlook for adapting a 1.86T-parameter flagship model.
Adapting Trillion-Scale MoE Models Across Heterogeneous AI Chips: Technical Breakthroughs and Engineering Practices
As the parameter count of large AI models moves toward the trillion scale, a single type of underlying hardware can no longer satisfy the diverse requirements of large-scale inference deployment. Recently, the industry saw the release of a flagship model with 1.86 trillion parameters, alongside an efficient model with 284 billion parameters. Both of these “giant” models adopt the Mixture-of-Experts (MoE) architecture, posing severe challenges for underlying compute adaptation. An open-source technical community completed, on day one, the full adaptation and inference deployment of the efficient hundred-billion-parameter model across more than 8 mainstream AI chips—spanning both domestically developed and international mainstream chips. This Day0 adaptation achievement marks a substantive breakthrough in unified scheduling of heterogeneous compute. This article analyzes the core technical difficulties and engineering practices behind this adaptation effort.
1. Architectural Innovations and Inference Challenges of Trillion-Scale MoE Models
The efficient model adapted in this effort has a total of 284B parameters, but activates only 13B parameters during inference, while supporting a context length of up to 1 million tokens. While this design drastically reduces inference compute, it also introduces complex engineering challenges.
- Routing overhead in the Mixture-of-Experts (MoE) architecture: MoE uses a gating network to dynamically select which expert modules are activated, meaning data must be routed and communicated at high frequency between different expert nodes during inference. In heterogeneous chip environments, different chips differ in inter-chip interconnect bandwidth and communication protocols. Ensuring efficient routing and load balancing is the foremost challenge.
- Memory pressure from ultra-long context: A 1M-token context length causes the KV Cache to grow explosively. In multi-chip parallel scenarios, improper memory management can easily trigger OOM (Out of Memory) errors, severely degrading inference throughput.
2. Cross-Hardware Adaptation Strategies for Core Architectural Features
The model introduces several cutting-edge techniques at the architectural level. Efficiently mapping these algorithmic logics onto the instruction sets of different chips is at the heart of the Day0 adaptation.
2.1 Operator Reconstruction for the Hybrid Attention Mechanism
The model introduces a hybrid attention mechanism combining Compressed Sparse Attention (CSA) with Highly Compressed Attention (HCA). CSA reduces the computational complexity of the attention matrix through a sparsification strategy, while HCA further compresses features, substantially improving long-context processing efficiency.
In heterogeneous adaptation, these custom operators must be reconstructed for the underlying compute units of different AI chips. For chips that support Tensor Cores or matrix compute units, sparse indices need to be converted into hardware-friendly block-sparse formats. For chips lacking native sparse computation support, masked tensor computation combined with operator fusion must be used to simulate the behavior, thereby reducing memory access overhead.
2.2 Cross-Layer Optimization of Manifold-Constrained Hyper-Connections (mHC)
To enhance the stability of cross-layer signal propagation, the model introduces the manifold-constrained hyper-connection mechanism. These cross-layer connections introduce long-range data dependencies into the computation graph.
In engineering practice, cross-layer data transfer often faces the problem of excessive intermediate tensor memory usage. The adaptation team employed “inter-layer tensor reuse” and “operator pipeline overlapping” techniques to achieve stable cross-layer signal propagation without increasing peak memory. Meanwhile, to address inter-chip communication bottlenecks on certain chips, a bucketed transfer strategy for gradients/activations was adopted to ensure low latency for cross-node connections.
2.3 Inference Adaptation for the Muon Optimizer
The Muon optimizer is used during training to accelerate convergence and improve training stability. Although no weight updates occur during inference, the optimizer’s influence on weight distributions during training becomes apparent at inference time. During adaptation, it is necessary to ensure that the inference framework’s precision calibration logic is compatible with the weight distribution characteristics left by the Muon optimizer, avoiding activation overflow under low-precision quantization such as FP8.
3. Engineering Practices for Day0 Adaptation Across Heterogeneous Compute
Achieving unified adaptation across more than 8 AI chips relies on an efficient and scalable underlying system software stack. The key lies in building a unified compute abstraction layer and enabling efficient mixed-precision scheduling.
3.1 Unified Compute Abstraction Layer Design
To shield instruction-set differences across chip vendors, the adaptation framework adopts a unified intermediate representation (IR). Before the model’s computation graph is compiled into machine code, it is first transformed into a hardware-agnostic IR, which is then optimized by backend compilers provided by each chip vendor. The logic is illustrated below:
# Pseudocode: scheduling logic of the unified compute abstraction layerdef dispatch_inference(model_ir, input_tokens, hardware_backend):# 1. Load the hardware-agnostic model computation graphgraph = load_model_ir(model_ir)# 2. Perform graph optimization for the hardware backend (e.g., operator fusion, constant folding)optimized_graph = hardware_backend.optimize(graph)# 3. Memory and stream allocationmemory_plan = hardware_backend.allocate_memory(optimized_graph, max_seq_len=1000000)# 4. Execute inferenceoutput = hardware_backend.execute(optimized_graph, input_tokens, memory_plan)return output
With this architecture, integrating a new model only requires ensuring its correctness at the IR layer, greatly shortening the adaptation cycle.
3.2 Unified Scheduling of FP8 Mixed Precision
Among the chips adapted this time, some models natively support the FP8 data format. FP8 can halve memory usage and substantially boost compute throughput with almost no loss of accuracy.
In cross-chip scheduling, the framework implements adaptive precision management: for hardware supporting FP8, attention matrix computations and parts of the linear layers are automatically down-cast to FP8; for hardware supporting only FP16/BF16, the original precision is retained, and KV Cache quantization is used to alleviate memory pressure. Meanwhile, dynamic loss scaling prevents numerical overflow in low-precision computation.
3.3 Long-Context Memory Management and Scheduling
For the 1M-token context, the framework introduces the PagedAttention mechanism and its heterogeneous variants. The KV Cache is divided into fixed-size memory blocks allocated on demand. In heterogeneous clusters, when a single chip’s memory cannot hold the entire context, the framework automatically offloads inactive memory blocks to host memory or other nodes, swapping them in and out on demand via PCIe or high-speed interconnects—thereby breaking through single-card memory limits.
4. Outlook: Migrating from the Efficient Model to the Trillion-Parameter Model
Having completed full adaptation of the hundred-billion-parameter efficient model, the open-source community is actively advancing the multi-chip migration and adaptation of the 1.86-trillion-parameter flagship model. Compared with the efficient model, the trillion-parameter model involves far more complex sharding strategies for tensor parallelism (TP) and pipeline parallelism (PP).
Future adaptation work will focus on:
- Cross-node communication optimization: At the trillion-parameter scale, All-to-All communication overhead becomes a bottleneck, requiring topology-aware communication scheduling algorithms.
- Hybrid strategies combining expert parallelism and data parallelism: In heterogeneous compute clusters, dynamically adjusting expert distribution based on each node’s compute-to-bandwidth ratio.
5. Conclusion
Day0 adaptation across heterogeneous AI chips is not only a victory in systems engineering, but also a critical step toward breaking down compute silos and fostering a thriving large-model ecosystem. By deeply understanding the core architectural innovations of trillion-scale MoE models—and combining unified compute abstraction, mixed-precision scheduling, and fine-grained memory management—developers can efficiently deploy frontier large models across all kinds of hardware. As adaptation work on trillion-parameter models progresses, heterogeneous compute scheduling technology will see even broader application prospects.
