Commit Graph

890 Commits

Author SHA1 Message Date
Vijay Janapa Reddi
f02fe68973 🔄 Rename milestone 06: mlperf → scaling (2020 GPT-3 era)
- 06_2020_scaling represents the scale crisis that made systems optimization essential
- Covers modules 14-19 (KV-cache through benchmarking)
- Complete decade progression: 1957 → 1969 → 1986 → 1998 → 2017 → 2020
2025-10-27 13:00:30 -04:00
Vijay Janapa Reddi
c4d5e4ebf8 🏗️ Restructure milestones with decade-based naming
- Rename to clean, focused convention: 01_1957_perceptron, 02_1969_xor, etc.
- Drop dramatic language (crisis, revival, revolution, era)
- 06_2018_mlperf → 06_2020_scaling (matches GPT-3 scale era)
- Tells clear story: 1950s → 2020s ML evolution
- Each milestone represents major architectural/systems shift
- Remove redundant step1/2/3 files from transformer milestone
2025-10-27 13:00:06 -04:00
Vijay Janapa Reddi
0ae627d0ea Clean root directory: remove debug scripts, status files, and redundant docs 2025-10-26 19:03:15 -04:00
Vijay Janapa Reddi
f1ae1728c6 🧹 Remove book/_build/ artifacts from git tracking
- Added book/_build/ to .gitignore
- Removed 540 auto-generated Jupyter Book build files from tracking
- Files remain locally for viewing but won't be committed anymore
- Reduces repo size and prevents merge conflicts on generated files
2025-10-25 17:37:43 -04:00
Vijay Janapa Reddi
59bbf7f93e 🧹 Remove git-rewrite temporary files 2025-10-25 17:36:10 -04:00
Vijay Janapa Reddi
f9449ee3d4 Merge remote dev branch with local website updates 2025-10-25 17:35:34 -04:00
Vijay Janapa Reddi
9982d7c4d8 🧹 Clean up book files
- Remove command-reference.md (consolidated into tito-essentials)
- Update resources.md and testing-framework.md
2025-10-25 17:31:08 -04:00
Vijay Janapa Reddi
019c8ba815 🧹 Clean up git-rewrite temporary files 2025-10-25 17:27:20 -04:00
Vijay Janapa Reddi
68ac62f182 📚 Update website navigation and content
- Add Module 20 (AI Olympics) to Competition section
- Remove Historical Milestones from navigation (simplify)
- Remove separate Leaderboard page (consolidate into capstone)
- Simplify AI Olympics capstone content (~60 lines)
  - Clear 'Coming Soon' box for competition platform
  - Brief category descriptions
  - Focus on what students can do now
- Simplify Community page (~50 lines)
  - Clear 'Coming Soon' box for dashboard features
  - Brief feature descriptions
  - Ways to participate now
- Split Competition and Community into separate nav sections
- Fix jupyter-book dependency compatibility for Python 3.8
  - myst-parser 0.18.1 (compatible with myst-nb 0.17.2)
  - sphinx 5.3.0
- Update requirements.txt with compatible versions

Result: Clean, honest, scannable website that shows all 20 modules
2025-10-25 17:26:54 -04:00
Vijay Janapa Reddi
2d4294a79a Add activity badges to README
- Add last commit badge to show project is actively maintained
- Add commit activity badge to show consistent development
- Add GitHub stars badge for social proof
- Add contributors badge to highlight collaboration
2025-10-25 17:07:43 -04:00
Vijay Janapa Reddi
b8f7ee2cbc Add activity badges to README
- Add last commit badge to show project is actively maintained
- Add commit activity badge to show consistent development
- Add GitHub stars badge for social proof
- Add contributors badge to highlight collaboration
2025-10-25 17:07:43 -04:00
Vijay Janapa Reddi
ea53d00138 Fix modules 10-13 tests and add CLAUDE.md
- Add CLAUDE.md entry point for Claude AI system
- Fix tito test command to set PYTHONPATH for module imports
- Fix embeddings export directive placement for nbdev
- Fix attention module to export imports properly
- Fix transformers embedding index casting to int
2025-10-25 17:04:00 -04:00
Vijay Janapa Reddi
791b09a950 Fix modules 10-13 tests and add CLAUDE.md
- Add CLAUDE.md entry point for Claude AI system
- Fix tito test command to set PYTHONPATH for module imports
- Fix embeddings export directive placement for nbdev
- Fix attention module to export imports properly
- Fix transformers embedding index casting to int
2025-10-25 17:04:00 -04:00
Vijay Janapa Reddi
0ad52f817a refactor: Update transformers module and milestone compatibility
- Update transformers module to match tokenization style with improved ASCII diagrams
- Fix attention module to use proper multi-head interface
- Update transformer era milestone for refined module integration
- Fix import paths and ensure forward() method consistency
- All transformer components now work seamlessly together
2025-10-25 16:42:02 -04:00
Vijay Janapa Reddi
6603e00850 refactor: Update transformers module and milestone compatibility
- Update transformers module to match tokenization style with improved ASCII diagrams
- Fix attention module to use proper multi-head interface
- Update transformer era milestone for refined module integration
- Fix import paths and ensure forward() method consistency
- All transformer components now work seamlessly together
2025-10-25 16:42:02 -04:00
Vijay Janapa Reddi
ed52d8ac59 refactor: Update attention module to match tokenization style
- Clean import structure following TinyTorch dependency chain
- Add proper export declarations for key functions and classes
- Standardize NBGrader cell structure and testing patterns
- Enhance ASCII diagrams with improved formatting
- Align documentation style with tokenization module standards
- Maintain all core functionality and educational value

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-25 15:26:33 -04:00
Vijay Janapa Reddi
77e2e7fd4a refactor: Update attention module to match tokenization style
- Clean import structure following TinyTorch dependency chain
- Add proper export declarations for key functions and classes
- Standardize NBGrader cell structure and testing patterns
- Enhance ASCII diagrams with improved formatting
- Align documentation style with tokenization module standards
- Maintain all core functionality and educational value
2025-10-25 15:26:33 -04:00
Vijay Janapa Reddi
3a1b08fd9b Merge remote-tracking branch 'origin/dev' into dev 2025-10-25 15:01:45 -04:00
Vijay Janapa Reddi
4d70e308ff refactor: Update embeddings module to match tokenization style
- Standardize import structure following TinyTorch dependency chain
- Enhance section organization with 6 clear educational sections
- Add comprehensive ASCII diagrams matching tokenization patterns
- Improve code organization and function naming consistency
- Strengthen systems analysis and performance documentation
- Align package integration documentation with module standards

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-25 14:58:30 -04:00
Vijay Janapa Reddi
daaf507c58 Update work in progress status in README 2025-10-25 14:00:22 -04:00
Vijay Janapa Reddi
1bddedfef0 Add .cursor/ and .claude/ to .gitignore and remove from tracking 2025-10-25 13:59:11 -04:00
Vijay Janapa Reddi
805608e3d4 fix: Adjust ASCII diagram spacing for consistent alignment 2025-10-24 17:51:11 -04:00
Vijay Janapa Reddi
c43c5d89c6 docs: Improve tokenization module with enhanced ASCII diagrams
Following module developer guidelines, added comprehensive visual diagrams:

1. Text-to-Numbers Pipeline (Introduction):
   - Added full boxed diagram showing 4-step tokenization process
   - Clear visual flow from human text to numerical IDs
   - Each step explained inline with the diagram

2. Character Tokenization Process:
   - Step-by-step vocabulary building visualization
   - Shows corpus → unique chars → vocab with IDs
   - Encoding process with ID lookup visualization
   - Decoding process with reverse lookup
   - All in clear nested boxes

3. BPE Training Algorithm:
   - Comprehensive 4-step process with nested boxes
   - Pair frequency analysis with bar charts (████)
   - Before/After merge visualizations
   - Iteration examples showing vocabulary growth
   - Final results with key insights

4. Memory Layout for Embedding Tables:
   - Visual bars showing relative memory sizes
   - Character (204KB) vs BPE-50K (102MB) vs Word-100K (204MB)
   - Shows fp32/fp16/int8 precision trade-offs
   - Real production model examples (GPT-2/3, BERT, T5, LLaMA)
   - Clear table format for comparison

Educational improvements:
- More visual, less text-heavy
- Clearer step-by-step flows
- Better intuition building
- Production context throughout
- Following module developer ASCII diagram patterns

Students now see:
- HOW tokenization works (not just WHAT)
- WHY different strategies exist
- WHAT the memory implications are
- HOW production models make these choices
2025-10-24 17:51:11 -04:00
Vijay Janapa Reddi
6efe1124c0 refactor: Standardize imports across modules 10-17 to match 01-09
Enforce consistent import pattern across all modules:
- Direct imports from tinytorch.core.* (no fallbacks)
- Remove all sys.path.append manipulations
- Remove try/except import fallbacks
- Remove mock/dummy class fallbacks

Fixed modules:
- Module 10 (tokenization): Removed try/except fallback
- Module 12 (attention): Removed sys.path.append for tensor/layers
- Module 15 (profiling): Removed sys.path + mock Tensor/Linear/Conv2d
- Module 16 (acceleration): Removed hardcoded path + importlib + mock Tensor
- Module 17 (quantization): Removed sys.path + disabled fallback block

All modules now follow the same pattern as modules 01-09:
  from tinytorch.core.tensor import Tensor
  from tinytorch.core.layers import Linear
  # etc.

No development fallbacks - assume tinytorch package is installed.
2025-10-24 17:51:10 -04:00
Vijay Janapa Reddi
9bb506a5b5 Merge pull request #7 from Zappandy/feature/dynamic-venv-config
Feature/dynamic venv config
2025-10-22 09:07:00 -04:00
Vijay Janapa Reddi
3f05acee4c Add construction-themed work-in-progress banner to website
- Bright yellow/orange gradient banner with construction icons (🚧 ⚠️ 🔨)
- Interactive controls for collapsing and dismissing the banner
- Responsive design that adapts to different screen sizes
- Clear messaging about active development and community feedback
- Proper spacing and professional appearance
- JavaScript functionality for persistent user preferences

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-19 16:19:10 -04:00
Vijay Janapa Reddi
0b961abc79 fix: Add sphinxcontrib-mermaid to book requirements
- Book _config.yml uses mermaid extension
- Extension was missing from requirements.txt
- Fixes Jupyter Book build error
2025-10-19 13:20:30 -04:00
Vijay Janapa Reddi
a639e1a771 fix: Use python -m tito.main instead of tito command
- tito entry point not configured in pyproject.toml
- Use module invocation for deploy-book workflow
2025-10-19 13:17:00 -04:00
Vijay Janapa Reddi
49c7515255 ci: Disable test-notebooks workflow
- This workflow was testing notebook conversion features
- Not required for website deployment
- Website deploys via deploy-book.yml on main branch
- Can re-enable later if needed for CI testing
2025-10-19 13:00:16 -04:00
Vijay Janapa Reddi
e55aa4a513 fix: Look for module dev files in modules/source subdirectory
- NotebooksCommand now checks modules/source/ for dev files
- Fixes 'No *_dev.py files found' error in CI
- Maintains backwards compatibility with flat structure
2025-10-19 12:59:20 -04:00
Vijay Janapa Reddi
5d46020bfa fix: Register notebooks command in CLI
- Add NotebooksCommand to commands dictionary in main.py
- Command was imported but not registered
- Fixes 'invalid choice: notebooks' error in workflow
2025-10-19 12:55:15 -04:00
Vijay Janapa Reddi
7d23bb1855 fix: Correct tito command syntax in workflow
- Change 'tito module notebooks' to 'tito notebooks'
- The notebooks command is a top-level command, not a module subcommand
- Fixes workflow test failures
2025-10-19 12:53:02 -04:00
Vijay Janapa Reddi
01bb20f235 fix: Remove mutually exclusive group from export command
- Positional arguments cannot be in mutually exclusive groups in argparse
- Keep modules as positional argument, --all as optional flag
- Fixes CLI initialization error in GitHub Actions
2025-10-19 12:50:59 -04:00
Vijay Janapa Reddi
6e789d5662 fix: Update GitHub Actions to use v4 of upload-artifact and cache
- Upgrade actions/upload-artifact from v3 to v4
- Upgrade actions/cache from v3 to v4
- Resolves deprecation warnings causing workflow failures
2025-10-19 12:49:23 -04:00
Vijay Janapa Reddi
4941fa9dcb Merge transformers-integration into dev
- Resolve conflicts in README.md and milestones-overview.md
- Add transformer modules and milestones
- Fix GitHub Actions workflow issues
2025-10-19 12:48:18 -04:00
Vijay Janapa Reddi
42a77450c0 docs: update README and website with milestones structure
- Updated main README to prominently feature historical milestones (1957-2024)
- Added new 'Journey Through ML History' section to book navigation
- Created comprehensive milestones-overview.md chapter explaining the progression
- Updated intro.md with milestone achievements section
- Enhanced quickstart-guide.md with milestone unlock information
- Reflects working milestones/ directory structure with 6 historical demonstrations
- Clear progression: Perceptron (1957) → XOR (1969) → MLP (1986) → CNN (1998) → Transformers (2017) → Systems (2024)
- Emphasizes proof-of-mastery approach with real achievements
2025-10-19 12:47:17 -04:00
Vijay Janapa Reddi
76fb4326dd feat: Complete transformer integration with milestones
- Add tokenization module (tinytorch/text/tokenization.py)
- Update Milestone 05 transformer demos (validation, TinyCoder, Shakespeare)
- Update book chapters with milestones overview
- Update README and integration plan
- Sync module notebooks and metadata
2025-10-19 12:46:58 -04:00
Vijay Janapa Reddi
63accf49f6 fix: Resolve GitHub Actions workflow failures
- Fix YAML syntax error in test-notebooks.yml (multi-line Python code)
- Add missing setup-dev.sh script referenced by workflow
- Both workflow files now pass YAML validation
2025-10-19 12:46:34 -04:00
Vijay Janapa Reddi
d654b76d17 Update README.md 2025-10-12 22:21:24 -04:00
Zappandy
7f5d591aed fixed default venv value in config for validation 2025-10-11 13:12:40 +02:00
Zappandy
e96d821fa1 Feat(env) dynamic virtual env support for advanced users 2025-10-11 12:31:11 +02:00
Vijay Janapa Reddi
d103b42177 Add Milestone 05: TinyGPT transformer demos (validation, TinyCoder, Shakespeare) 2025-09-30 18:42:37 -04:00
Vijay Janapa Reddi
78c172302e docs: update README and website with milestones structure
- Updated main README to prominently feature historical milestones (1957-2024)
- Added new 'Journey Through ML History' section to book navigation
- Created comprehensive milestones-overview.md chapter explaining the progression
- Updated intro.md with milestone achievements section
- Enhanced quickstart-guide.md with milestone unlock information
- Reflects working milestones/ directory structure with 6 historical demonstrations
- Clear progression: Perceptron (1957) → XOR (1969) → MLP (1986) → CNN (1998) → Transformers (2017) → Systems (2024)
- Emphasizes proof-of-mastery approach with real achievements
2025-09-30 17:42:12 -04:00
Vijay Janapa Reddi
ad0efbb434 feat: Add overfitting detection to Milestones 03 and 04
Track train vs test accuracy to detect overfitting:

Training Progress:
- Print both train and test accuracy every 5 epochs
- Show gap between train/test with indicator:
  ✓ Gap < 10%: Healthy generalization
  ⚠️ Gap > 10%: Overfitting warning

Results Table (ACT 4):
- Train Accuracy + improvement
- Test Accuracy + improvement
- Overfitting Gap + status
- Training Time

Final Panel (ACT 5):
- Show test accuracy with gap
- Celebrate good generalization

Educational Value:
Students now see:
1. How to detect overfitting (growing train/test gap)
2. When model memorizes vs generalizes
3. Real ML systems track BOTH metrics

Example output:
  Epoch  5/20  Loss: 1.234  Train: 85.0%  Test: 82.0%  ✓ Gap: 3.0%
  Epoch 10/20  Loss: 0.891  Train: 90.0%  Test: 87.0%  ✓ Gap: 3.0%

This prepares them for regularization techniques (Dropout, etc.)
in later modules!
2025-09-30 17:33:54 -04:00
Vijay Janapa Reddi
877b9adc27 style: Make Milestone 04 architecture consistent with others
Changed from Panel to plain console.print with ASCII diagram.

All 4 milestones now follow identical format:
- console.print('[bold]🏗️ The Architecture:[/bold]')
- ASCII box diagram with arrows
- console.print('[bold]🔧 Components:[/bold]')
- Bullet list of components

This ensures visual consistency across all milestone demonstrations!
2025-09-30 17:17:46 -04:00
Vijay Janapa Reddi
e6d0757bbd refactor: Keep explicit module imports + optimize CNN milestone
Import Strategy:
- Keep explicit 'from tinytorch.core.spatial import Conv2d'
- Maps directly to module structure (Module 09 → core.spatial)
- Better for education: students see exactly where each concept lives
- Removed redundant tinytorch/nn.py (nn/ directory already exists)

Milestone 04 Optimizations:
- Reduced epochs: 50 → 20 (explicit loops are slow!)
- Print progress every 5 epochs (instead of 10)
- Load from local npz file (no sklearn dependency)
- Still achieves ~80%+ accuracy

Educational Rationale:
TinyTorch uses explicit imports to show module structure:
  tinytorch.core.tensor      # Module 01
  tinytorch.core.layers      # Module 03
  tinytorch.core.spatial     # Module 09
  tinytorch.core.losses      # Module 04

PyTorch's torch.nn is convenient but pedagogically unclear.
Our approach: clarity over convenience!
2025-09-30 17:15:40 -04:00
Vijay Janapa Reddi
95274448bd feat: Add Milestone 04 (CNN Revolution 1998) + Clean spatial imports
Milestone 04 - CNN Revolution:
 Complete 5-Act narrative structure (Challenge → Reflection)
 SimpleCNN architecture: Conv2d → ReLU → MaxPool → Linear
 Trains on 8x8 digits dataset (1,437 train, 360 test)
 Achieves 84.2% accuracy with only 810 parameters
 Demonstrates spatial operations preserve structure
 Beautiful visual output with progress tracking

Key Features:
- Conv2d (1→8 channels, 3×3 kernel) detects local patterns
- MaxPool2d (2×2) provides translation invariance
- 100× fewer parameters than equivalent MLP
- Training completes in ~105 seconds (50 epochs)
- Sample predictions table shows 9/10 correct

Module 09 Spatial Improvements:
- Removed ugly try/except import pattern
- Clean imports: 'from tinytorch.core.tensor import Tensor'
- Matches PyTorch style (simple and professional)
- No fallback logic needed

All 4 milestones now follow consistent 5-Act structure!
2025-09-30 17:04:41 -04:00
Vijay Janapa Reddi
6af994a82f test: Add comprehensive CNN integration tests
Created test_cnn_integration.py with:

 Conv2d Operations Tests:
- Verifies actual convolution (not just shape manipulation)
- Edge detector test proves Conv2d computes correctly
- Shape transformations for various configurations
- Parameter count verification (448 params for 3→16, k=3)

 Pooling Operations Tests:
- MaxPool2d actually computes maximum values
- AvgPool2d actually computes averages
- Shape transformations validated
- Handles negative values correctly

 Numerical Stability Tests:
- Zero inputs handled correctly
- Negative values in pooling work properly

⚠️  Gradient Flow Tests (TODO):
- Placeholder for Conv2d backward support
- Will add when Conv2d autograd integration is implemented

All forward pass tests passing (8/8)!
These tests ensure CNNs actually work, not just shape shuffle.
2025-09-30 16:57:14 -04:00
Vijay Janapa Reddi
cf575b4829 fix: Update Module 09 spatial for standalone classes
Changes:
- Removed broken _SimplifiedTensor and internal Module helper classes
- Updated imports to use tinytorch.core instead of dev modules
- Removed Module inheritance from Conv2d, MaxPool2d, AvgPool2d, SimpleCNN
- All spatial classes now standalone like Linear in layers module

This allows spatial module to export cleanly and import correctly:
  from tinytorch.core.spatial import Conv2d, MaxPool2d, AvgPool2d

Smoke test: Conv2d(1,3,8,8) → (1,16,6,6) ✓
2025-09-30 16:54:21 -04:00
Vijay Janapa Reddi
a62e696900 refactor: Display training times in milliseconds for better resolution
Training on 8x8 digits is so fast (< 1 second) that showing
seconds rounded to 1 decimal doesn't provide meaningful resolution.
Changed to milliseconds (ms) to show actual time differences between
batch sizes.

Now shows: '147ms' instead of '0.1s'
2025-09-30 16:48:26 -04:00