Commit Graph

45 Commits

Author SHA1 Message Date
Vijay Janapa Reddi
3b5ce80903 Update cursor rules to mandate pytest for all testing
- Add explicit pytest requirement to testing-patterns.mdc
- Update user-preferences.mdc to include pytest preference
- Modify development-workflow.mdc to reference pytest usage
- Specify that all tests must use pytest framework
- Document pytest features to use (classes, fixtures, assertions)
- Add comprehensive examples of proper pytest structure
- Include DO NOT USE section for prohibited testing approaches
- Ensure CLI integration expects pytest-compatible test files
- Make it clear that manual testing and other frameworks are not allowed
2025-07-10 19:32:04 -04:00
Vijay Janapa Reddi
c5084dad27 Restore comprehensive setup module with full educational content
- Restore complete setup module with system information and developer profiles
- Add NBDev educational patterns with #| export and #| hide directives
- Implement SystemInfo class for platform detection and compatibility checking
- Add DeveloperProfile class with ASCII art customization and personalization
- Include comprehensive educational content with step-by-step learning progression
- Expand test suite to 20 comprehensive tests covering all functionality:
  - Function execution and output validation
  - Arithmetic operations (basic, negative, floating-point)
  - System information collection and compatibility
  - Developer profile creation and customization
  - ASCII art file loading and fallback behavior
  - Error recovery and integration testing
- Update README with complete feature documentation and usage examples
- Convert to executed notebook showing rich output and system information
- Maintain file-based ASCII art system with tinytorch_flame.txt
- All tests passing with professional pytest structure
2025-07-10 19:30:01 -04:00
Vijay Janapa Reddi
1a15dfac58 Convert setup module to use pytest
- Replace manual testing with pytest test classes and assertions
- Add comprehensive test coverage:
  - Function execution without errors
  - Correct output content validation
  - ASCII art file existence and content checks
  - Error handling and fallback behavior
  - Missing file graceful handling
- Update README with pytest testing instructions
- Make testing consistent with other TinyTorch modules
- All 5 tests passing with proper pytest integration
2025-07-10 19:25:52 -04:00
Vijay Janapa Reddi
9d5fc583b5 Simplify setup module to only display ASCII art
- Replace complex setup module with simple hello_tinytorch() function
- Keep only the ASCII art file (tinytorch_flame.txt) for visual appeal
- Simplify tests to just verify function runs and file exists
- Update README to reflect simplified purpose and usage
- Remove complex developer profiles and system info classes
- Focus on minimal introduction to TinyTorch workflow
2025-07-10 19:22:18 -04:00
Vijay Janapa Reddi
04d6744138 Add notebook compatibility and execute setup_dev.ipynb
🔧 Notebook Compatibility:
- Fix __file__ NameError in notebook environment
- Add try/except for file path detection
- Handle both script and notebook execution contexts
- Use os.getcwd() fallback when __file__ not available

📓 Notebook Execution:
- Execute setup_dev.ipynb with all outputs generated
- Beautiful ASCII art displays properly in notebook
- All test cells show expected results
- Student-friendly interactive experience

🎨 ASCII Art Display:
- Stunning flame ASCII art renders perfectly in notebook
- Full profile display with Tiny🔥Torch branding
- Interactive testing cells with clear outputs
- Students can see the ASCII art immediately

🧪 Testing:
- All 17 tests still pass after notebook conversion
- File loading works in both environments
- Comprehensive coverage maintained
- Ready for student use

Students can now run the setup_dev.ipynb notebook and immediately see the beautiful ASCII art output, making their first TinyTorch experience memorable and engaging
2025-07-10 19:19:22 -04:00
Vijay Janapa Reddi
250cc9f0fa Add file-based ASCII art system with stunning flame design
🎨 File-Based ASCII Art System:
- Add beautiful tinytorch_flame.txt with sophisticated flame design
- Dynamic file loading with fallback to simple flame
- Easy customization - students can edit the file directly
- Proper error handling for missing files

🔥 Enhanced Visual Experience:
- Stunning detailed flame ASCII art from file
- 'Tiny🔥Torch' branding with 'Build ML Systems from Scratch!' tagline
- Much more sophisticated design than hardcoded version
- Students can easily customize by editing tinytorch_flame.txt

📚 Educational Benefits:
- Two customization options: parameter override or file editing
- Teaches file I/O and error handling concepts
- Encourages creative expression and ownership
- Professional development practices

🧪 Testing:
- Updated all tests to work with file-based system
- All 17 tests pass successfully
- Comprehensive coverage of file loading and fallback
- Verified both custom and default ASCII art functionality

Students can now easily create their own ASCII art by editing the tinytorch_flame.txt file or providing custom art via parameters
2025-07-10 19:14:49 -04:00
Vijay Janapa Reddi
b9c2c6de6d Add ASCII art and enhance developer personalization
🎨 ASCII Art Features:
- Add beautiful TinyTorch flame ASCII art as default
- Support custom ASCII art for student personalization
- New get_ascii_art() and get_full_profile() methods
- Enhanced visual appeal and student engagement

👨‍💻 Profile Updates:
- Update instructor info: vj@eecs.harvard.edu, @profvjreddi
- Add comprehensive ASCII art examples and ideas
- Encourage creative student customization
- Professional signature generation with visual flair

🧪 Testing:
- Add 2 new ASCII art tests (17 total tests pass)
- Test default flame art and custom art functionality
- Verify full profile display with proper formatting
- Comprehensive coverage of all new features

Students can now create truly personalized TinyTorch experiences with custom ASCII art, making their learning journey unique and memorable
2025-07-10 19:11:41 -04:00
Vijay Janapa Reddi
1d27b3a8e2 Add developer personalization to setup module
- Add DeveloperProfile class with customizable developer information
- Default to course instructor (Vijay Janapa Reddi) but allow student customization
- Include professional signature generation for code attribution
- Add comprehensive test coverage (6 new tests, 15 total tests pass)
- Encourage student ownership and personalization of their TinyTorch journey
- Maintain educational structure with TODO sections and hidden solutions
2025-07-10 19:00:16 -04:00
Vijay Janapa Reddi
99f4bb76aa Fix setup module and add comprehensive tests
- Fix syntax errors in setup_dev.py test cells (proper indentation)
- Add comprehensive test suite for setup module (test_setup.py)
- Test coverage: functions, SystemInfo class, integration tests
- Custom test runner (no pytest dependency required)
- All 9 tests pass successfully
- Update .gitignore to allow modules/ directory for educational structure
2025-07-10 18:52:14 -04:00
Vijay Janapa Reddi
e86d0223d1 Update test discovery and documentation for new module structure
- Fix CLI tool to look for tests in modules/{module}/tests/ instead of tests/
- Update test imports to use parent directory module imports
- Update Cursor rules to reflect new test structure:
  * Project structure shows tests/ subdirectory
  * Testing patterns show correct paths and import patterns
  * Development workflow shows updated test locations
- Test imports now work: from tensor_dev import Tensor
- CLI commands now find tests in correct locations

Tests are now properly organized and discoverable
2025-07-10 18:45:09 -04:00
Vijay Janapa Reddi
ee04857215 Reorganize modules with clean structure and tests/ subdirectory
- Move test_tensor.py to modules/tensor/tests/test_tensor.py
- Create tests/ directories in setup and tensor modules
- Clean up setup module: remove setup_dev.html, setup_dev_files/, __init__.py
- Establish clean module structure pattern:
  * {module}_dev.py - Main development file
  * {module}_dev.ipynb - Generated notebook
  * README.md - Module documentation
  * tests/ - Test directory with test_{module}.py

This makes it crystal clear to students where tests are located.
2025-07-10 18:40:50 -04:00
Vijay Janapa Reddi
997f27eff5 Ensure all Cursor rules have proper descriptions and follow best practices
- Fix frontmatter for all rules to include proper descriptions
- Update rule types according to Cursor guidelines:
  * alwaysApply: project-structure, user-preferences
  * globs: nbdev-educational-pattern, testing-patterns
  * description only: development-workflow, ml-systems-course-context
- All rules under 500 lines, focused and actionable
- Follow MDC format with proper metadata
- Ready for proper Cursor rule functionality
2025-07-10 18:28:26 -04:00
Vijay Janapa Reddi
bece90eab1 Add comprehensive Cursor rules for TinyTorch development
- Project structure guide (always applied)
- NBDev educational pattern for module development files
- Development workflow and CLI usage
- Testing patterns and conventions
- ML Systems course context and learning approach
- User preferences and conventions

These rules will help with codebase navigation, understanding the educational approach,
and maintaining consistency across the TinyTorch framework.
2025-07-10 18:24:12 -04:00
Vijay Janapa Reddi
22f44c62a8 Clean up tensor module to follow NBDev educational pattern
- Remove experimental files (tensor_nbdev_educational.*, tensor_dev_standard.*, tensor_dev_student.ipynb)
- Create clean tensor_dev.py source file following setup module pattern
- Keep only essential files: tensor_dev.py, test_tensor.py, README.md
- Ready for NBDev workflow: Python source -> notebook -> package export
2025-07-10 18:20:26 -04:00
Vijay Janapa Reddi
10ba098c32 🧹 Remove deployment issue file - moved to GitHub issues
The content was meant for a GitHub issue, not a repo file.
Issue should be created at: https://github.com/USERNAME/TinyTorch/issues/new
2025-07-10 18:15:43 -04:00
Vijay Janapa Reddi
073dda926a 📋 Add deployment system implementation issue
Comprehensive issue for implementing TinyTorch educational deployment system:

🎯 Core Features:
- Generate student versions (NotImplementedError stubs)
- Generate solution versions (complete implementations)
- Git-based progressive release system
- Preserve existing NBDev development workflow

🔧 Architecture:
- Additive approach - no breaking changes
- Extend bin/tito.py with deploy/release commands
- Git-based distribution for controlled timing
- Batch operations and multi-module support

📋 Implementation Plan:
- Phase 1: Core generation (student/solution versions)
- Phase 2: Git integration and release management
- Phase 3: Polish, documentation, and testing

🎓 User Workflows:
- Instructor: develop → deploy → release with git tags
- Student: git clone → git pull for updates → work on exercises

Ready for future implementation when bandwidth allows.
2025-07-10 18:13:49 -04:00
Vijay Janapa Reddi
bed1c24f7f Setup proper student/instructor versions with NBDev
🎯 Student Version (Visible):
- All functions raise NotImplementedError('Student implementation required')
- Clear TODO instructions with specific guidance
- Test cells handle NotImplementedError gracefully
- Students must implement everything from scratch

🔧 Instructor Version (Hidden with #|hide):
- Complete working implementations
- Same function signatures as student version
- Production-ready code for package export

📚 Added MODULE_GENERATION_GUIDE.md:
- Clear instructions for creating student/instructor modules
- NBDev workflow documentation
- Module structure patterns and templates
- Generation commands and checklist

🔄 Generation Flow:
1. Write .py with student stubs + hidden instructor solutions
2. Convert to notebook: jupytext --to notebook module_dev.py
3. Export package: python bin/tito.py sync --module name
4. Package gets instructor solutions, students see exercises

Perfect foundation for all TinyTorch modules
2025-07-10 17:42:01 -04:00
Vijay Janapa Reddi
8f2ee2a907 🧹 Clean up - remove extra NBDev educational files
- Removed modules/setup/setup_nbdev_educational.* files
- Keep only the clean setup_dev.* files
- Setup module now focused and clean
- NBDev features work behind scenes without clutter
2025-07-10 16:31:24 -04:00
Vijay Janapa Reddi
6d8fb078f7 🧹 Clean up setup module - NBDev behind the scenes
- Focused on original purpose: just setting up development environment
- Students don't see NBDev educational features explanations
- Simple workflow: hello world, basic class, export, test, progress
- NBDev #|hide directive works behind scenes for instructor solutions
- Clean and simple, just like the original but with hidden solutions

Back to basics: setup is about setup, not teaching NBDev features
2025-07-10 16:30:23 -04:00
Vijay Janapa Reddi
a7c03b4ced Enhanced setup module with NBDev educational features
SINGLE SOURCE approach: One notebook serves both instructors and students

🎯 Key Features:
- #|hide directive hides complete solutions from students
- #|code-fold creates collapsible sections for details
- #|export with educational metadata
- Progressive learning: simple → ML-relevant complexity
- Vector operations (add, dot product) as ML foundations
- ML-aware SystemInfo class with library checking
- Comprehensive testing for both student/instructor versions

🔄 Workflow:
- Students see exercises with TODOs and hints
- Instructors see complete solutions (hidden by default)
- Package exports get instructor (complete) implementations
- Single notebook maintains both audiences

This establishes the pattern for all TinyTorch modules
2025-07-10 16:27:23 -04:00
Vijay Janapa Reddi
f94b02af8e Create NBDev educational setup module - demonstrates progressive learning with #|hide, #|code-fold, ML-relevant hello world 2025-07-10 16:22:37 -04:00
Vijay Janapa Reddi
030e874c59 Discover NBDev's built-in educational features
- Create tensor_nbdev_educational.py with NBDev directives
- Demonstrate #|hide, #|code-fold, #|filter_stream features
- Convert using standard Jupytext (# %% markers)
- Add comprehensive guides and comparisons
- Show superior approach vs custom generator

Key insight: NBDev already has mature educational capabilities!
No need to build custom tools when industry standards exist.
2025-07-10 16:11:33 -04:00
Vijay Janapa Reddi
2616b78455 Adds Tensor class with basic operations
Introduces a Tensor class that wraps numpy arrays, enabling
fundamental ML operations like addition, subtraction,
multiplication, and division.

Adds utility methods such as reshape, transpose, sum, mean, max,
min, item, and numpy to the Tensor class.

Updates tests to accommodate both scalar and Tensor results
when checking mean values.
2025-07-10 14:30:41 -04:00
Vijay Janapa Reddi
898a9e2315 Adds initial project structure and documentation
Introduces a README with project overview, setup instructions,
and course structure.

Adds a VISION document outlining the project's goals, conventions,
and architecture.

Includes updates to the setup module's README to clarify module to
package mapping.
2025-07-10 14:09:04 -04:00
Vijay Janapa Reddi
d5e139ac7f feat: Complete Setup module and enhance CLI functionality
 Setup Module Implementation:
- Created comprehensive setup_dev.ipynb with TinyTorch workflow tutorial
- Added hello_tinytorch(), add_numbers(), and SystemInfo class
- Updated README with clear learning objectives and development workflow
- All 11 tests passing for complete workflow validation

🔧 CLI Enhancements:
- Added --module flag to 'tito sync' for module-specific exports
- Implemented 'tito reset' command with --force option
- Smart auto-generated file detection and cleanup
- Interactive confirmation with safety preservations

📚 Documentation Updates:
- Updated all references to use [module]_dev.ipynb naming convention
- Enhanced test coverage for new functionality
- Clear error handling and user guidance

This establishes the foundation workflow that students will use throughout TinyTorch development.
2025-07-10 13:09:10 -04:00
Vijay Janapa Reddi
0862d92e37 Adds module-specific sync functionality
Extends the sync command to allow users to synchronize
specific modules instead of the entire project. This
improves efficiency by reducing the scope of the nbdev
export process. Adds argument parsing for module selection.
2025-07-10 12:47:17 -04:00
Vijay Janapa Reddi
ada1d8206e Adds TinyTorch VISION.md
Adds a comprehensive VISION.md document outlining the philosophy, learning approach, module design principles, and target learning outcomes for TinyTorch.

This document serves as a canonical guide for module development, emphasizing a systems-first approach to understanding ML frameworks, and provides a framework for thinking about design trade-offs in accuracy, runtime, and memory footprint.
2025-07-10 12:21:53 -04:00
Vijay Janapa Reddi
bb8681811e Adds vision document for TinyTorch
Introduces the VISION.md document, which outlines the core philosophy, learning approach, module design principles, target learning outcomes, module progression logic, and success metrics for TinyTorch.

This document serves as the "ground truth" for course design decisions, emphasizing a systems-first approach to understanding machine learning frameworks. It details the "Loops to Systems" learning approach, focusing on the systems engineering challenges that arise when implementing ML concepts at scale.
2025-07-10 12:18:54 -04:00
Vijay Janapa Reddi
ca7ae9424d Renames development notebook filenames
Updates references to the development notebook naming convention from `[module].ipynb` to `[module]_dev.ipynb` in documentation. This change ensures consistency across the project and aligns with the intended naming scheme for development notebooks.
2025-07-10 11:35:11 -04:00
Vijay Janapa Reddi
8253d4be95 Cleaning up the repo 2025-07-10 11:23:48 -04:00
Vijay Janapa Reddi
13193777a7 Been refactoring the structure, got setup working 2025-07-10 11:13:45 -04:00
Vijay Janapa Reddi
b51ff16619 Updates course navigation to new module location
Updates the "Start Here" link in the course navigation to
reflect the new location of the setup README.md file.
2025-07-09 18:02:37 -04:00
Vijay Janapa Reddi
9f09f88f4a Implements modular course structure
Introduces a standardized module structure with README, notebooks, tutorials, tests, and solutions.

Refactors the project to emphasize a modular learning path, enhancing clarity and consistency across the TinyTorch course.

Changes the virtual environment path to ".venv".
2025-07-09 18:00:14 -04:00
Vijay Janapa Reddi
7ddd1d097d Refactors to use .venv for virtual environment
Updates the project to use `.venv` as the standard virtual environment directory. This change:

- Updates `.gitignore` to ignore `.venv/`.
- Modifies the activation script to create and activate `.venv`.
- Adjusts the `tito.py` script to check for `.venv`'s existence and activation.
- Updates documentation and setup scripts to reflect the new virtual environment naming convention.

This change streamlines environment management and aligns with common Python practices.
2025-07-09 17:40:08 -04:00
Vijay Janapa Reddi
4aa27a654a Adds initial .gitignore file
Adds a comprehensive .gitignore file to exclude common build artifacts, logs, temporary files, and other project-specific files that should not be tracked by Git.

This ensures a cleaner repository and prevents accidental inclusion of sensitive or unnecessary files.
2025-07-09 17:04:22 -04:00
Vijay Janapa Reddi
22c3f50dd6 Merge remote-tracking branch 'origin/main' 2025-07-09 17:03:47 -04:00
Vijay Janapa Reddi
293496abcb Adds CLI tool for project setup and management
Introduces a command-line interface (CLI) named 'tito'
to streamline project setup, testing, and information retrieval.

Includes a setup script to automate virtual environment
creation and dependency installation.

Improves the user experience by providing clear instructions
and status indicators within the CLI.
2025-07-09 17:03:44 -04:00
Vijay Janapa Reddi
d19c1593cf Update README.md 2025-07-09 11:24:18 -04:00
Vijay Janapa Reddi
c1a6dd6660 Update README.md 2025-07-09 11:23:51 -04:00
Vijay Janapa Reddi
75413d6a81 Update README.md 2025-07-09 10:50:03 -04:00
Vijay Janapa Reddi
9c57d130f7 Adds initial project README
Introduces the TinyTorch project, a pedagogical tool for building ML systems from scratch.

Provides an overview of the project's goals, system architecture, curriculum integration, and getting started guide.
2025-07-09 01:18:27 -04:00
Vijay Janapa Reddi
25c4910684 Initializes TinyTorch project structure and setup
Sets up the foundational project structure for the TinyTorch ML system, including the CLI entry point, project directories, and setup scripts.

This commit introduces the `tito` CLI for project management, testing, and information display.
It also includes setup scripts to automate environment creation and verification, along with initial documentation.
2025-07-09 00:46:26 -04:00
Vijay Janapa Reddi
38a5381bef Adds initial TinyTorch CLI and core structure
Introduces the foundational CLI structure and core components for the TinyTorch project.

This initial commit establishes the command-line interface (CLI) using `argparse` for training, evaluation, benchmarking, and system information. It also lays out the basic directory structure and essential modules, including tensor operations, autograd, neural network layers, optimizers, data loading, and MLOps components.
2025-07-09 00:23:19 -04:00
Vijay Janapa Reddi
7fe80e2b17 Update README.md 2025-07-08 22:53:35 -04:00
Vijay Janapa Reddi
5367849b79 Initial commit 2025-07-08 22:47:00 -04:00