Phase 0: How Computers Actually Work · ~30 minutes · Python · uv
CPU vs. GPU, and Why It'll Matter Later
A GPU isn't a faster CPU. It's a different shape of computation entirely.
Real-world application: Can explain GPU parallelism as a shape-of-workload question, not a raw-speed question — the exact distinction that makes later CUDA/training content make sense instead of feeling like memorized trivia
What you will learn
- Explain the structural difference between a CPU (few powerful sequential cores) and a GPU (thousands of simple parallel cores)
- Identify whether a given task is parallelizable (GPU-friendly) or inherently sequential (CPU-friendly)
- Explain in one sentence why matrix multiplication specifically benefits from a GPU
- Measure a real timing difference between a loop-based and a vectorized approach to the same problem
Introduction
- Type: Learn
- Languages: Python
- Prerequisites: What a Computer Actually Does
- Time: ~30 minutes
Objective
Learning objectives
- Explain the structural difference between a CPU (few powerful sequential cores) and a GPU (thousands of simple parallel cores)
- Identify whether a given task is parallelizable or inherently sequential
- Explain in one sentence why matrix multiplication specifically benefits from a GPU
- Demonstrate, with real code, why order matters for some tasks and not others
What you're building
A script (parallel_vs_sequential.py) that:
- Reproduces this lesson's squaring example, proving order-independence by comparing sorted results from two different input orderings
- Implements the sequential
previous_result * 2 + next_input recurrence from the callout above, run once on [1, 2, 3, 4, 5] and once on a shuffled version of the same numbers, printing both final results - A one-paragraph write-up (
why_it_matters.txt) explaining, in your own words, why the two results in step 2 are different — and naming one real task (not from this lesson) that would be a bad fit for GPU-style parallelism, with a one-sentence reason why
Which of these is the better fit for a GPU's thousands-of-simple-cores design: "convert every pixel in a photo to grayscale" or "calculate your bank balance after this month's transactions, in the order they happened"?
Converting a pixel to grayscale only needs that one pixel's own color values — it doesn't matter what color the pixel next to it is, or whether that neighbor has been processed yet. Millions of independent, identical, tiny operations is exactly the shape a GPU is built for. A running bank balance is the opposite: this month's balance is only meaningful after last month's transactions have already been applied in order — genuinely sequential, and no amount of extra parallel workers changes that. (And the "GPUs can only do graphics" option is worth naming directly: GPUs were originally built for graphics, but the same "many independent identical operations" property applies far beyond images — which is exactly why they ended up training neural networks too.)
Unlock the full lesson
You've read the first 2 sections. The rest of this lesson covers The Problem, Check Yourself, Key Terms & Next — plus a hands-on lab, quiz, and project artifact.
Create a free account — the opening phases of 29 of 35 courses are free, no credit card.
Browse all courses · View pricing · DeVenture Academy