8 Commits

Author SHA1 Message Date
Vijay Janapa Reddi
42025d34aa Standardize section headers to use colons instead of dashes 2025-12-05 13:03:00 -08:00
Vijay Janapa Reddi
3aa6a9b040 Clean up formatting in verification functions 2025-12-05 12:12:38 -08:00
Vijay Janapa Reddi
8b03ee8f23 Refactor Module 15: Extract verify_quantization_works() function
- Create standalone verify_quantization_works() function (Section 5)
- Clean separation: verification logic in reusable function
- test_module() now calls verify_quantization_works() - much cleaner
- Students can call this function on their own models
- Returns dict with verification results for programmatic use
- Includes example usage in __main__ block
- Update section numbering: Systems Analysis now Section 6

Benefits:
- Not tacked on - first-class verification function
- Reusable and discoverable
- Each function has one clear job
- Easier to test verification logic separately
2025-12-05 12:05:51 -08:00
Vijay Janapa Reddi
fa6c725531 Add verification section to Module 15 (Quantization) test_module
- Add VERIFICATION section after integration tests
- Measure actual memory reduction using .nbytes comparison
- Compare FP32 original vs INT8 quantized actual bytes
- Assert 3.5× minimum reduction (accounts for scale/zero_point overhead)
- Print clear before/after with verification checkmark
- Update final summary to include verification confirmation

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 09:18:50 -08:00
Vijay Janapa Reddi
4f06392de5 Apply formatting fixes to achieve 10/10 consistency
- Add 🧪 emoji to all test_module() docstrings (20 modules)
- Fix Module 16 (compression): Add if __name__ guards to 6 test functions
- Fix Module 08 (dataloader): Add if __name__ guard to test_training_integration

All modules now follow consistent formatting standards for release.
2025-11-24 15:07:32 -05:00
Vijay Janapa Reddi
f35f30a1f7 Improve module implementations: code quality and functionality updates
- Enhance tensor operations and autograd functionality
- Improve activation functions and layer implementations
- Refine optimizer and training code
- Update spatial operations and transformer components
- Clean up profiling, quantization, and compression modules
- Streamline benchmarking and acceleration code
2025-11-13 10:42:49 -05:00
Vijay Janapa Reddi
884f024743 Fix NBGrader metadata for Modules 15 and 16
Module 15 (Quantization):
- Added locked=true to test_module cell (line 1523)
- Added NBGrader metadata to systems-thinking markdown cell (line 1751)
- Added schema_version: 3 to both cells

Module 16 (Compression):
- Added NBGrader metadata to 6 solution cells:
  * measure-sparsity (line 380)
  * magnitude-prune (line 511)
  * structured-prune (line 675)
  * low-rank-approx (line 843)
  * distillation (line 1013)
  * compress-model-comprehensive (line 1234)
- Added NBGrader metadata to 6 test cells:
  * test-measure-sparsity (line 427) - 5 points
  * test-magnitude-prune (line 567) - 10 points
  * test-structured-prune (line 733) - 10 points
  * test-low-rank (line 888) - 10 points
  * test-distillation (line 1133) - 15 points
  * test-compression-integration (line 1300) - 20 points
- Total: 70 points for Module 16

Result:
- Module 15: 0 P0-BLOCKER, 0 P1-IMPORTANT (was 1 P0 + 1 P1)
- Module 16: 0 P0-BLOCKER, 0 P1-IMPORTANT (was 12 P0)
- Both modules now production-ready for NBGrader deployment(https://claude.com/claude-code)
2025-11-11 14:50:37 -05:00
Vijay Janapa Reddi
5f3591a57b Reorder modules for better pedagogical flow
Moved memoization (KV-cache) after compression to align with optimization tier milestones.

Changes:
- Module 15: Quantization (was 16)
- Module 16: Compression (was 17)
- Module 17: Memoization (was 15)

Pedagogical Rationale:
This creates clear alignment with the optimization milestone structure:
  - M06 (Profiling): Module 14
  - M07 (Compression): Modules 15-16 (Quantization + Compression)
  - M08 (Acceleration): Modules 17-18 (Memoization/KV-cache + Acceleration)

Before: Students learned KV-cache before understanding why models are slow
After: Students profile → compress → then optimize with KV-cache

Updated milestone reference in profile_kv_cache.py: Module 15 → Module 17
2025-11-10 19:29:10 -05:00