mirror of
https://github.com/MLSysBook/TinyTorch.git
synced 2026-04-28 08:27:31 -05:00
🎯 Student Version (Visible): - All functions raise NotImplementedError('Student implementation required') - Clear TODO instructions with specific guidance - Test cells handle NotImplementedError gracefully - Students must implement everything from scratch 🔧 Instructor Version (Hidden with #|hide): - Complete working implementations - Same function signatures as student version - Production-ready code for package export 📚 Added MODULE_GENERATION_GUIDE.md: - Clear instructions for creating student/instructor modules - NBDev workflow documentation - Module structure patterns and templates - Generation commands and checklist 🔄 Generation Flow: 1. Write .py with student stubs + hidden instructor solutions 2. Convert to notebook: jupytext --to notebook module_dev.py 3. Export package: python bin/tito.py sync --module name 4. Package gets instructor solutions, students see exercises Perfect foundation for all TinyTorch modules
Module 0: Setup
Learning Objectives
This module teaches you the TinyTorch development workflow. By the end, you'll be comfortable with:
- Writing code in Jupyter notebooks using nbdev conventions
- Exporting notebook code to Python modules
- Running tests and using the TinyTorch CLI
- Understanding the development rhythm you'll use for all modules
What You'll Build
A simple "Hello World" system that demonstrates the complete development cycle:
- Basic utility functions
- A simple
SystemInfoclass - Tests to verify everything works
- Experience with the full notebook → export → test workflow
Module Structure
modules/setup/
├── setup_dev.ipynb # 📓 Main development notebook
├── README.md # 📖 This guide
└── __init__.py # 📦 Module marker
Development Workflow
1. Work in the Notebook
cd modules/setup
jupyter lab setup_dev.ipynb
2. Export Your Code
python bin/tito.py sync
3. Test Your Implementation
python bin/tito.py test --module setup
4. Check Your Progress
python bin/tito.py info
Key Concepts
- nbdev workflow: Write in notebooks, export to Python
- Export directive: Use
#| exportto mark code for export - Module → Package mapping: This module exports to
tinytorch/core/utils.py - Teaching vs. Building: Learn by modules, build by function (see VISION.md)
- Test integration: Tests run automatically via CLI
- Module development: Each module is self-contained
Success Criteria
✅ All tests pass
✅ Code exports cleanly to tinytorch/core/utils.py
✅ You understand the development rhythm
✅ Ready to tackle the Tensor module
Next Module: Tensor - Core data structures and operations