Computing Architecture Evolution and Heterogeneous NPU Adaptation Practices in the AI Era
The rapid development of large-scale AI models has driven exponential growth in demand for computing power, exposing the limitations of traditional CPU-centric architectures. This article explores the evolution of AI-era computing architectures, focusing on core elements such as compute-in-memory, high-speed interconnects, and native heterogeneous scheduling. It further delves into the challenges of adapting deep learning frameworks to dedicated NPUs, highlighting best practices for developers, including framework integration and performance optimization techniques like automatic mixed precision. Finally, it discusses the role of cloud platforms in supporting heterogeneous computing ecosystems and provides an outlook on the future of AI infrastructure.
Introduction: The Thirst for Computing Power in the Era of Large AI Models
As AI technology advances, especially with the emergence of ultra-large pre-trained models, global computing power demand is growing exponentially. Traditional CPU-centric architectures face bottlenecks such as the “memory wall,” I/O bandwidth limits, and poor cluster scalability when training and inferring hundred-billion to trillion-parameter models. To break these physical and architectural constraints, the industry is continuously exploring new computing architectures for the AI era. Recently, a tech company announced a new computing architecture tailored for the AI era, followed by a research lab jointly releasing a deep learning framework extension adapted for dedicated Neural Processing Units (NPUs) with the company. These moves mark significant progress in heterogeneous computing, software-hardware co-optimization, and computing ecosystem development.
I. Core Elements of AI-Era Computing Architectures
Traditional architectures suffer from high latency and power consumption due to frequent data movement between processors and memory during large-scale tensor operations. The new computing architecture essentially reconfigures this paradigm, with core elements reflected in the following aspects:
- Compute-in-Memory Design: New architectures tend to break the physical boundaries between computing and storage. By introducing computing capabilities near storage units, bandwidth loss from data movement is drastically reduced. This design significantly improves data throughput during large model training.
- Large-Scale Distributed High-Speed Interconnects: The upper limit of single-node computing power cannot meet the demands of large models, making clusterization inevitable. New architectures typically introduce ultra-high-speed network interconnect technologies (e.g., unified bus architectures) to achieve multi-node memory sharing and low-latency communication, enabling the cluster to perform as a “single supercomputer.”
- Native Heterogeneous Computing Scheduling: Modern AI architectures no longer rely on a single type of processor but organically integrate CPUs (logic control), NPUs/GPUs (large-scale parallel computing), and DPUs (network and data offload). The architecture layer provides unified instruction sets and compilers to achieve dynamic, fine-grained scheduling of heterogeneous computing power.
II. Challenges in Adapting Deep Learning Frameworks to Heterogeneous Computing (NPU)
The evolution of underlying hardware architectures must be accompanied by upper-layer software ecosystems. Deep learning frameworks bridge algorithms and hardware; their adaptation quality for dedicated NPUs directly determines how well hardware computing power is unleashed. However, the adaptation process faces numerous technical challenges:
- Operator Library Development and Alignment
Deep learning models consist of numerous basic operators (such as matrix multiplication, convolution, and activation functions). The underlying instruction set of NPUs differs significantly from general GPUs, requiring frameworks to rewrite or optimize operator libraries for NPU microarchitectures. This not only requires ensuring the numerical precision of operator calculations but also maximizing the utilization of the NPU’s matrix computing units. - Compute Graph Compilation and Optimization
Frameworks typically describe models by constructing static or dynamic compute graphs. When adapting to NPUs, the graph compiler must lower high-level compute graphs into executable low-level instructions for the NPU. This involves complex optimization strategies such as operator fusion, memory reuse, and pipeline parallelism. - Distributed Communication and Memory Management
In multi-card, multi-machine environments, frameworks must support strategies like data parallelism, tensor parallelism, and pipeline parallelism. For the memory characteristics of NPUs, frameworks need to implement fine-grained memory allocation and garbage collection mechanisms to prevent Out of Memory (OOM) errors caused by memory fragmentation.
III. Industry-Academia Collaboration in Computing Ecosystem Building
Breakthroughs in underlying hardware often rely on close cooperation between academia and industry. The recent joint release of a deep learning framework extension for NPU adaptation by a research lab and a tech company is a typical practice of software-hardware collaborative ecosystem building.
The value of such collaboration includes:
- Standard Co-construction: Research institutions typically have a profound understanding of frontier algorithms and underlying theories, while enterprises possess engineering capabilities and hardware manufacturing. Cooperation between the two can promote the standardization of computing interfaces and compilation standards.
- Framework Extensibility Verification: Through the joint release of framework extension components, not only are the software stacks of underlying hardware enriched, but developers are also provided with out-of-the-box toolchains, lowering the barrier to using heterogeneous computing power.
IV. Developer Practices: Framework Invocation and Optimization in Heterogeneous Environments
For general developers, integrating new NPU computing architectures typically does not require dealing with register-level operations, but they do need to master the heterogeneous configuration interfaces provided by the framework. Here is a common framework adaptation and invocation example:
import torchimport torch_npu # Assume this is an NPU adaptation extension library# 1. Check heterogeneous computing availabilityif torch.npu.is_available():device = torch.device("npu")print(f"Currently available NPUs: {torch.npu.device_count()}")else:device = torch.device("cpu")# 2. Migrate model and data to the heterogeneous devicemodel = MyLargeLanguageModel().to(device)optimizer = torch.optim.AdamW(model.parameters(), lr=2e-5)# 3. Enable Automatic Mixed Precision (AMP) to fully utilize NPU Tensor Coresscaler = torch.npu.amp.GradScaler()for data, target in train_loader:data, target = data.to(device), target.to(device)optimizer.zero_grad()# Forward pass and loss calculationwith torch.npu.amp.autocast():output = model(data)loss = loss_fn(output, target)# Backward pass and parameter updatescaler.scale(loss).backward()scaler.step(optimizer)scaler.update()
In the pseudocode above, developers use a dedicated hardware extension library to migrate the model and tensor data to the target device via unified APIs. Enabling Automatic Mixed Precision (AMP) is a common best practice to unleash NPU computing power and reduce memory footprint.
V. The Role of Cloud Platforms in the Computing Ecosystem
In the process of building AI computing architectures and ecosystems, cloud service providers act as infrastructure providers. For example, platforms like Baidu AI Cloud offer a rich array of general computing products (such as high-performance GPU/NPU compute instances, container platforms, and object storage) to provide elastic resource pools for enterprise AI training and inference.
The advantages of cloud platforms include:
- Heterogeneous Computing Pooling: Through virtualization technology, physical computing power is sliced or aggregated into virtual instances that meet business demands, improving resource utilization.
- Full-Stack Monitoring and O&M: Comprehensive logging services and monitoring/alerting systems are provided to help developers quickly locate performance bottlenecks in complex distributed training.
- Ecosystem Compatibility: Cloud platform AI development environments are typically compatible with mainstream deep learning frameworks, allowing adaptation work for specific hardware to seamlessly migrate to the cloud for execution.
VI. Summary and Outlook
Computing architectures in the AI era are evolving from simple computing power stacking towards “software-hardware co-optimization, compute-in-memory, and cluster interconnection.” The adaptation of deep learning frameworks to underlying dedicated NPUs is a key link in closing the software-hardware ecosystem loop. For developers and enterprises, understanding the underlying logic of new computing architectures and mastering framework adaptation and performance tuning methods in heterogeneous environments will become crucial capabilities for building core technical barriers in the AI large model competition. In the future, as industry, academia, and research institutions continue to collaborate, the barrier to heterogeneous computing development will further decrease, and computing power will truly empower various industries as conveniently as water and electricity.
