mirror of
https://github.com/MLSysBook/TinyTorch.git
synced 2026-05-05 19:09:35 -05:00
- Remove bold formatting from all markdown headers - Remove 'NEW:' tags from README to keep it clean - Maintain professional academic appearance
244 lines
6.6 KiB
Markdown
244 lines
6.6 KiB
Markdown
# Serious Development Path
|
|
|
|
**Perfect for:** "I want to build this myself" • "This is my class assignment" • "I want to understand ML frameworks deeply"
|
|
|
|
---
|
|
|
|
## What You'll Build
|
|
|
|
A complete ML framework from scratch, including:
|
|
- **Your own tensor library** with operations and autograd
|
|
- **Neural network components** (layers, activations, optimizers)
|
|
- **Training systems** that work on real datasets (CIFAR-10)
|
|
- **Production features** (compression, monitoring, benchmarking)
|
|
- **Language models** that extend your vision framework to TinyGPT
|
|
|
|
**End result:** A working ML framework that powers both computer vision AND language models.
|
|
|
|
---
|
|
|
|
## Quick Start (5 minutes)
|
|
|
|
### Step 1: Get the Code
|
|
```bash
|
|
git clone https://github.com/your-org/tinytorch.git
|
|
cd TinyTorch
|
|
```
|
|
|
|
### Step 2: Setup Environment
|
|
```bash
|
|
# Activate virtual environment
|
|
source bin/activate-tinytorch.sh
|
|
|
|
# Install dependencies
|
|
make install
|
|
|
|
# Verify everything works
|
|
tito system doctor
|
|
```
|
|
|
|
### Step 3: Start Building
|
|
```bash
|
|
# Open first assignment
|
|
cd modules/source/01_setup
|
|
jupyter lab setup_dev.py
|
|
```
|
|
|
|
### Step 4: Build → Test → Export → Use
|
|
```bash
|
|
# After implementing code in the notebook:
|
|
tito export # Export your code to tinytorch package
|
|
tito test setup # Test your implementation
|
|
|
|
# Now use YOUR own code:
|
|
python -c "from tinytorch.core.setup import hello_tinytorch; hello_tinytorch()"
|
|
# 🔥 TinyTorch! Built by: [Your Name]
|
|
```
|
|
|
|
---
|
|
|
|
## Learning Path (Progressive Complexity)
|
|
|
|
### Foundation (Weeks 1-2)
|
|
Build the core infrastructure:
|
|
|
|
**Module 01: Setup & CLI**
|
|
- Professional development workflow with `tito` CLI
|
|
- Understanding package architecture and exports
|
|
- Quality assurance with automated testing
|
|
|
|
**Module 01: Tensors**
|
|
- Multi-dimensional arrays and operations
|
|
- Memory management and data types
|
|
- Foundation for all ML operations
|
|
|
|
**Module 02: Activations**
|
|
- ReLU, Sigmoid, Tanh, Softmax functions
|
|
- Understanding nonlinearity in neural networks
|
|
- Mathematical foundations of deep learning
|
|
|
|
---
|
|
|
|
### 🧱 Building Blocks (Weeks 3-4)
|
|
Create neural network components:
|
|
|
|
**Module 03: Layers**
|
|
- Dense (linear) layers with matrix multiplication
|
|
- Weight initialization strategies
|
|
- Building blocks that stack together
|
|
|
|
**Module 04: Networks**
|
|
- Sequential model architecture
|
|
- Composition patterns and forward propagation
|
|
- Creating complete neural networks
|
|
|
|
**Module 05: CNNs**
|
|
- Convolutional operations for computer vision
|
|
- Understanding spatial processing
|
|
- Building blocks for image classification
|
|
|
|
---
|
|
|
|
### Training Systems (Weeks 5-6)
|
|
Complete training infrastructure:
|
|
|
|
**Module 06: DataLoader**
|
|
- Efficient data loading and preprocessing
|
|
- Real dataset handling (CIFAR-10)
|
|
- Batching, shuffling, and memory management
|
|
|
|
**Module 07: Autograd**
|
|
- Automatic differentiation engine
|
|
- Computational graphs and backpropagation
|
|
- The magic that makes training possible
|
|
|
|
**Module 08: Optimizers**
|
|
- SGD, Adam, and learning rate scheduling
|
|
- Understanding gradient descent variants
|
|
- Convergence and training dynamics
|
|
|
|
**Module 09: Training**
|
|
- Complete training loops and loss functions
|
|
- Model evaluation and metrics
|
|
- Checkpointing and persistence
|
|
|
|
---
|
|
|
|
### Production & Performance (Weeks 7-8)
|
|
Real-world deployment:
|
|
|
|
**Module 10: Compression**
|
|
- Model pruning and quantization
|
|
- Reducing model size by 75%+
|
|
- Deployment optimization
|
|
|
|
**Module 11: Kernels**
|
|
- High-performance custom operations
|
|
- Hardware-aware optimization
|
|
- Understanding framework internals
|
|
|
|
**Module 12: Benchmarking**
|
|
- Systematic performance measurement
|
|
- Statistical validation and reporting
|
|
- MLPerf-style evaluation
|
|
|
|
**Module 13: MLOps**
|
|
- Production deployment and monitoring
|
|
- Continuous learning and model updates
|
|
- Complete production pipeline
|
|
|
|
**Module 16: TinyGPT 🔥**
|
|
- Extend vision framework to language models
|
|
- GPT-style transformers with 95% component reuse
|
|
- Autoregressive text generation
|
|
- Framework generalization mastery
|
|
|
|
---
|
|
|
|
## Development Workflow
|
|
|
|
### The `tito` CLI System
|
|
TinyTorch includes a complete CLI for professional development:
|
|
|
|
```bash
|
|
# System management
|
|
tito system doctor # Check environment health
|
|
tito system info # Show module status
|
|
|
|
# Module development
|
|
tito export # Export dev code to package
|
|
tito test setup # Test specific module
|
|
tito test --all # Test everything
|
|
|
|
# NBGrader integration
|
|
tito nbgrader generate setup # Create assignments
|
|
tito nbgrader release setup # Release to students
|
|
tito nbgrader autograde setup # Auto-grade submissions
|
|
```
|
|
|
|
### Quality Assurance
|
|
Every module includes comprehensive testing:
|
|
- **100+ automated tests** ensure correctness
|
|
- **Inline tests** provide immediate feedback
|
|
- **Integration tests** verify cross-module functionality
|
|
- **Performance benchmarks** track optimization
|
|
|
|
---
|
|
|
|
## Proven Student Outcomes
|
|
|
|
```{admonition} Real Results
|
|
:class: success
|
|
**After 6-8 weeks, students consistently:**
|
|
|
|
✅ Build multi-layer perceptrons that classify CIFAR-10 images
|
|
✅ Implement automatic differentiation from scratch
|
|
✅ Create custom optimizers (SGD, Adam) that converge reliably
|
|
✅ Optimize models with pruning and quantization
|
|
✅ Deploy production ML systems with monitoring
|
|
✅ Understand framework internals better than most ML engineers
|
|
🔥 **Extend their vision framework to language models with 95% reuse**
|
|
|
|
**Test Coverage:** 200+ tests across all modules ensure student implementations work
|
|
```
|
|
|
|
---
|
|
|
|
## Why This Approach Works
|
|
|
|
### Build → Use → Understand
|
|
Every component follows this pattern:
|
|
|
|
1. **🔧 Build**: Implement `ReLU()` from scratch
|
|
2. **🚀 Use**: `from tinytorch.core.activations import ReLU` - your code!
|
|
3. **💡 Understand**: See how it enables complex pattern learning
|
|
|
|
### Real Data, Real Systems
|
|
- Work with CIFAR-10 (not toy datasets)
|
|
- Production-style code organization
|
|
- Performance and engineering considerations
|
|
- Professional development practices
|
|
|
|
### Immediate Feedback
|
|
- Code works immediately after implementation
|
|
- Visual progress indicators and success messages
|
|
- Comprehensive error handling and guidance
|
|
- Professional-quality development experience
|
|
|
|
---
|
|
|
|
## Ready to Start?
|
|
|
|
### Choose Your Module
|
|
**New to ML frameworks?** → Start with [Setup](../chapters/01-setup.md)
|
|
**Have ML experience?** → Jump to [Tensors](../chapters/02-tensor.md)
|
|
**Want to see the vision?** → Try [Activations](../chapters/03-activations.md)
|
|
|
|
### Get Help
|
|
- **💬 Discussions**: GitHub Discussions for questions
|
|
- **🐛 Issues**: Report bugs or suggest improvements
|
|
- **📧 Support**: Direct contact with TinyTorch team
|
|
|
|
---
|
|
|
|
*🎉 Ready to build your own ML framework? Your unified vision+language framework is 8 weeks away!* |