Multi-Chip Adaptation for Large Language Models: Technical Approaches and Practical Lessons
This article explains how a unified open-source software stack enabled a newly released large language model to run on several AI chip families on launch day. It covers the operator library, a flexible tensor parallelism strategy for low-memory devices, the conversion from FP4/FP8 weights to FP8/BF16, and the deployment workflow. It also lists practical lessons for developers and enterprises deploying models across mixed hardware.
1. Background: Compute Fragmentation Slows Large Model Deployment
Open-source large language models keep growing in parameter count and capability. The range runs from dense models with hundreds of billions of parameters to mixture-of-experts models with trillions of parameters. Stronger models require much more capable inference hardware.
In practice, the compute supply is fragmented:
- Diverse hardware architectures: General-purpose GPUs, dedicated accelerators, and reconfigurable computing architectures coexist. Their instruction sets, memory hierarchies, and communication topologies differ significantly.
- Scarce high-end resources: Accelerators that support the latest low-precision formats, such as FP4, and very large memory capacity are limited in supply and expensive. They cannot easily meet large-scale deployment demand.
- Fragmented software stacks: Each chip vendor typically provides its own drivers, compilers, and runtimes. Porting a model often requires rewriting operators and scheduling logic for each chip, which lengthens adaptation cycles and increases maintenance costs.
Given these constraints, the industry widely seeks a unified open-source software stack that supports “develop once, run on many chips.” A team recently released a new generation of open-source large models. On the release day, the team used a unified system software stack to support several mainstream AI chips, including general-purpose GPUs, domestic accelerator cards in China, and reconfigurable architecture chips. This adaptation offers a useful case study for multi-chip deployment.
2. Key Architectural Features of the Target Model
Before examining the adaptation challenges, it helps to understand the model’s technical features. The model series includes two sizes. The largest version has trillion-scale parameters and targets maximum capability. The lighter version has hundreds of billions of parameters and targets efficient inference. The architecture includes several notable features:
1. Hybrid attention mechanism. The model uses a hybrid attention design. In ultra-long context scenarios, with contexts reaching millions of tokens, it requires about 27% of the inference compute and 10% of the KV cache footprint of a conventional approach. This places new demands on the inference engine’s memory management. Allocating, reclaiming, and moving KV cache across chips all need targeted optimization.
2. Cross-layer signal enhancement. The model uses manifold-constrained hyper-connections to strengthen signal propagation across layers. As a result, the inference graph is no longer a simple sequential stack of layers. The adaptation framework must correctly handle these non-standard data flow dependencies.
3. Two-stage post-training paradigm. The model first trains domain experts through supervised fine-tuning combined with reinforcement learning. It then merges them through on-policy distillation. As a result, the model weights contain multiple components, and the deployment must fully support the inference logic of all of them.
3. Three Key Technical Breakthroughs for Multi-Chip Adaptation
1. Full Operator Replacement: Using a Unified Operator Library to Hide Chip Differences
Operators are the first barrier to large model inference. The original model’s inference implementation typically relies on a specific vendor’s operator library. Running it directly on other chips leads to many missing or incompatible operators.
The core approach in this adaptation is to replace all original operators with a unified, high-performance operator library. The library writes operator logic in a high-level language, such as a Python-like DSL. Each chip’s backend compiler then generates an efficient implementation for that chip. This approach offers the following benefits:
- Development efficiency: Operator logic is written once. Supporting a new chip requires completing only that chip’s compiler backend, not rewriting each operator.
- Consistent semantics: The same operator definition behaves identically on every chip. This avoids maintaining a separate model version for each chip.
- Reuse of the ecosystem: Common large model operators, including attention, normalization, activation functions, and quantization and dequantization, already have mature implementations. The cost of replacing them is manageable.
2. Independent Tensor Parallelism Strategy: Enabling Low-Memory Deployment
Large model inference typically uses tensor parallelism to split weights across multiple cards. However, memory capacity varies widely across chips. For models with hundreds of billions of parameters, some domestic chips have much less memory per card than high-end accelerators. A standard parallelism strategy can cause out-of-memory errors on these chips.
To address this, the adaptation team designed an independent tensor parallelism strategy for the model’s grouped inference structure (o-group). The strategy adjusts the split granularity based on the memory limit of the actual hardware. This makes deployment possible on low-memory devices. It reflects a general principle of multi-chip adaptation: parallelism strategy should not be a fixed configuration baked into the model. It should be a deployment parameter that can be tuned for the hardware.
3. Precision Path Conversion: Removing the Dependency on FP4
The new model natively uses mixed FP4 and FP8 precision for training and storage. However, most AI chips deployed at scale in China do not support the FP4 format. Internationally, only the latest generation of high-end chips supports it.
The solution converts the native FP4 and FP8 weights into an FP8 or BF16 precision path. During deployment, the weights are converted into a numerical format that the target chip supports. Dequantization operators preserve computational accuracy. This conversion allows the model to run on mainstream chips that support only FP8, or even only BF16. It significantly expands the range of hardware that can run the model.
# Pseudocode for the general weight conversion workflowdef convert_weights(state_dict, target_dtype="bfloat16"):for name, tensor in state_dict.items():if is_fp4(tensor):# FP4 -> FP8: first dequantize into a higher-precision intermediate representationfp8_tensor = dequantize_fp4(tensor).to(torch.float8_e4m3)else:fp8_tensor = tensor.to(torch.float8_e4m3)state_dict[name] = fp8_tensor.to(target_dtype)return state_dict
4. Access and Deployment: A Ready-to-Use Practical Path
The unified software stack provides a ready-to-use deployment option. A typical workflow includes these steps:
- Environment setup: Install the unified software stack and the corresponding chip backend in the target chip environment. A container image usually makes this quick.
- Model acquisition: Download the multi-chip model weights and configuration files from the open-source community. The weights have already been converted to the target precision path.
- Inference deployment: Start the service through the unified inference interface. Choose the parallelism strategy and quantization configuration based on the hardware.
- Validation and tuning: Run a standard evaluation set to verify output consistency. Then tune the parallelism degree and batch parameters for throughput and latency.
# Illustrative deployment commands based on the unified software stackpip install flagscale-inferpython -m flagscale.infer \--model-path ./model-v4-flash \--backend auto \--tp-size 4 \--max-context-len 1000000
5. Takeaways for Developers and Enterprises
This multi-chip adaptation offers three lessons for the industry:
- A unified software stack is a key lever for overcoming compute fragmentation. An operator abstraction layer reduces the cost of adapting a new model to a new chip from weeks to days. In some cases, it enables Day-0 support.
- Precision flexibility determines hardware coverage. Model design should consider compatibility with multiple numerical formats from the start. Tying a model to the newest hardware features limits where it can run.
- Parallelism should be decoupled from hardware. A configurable parallelism scheme lets the same model perform reasonably on both high-end and mainstream devices.
Enterprises planning to build their own inference services should first evaluate deployment options based on a unified open-source software stack. This approach offers better portability and easier long-term maintenance across diverse compute environments. Making diverse AI compute usable and practical depends on systematic engineering work of this kind.
