Files
Vijay Janapa Reddi fe50b96782 refactor(tinytorch): bump Python minimum to 3.10 and update Milestone 05 docs
- Update Python version requirement from 3.8+ to 3.10+ across badges,
  docs, tests, and setup validation
- Rewrite Milestone 05 docs to reflect single synthetic-task script
  (01_vaswani_attention.py) replacing old 3-script approach
- Fix repository URLs from placeholder VJ/TinyTorch to
  harvard-edge/cs249r_book
- Update contact email to info@mlsysbook.ai

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 12:51:48 -04:00
..

Environment Validation Tests

Comprehensive tests to ensure TinyTorch environment is correctly configured.

For Students

# Quick health check
tito system health

# Verbose output for debugging
tito system health --verbose

Use when:

  • After running tito setup
  • Before starting a new module
  • When something isn't working
  • Sharing output with TAs for help

Test Suites

Setup Validation (test_setup_validation.py)

Tests 50+ environment checks:

  • Python Environment: Version (3.10+), virtual environment, pip
  • Core Dependencies: NumPy, Matplotlib, pytest, PyYAML, Rich
  • Jupyter Environment: Jupyter, JupyterLab, kernels, Jupytext
  • TinyTorch Package: Import, core modules, version
  • Project Structure: tinytorch/, modules/, src/, tests/, TITO CLI
  • System Resources: Disk space, memory
  • Git Configuration: Git available, user configured

Requirements Validation (test_all_requirements.py)

Auto-discovers and tests ALL packages from requirements files:

  • Package installation (can be imported)
  • Version matching (meets specification)
  • Functionality (actually works, not just installed)

Running Tests

# Via TITO (recommended)
tito system health

# Via pytest
pytest tests/environment/ -v

# Specific suite
pytest tests/environment/test_setup_validation.py -v

Troubleshooting

"No module named 'X'":

pip install -r requirements.txt

Version mismatch:

pip install --upgrade X

Virtual environment not detected:

source .venv/bin/activate  # Mac/Linux
.venv\Scripts\activate     # Windows

Jupyter tests fail:

pip install --upgrade jupyter jupyterlab
python -m ipykernel install --user

CI Integration

- name: Validate Environment
  run: pytest tests/environment/ -v