Vijay Janapa Reddi
999fd13447
refactor(tests): reorganize test folders and fix misplaced files
...
Folder consolidation:
- Merge system/ into integration/ (removed duplicate folder)
- Remove performance/ (only had framework, no tests)
File relocations:
- Move test_dense_layer.py, test_dense_integration.py from 04_losses/ to 03_layers/
- Move test_network_capability.py from 04_losses/ to integration/
- Move test_kv_cache_integration.py from 14_profiling/ to 18_memoization/
- Move system/ tests (forward_passes, gradients, shapes, etc.) to integration/
Removed duplicates:
- system/test_gradient_flow_overall.py (duplicate of integration version)
- system/test_integration.py (redundant with integration/ folder)
- system/test_milestones.py (duplicate of milestones/ tests)
Final structure: 26 folders, 100 test files
2026-01-24 12:44:40 -05:00
Vijay Janapa Reddi
389989ece7
refactor(tests): clean up test folder and fix gradient flow issues
...
Test Cleanup (113 files, -22,000 lines):
- Remove 21 redundant run_all_tests.py files
- Remove checkpoints/ folder (22 obsolete checkpoint files)
- Remove progressive/, debugging/, diagnostic/ folders
- Remove duplicate integration tests and examples
- Remove orphaned dev artifacts and generated outputs
- Consolidate test_gradient_flow_overall.py into system/
Documentation Cleanup (4 files removed):
- Remove duplicate HOW_TO_USE.md, WORKFLOW.md, SYSTEM_DESIGN.md
- Trim environment/README.md from 334 to 86 lines
- Update capstone/README.md removing outdated bug references
Test Fixes:
- Add requires_grad=True to layer parameters in gradient tests
- Fix PositionalEncoding argument order in test_shapes.py
- Adjust performance thresholds for realistic expectations
- Fix gradient clipping to handle memoryview correctly
- Update zero_grad assertions to accept None or zeros
2026-01-24 12:22:37 -05:00
Vijay Janapa Reddi
42face28fb
refactor(tests): remove all pytest.skip patterns for honest test results
...
- Move imports to module level in all *_core.py test files (16 files)
- Remove try/except/skip patterns from integration tests
- Remove @pytest.mark.skip decorators from gradient flow tests
- Convert environment validation skips to warnings for optional checks
- Change milestone tests from skip to fail when scripts missing
Tests now either pass or fail - no silent skipping that hides issues.
This ensures the test suite provides accurate feedback about what works.
2026-01-23 23:06:23 -05:00
Vijay Janapa Reddi
acb5142fd7
fix(tests): resolve import issues and test naming collisions
...
- Fix incorrect imports (tinytorch.text/nn/data → tinytorch.core.*)
- Fix MeanSquaredError → MSELoss imports
- Fix learning_rate= → lr= for optimizer arguments
- Rename test_progressive_integration.py files to unique names
- Add missing PerformanceTestSuite classes to performance framework
- Add pytest config to tinytorch/pyproject.toml to override coverage
This resolves the pytest collection errors caused by module name conflicts.
2026-01-23 17:59:43 -05:00
Vijay Janapa Reddi
44e5822fbc
fix(tests): correct MODULE_NUMBER and MODULE_NAME in all run_all_tests.py
...
Fixed copy-paste errors where MODULE metadata was incorrect:
- 01_tensor: 02 → 01
- 02_activations: 03 → 02
- 03_layers: 04 → 03
- 04_losses: Dense/Networks → Losses
- 05_dataloader: 09/Autograd → 05/DataLoader
- 06_autograd: XX → 06/Autograd
- 07_optimizers: 06/Spatial/CNN → 07/Optimizers
- 08_training: XX → 08/Training
- 09_convolutions: XX → 09/Convolutions
- 10_tokenization: XX → 10/Tokenization
- 11_embeddings: XX → 11/Embeddings
- 12_attention: XX → 12/Attention
- 13_transformers: XX → 13/Transformers
- 14_profiling: KV Caching → Profiling
- 15_quantization: Module 16 → Module 15
- 18_memoization: XX → 18/Memoization
2026-01-23 13:17:15 -05:00
Vijay Janapa Reddi
d203fba8b8
fix: complete module renumbering across entire codebase
...
Updated all references to reflect new module order:
- Module 05: DataLoader (was 08)
- Module 06: Autograd (was 05)
- Module 07: Optimizers (was 06)
- Module 08: Training (was 07)
Changes include:
- paper/paper.tex: 20+ references, tier descriptions, milestones
- src/: Export commands, dependency diagrams, docstrings
- tests/: Dependency chains, integration tests, README
- tito/: export_utils.py path mappings
- tinytorch/: Auto-generated package file headers
Foundation Tier is now Modules 01-08
Architecture Tier is now Modules 09-13
2025-12-19 17:43:41 -05:00
Vijay Janapa Reddi
3d515573b7
fix: correct module numbering in test file error messages
...
Module references were using an incorrect/outdated numbering scheme.
Updated to match actual module order: 01-Tensor through 13-Transformers.
2025-12-17 07:39:09 -05:00
Vijay Janapa Reddi
853eb03ee8
style: apply consistent whitespace and formatting across codebase
2025-12-13 14:05:34 -05:00
Vijay Janapa Reddi
0cf91ee0c3
refactor(tinytorch): simplify module 03 API and remove confusing aliases
...
Simplifies the layers module API by removing alias proliferation that could confuse students in a pedagogical framework.
Changes:
- Rename SimpleModel → Sequential (matches PyTorch naming)
- Remove create_mlp() and MLP alias (taught in milestones, not core modules)
- Remove input_size/output_size aliases from Linear (keep only in_features/out_features)
- Update all tests to use explicit Sequential composition
- Fix dtype test to validate float32 normalization (TinyTorch's design)
Module focus: Individual building blocks (Linear, Dropout, Sequential container)
MLP construction: Taught in Milestone 03 (1986 MLP) using manual composition
Rationale:
- Progressive disclosure: students learn explicit composition first
- API clarity: one way to do things reduces cognitive load
- Separation of concerns: modules teach primitives, milestones teach patterns
All tests passing: 48/48 in module 03, 214/221 across all modules
2025-12-07 05:31:05 -08:00
Vijay Janapa Reddi
fa6d951a8a
fix(tinytorch): fix test flakiness and coverage requirements
...
- Add np.random.seed(42) to test_deep_network_gradient_chain for reproducibility
- Add --no-cov to tito module test to avoid root pyproject.toml coverage requirements
- Skip test_layers_networks_integration.py when tinytorch.core.dense is not implemented
2025-12-07 04:32:14 -08:00
Vijay Janapa Reddi
c602f97364
feat: integrate TinyTorch into MLSysBook repository
...
TinyTorch educational deep learning framework now lives at tinytorch/
Structure:
- tinytorch/src/ - Source modules (single source of truth)
- tinytorch/tito/ - CLI tool
- tinytorch/tests/ - Test suite
- tinytorch/site/ - Jupyter Book website
- tinytorch/milestones/ - Historical ML implementations
- tinytorch/datasets/ - Educational datasets (tinydigits, tinytalks)
- tinytorch/assignments/ - NBGrader assignments
- tinytorch/instructor/ - Teaching materials
Workflows (with tinytorch- prefix):
- tinytorch-ci.yml - CI/CD pipeline
- tinytorch-publish-dev.yml - Dev site deployment
- tinytorch-publish-live.yml - Live site deployment
- tinytorch-build-pdf.yml - PDF generation
- tinytorch-release-check.yml - Release validation
Repository Variables added:
- TINYTORCH_ROOT = tinytorch
- TINYTORCH_SRC = tinytorch/src
- TINYTORCH_SITE = tinytorch/site
- TINYTORCH_TESTS = tinytorch/tests
All workflows use \${{ vars.TINYTORCH_* }} for path configuration.
Note: tinytorch/site/_static/favicon.svg kept as SVG (valid for favicons)
2025-12-05 19:23:18 -08:00