tinytorch/site/preface.md
Everyone wants to be an astronaut ๐งโ๐. Very few want to be the rocket scientist ๐.
Everyone wants to be an astronaut. Very few want to be the rocket scientist.
In machine learning, we see the same pattern. Everyone wants to train models, run inference, deploy AI. Very few want to understand how the frameworks actually work. Even fewer want to build one.
The world is full of users. We do not have enough buildersโpeople who can debug, optimize, and adapt systems when the black box breaks down.
This is the gap TinyTorch exists to fill.
Most people can use PyTorch or TensorFlow. They can import libraries, call functions, train models. But very few understand how these frameworks work: how memory is managed for tensors, how autograd builds computation graphs, how optimizers update parameters. And almost no one has a guided, structured way to learn that from the ground up.
<div style="background: #f8f9fa; padding: 1.5rem; border-radius: 0.5rem; margin: 1.5rem 0;">Why does this matter? Because users hit walls that builders do not:
The framework becomes a black box you cannot debug, optimize, or adapt. You are stuck waiting for someone else to solve your problem.
</div>Students cannot learn this from production code. PyTorch is too large, too complex, too optimized. Fifty thousand lines of C++ across hundreds of files. No one learns to build rockets by studying the Saturn V.
They also cannot learn it from toy scripts. A hundred-line neural network does not reveal the architecture of a framework. It hides it.
TinyTorch teaches you the AI bricksโthe stable engineering foundations you can use to build any AI system. Small enough to learn from: bite-sized code that runs even on a Raspberry Pi. Big enough to matter: showing the real architecture of how frameworks are built.
<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin: 2rem 0;"> <div style="background: #e3f2fd; padding: 1.5rem; border-radius: 0.5rem; border-left: 4px solid #1976d2;"> <strong style="color: #1565c0;">๐ MLSysBook</strong> <p style="margin: 0.5rem 0 0 0;">The <a href="https://mlsysbook.ai">Machine Learning Systems</a> textbook teaches you the <em>concepts</em> of the rocket ship: propulsion, guidance, life support.</p> </div> <div style="background: #fff3e0; padding: 1.5rem; border-radius: 0.5rem; border-left: 4px solid #ff8247;"> <strong style="color: #e65100;">TinyTorch</strong> <p style="margin: 0.5rem 0 0 0;">TinyTorch is where you actually <em>build</em> a small rocket with your own hands. Not a toyโa real framework.</p> </div> </div>This is how people move from using machine learning to engineering machine learning systems. This is how someone becomes an AI systems engineer rather than someone who only knows how to run code in a notebook.
What you need is not another API tutorial. You need to build.1
By the end of TinyTorch, you will have implemented:
This is not a simulation. This is the actual architecture of modern ML frameworks, implemented at a scale you can fully understand.
Each module follows a Build-Use-Reflect cycle: implement from scratch, apply to real problems, then connect what you built to production systems and understand the tradeoffs. Work through Foundation first, then choose your path based on your interests.
<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 1.5rem 0;"> <div style="border: 1px solid #e0e0e0; padding: 1rem; border-radius: 0.5rem;"> <strong>Type every line yourself</strong> <p style="margin: 0.5rem 0 0 0; font-size: 0.9rem; color: #666;">Do not copy-paste. The learning happens in the struggle of implementation.</p> </div> <div style="border: 1px solid #e0e0e0; padding: 1rem; border-radius: 0.5rem;"> <strong>Profile your code</strong> <p style="margin: 0.5rem 0 0 0; font-size: 0.9rem; color: #666;">Use built-in profiling tools. Measure first, optimize second.</p> </div> <div style="border: 1px solid #e0e0e0; padding: 1rem; border-radius: 0.5rem;"> <strong>Run the tests</strong> <p style="margin: 0.5rem 0 0 0; font-size: 0.9rem; color: #666;">Every module includes comprehensive tests. When they pass, you have built something real.</p> </div> <div style="border: 1px solid #e0e0e0; padding: 1rem; border-radius: 0.5rem;"> <strong>Compare with PyTorch</strong> <p style="margin: 0.5rem 0 0 0; font-size: 0.9rem; color: #666;">Once your implementation works, compare with PyTorch's equivalent.</p> </div> </div>Take your time. The goal is not to finish fast. The goal is to understand deeply.
<div style="background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%); padding: 1.5rem 2rem; border-radius: 0.5rem; margin: 2rem 0; text-align: center;"> <p style="color: #f8fafc; font-size: 1.2rem; font-style: italic; margin: 0; font-weight: 500;"> "Building systems creates irreversible understanding." </p> </div>TinyTorch is part of a larger effort to educate a million learners at the edge of AI. The Machine Learning Systems textbook provides the conceptual foundation. TinyTorch provides the hands-on implementation experience. Together, they form a complete path into ML systems engineering.
This approach follows a long tradition in systems education: from SICP's "build to understand" philosophy, to xv6's transparent operating system, to Nachos and Pintos. The pedagogical principles behind TinyTorch are detailed in our research paper, which positions this work within decades of CS education research.
The next generation of engineers cannot rely on magic. They need to see how everything fits together, from tensors all the way to systems. They need to feel that the world of ML systems is not an unreachable tower but something they can open, shape, and build.
That is what TinyTorch offers: the confidence that comes from building something real.
Prof. Vijay Janapa Reddi</br> (Harvard University)</br> 2025
See the Big Picture โ โ How all 20 modules connect, what you'll build, and which path to take.
My own background was in compilers, specifically just-in-time (JIT) compilation. But I did not become a systems engineer by reading papers alone. I became one by building Pin, a dynamic binary instrumentation engine that uses JIT technology. The lesson stayed with me: reading teaches concepts, but building deepens understanding. โฉ