✅ NBGrader solution/test structure: ### BEGIN/END SOLUTION blocks
✅ Educational TODO sections: STEP-BY-STEP, HINTS, EXAMPLES, LEARNING CONNECTIONS
✅ Immediate unit tests: proper assertions after each solution
✅ TinyTorch consistency: same patterns as tensor, layers, activations modules
✅ All tests passing: 100% success rate with comprehensive coverage
Module now follows established TinyTorch educational format:
- Detailed TODO instructions for student implementation
- Solution blocks wrapped in NBGrader tags
- Immediate feedback with unit tests after each piece
- Progress tracking with emojis and clear status messages
Ready for NBGrader processing and student use.
- Implement scaled dot-product attention with masking support
- Build multi-head attention with learnable projections
- Create sinusoidal positional encoding for sequence understanding
- Add layer normalization for training stability
- Complete transformer block with residual connections
- Include self-attention wrapper and utility functions
- Full inline testing with 100% pass rate
- Educational content explaining attention mechanisms
- Foundation for modern AI architectures (GPT, BERT, etc.)
This module bridges classical ML (tensors, layers, networks) with
modern transformer architectures that power ChatGPT and contemporary AI.
- Added educational metadata (difficulty, time_estimate) to all module.yaml files
- Updated convert_readmes.py to read from YAML instead of hardcoded mappings
- Standardized difficulty progression: ⭐ → ⭐⭐ → ⭐⭐⭐ → ⭐⭐⭐⭐ → ⭐⭐⭐⭐⭐🥷
- Fixed path resolution for YAML reading in book build process
- Eliminated duplication: single source of truth for educational metadata
- Capstone gets special ninja treatment (⭐⭐⭐⭐⭐🥷) as beyond-expert level
- Updated book generation to include 15_capstone with 5-star difficulty rating
- Changed time estimate from '20-40 hours' to 'Capstone Project' for better visitor experience
- Removed specific week references from project phases for more encouraging presentation
- Maintained detailed project structure while making timeline more flexible
- Ensures consistent 5-star rating for expert-level modules across the framework
- Added bold formatting to match other modules' style
- Enhanced clarity with more specific descriptors
- Added 'efficiently' and 'with proper broadcasting' for precision
- Now consistent with activations and other modules formatting
- Improves visual hierarchy and readability in built book
Standardize module endings with motivational section + grid cards:
Added to 4 key modules:
- 01_setup: Foundation workflow mastery message
- 03_activations: Neural networks come alive message
- 06_cnn: Computer vision implementation message
- 09_optimizers: Learning algorithms message
Standard Format:
## 🎉 Ready to Build?
[Module-specific motivational content about what they're building]
Take your time, test thoroughly, and enjoy building something that really works! 🔥
[Grid cards automatically follow via converter]
Progress: 6/14 modules now have consistent endings
- ✅ 01_setup, 02_tensor, 03_activations, 06_cnn, 07_dataloader, 09_optimizers
- 🔄 8 more modules to standardize
Result: Better user experience with consistent motivation + clear next steps
Key Improvements:
1. **Meaningful titles**: Keep 'Module: CNN' format instead of just 'CNN'
2. **Clean breadcrumbs**: 'Home → CNN' instead of 'Home → Module 3: 03 Activations'
3. **Remove duplicate info**: Stop generating redundant Module Info boxes
4. **Use source formatting**: Let READMEs control their own presentation
5. **Enhanced README**: Added Jupyter Book admonition formatting to CNN module info
Results:
- More logical navigation and titles
- Single source of truth for module information
- Better formatted content boxes (CNN example with admonitions)
- Eliminated confusing duplicate content
- Cleaner, more professional presentation
README Updates:
- All modules now use consistent '🔥 Module: [Name]' format
- Removed inconsistent emojis (🧠, 🚀, 📊, 🧱, 🏋️)
- Removed module numbers and descriptive subtitles
- Clean, consistent branding across all 14 modules
Converter Updates:
- Added header cleaning logic to strip module prefixes from chapter titles
- Chapters now show clean names: 'CNN', 'Tensor', 'Setup', etc.
- No emoji or module numbers in final website headers
- Maintains clean, professional appearance
Result: Consistent source files + clean website presentation
- Updated all module references to start from 01 instead of 00
- Changed tagline to 'Build your own ML framework. Start small. Go deep.'
- Added educational foundation section linking to ML Systems book
- Updated README, documentation, CLI examples, and prerequisites
- Regenerated book content with consistent numbering throughout
- Maintains 14 modules total but with natural numbering (01-14)
✅ Rename all module directories: 00_setup → 01_setup, etc.
✅ Update convert_modules.py mappings for new directory names
✅ Update _toc.yml file paths and titles (1-14 instead of 0-13)
✅ Regenerate all overview pages with new numbering
✅ Fix all broken references in usage-paths and intro
✅ Update chapter references to use natural numbering
Benefits:
- More intuitive course progression starting from 1
- Matches academic course numbering conventions
- Eliminates confusion about 'Module 0' concept
- Cleaner mental model for students and instructors
- All references and links properly updated
Complete transformation: 14 modules now numbered 01-14
✅ Clean source file headers: 'Module X:' → clean descriptive titles
✅ Regenerate overview pages with clean headers
✅ More flexible content that works in any context
✅ Numbers still provided by book TOC structure
Changes:
- Remove 'Module X: ' prefix from all source file headers
- Headers now focus on descriptive content titles
- Book maintains proper chapter ordering via _toc.yml
- Content is more reusable across different presentations
- Flattened tests/ directory structure (removed integration/ and system/ subdirectories)
- Renamed all integration tests with _integration.py suffix for clarity
- Created test_utils.py with setup_integration_test() function
- Updated integration tests to use ONLY tinytorch package imports
- Ensured all modules are exported before running tests via tito export --all
- Optimized module test timing for fast execution (under 5 seconds each)
- Fixed MLOps test reliability and reduced timing parameters across modules
- Exported all modules (compression, kernels, benchmarking, mlops) to tinytorch package
- Shortened verbose 119-line summary to focused 32-line format
- Removed redundant sections and excessive congratulatory language
- Added standard Next Steps with actionable tito commands
- Now consistent with other module endings (tensor, layers, optimizers, etc.)
- Maintains essential accomplishments and real-world connections
- ✅ tito system info/doctor: Full system health check working
- ✅ tito module status: Shows all 14 modules with proper status
- ✅ tito export --all: Successfully exports all modules to tinytorch package
- ✅ tito test --all: Runs all inline tests (65/66 tests passing)
- ✅ tito nbgrader: All assignment management commands available
- ✅ tito package nbdev: NBDev integration working
- ✅ Global PATH: Added bin/ to PATH for global tito access
Only minor issue: 1 MLOps test failing due to script execution
All core functionality working perfectly for educational use
- Update MLOps module ending to match standard TinyTorch module format
- Remove verbose ending text, use concise professional summary
- Add comprehensive benchmarking integration tests
- Test benchmarking framework with real TinyTorch components
- Include tests for kernels, networks, and statistical validation
- Follow established integration test patterns
- Replace overly celebratory ending with standard progress indicator
- Use same format as other modules: 'Final Progress: [module] ready for [next step]!'
- Maintain professional, educational tone consistent with project
- Standardize module.yaml files (11-13) to match concise format of early modules
- Remove verbose sections, keep essential metadata only
- Update kernels README to match TinyTorch module style standards
- Add comprehensive integration tests for kernels module
- Test hardware-optimized operations with real TinyTorch components
- Prepare for systematic integration testing across all modules
- Complete MLOps pipeline with 4 core components:
1. ModelMonitor: Tracks performance over time, detects degradation
2. DriftDetector: Statistical tests for data distribution changes
3. RetrainingTrigger: Automated retraining based on thresholds
4. MLOpsPipeline: Orchestrates complete workflow integration
- Follows TinyTorch educational pattern exactly:
- Concept explanations before implementation
- Guided TODOs with step-by-step instructions
- Immediate testing after each component
- Progressive complexity building on previous modules
- Comprehensive summary with career applications
- Integrates all previous TinyTorch components:
- Uses training pipeline from Module 09
- Uses benchmarking from Module 12
- Uses compression from Module 10
- Demonstrates complete ecosystem integration
- Production-ready MLOps concepts:
- Performance monitoring and alerting
- Drift detection with statistical validation
- Automated retraining triggers
- Model lifecycle management
- Complete deployment workflows
- Educational value:
- Real-world MLOps applications (Netflix, Uber, Google)
- Industry connections (MLflow, Kubeflow, SageMaker)
- Career preparation for ML Engineer roles
- Complete capstone bringing together all 13 modules
- Technical implementation:
- 1700+ lines of educational content and code
- NBGrader integration for assessment
- Comprehensive test suite with 100+ points
- Auto-discovery testing framework
- Professional documentation and examples
This completes the TinyTorch ecosystem with production-ready MLOps
- Update kernels_dev.py with any modifications made during testing
- Add test_report.md generated by benchmarking module
- Ensure all changes from comprehensive testing are committed
- Simplify testing section to match kernels module convention
- Replace verbose summary with concise pattern matching other modules
- Fix type annotation for BenchmarkResult.metadata field
- Remove excessive detail from module summary (200+ lines → 30 lines)
- Maintain clean, professional educational structure
✅ **Generalized Language:**
- Changed 'capstone project' → 'ML project' throughout
- Renamed generate_capstone_report() → generate_project_report()
- Updated README.md to remove capstone assumptions
- Made module universally applicable
✅ **Maintained Functionality:**
- All 5 test functions still passing (100% success rate)
- Complete benchmarking workflow unchanged
- Professional reporting still generates high-quality outputs
- Statistical validation working correctly
✅ **Improved Focus:**
- Module now teaches systematic ML evaluation skills
- Applicable to research projects, industry work, personal projects
- Removed assumption of specific capstone context
- Enhanced universal applicability
✅ **Test Results:**
- All benchmarking tests passing
- Performance reporter generating professional reports
- Statistical validation working with confidence intervals
- Framework ready for any ML project evaluation
✅ **Full Module Implementation:**
- module.yaml: Proper metadata and dependencies
- README.md: Comprehensive documentation with learning objectives
- benchmarking_dev.py: Complete implementation with educational pattern
✅ **MLPerf-Inspired Architecture:**
- BenchmarkScenarios: Single-stream, server, and offline scenarios
- StatisticalValidator: Proper statistical validation and significance testing
- TinyTorchPerf: Complete framework integrating all components
- PerformanceReporter: Professional report generation for capstone projects
✅ **Educational Excellence:**
- Same structure as layers_dev.py with Build → Use → Analyze framework
- Comprehensive TODO guidance with step-by-step implementation
- Unit tests for each component with immediate feedback
- Integration testing with realistic TinyTorch models
- Professional module summary with career connections
✅ **Test Results:**
- All 5 test functions passing (100% success rate)
- Complete benchmarking workflow validated
- Statistical validation working correctly
- Professional reporting generating capstone-ready outputs
- Framework ready for student use
✅ **Capstone Preparation:**
- Students can now systematically evaluate their final projects
- Professional reporting suitable for academic presentations
- Statistical validation ensures meaningful results
- Industry-standard methodology following MLPerf patterns
🎓 **Perfect Bridge to Module 13 (MLOps):**
- Benchmarking establishes performance baselines
- MLOps will monitor production systems against these baselines
- Statistical validation transfers to production monitoring
- Professional reporting becomes production dashboards
✅ **Pedagogical Improvements:**
- Removed complex SimpleProfiler dependency
- Added simple time_kernel() function using time.perf_counter()
- Displays timing in microseconds (realistic for kernel operations)
- Focused learning on kernel optimization vs profiling complexity
✅ **Clean Learning Progression:**
- Module 11 (Kernels): Simple timing - 'Can I make this faster?'
- Module 12 (Benchmarking): Professional profiling - 'How do I measure systematically?'
- Module 13 (MLOps): Production monitoring - 'How do I track in production?'
✅ **Implementation Details:**
- Fixed imports to use matmul_naive from TinyTorch layers
- Simplified baseline implementation using NumPy dot product
- Reduced cognitive load by removing measurement complexity
- Maintained all kernel optimization concepts
⚠️ **Note:** Cache-friendly implementation needs debugging but core timing functionality works
🎯 **Impact:** Students can now focus on building optimized kernels with immediate microsecond-level performance feedback, setting up perfect progression to comprehensive benchmarking in Module 12.
- Added locked standardized testing sections to autograd and optimizers modules
- Fixed kernels module structure to match optimizers/training pattern
- Added comprehensive VS Code setup guide for Jupytext editing
- All 12 TinyTorch modules now have consistent testing framework
- Cleaned up temporary development files
- Add tinytorch.utils.profiler following PyTorch's utils pattern
- Includes SimpleProfiler class for educational performance measurement
- Provides timing, memory usage, and system metrics
- Follows PyTorch's torch.utils.* organizational pattern
- Module 11: Kernels uses profiler for performance demonstrations
Features:
- Wall time and CPU time measurement
- Memory usage tracking (peak, delta, percentages)
- Array information (shape, size, dtype)
- CPU and system metrics
- Clean educational interface for ML performance learning
Import pattern:
from tinytorch.utils.profiler import SimpleProfiler
MAJOR IMPROVEMENT: Simplified test discovery logic
- Removed restrictive valid_patterns requirement from testing framework
- Any function starting with 'test_' is now automatically discovered
- Follows standard pytest conventions - no maintenance overhead
- Eliminates need to manually add patterns for new test functions
CLEANED UP: Test function names across all 10 modules
- Removed redundant '_comprehensive' suffix from all test functions
- Updated 40+ test function names to be more concise and readable:
* 00_setup: 6 functions (test_personal_info, test_system_info, etc.)
* 01_tensor: 4 functions (test_tensor_creation, test_tensor_properties, etc.)
* 02_activations: 1 function (test_activations)
* 03_layers: 3 functions (test_matrix_multiplication, test_dense_layer, etc.)
* 04_networks: 4 functions (test_sequential_networks, test_mlp_creation, etc.)
* 05_cnn: 3 functions (test_convolution_operation, test_conv2d_layer, etc.)
* 06_dataloader: 4 functions (test_dataset_interface, test_dataloader, etc.)
* 07_autograd: 6 functions (test_variable_class, test_add_operation, etc.)
* 08_optimizers: 5 functions (test_gradient_descent_step, test_sgd_optimizer, etc.)
* 09_training: 6 functions (test_mse_loss, test_crossentropy_loss, etc.)
* 10_compression: 6 functions (already cleaned up)
VERIFICATION: All tests still pass
- All 10 modules tested successfully with new discovery logic
- Total test count maintained: 47 inline tests across all modules
- No functionality lost, only improved maintainability
RESULT: Much cleaner, more maintainable testing framework following standard conventions
- Exported 09_training module using nbdev directly from Python file
- Exported 08_optimizers module to resolve import dependencies
- All training components now available in tinytorch.core.training:
* MeanSquaredError, CrossEntropyLoss, BinaryCrossEntropyLoss
* Accuracy metric
* Trainer class with complete training orchestration
- All optimizers now available in tinytorch.core.optimizers:
* SGD, Adam optimizers
* StepLR learning rate scheduler
- All components properly exported and functional
- Integration tests passing (17/17)
- Inline tests passing (6/6)
- tito CLI integration working correctly
Package exports:
- tinytorch.core.training: 688 lines, 5 main classes
- tinytorch.core.optimizers: 17,396 bytes, complete optimizer suite
- Clean separation of development vs package code
- Ready for production use and further development
- Implemented numerically stable binary cross-entropy using log-sum-exp trick
- Computes loss directly from logits without sigmoid computation
- Handles extreme values (±100) correctly without overflow/underflow
- All training module tests now pass successfully
- Fixed issue where extreme predictions caused NaN values
Technical improvements:
- Uses log_sigmoid(x) = x - max(0,x) - log(1 + exp(-abs(x)))
- Avoids sigmoid computation entirely for better numerical stability
- Maintains mathematical correctness while preventing overflow
- Perfect predictions now produce near-zero loss as expected
- Add training_dev.py with comprehensive educational structure
- Implement MeanSquaredError, CrossEntropyLoss, BinaryCrossEntropyLoss
- Add Accuracy metric with extensible framework
- Create Trainer class for complete training orchestration
- Include comprehensive inline tests for all components
- Add module.yaml with proper dependencies and metadata
- Create detailed README.md with examples and applications
- Add test_training_integration.py with real component integration tests
- Follow TinyTorch NBDev educational pattern with Build → Use → Optimize
- Ready for real-world training workflows with validation and monitoring
- Updated all _dev.py files to use 'comprehensive test' instead of 'integration test'
- Changed function names: test_*_integration() → test_*_comprehensive()
- Updated markdown headers, print statements, success/error messages
- Clarifies that these are comprehensive tests of single modules, not cross-module integration
- Real cross-module integration tests remain in tests/ directory
- Updated modules: 00_setup, 01_tensor, 02_activations, 03_layers, 04_networks, 05_cnn, 06_dataloader, 07_autograd
- Remove student-facing bloat (learning objectives, time estimates, pedagogical details)
- Remove assessment sections (not needed for operational metadata)
- Streamline to essential system information only:
- Module identification and dependencies
- Package export configuration
- File structure and component listings
- Updated existing files (6): setup, tensor, activations, layers, autograd, optimizers
- Created missing files (3): networks, cnn, dataloader
- Consistent 25-26 line format across all 9 modules
Result: Pure operational metadata for CLI tools and build systems
Perfect for instructor/staff development workflow
- 00_setup: Fix naming inconsistency (setup_health → setup_score)
- Tests expected 'setup_score' key but implementation returned 'setup_health'
- Updated all references to use consistent 'setup_score' naming
- Result: 37/37 tests now passing
- 05_cnn: Fix flatten function shape expectations
- Comprehensive tests expected (4,) shape but integration tests expected (1,4) shape
- Made comprehensive tests consistent with integration test expectations
- Flatten function now correctly preserves batch dimension for realistic usage
- Result: 39/39 tests now passing
- 08_optimizers: Fix recursion error in test execution
- Direct test call was causing infinite recursion loop
- Removed problematic direct test call, rely on auto-discovery system
- Result: 5/5 tests now passing
All inline tests now pass: 214/214 tests (100% success rate)
🎯 Issues Fixed:
1. MockTensor Scalar Handling: Fix np.array([data]) → np.array(data) for scalar shape ()
2. Index Bounds Validation: Add negative index check (index < 0) to MockDataset.__getitem__
3. DataLoader Input Validation: Add proper validation for batch_size > 0 and dataset ≠ None
✅ Impact: 06_dataloader external tests now pass 28/28 (was 19/28)
🔧 Technical Changes:
- MockTensor: Handle scalars correctly to create shape () instead of (1,)
- MockDataset: Validate negative indices to raise IndexError as expected
- DataLoader: Add robust input validation with proper error messages
- All issues were legitimate implementation problems, not test issues
This completes the systematic external test fixing across all 4 modules with failures.