Khám phá CPU Vai trò quan trọng của nó trong AI và Học máy. Tìm hiểu về ứng dụng của nó trong chuẩn bị dữ liệu, suy luận và so sánh với GPU/TPU.
A Central Processing Unit (CPU) is the primary component of a computer that acts as its "brain," responsible for interpreting and executing instructions from hardware and software. In the context of artificial intelligence (AI), the CPU plays a fundamental role in data handling, system orchestration, and executing inference, particularly on edge devices where power efficiency is critical. While specialized hardware like GPUs are often associated with the heavy lifting of training deep learning models, the CPU remains indispensable for the overall machine learning (ML) pipeline.
Although GPUs are celebrated for their massive parallelism during training, the CPU is the workhorse for many essential stages of the computer vision (CV) lifecycle. Its architecture, typically based on x86 (Intel, AMD) or ARM designs, is optimized for sequential processing and complex logic control.
Hiểu rõ về cấu trúc phần cứng là rất quan trọng để tối ưu hóa các hoạt động học máy (MLOps) . Các bộ xử lý này khác nhau đáng kể về kiến trúc và trường hợp sử dụng lý tưởng.
CPUs are frequently the hardware of choice for applications where cost, availability, and energy consumption outweigh the need for massive raw throughput.
Các nhà phát triển thường thử nghiệm các mô hình trên CPU để xác minh khả năng tương thích với môi trường điện toán phi máy chủ hoặc các thiết bị tiêu thụ điện năng thấp. Ultralytics API cho phép bạn dễ dàng nhắm mục tiêu vào CPU , đảm bảo ứng dụng của bạn có thể chạy ở mọi nơi.
Ví dụ sau đây minh họa cách tải một mô hình nhẹ và chạy suy luận cụ thể trên... CPU :
from ultralytics import YOLO
# Load the lightweight YOLO26 nano model
# Smaller models are optimized for faster CPU execution
model = YOLO("yolo26n.pt")
# Run inference on an image, explicitly setting the device to 'cpu'
results = model.predict("https://ultralytics.com/images/bus.jpg", device="cpu")
# Print the detection results (bounding boxes)
print(results[0].boxes.xywh)
To further improve performance on Intel CPUs, developers can export their models to the OpenVINO format, which optimizes the neural network structure specifically for x86 architecture. For managing datasets and orchestrating these deployments, tools like the Ultralytics Platform simplify the workflow from annotation to edge execution.