How Custom AI Chips Serve Large Language Models: Architecture, Co-Design, and Deployment
Custom AI chips for large language models must be designed around workload characteristics, numerical precision, memory access, communication, and the software stack. This article explains how chip architecture maps to Transformer workloads, how compiler and runtime optimization unlock hardware performance, how to benchmark training and inference fairly, and how to deploy custom accelerators reliably in cloud-native environments. All figures are illustrative; production decisions should be based on measured results.
1. Why Large Language Models Need Specialized Chips
The answer to how a custom AI chip serves large language models depends on the workload, precision strategy, and software stack. Model computation can generally be divided into training and inference, each with different bottlenecks.
Training is dominated by large matrix multiplications, while also requiring backpropagation and gradient synchronization. It therefore places high demands on floating-point performance and inter-device communication.
Inference has two distinct phases:
- Prefill processes the entire input sequence at once and is generally compute-intensive.
- Decode generates one token at a time. It repeatedly reads model weights and the KV cache, making it more memory-access-intensive.
KV cache capacity can be estimated as:
KV cache size ≈ 2 × number of layers × number of KV heads × head dimension× sequence length × batch size × bytes per element
For example, with 32 layers, 8 KV heads, a head dimension of 128, a sequence length of 4,096, a batch size of 16, and 2 bytes per element in FP16:
2 × 32 × 8 × 128 × 4,096 × 16 × 2 bytes ≈ 8.6 GB
This value grows linearly as the sequence length or batch size increases. Memory capacity and bandwidth can therefore become limiting factors quickly.
General-purpose processors reserve substantial area for control logic and multi-level caches that support a wide range of workloads. These resources contribute less to specialized matrix operations. A custom design can allocate more area to matrix-processing units and on-chip memory. The trade-off is that the ecosystem, compiler, and software stack require significant long-term investment.
Whether custom silicon is worthwhile depends on how stable the target workloads are and whether the organization can maintain the complete software stack over time.
2. Key Architectural Trade-Offs
The following table summarizes several common design choices and their trade-offs.
| Design dimension | Common approach | Main benefit | Main cost |
|---|---|---|---|
| Compute precision | FP8, BF16, FP16, and other low-precision formats | Reduces memory usage and bandwidth requirements | Requires validation of training convergence and inference accuracy |
| Accumulation precision | Low-precision multiplication with FP32 accumulation | Reduces accumulation error | Increases accumulator area and power consumption |
| On-chip memory | Larger SRAM for caching weights and intermediate results | Reduces external-memory traffic | Increases chip area and cost |
| Interconnect | High-speed point-to-point links with scalable topologies | Reduces cross-device communication latency | Increases routing complexity, power, and thermal pressure |
2.1 Low-Precision Computation
Low-precision formats allow more parameters to fit into the same memory capacity and can increase throughput per cycle. However, the claim of “no loss of accuracy” is valid only for specific models and training configurations.
When FP8 is used for training, scale-factor management is generally required, along with monitoring for overflow and underflow. A common approach is to use low-precision multiplication with FP32 accumulation. The exact implementation should follow the chip vendor’s documentation.
2.2 Tiled Computation and On-Chip Caching
In attention computation, the Q, K, and V matrices can be divided into smaller tiles and processed incrementally. Intermediate results can remain on-chip, reducing writes to and reads from external memory.
This tiling approach is already well established in the industry. Whether a particular chip benefits from it depends on whether its on-chip memory can hold the tiled data.
For example, a tile containing 128 Query rows with a head dimension of 128 in FP16 requires approximately:
128 × 128 × 2 = 32 KB
Adding K, V, and output tiles increases the required capacity substantially. If the on-chip SRAM is too small, the tile size must be reduced. This increases external-memory traffic and may reduce bandwidth efficiency.
As a result, the improvement in bandwidth utilization depends on SRAM capacity, tiling strategy, and compiler scheduling. It cannot be inferred from a single hardware specification.
2.3 Interconnects and Scaling Efficiency
Multi-device training scaling efficiency can be calculated as follows:
Scaling efficiency = measured total throughput ÷ (single-device throughput × device count)
If eight devices achieve 7.2 times the throughput of one device, the scaling efficiency is 90%.
A value closer to 100% indicates lower communication overhead, but the result varies with the parallelism strategy, the ratio of communication to computation, and the network topology.
Tensor parallelism communicates frequently and is highly sensitive to interconnect bandwidth and latency. Pipeline parallelism generally transfers less data but introduces pipeline bubbles. Only measurements from the actual configuration provide meaningful results.
Cache coherence can help with certain communication patterns, but it is not required for every workload. Whether to enable it should depend on the actual shared-data access pattern.
3. Hardware–Software Co-Design
The theoretical peak performance of a chip is only an upper bound. Real performance depends on whether the software stack can map the computation graph efficiently to the hardware.
3.1 Compiler Operator Fusion
A framework-generated computation graph often contains many small operators. Each operator may trigger a separate kernel launch and write intermediate results to memory before reading them again.
A compiler can identify adjacent operators that can be fused. Examples include combining LayerNorm with a following element-wise operation or merging matrix multiplication with an activation function into a single hardware instruction sequence.
Fusion must be measured rather than assumed to be beneficial. A recommended process is:
- Fix the model, input length, batch size, and precision.
- Run the workload before and after fusion. Use profiling tools to record kernel count, memory-read and memory-write bytes, and total kernel-launch time.
- Repeat each experiment multiple times, report the median, and record variance.
- Compare end-to-end throughput and latency to confirm that fusion improves overall execution rather than only reducing the time of one operator.
3.2 Runtime Memory Management
Variable-length inputs make KV cache allocation more complex. If every request receives a contiguous region sized for the maximum possible sequence length, memory utilization can be poor.
Paged memory management is a common solution. The runtime divides the KV cache into fixed-size pages, such as pages containing 16 tokens, and allocates or reclaims them on demand.
This mechanism also introduces additional monitoring requirements. Recommended metrics include:
- The ratio of allocated pages to tokens actually in use, which indicates internal fragmentation.
- The number of requests waiting for allocation, which shows whether memory is limiting concurrency.
- Page reclamation speed, which indicates whether memory is released promptly after long requests finish.
3.3 Operator Coverage and Fallbacks
If a chip does not support an operator, the framework may fall back to a general-purpose processor. Such fallbacks introduce additional data-transfer and synchronization overhead and can make the workload much slower than expected.
Before production deployment, list every operator in the model and verify its support status on the target chip. Also measure the number of fallback operations. If fallbacks remain, they should be addressed before performance optimization proceeds.
4. Benchmarking Methodology
Performance figures are easy to misinterpret. When comparing different solutions, keep the following conditions consistent:
- The model architecture, parameter count, sequence length, batch size, and precision must be identical.
- The baseline should use the same number of devices as the proposed solution, with the same framework and driver versions.
- For training, report tokens processed per second and model FLOPs utilization (MFU). MFU is the actual model floating-point operation rate divided by the hardware peak compute rate.
- For inference, report time to first token (TTFT), time per output token (TPOT), and end-to-end throughput. These metrics should be reported together; throughput alone may conceal worsening latency.
- Warm up the system before testing, repeat each test multiple times, and report the median and variation range.
- Peak compute is not the same as effective throughput. Decisions should be based on measurements from the complete workflow.
5. Deployment in Cloud-Native Environments
The following example describes a general deployment pattern for a custom accelerator in a container cluster.
5.1 Exposing and Scheduling Device Resources
Kubernetes uses the device plugin mechanism to register physical accelerators as extended resources. The resource name is defined by the chip vendor; the example below uses a fictional name.
apiVersion: v1kind: Podmetadata:name: llm-training-worker-0spec:nodeSelector:example.com/ai-chip: "true"containers:- name: trainerimage: example-llm-framework:1.0resources:limits:vendor.example.com/ai-chip: 8memory: "512Gi"cpu: "64"requests:memory: "512Gi"cpu: "64"env:- name: WORKER_INDEXvalue: "0"- name: WORLD_SIZEvalue: "64"
Important considerations include:
- Extended resources must be declared under
limits. If they are also declared underrequests, the two values must be identical. - The device plugin version must be compatible with the driver and runtime versions installed on the node. Version mismatches can prevent devices from being discovered or cause runtime failures.
- Communication-intensive Pods should preferably be scheduled on nodes connected to the same switch. This can be implemented with node labels,
nodeSelector, or affinity rules. Cluster administrators must maintain the meaning of these labels on the nodes.
5.2 Data Loading and Storage
Training data is often stored in object storage. If data loading is too slow, accelerators remain idle. A practical design process is:
- Estimate the data consumption rate per device. Suppose each device processes 3,000 tokens per second and each token is stored as a 4-byte integer. The raw requirement is approximately 12 KB/s per device. However, decoding, decompression, and online augmentation can make the actual requirement much higher, so it must be measured.
- Determine the number of parallel shards and reader threads based on the total bandwidth requirement.
- Use prefetching so that the next batch starts loading while the current batch is being processed.
- Use shared memory to pass data between processes on the same node and reduce duplicate copies.
- Monitor the proportion of each step spent waiting for data. A persistently high ratio indicates a data-path bottleneck.
5.3 Fault Recovery and Checkpoints
During long-running training at large scale, hardware failures are normal rather than exceptional. Checkpoint frequency requires a balance between checkpoint overhead and the amount of work lost after a failure.
The Young/Daly formula provides an approximate optimal interval:
Optimal interval ≈ √(2 × checkpoint duration × mean time between failures)
If a checkpoint takes 120 seconds and the mean time between failures is six hours, or 21,600 seconds:
√(2 × 120 × 21,600) ≈ 2,277 seconds
This is approximately 38 minutes. It is only a starting point; the actual interval should be adjusted using cluster failure statistics and storage-write performance.
Recovery objectives can be divided into two metrics:
- RPO (Recovery Point Objective): the maximum amount of training progress that can be lost, primarily determined by the checkpoint interval.
- RTO (Recovery Time Objective): the time from failure detection to resumed training, including failure detection, scheduling replacement nodes, loading the checkpoint, and warming up the workload again.
Both metrics should be validated through operational drills. Periodically simulate node failures, record the duration of each stage, and compare the results with the targets. If the drill results fall short, reducing checkpoint loading time should be a priority because it is often the largest part of the RTO.
5.4 Common Troubleshooting Steps
After deployment, investigate issues in the following order:
- Device is not visible: Check whether the device plugin is running, the driver is loaded, and the node is reporting the correct resource count.
- Pod remains Pending: Check whether the resource request exceeds node capacity and whether the
nodeSelectormatches available nodes. - Multi-device communication times out: Check the network topology, link status, and communication-library configuration. Confirm that all nodes use compatible versions.
- Throughput suddenly drops: Check for operators falling back to a general-purpose processor and determine whether data-loading wait time has increased.
- Out of memory: Inspect KV cache page allocation and verify that batch size and sequence length are within the expected limits.
6. Conclusion
The value of a custom AI chip depends on whether it can deliver stable, verifiable throughput and latency under real workloads.
At the architectural level, low-precision computation, tiled caching, and high-speed interconnects are common directions, but each introduces trade-offs. At the software level, compiler operator fusion, paged runtime memory management, and complete operator coverage determine how much of the hardware’s potential can be realized. At deployment time, device scheduling, data loading, and checkpoint strategy determine whether the cluster can operate reliably over the long term.
For developers and platform teams, the most useful approach is to standardize benchmark conditions, report complete latency and throughput metrics, and validate recovery capabilities through failure drills. Only then can performance figures from different solutions be compared meaningfully.
