Many threads writing to the same place is the classic GPU problem. Sum 16.8 million floats twice, first with one atomic add per element and then with a shared-memory tree reduction, and build a 256-bin histogram of an 18-megapixel photo with global atomics and then with a privatized per-block histogram. Every result is checked against NumPy, and every kernel is timed and compared in GB/s. The photo (~5 MB) is downloaded from the Hugging Face Hub on first run.
Data Setup
Exploring the Data
Parallel Reductions
Histograms and Throughput
Premium Project
This guided, GPU-powered project is available to Premium members. Upgrade to train models end-to-end in an interactive notebook.