NPU

Neural Processing Unit

Definition

NPU (Neural Processing Unit) is an acceleration chip specifically designed for deep learning inference. Compared to general-purpose CPUs/GPUs, it is more energy-efficient for AI workloads such as convolution and matrix operations. It is suitable for edge-side Inference at the Edge and supports mainstream architectures like YOLO, ResNet, and MobileNet, with single-frame inference latency potentially below 50ms. Models are usually deployed after ONNX conversion, and inference speed can be further improved with optimizations such as TensorRT.

Technical Features

NPU uses dedicated matrix computation units and supports low-precision quantization (INT8/FP16), achieving several times the energy efficiency of GPUs. Typical products include Huawei Ascend, Cambricon, Rockchip RK series, and Amlogic. It supports ONNX, TensorFlow Lite, Caffe, and other model formats. Integrating NPU into edge AI gateways allows local execution of object detection, classification, and segmentation, reducing cloud transmission and latency, suitable for industrial vision, security, defect detection, and other IIoT scenarios.

Comparison with GPU

GPUs (such as NVIDIA Jetson) are highly versatile, have mature ecosystems, and support optimizations like TensorRT; NPUs offer higher energy efficiency, controllable costs, and are suitable for large-scale edge deployments. When choosing, one needs to consider model compatibility, inference performance, power consumption, and cost. In industrial scenarios, lightweight models (YOLOv5s, MobileNet) often use NPUs, while GPUs are preferred for complex models or parallel multi-model inference.

Operator Coverage and the Quantized Graph

The matrix array accelerates only certain operators

What is laid out inside a neural processing unit is a multiply-accumulate array and on-chip memory, not a general-purpose processor. Convolution, fully connected layers, pooling, and some activation functions are mapped onto the array and computed in batches. Control flow, irregular post-processing, and custom layers still fall back to the CPU beside it. The chip's stated peak throughput means something only when the body of the network can land on the array. After input resolution, channel count, or batch size changes, if the cache cannot hold the intermediate tensors, the speedup drops suddenly, and the chip may fall back to shuttling each layer through external memory.

Low precision is where the efficiency comes from. The array usually works in 8-bit integer or 16-bit floating point, and weights and activations are quantized at compile time. Quantization is not rounding a fraction to the nearest integer. A scale has to be chosen for each layer. If the scale departs from real data, detection-box confidence shifts as a whole. The model looks as if it "suddenly stopped working," while the graph is still running.

The model has to land on the chip toolchain first

The condition for use is a frozen model structure, operators from the training framework that this chip's compiler recognizes, and an input shape known at deployment. The toolchain generally requires an intermediate representation first, then compilation into a vendor-private executable graph. That step has to be done on the target board, or on an environment of the same series. A chip of a different generation usually means rebuilding the graph. Memory also has to hold the input buffer, the intermediate tensors, and output parsing at the same time. In industrial vision, if decoding is stacked on top, the CPU and the array contend for bandwidth.

It suits edge sites with few model variants, a fixed resolution, and a result that is only a class or a small set of coordinates. If the network structure changes often, or the job needs new operators the compiler does not cover yet, array utilization stays low. List the layers that cannot be mapped, and decide whether to change the model or change the compute platform. Do not place the order against peak compute first.

Dynamic shapes and unsupported operators

The most common failure is a dynamic input. Height and width vary in training, but the compiler wants a fixed side length. Stretching the image to force a fit changes the object's aspect ratio. Thresholds carried over from the training set then raise false detections. Next, operators are quietly placed on the CPU. End-to-end latency stays long, while the power table shows the array almost idle. Check the compile log for where each layer actually runs. Do not stop at "load succeeded."

The third failure is inconsistent preprocessing. Mean subtraction, color order, and scaling used in training, if implemented differently on the board, shift the network output systematically. If the quantization calibration set comes only from laboratory lighting, backlight and a dirty lens on site make the 8-bit scales invalid. Do not ignore chip temperature either. In a closed cabinet the array clocks down, the frame rate misses the line takt, and alarms pile up. Compared with an inference engine on a general graphics processor, this path depends more on the vendor compiler. Changing boards means rebuilding the graph. Copying one file is not a finished deployment.

Cooling and clock reduction on the board also belong in the latency budget. When array temperature rises inside a closed enclosure, the part clocks down and the theoretical latency in the compile log no longer holds. The application should read chip temperature and raise a clear alarm when the reduced clock makes the frame rate too low, rather than letting the line keep watching results that arrive more and more slowly.

Related Terms

Return to hardware knowledge base