#402 · Primary category: Education & Research

GPU-Puzzles

cuda machine-learning puzzles

Solve puzzles. Learn CUDA.

Project last updated:09/01/24

GitHub Stars

12.4K

Forks

951

Contributors

4

License

MIT

Why we included this project

Most people who train models never write a line of GPU code, and this interactive notebook is one of the quickest ways to fix that: the puzzles get progressively harder, and you fill in the body of a CUDA kernel, starting with a simple vector map and working up to the shared-memory and reduction algorithms that power most of today's deep learning. Because the code runs through Numba, your Python-like functions get compiled into actual CUDA kernels, which keeps the entry barrier low without hiding what the hardware is doing. Each puzzle checks your kernel against a reference implementation, so you find out immediately whether your indexing is right. The best way to use it is as a hands-on tutorial: open it in Colab, turn on GPU mode, and work through the exercises instead of reading about them. It also makes a solid first exercise for anyone onboarding onto GPU work, and pairs naturally with Sasha Rush's companion Tensor Puzzles for the PyTorch side.

Articles for this project

No articles for this project yet.

To suggest a topic or contribute an article, contact us.

Related projects in this category