Vijay Janapa Reddi
4264699b5f
Update test files with progressive integration and checkpoint improvements
2025-12-04 11:08:17 -08:00
Vijay Janapa Reddi
4aeb3c9c69
Merge main into dev, resolving conflicts with dev's version
2025-12-03 07:26:43 -08:00
Vijay Janapa Reddi
8d77ea3cd1
Add educational WHAT/WHY/STUDENT LEARNING docstrings to all module tests
...
All 20 modules now have *_core.py test files with:
- Module-level context explaining WHY the component matters
- WHAT each test does
- WHY that behavior is important
- STUDENT LEARNING tips for understanding
Works with --tinytorch pytest flag for Rich CLI output.
2025-12-02 22:47:25 -08:00
Vijay Janapa Reddi
3a885601f9
Clean up repository
...
- Remove stale feature branches (kept debugging branch with unmerged work)
- Move test_spatial_core.py to correct directory (tests/09_spatial)
- Remove .tito user state from tracking (config.json, progress.json)
- Delete archived CLI commands (tito/commands/_archived/)
- Move standalone integration tests to tests/integration/
- Remove outdated audit/report markdown files
- Remove old template and deprecated test files
- Simplify .gitignore for .tito/ directory
2025-12-02 22:03:16 -05:00
Vijay Janapa Reddi
2b0a1db71e
Fix all tests to pass: clean up stale and misaligned test files
...
Test cleanup:
- Remove misaligned progressive integration tests (wrong module assignments)
- Remove tests referencing non-existent classes (SimpleDataset, etc.)
- Remove tests with wrong API signatures (learning_rate vs lr, etc.)
- Fix parameter names: use_bias -> bias, weights -> weight
- Fix dtype tests: expect float32 (TinyTorch standard)
- Add MultiplyLayer definition where missing
Results:
- tito module test --all: 20/20 modules pass
- pytest tests/modules: 223 tests pass
Both inline tests and external tests now pass completely.
2025-12-02 14:30:31 -05:00
Vijay Janapa Reddi
bd7fcb2177
Release preparation: fix package exports, tests, and documentation
...
Package exports:
- Fix tinytorch/__init__.py to export all required components for milestones
- Add Dense as alias for Linear for compatibility
- Add loss functions (MSELoss, CrossEntropyLoss, BinaryCrossEntropyLoss)
- Export spatial operations, data loaders, and transformer components
Test infrastructure:
- Create tests/conftest.py to handle path setup
- Create tests/test_utils.py with shared test utilities
- Rename test_progressive_integration.py files to include module number
- Fix syntax errors in test files (spaces in class names)
- Remove stale test file referencing non-existent modules
Documentation:
- Update README.md with correct milestone file names
- Fix milestone requirements to match actual module dependencies
Export system:
- Run tito export --all to regenerate package from source modules
- Ensure all 20 modules are properly exported
2025-12-02 14:19:56 -05:00
Vijay Janapa Reddi
d2c20836dd
Add comprehensive unit tests for gradient flow regression prevention
...
- test_spatial_gradient_flow.py: Tests Conv2d and MaxPool2d backward function attachment and gradient propagation
- test_embedding_gradient_flow.py: Tests Embedding backward function attachment and gradient propagation
- Tests verify _grad_fn attachment to prevent .data bypass issues
- Tests validate gradient flow to all parameters (weight, bias)
- Tests check end-to-end gradient chains
- All tests pass (8/8 spatial, 6/6 embedding)
2025-11-22 17:43:02 -05:00
Vijay Janapa Reddi
522946ecfd
Add comprehensive unit tests for gradient flow regression prevention
...
- test_spatial_gradient_flow.py: Tests Conv2d and MaxPool2d backward function attachment and gradient propagation
- test_embedding_gradient_flow.py: Tests Embedding backward function attachment and gradient propagation
- Tests verify _grad_fn attachment to prevent .data bypass issues
- Tests validate gradient flow to all parameters (weight, bias)
- Tests check end-to-end gradient chains
- All tests pass (8/8 spatial, 6/6 embedding)
2025-11-22 17:43:02 -05:00
Vijay Janapa Reddi
855edafef3
Rename test directories to match source module names exactly
...
- module_01 → 01_tensor
- module_02 → 02_activations
- module_03 → 03_layers
- module_04 → 04_losses
- module_05 → 05_autograd
- module_06 → 06_optimizers
- module_07 → 07_training
- module_08 → 08_dataloader
- module_09 → 09_spatial
- module_10 → 10_tokenization
- module_11 → 11_embeddings
- module_12 → 12_attention
- module_13 → 13_transformers
- module_14 → 14_kvcaching
- module_15 → 15_profiling
This prevents misalignment between source and test directories.
Tests now mirror the exact structure of modules/source/.
2025-09-30 12:24:48 -04:00
Vijay Janapa Reddi
6f86460ec0
Rename test directories to match source module names exactly
...
- module_01 → 01_tensor
- module_02 → 02_activations
- module_03 → 03_layers
- module_04 → 04_losses
- module_05 → 05_autograd
- module_06 → 06_optimizers
- module_07 → 07_training
- module_08 → 08_dataloader
- module_09 → 09_spatial
- module_10 → 10_tokenization
- module_11 → 11_embeddings
- module_12 → 12_attention
- module_13 → 13_transformers
- module_14 → 14_kvcaching
- module_15 → 15_profiling
This prevents misalignment between source and test directories.
Tests now mirror the exact structure of modules/source/.
2025-09-30 12:24:48 -04:00