A1.1.2 · Computer fundamentals
A1.1.2 · 计算机基础
The Role of a GPU
GPU 的作用
A CPU could draw every pixel of a game one after another, but far too slowly. A GPU takes the opposite approach: thousands of small cores, each doing the same simple sum, all at the same time.
CPU 也可以一个接一个地画出游戏里的每一个像素,但速度太慢了。GPU 采取相反的做法:成千上万个小核心,每个都在做同样的简单运算,而且全都同时进行。
A1's guiding question asks what principles underpin how a computer works. This page adds a second kind of processor to A1.1.1's CPU: one designed around doing many things at once rather than one thing quickly.
A1 的引导性问题问的是支撑计算机运行的原理。本页在 A1.1.1 的 CPU 之外加入第二种处理器:一种围绕"同时做很多件事"而非"快速做一件事"来设计的处理器。
Explainer
讲解
What a GPU is
GPU 是什么
A GPU (graphics processing unit) is a specialised processor that carries out a very large number of simple calculations at the same time (in parallel). It was designed to draw graphics, but the same design suits any job that is many similar calculations over a large amount of data.
GPU(图形处理单元)是一种专门化的处理器,能并行地同时执行大量简单的计算。它最初是为绘制图形而设计的,但这种设计也适合任何"对大量数据做许多类似计算"的工作。
A GPU works alongside the CPU, not instead of it. The CPU still runs the operating system and the decision-heavy logic; the GPU takes on the parts that are the same operation repeated across a huge number of data points, and hands the results back.
GPU 与 CPU 协同工作,而不是取代它。CPU 仍然负责运行操作系统和大量需要判断的逻辑;GPU 则接手那些"同一种操作在海量数据点上重复"的部分,并把结果交回来。
Explainer
讲解
The architecture that makes it suitable
使它适合这类任务的架构
| Feature | What it means | Why it suits the work |
|---|---|---|
| Many small cores | Hundreds to thousands of cores, each far simpler and less powerful than a single CPU core | A task that splits into many identical pieces (one per pixel, one per data point) can have every piece worked on at once |
| Parallel structure | The cores are wired to run the same instruction on different data at the same time | Matches jobs that are "do this one operation everywhere", such as running a colour filter over every pixel, or one multiply for every number in a matrix |
| High-bandwidth memory | Its own fast video memory (VRAM) that can move very large blocks of data per transfer | Keeps thousands of cores fed with the large textures, images and data sets they are all working on |
| High throughput | Optimised for total amount of work per second, not for finishing any single task with the shortest delay | Rendering a frame or training a model is measured by how much data gets through, not by one quick answer |
| 特性 | 它的含义 | 为什么适合这类工作 |
|---|---|---|
| 许多小核心 | 数百到数千个核心,每一个都比单个 CPU 核心简单得多、性能弱得多 | 一个能拆成许多相同小块的任务(每个像素一块、每个数据点一块),可以让所有小块被同时处理 |
| 并行结构 | 这些核心被连接成可以同时对不同数据执行同一条指令 | 契合那种"对所有地方做同一种操作"的工作,例如对每个像素应用一个滤镜,或对矩阵里每个数做一次乘法 |
| 高带宽内存 | 自带的高速显存(VRAM),每次传输能移动非常大的数据块 | 让数千个核心持续获得它们共同处理的大纹理、图像和数据集 |
| 高吞吐量 | 为"每秒完成的总工作量"而优化,而不是为"以最短延迟完成某一个任务"而优化 | 渲染一帧画面或训练一个模型,衡量标准是有多少数据被处理完,而不是某一个快速的答案 |
Each GPU core is weak on its own and poor at branchy, decision-heavy code. The GPU wins only when the same work can be spread across thousands of cores at once. A job full of "if this then that" choices still belongs to the CPU.
GPU 的每个核心单独看都很弱,也不擅长充满分支、需要大量判断的代码。只有当同一份工作能同时铺开到数千个核心上时,GPU 才占优势。一个充满"如果这样就那样"选择的任务,仍然属于 CPU。
Explore
探索
Four real-world uses
四种实际应用
The syllabus names these four. Click each one to see the repeated calculation the GPU is doing.
考纲点名了这四种。点击每一种,看看 GPU 在其中反复进行的是什么计算。
Check your understanding
检验你的理解
Why is a GPU, rather than a CPU alone, recommended for training a deep learning model on a large dataset?
在大型数据集上训练一个深度学习模型时,为什么推荐使用 GPU 而不是只用 CPU?
Common mistake
常见错误
RecurringA weak answer describes a GPU as "a faster CPU" or "a CPU with more powerful cores". Its cores are individually weaker and simpler, and it is poor at the sequential, decision-heavy work a CPU handles well. Its role is narrower and specific: taking on work that is the same calculation repeated across a large amount of data, running many of those calculations at once, and leaving the rest to the CPU.
反复出现薄弱的答案把 GPU 描述成"更快的 CPU"或"核心更强的 CPU"。它的核心单个看更弱、更简单,而且不擅长 CPU 所擅长的那种顺序执行、大量判断的工作。它的作用更狭窄、更具体:接手那种同一种计算在大量数据上重复的工作,一次进行许多这样的计算,其余的留给 CPU。
Treats it as a better CPU: "A GPU is a more powerful processor that replaces the CPU for heavy tasks." Misses that it is specialised for parallel work and weak at everything else.
把它当作更好的 CPU: "GPU 是一个更强大的处理器,在繁重任务上取代 CPU。" 忽略了它是为并行工作而专门化的,在其他一切上都很弱。
Names the role: "A GPU has thousands of small cores that run the same operation on many data points at once. It works with the CPU: the CPU handles logic and control, the GPU handles the large parallel calculations such as rendering pixels or multiplying matrices."
说清了它的作用: "GPU 拥有数千个小核心,能一次对许多数据点执行同一种操作。它与 CPU 协同工作:CPU 处理逻辑与控制,GPU 处理大规模并行计算,例如渲染像素或做矩阵乘法。"
Revision questions
复习题
Specimen-paper style. Write an answer, then reveal the marking points and mark yourself.
采用样卷风格。写下答案,然后展开评分要点给自己打分。
[2]Describe the role of a graphics processing unit (GPU).
[2]描述图形处理单元(GPU)的作用。
Marking points
评分要点
- A GPU is a specialised processor with hundreds to thousands of small cores that carry out the same operation on many data points at the same time (in parallel).
- It works alongside the CPU, taking on the large parallel calculations while the CPU handles logic and control.
- GPU 是一种专门化的处理器,拥有数百到数千个小核心,同时(并行地)对大量数据点执行同一种操作。
- 它与 CPU 协同工作,承担大规模的并行计算,而 CPU 处理逻辑和控制。
[2]Outline one reason a GPU speeds up the rendering of a modern video game.
[2]概述 GPU 能加快现代电子游戏渲染速度的一个原因。
Marking points
评分要点
- Rendering a frame is the same colour and lighting calculation carried out for every one of millions of pixels.
- The GPU's many cores work on many pixels at once, so the frame is produced far faster than a CPU could manage.
- 渲染一帧,是对数百万个像素中的每一个执行同样的颜色和光照计算。
- GPU 的众多核心一次处理许多像素,所以画面比 CPU 所能达到的快得多。
[3]Explain, with reference to its architecture, why a GPU is well suited to large scientific simulations.
[3]结合 GPU 的架构,解释它为什么很适合大型科学模拟。
Marking points
评分要点
- A large simulation applies the same equation to a huge number of data points (cells, particles, grid squares).
- The GPU's thousands of cores run that one calculation on many points at the same time.
- Its high-bandwidth memory keeps all those cores supplied with the large data set they share, so total work per second is very high.
- 一个大型仿真把同一个方程应用到海量的数据点(单元、粒子、网格)。
- GPU 的数千个核心同时对许多点运行那一个计算。
- 它的高带宽内存让所有这些核心持续获得它们共享的大数据集,所以每秒的总工作量非常高。
[3]Outline one type of task for which a GPU gives no advantage over a CPU, and explain why.
[3]概述一类 GPU 相较 CPU 没有任何优势的任务,并解释原因。
Marking points
评分要点
- A task that is mostly a single sequence of decisions (lots of if...then branching), or one that cannot be split into independent pieces.
- Each GPU core is weak and poor at branchy code, and there is nothing to spread across the many cores, so a CPU core does it faster.
- 一个主要由一串判断组成的任务(大量 if...then 分支),或一个无法拆成独立小块的任务。
- 单个 GPU 核心很弱、不擅长分支代码,而且没有东西可以铺开到众多核心上,所以 CPU 核心做得更快。
[2]State what VRAM is and why a GPU needs high-bandwidth memory.
[2]说明 VRAM 是什么,以及 GPU 为什么需要高带宽内存。
Marking points
评分要点
- VRAM is the GPU's own fast video memory, separate from the CPU's RAM.
- The GPU needs high-bandwidth memory so it can move very large blocks of data (textures, images, data sets) per transfer and keep thousands of cores fed.
- VRAM 是 GPU 自带的高速显存,与 CPU 的 RAM 分开。
- 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.2, and every other IB CS 2027 statement.
免费账户:解锁 A1.1.2 以及所有其他 IB CS 2027 考纲陈述的全部复习题和记忆卡片。