AI 運算解析(第 4 部分):Apple Metal 的不同路線
Understanding AI Computing — Part 4
Apple 透過 Metal、Apple Silicon 的統一記憶體及專用 AI 硬件,整合 GPU、Neural Engine 與軟件框架,支援在個人裝置上運行 AI。
Apple Metal: A Different Approach to AI Computing
How Apple combines GPUs, specialized AI hardware, and unified memory to bring artificial intelligence onto personal devices.
Understanding AI ComputingWhen we talk about AI computing, we usually think about enormous data centers filled with NVIDIA processors.
But there is another approach.
Instead of sending every AI request to a remote server, why not run artificial intelligence directly on your computer?
Apple has been developing the hardware and software needed to make that possible.
And one of the key technologies behind this approach is Metal.
What Is Metal?
Metal is Apple’s low-level programming interface for graphics and parallel computing.
Originally introduced in 2014, it allows developers to use the GPU for much more than rendering images.
Sound familiar?
In Part 1, we explored how NVIDIA’s CUDA made GPUs accessible for general-purpose computing.
Metal provides similar GPU-computing capabilities on Apple platforms, although the two are not interchangeable.
Developers can write programs that execute thousands of parallel operations on the GPU rather than the CPU.
And that is particularly useful for machine learning.
But Metal is only one part of Apple’s AI software ecosystem.
Metal, MLX, and the Neural Engine
Apple provides several technologies for accelerating AI workloads.
Metal gives developers direct access to GPU computing.
Metal Performance Shaders provides optimized mathematical operations, including those used in neural networks.
MLX is Apple’s open-source machine learning framework, designed specifically for Apple Silicon.
And Core ML helps applications execute trained models using the available CPU, GPU, and Neural Engine.
These technologies operate at different levels.
An application using MLX can perform calculations on the GPU through Metal without its developer having to write GPU kernels for every operation.
An application using Core ML can allow the system to select appropriate computing resources for supported model operations.
That distinction is important.
Metal computing does not automatically mean using Apple’s Neural Engine.
The Neural Engine is separate specialized hardware. Ordinary Metal compute operations execute on the GPU.
With Metal 4, Apple has also introduced machine learning operations that integrate model execution into GPU workflows, with supported models able to use different inference engines.
Apple is gradually bringing its graphics and machine learning technologies closer together.
What Makes Apple Silicon Different?
One of Apple Silicon’s most interesting features is unified memory.
In a traditional computer with a discrete GPU, the CPU and GPU generally have separate memory spaces.
Moving data between them can require additional transfers.
Apple Silicon takes a different approach.
The CPU and GPU share a common pool of physical memory.
This means that applications can work with the same data without necessarily copying it between separate CPU and GPU memories.
For machine learning, that can be a significant advantage.
Consider a large language model.
Its weights must fit into memory, and the processor must repeatedly access those weights during inference.
A Mac with sufficient unified memory can run models that would exceed the dedicated video memory of many conventional graphics cards.
Of course, shared memory is not automatically faster.
Memory bandwidth, computing performance, and the amount of memory available to the application still matter.
But it gives Apple Silicon a useful architectural advantage for certain local AI workloads.
Apple Is Also Building Specialized AI Hardware
Like NVIDIA, Apple has moved beyond general-purpose GPU computing.
Apple Silicon includes a Neural Engine designed for efficient machine learning operations.
And with the M5 generation, Apple introduced dedicated Neural Accelerators directly into its GPU cores.
This is an important development.
Apple now combines specialized AI hardware inside the GPU with a separate Neural Engine.
The GPU can perform general parallel calculations while accelerating supported neural-network operations.
The Neural Engine provides another execution option for suitable workloads.
Together with Metal, Core ML, and MLX, these components form an increasingly integrated AI computing platform.
But Apple’s strategy differs from NVIDIA’s in one fundamental respect.
Apple controls the hardware, the operating system, and the software frameworks.
It can design all three to work together.
A Different Kind of Ecosystem
CUDA’s importance comes partly from its widespread use across AI research, cloud infrastructure, and high-performance computing.
Apple’s ecosystem serves a different market.
Metal also supports older compatible Macs with Intel or AMD graphics hardware, but modern local AI development increasingly focuses on Apple Silicon.
And unlike CUDA, Metal has not become a broadly adopted platform for general-purpose AI data centers.
Apple Silicon does appear in server infrastructure, including Apple’s own cloud systems, but that is not the main market for Metal-based AI development.
Apple’s strength lies in tightly integrating computing capabilities into devices people already own.
A developer can build an application that processes images, recognizes speech, or runs a language model locally.
No dedicated NVIDIA graphics card is required.
And depending on the application, no connection to a remote AI server is necessary.
That can reduce latency, avoid recurring cloud inference costs, and keep sensitive data on the device.
Naturally, local execution has limitations.
Memory capacity, processing speed, battery consumption, and model size all constrain what a personal device can handle.
Large-scale training and demanding inference workloads still benefit from powerful server infrastructure.
But not every AI application requires a data center.
The Real Lesson
NVIDIA and Apple have developed different approaches to AI computing.
NVIDIA combines powerful accelerators with CUDA, a mature software ecosystem widely used in large-scale computing.
Apple combines GPU computing, specialized AI hardware, unified memory, and software frameworks within a tightly integrated platform.
Neither approach is universally superior.
They address different requirements and economic priorities.
And both demonstrate something important.
The value of AI hardware depends not only on the processor itself, but on how effectively hardware and software work together.
CUDA helped establish NVIDIA’s position in AI computing.
Metal and Apple’s machine learning frameworks are helping make powerful AI applications practical on personal devices.
And as AI becomes part of everyday software, that distinction may become increasingly important.
References & Further Reading
- Apple — Discover Metal 4 (WWDC25)
- Apple — Get Started with MLX for Apple Silicon
- Apple — Core ML Documentation
- Apple — M5: The Next Leap in AI Performance This is Part 4 of Understanding AI Computing, a series exploring the hardware, software, and economics behind modern artificial intelligence.
來源:DEV Community · dev.to