- Move all documentation to docs/ directory with clear organization - Use lowercase-with-dashes naming convention (modern standard) - Organize by audience: students/, development/, pedagogy/ - Create comprehensive docs/README.md index - Clean up root directory (only README.md and quickstart.md remain) Structure: docs/ ├── pedagogy/ # Educational philosophy ├── development/ # Module development guides ├── students/ # Student-facing documentation └── README.md # Documentation index This makes the project more professional and easier to navigate.
8.0 KiB
🚀 TinyTorch Quick Start Guide
Get up and running with TinyTorch in 10 minutes! This guide will walk you through setting up your environment and implementing your first ML component.
📋 Prerequisites
- Python 3.8+ (check with
python --version) - Git for cloning the repository
- Basic Python knowledge (functions, classes, imports)
- Jupyter familiarity (we'll install it for you)
⚡ 5-Minute Setup
Step 1: Clone and Navigate
git clone https://github.com/tinytorch/TinyTorch.git
cd TinyTorch
Step 2: Create Virtual Environment
# Create isolated environment
python -m venv .venv
# Activate it
source .venv/bin/activate # Linux/Mac
# OR: .venv\Scripts\activate # Windows
Step 3: Install Dependencies
# Install all required packages
pip install -r requirements.txt
# This installs: numpy, matplotlib, jupyter, nbdev, pytest, and more
Step 4: Verify Installation
# Check TinyTorch CLI
python bin/tito.py --version
# Check environment
python bin/tito.py info
✅ If you see system information, you're ready to go!
🎯 Your First Module: Setup
Let's implement your first TinyTorch component to understand the workflow.
Step 1: Navigate to Setup Module
cd modules/setup/
Step 2: Read the Module Overview
# This explains what you'll build
cat README.md
Step 3: Open the Development Notebook
# Start Jupyter Lab
jupyter lab setup_dev.ipynb
# The notebook will open in your browser at http://localhost:8888
Step 4: Follow the Notebook
The notebook guides you through:
- Environment check - Verify everything works
- Hello function - Implement
hello_tinytorch() - Export process - Learn the
#| exportdirective - Testing - Run interactive tests
Step 5: Export Your Code
# Back in terminal (new tab/window):
cd /path/to/TinyTorch # Navigate back to root
# Export notebook code to Python package
python bin/tito.py sync
This creates tinytorch/core/utils.py with your function!
Step 6: Test Your Implementation
# Run automated tests
python bin/tito.py test --module setup
# Should show: ✅ All tests passed!
Step 7: Verify Integration
# Test that your function is importable
python -c "from tinytorch.core.utils import hello_tinytorch; print(hello_tinytorch())"
🎉 Congratulations! You've completed your first module!
🔄 The TinyTorch Development Workflow
Now you understand the core workflow that you'll use for every module:
graph LR
A[Read README] --> B[Open Notebook]
B --> C[Implement Code]
C --> D[Mark #|export]
D --> E[Test in Notebook]
E --> F[Export with tito sync]
F --> G[Run Tests]
G --> H{Tests Pass?}
H -->|No| C
H -->|Yes| I[Next Module]
Key Commands Reference
| Command | Purpose | When to Use |
|---|---|---|
cat README.md |
Read module overview | Start of each module |
jupyter lab [module]_dev.ipynb |
Open development environment | Implement code |
python bin/tito.py sync |
Export notebooks to package | After coding in notebook |
python bin/tito.py test --module [name] |
Test your implementation | Verify correctness |
python bin/tito.py info |
Check system status | Anytime |
🧗 Next Steps: Building Your First Tensor
Ready for the real challenge? Let's build the foundation of TinyTorch!
Step 1: Move to Tensor Module
cd modules/tensor/
Step 2: Read the Overview
cat README.md
Step 3: Start Building
jupyter lab tensor_dev.ipynb
In this module, you'll implement:
- Tensor class - Multi-dimensional arrays
- Arithmetic operations - Addition, multiplication
- Utility methods - Reshape, transpose, sum
- Error handling - Robust edge cases
Expected Timeline
- Setup module: 15-30 minutes
- Tensor module: 2-4 hours
- Complete course: 40-80 hours (over several weeks)
🛠️ Development Environment Tips
Jupyter Lab Shortcuts
- Shift + Enter: Run cell and move to next
- Ctrl + Enter: Run cell and stay
- A: Insert cell above
- B: Insert cell below
- DD: Delete cell
TinyTorch Best Practices
- Read module READMEs first - Understand objectives
- Test frequently - Don't implement everything at once
- Use
#| exportcorrectly - Only mark code for the package - Write docstrings - Document your functions
- Check tests - They show exactly what's expected
Common Issues and Solutions
"ModuleNotFoundError"
# Make sure you've activated your environment
source .venv/bin/activate
# And exported your notebooks
python bin/tito.py sync
"Command 'tito' not found"
# Use the full path
python bin/tito.py [command]
# Make sure you're in the TinyTorch root directory
pwd # Should end with /TinyTorch
"Tests failing"
# Run with verbose output to see details
python bin/tito.py test --module setup -v
# Check the specific error messages
# Fix in the notebook, then re-export and test
"Jupyter not starting"
# Make sure it's installed
pip install jupyter jupyterlab
# Try classic notebook instead
jupyter notebook modules/setup/setup_dev.ipynb
📚 Learning Path
Beginner Track (Start Here)
- Setup (30 min) - Learn the workflow
- Tensor (4 hours) - Core data structures
- MLP (6 hours) - Basic neural networks
Intermediate Track
- Autograd (8 hours) - Automatic differentiation
- CNN (6 hours) - Convolutional networks
- Training (4 hours) - Training loops and optimizers
Advanced Track
- Data (3 hours) - Efficient data loading
- Kernels (10 hours) - Custom GPU operations
- Compression (6 hours) - Model optimization
Expert Track
- Profiling (4 hours) - Performance analysis
- Benchmarking (4 hours) - Systematic evaluation
- Config (2 hours) - Configuration management
- MLOps (8 hours) - Production systems
🎯 Success Metrics
You'll know you're succeeding when:
After Each Module
- ✅ All tests pass:
python bin/tito.py test --module [name] - ✅ Code is importable:
from tinytorch.core.X import Y - ✅ You understand what you built
- ✅ Ready for the next module
After Major Milestones
- Tensor complete: Can create and manipulate multi-dimensional arrays
- MLP complete: Can build and train simple neural networks
- CNN complete: Can implement convolutional architectures
- Course complete: You've built a complete ML framework!
💡 Getting Help
Self-Help Resources
- Module READMEs - Detailed explanations and tips
- Test files - Show exactly what's expected
- Notebook examples - See reference implementations
- Error messages - Often contain helpful guidance
Debugging Workflow
- Read the error - Understand what failed
- Check the test - See what was expected
- Review the notebook - Look for implementation issues
- Test incrementally - Don't implement everything at once
- Use print statements - Debug your logic
Community Support
- GitHub Issues - Report bugs or ask questions
- Discussions - Share tips and solutions
- Study Groups - Find fellow learners
🚀 Ready to Build?
You now have everything you need to start building ML systems from scratch!
# Quick reminder of the workflow:
cd modules/setup/ # Navigate to module
cat README.md # Read overview
jupyter lab setup_dev.ipynb # Start implementing
# [work in notebook]
python bin/tito.py sync # Export to package
python bin/tito.py test --module setup # Test implementation
Welcome to TinyTorch! Let's build something amazing! 🔥
📖 What's Next?
After completing the QUICKSTART:
- Dive deeper: Read
COURSE_GUIDE.mdfor the complete curriculum - Understand the structure: Review
STRUCTURE_PROPOSAL.mdfor architecture details - Stay updated: Check
README.mdfor the latest information
Happy coding! 🎉