A1.1.3 · Computer fundamentals · HL
A1.1.3 · 计算机基础 · HL
Differences between the CPU and the GPU
CPU 与 GPU 的区别
Both are processors on a chip, but they are built on opposite bets. The CPU bets on a few very capable cores that finish one job quickly; the GPU bets on thousands of simple cores that finish one job many times over.
两者都是芯片上的处理器,但它们建立在相反的取舍之上。CPU 押注于少数几个能力很强的核心,快速完成一件工作;GPU 押注于数千个简单核心,把一件工作重复完成许多次。
Command term: explain. Two marks come from stating a difference; the rest come from saying why the design choice leads to the usage. A list of differences with no "so it is used for..." is a partial answer.
命令词:explain(解释)。说出一处差异能拿到一部分分;其余的分来自说清楚这个设计选择为什么会导致相应的用途。只罗列差异而没有"所以它被用于……"是不完整的答案。
Explainer
讲解
Two design philosophies
两种设计理念
The CPU is a general-purpose processor. It is built for flexibility and low delay: run any kind of instruction, make decisions quickly, and switch between different tasks. So it is given a few powerful, versatile cores.
CPU 是一种通用处理器。它为灵活性和低延迟而设计:能运行任何种类的指令、快速做出判断、在不同任务之间切换。因此它配备的是少数几个强大、多才多艺的核心。
The GPU is a specialised processor. It is built for throughput: get the largest total amount of work done per second on tasks that split into many identical, independent pieces. So it is given thousands of simple cores that all run the same instruction on different data at once.
GPU 是一种专门化处理器。它为吞吐量而设计:在那些"能拆成许多相同、互相独立的小块"的任务上,追求每秒完成的总工作量最大。因此它配备的是数千个简单核心,它们全都同时对不同的数据执行同一条指令。
Explainer
讲解
Four differences that follow
由此而来的四点差异
Each row is one design choice and the usage it leads to. In an "explain" answer, name both halves.
每一行都是一个设计选择,以及由它带来的用途。在"解释"题的答案里,两半都要说到。
| Compared on | CPU | GPU |
|---|---|---|
| Core architecture | A few powerful cores, plus extra logic (branch prediction, out-of-order execution) that keeps one sequence of instructions moving | Hundreds to thousands of small, simple cores; one instruction runs against a whole batch of data values simultaneously |
| Processing power | Higher clock speed per core, so a single task finishes quickly; strong at sequential and decision-heavy work | Lower clock speed per core, but the huge number of cores gives far more total work per second on parallel tasks |
| Memory access | A cache hierarchy (L1, L2, L3) tuned for low latency, getting small pieces of data with the shortest delay | High-bandwidth memory tuned for throughput, moving large blocks of data to feed thousands of cores |
| Power efficiency | Uses less power for general work; adjusts clock speed to the load to save energy | Uses more power overall, but less power per task when work is spread across many cores |
| 比较项 | CPU | GPU |
|---|---|---|
| 核心架构 | 少数几个强大的核心;还有分支预测、乱序执行等额外功能,让一条指令序列不停顿地推进 | 数百到数千个小而简单的核心;一条指令一次同时作用于一整批数据值 |
| 处理能力 | 每个核心的时钟频率更高,所以单个任务能很快完成;擅长顺序执行和需要大量判断的工作 | 每个核心的时钟频率较低,但海量核心在并行任务上带来大得多的每秒总工作量 |
| 内存访问 | 为低延迟而调优的缓存层级(L1、L2、L3),以最短的延迟取得小块数据 | 为吞吐量而调优的高带宽内存,移动大数据块来喂饱数千个核心 |
| 功耗效率 | 处理一般性工作时耗电更少;根据负载调节时钟频率以省电 | 总体耗电更多,但当工作铺开到许多核心上时,每个任务的耗电更少 |
Explore
探索
Working together
协同工作
On a real workload the CPU and GPU divide the job. Click each part to see who does it and why.
在真实的工作负载中,CPU 与 GPU 会分工。点击每一部分,看看它由谁来做、为什么。
Check your understanding
检验你的理解
Which statement correctly describes the memory-access difference between a CPU and a GPU?
下面哪一句正确描述了 CPU 与 GPU 在内存访问上的差异?
Common mistake
常见错误
RecurringMany answers list differences ("the CPU has fewer cores, the GPU has more") and stop. The command term is explain, so each difference needs its consequence: because the CPU has few powerful cores with branch prediction, it is fast at sequential decision-making, so it runs the operating system and game logic; because the GPU has thousands of simple cores, it does many identical calculations at once, so it renders pixels and trains models. Also avoid "the GPU is better", they are specialised for different jobs.
反复出现许多答案只是罗列差异("CPU 核心少,GPU 核心多")就停下了。命令词是 explain(解释),所以每一处差异都要说出它的后果:因为 CPU 有少数几个带分支预测的强大核心,所以它在顺序决策上很快,因此它运行操作系统和游戏逻辑;因为 GPU 有数千个简单核心,所以它一次做许多相同的计算,因此它渲染像素、训练模型。另外不要说"GPU 更好",它们是为不同工作而专门化的。
List with no reasoning: "A CPU has a few fast cores and a GPU has many slow cores. A GPU uses more power." States differences but never connects them to what each processor is used for.
只罗列,不说理: "CPU 有几个快核心,GPU 有许多慢核心。GPU 更费电。" 说了差异,却从没把它们和"每个处理器用来做什么"联系起来。
Difference plus consequence: "A CPU has a few powerful cores optimised for one fast sequence of instructions, so it is used for the operating system and control logic. A GPU has thousands of simple cores that apply one instruction to many data items at once, so it is used for rendering and training models, where the same calculation is repeated across huge data."
差异加后果: "CPU 有少数几个强大核心,为一条快速的指令序列而优化,所以用于操作系统和控制逻辑。GPU 有数千个简单核心,一次把一条指令应用到许多数据项上,所以用于渲染和训练模型,那里同一种计算要在海量数据上重复。"
Revision questions
复习题
Specimen-paper style. Write an answer, then reveal the marking points and mark yourself.
采用样卷风格。写下答案,然后展开评分要点给自己打分。
[4]Explain two differences in core architecture between a CPU and a GPU, and the kind of task each design suits.
[4]解释 CPU 与 GPU 在核心架构上的两点差异,以及每种设计各自适合哪类任务。
Marking points
评分要点
- Any two differences, each with the task it suits: the CPU has a few powerful cores with branch prediction, so it is fast at one sequence of decisions and runs the operating system and control logic; the GPU has thousands of small simple cores running one instruction across a batch of data, so it renders frames and trains models where the same calculation repeats.
- Each difference must be connected to a consequence, not just stated.
- 任选两处差异,每处附它适合的任务:CPU 有少数几个带分支预测的强大核心,所以它在一串判断上很快,运行操作系统和控制逻辑;GPU 有数千个小而简单的核心,一条指令作用于一整批数据,所以它渲染画面、训练模型,那里同一种计算不断重复。
- 每处差异都必须连到一个后果上,不能只陈述。
[3]Explain why the CPU's memory system is optimised for low latency while the GPU's is optimised for high bandwidth.
[3]解释为什么 CPU 的内存系统为低延迟而优化,而 GPU 的为高带宽而优化。
Marking points
评分要点
- The CPU constantly switches between tasks and needs the next value quickly, so its cache hierarchy is tuned for low latency: the shortest delay to fetch a small piece of data.
- The GPU runs one operation over huge data sets, so it needs to move large blocks to thousands of cores; its memory is tuned for high bandwidth (amount moved per transfer) rather than the delay on any one piece.
- CPU 不断在任务之间切换,需要很快拿到下一个值,所以它的缓存层级为低延迟而调优:以最短的延迟取回一小块数据。
- GPU 对巨大的数据集运行一种操作,所以它需要把大数据块移动给数千个核心;它的内存为高带宽(每次传输的量)而调优,而不是为某一小块的延迟。
[5]Discuss how the different design philosophies of the CPU and the GPU reflect their roles in a computing system.
[5]讨论 CPU 与 GPU 不同的设计理念如何体现了它们在计算系统中的角色。
Marking points
评分要点
- The CPU's design (few powerful, flexible cores, low latency) makes it the general-purpose controller: it runs the operating system, makes decisions, and coordinates everything, including the GPU.
- The GPU's design (thousands of simple cores, high throughput) makes it a specialised worker for large parallel calculations that the CPU hands off.
- Together they cover both kinds of work: sequential decision-making and massive parallel computation. Neither replaces the other.
- CPU 的设计(少数几个强大、灵活的核心,低延迟)使它成为通用的控制者:它运行操作系统、做决定、协调一切,包括 GPU。
- GPU 的设计(数千个简单核心,高吞吐量)使它成为处理大规模并行计算的专门工人,由 CPU 把这类工作交出去。
- 两者合起来覆盖了两类工作:顺序决策和海量并行计算。谁也不取代谁。
[4]Describe how a CPU and a GPU divide the work, and share data, when running a video game.
[4]描述运行一款电子游戏时,CPU 与 GPU 如何分工并共享数据。
Marking points
评分要点
- The CPU runs the game logic, reads the player's input, and works out the new positions and physics.
- It passes the scene data across to the GPU.
- The GPU renders the frame: it works out the colour of every pixel in parallel.
- The data travels between CPU memory and GPU memory over the bus; on a system with unified memory both use the same physical memory and the copy is avoided.
- CPU 运行游戏逻辑、读取玩家输入,并算出新的位置和物理。
- 它把场景数据传给 GPU。
- GPU 渲染这一帧:它并行地算出每个像素的颜色。
- 数据在 CPU 内存与 GPU 内存之间通过总线传输;在采用统一内存的系统上,两者使用同一块物理内存,省去这次复制。
[3]Explain why moving data between CPU memory and GPU memory can be a bottleneck, and how unified memory helps.
[3]解释为什么在 CPU 内存与 GPU 内存之间搬运数据可能成为瓶颈,以及统一内存如何缓解这一问题。
Marking points
评分要点
- When the CPU and GPU have separate memory, data worked out by the CPU must be copied across the bus to GPU memory before the GPU can use it, and results copied back.
- That transfer is slow compared with the calculations, so it can become a bottleneck.
- Unified memory means both processors read and write the same physical memory, so no copy is needed.
- 当 CPU 和 GPU 有各自的内存时,CPU 算出的数据必须经总线复制到 GPU 内存,GPU 才能使用,结果还要复制回来。
- 相比计算本身,这次传输很慢,所以可能成为瓶颈。
- 统一内存意味着两个处理器读写同一块物理内存,所以不需要复制。
Flashcards
记忆卡片
Active recall for this statement’s key terms.
针对本条考纲陈述关键术语的主动回忆练习。
Keep this statement’s practice with you
把这条考纲陈述的练习保存下来
Free account: unlock every revision question and flashcard for A1.1.3, and every other IB CS 2027 statement.
免费账户:解锁 A1.1.3 以及所有其他 IB CS 2027 考纲陈述的全部复习题和记忆卡片。