272 Commits

Author SHA1 Message Date
Vijay Janapa Reddi
25e1e77492 Improve CLI: remove redundant --module flags
- Update test, export, and clean commands to use positional arguments
- Change from 'tito module test --module dataloader' to 'tito module test dataloader'
- Eliminates redundant --module flag within module command group
- Update help text and examples to reflect new syntax
- Maintains backward compatibility with --all flag
- More intuitive and consistent CLI design
2025-07-12 00:56:00 -04:00
Vijay Janapa Reddi
3454ea5fbe refactor: standardize module export command with --all flag
- Move export functionality from 'tito package export' to 'tito module export'
- Require --all flag for exporting all modules (consistent with test command)
- Remove export from package command group to eliminate duplication
- Update help text and examples across all commands
- Fix tensor module arithmetic operators for complete functionality
- Clean up duplicate _quarto.yml and sidebar.yml files in modules/

This creates a consistent CLI pattern:
- tito module export --all (export all modules)
- tito module export --module <name> (export specific module)
- tito module test --all (test all modules)
- tito module test --module <name> (test specific module)
2025-07-12 00:36:59 -04:00
Vijay Janapa Reddi
ca8ec10427 Simplify module.yaml and enhance export command with real export targets
- Remove redundant fields from module.yaml files: exports_to, files, components
- Keep only essential system metadata: name, title, description, dependencies
- Export command now reads actual export targets from dev files (#| default_exp directive)
- Status command updated to use dev files as source of truth for export targets
- Export command shows detailed source → target mapping for better clarity
- Dependencies field retained as it's useful for CLI module ordering and prerequisites
- Eliminates duplication between YAML and dev files - dev files are the real truth
2025-07-12 00:05:45 -04:00
Vijay Janapa Reddi
2a4bbc6a09 Rename sync command to export for clarity
- Rename SyncCommand to ExportCommand and sync.py to export.py
- Update all CLI references from 'tito package sync' to 'tito package export'
- Update help text and internal messages to use 'Export' terminology
- Update imports across all command files
- Update help text in main CLI, reset, clean, info, and notebooks commands
- Command now clearly communicates that it exports notebook code to Python package
- Maintains same functionality but with clearer naming for user experience
2025-07-11 23:59:25 -04:00
Vijay Janapa Reddi
74ec7e482c Add module clean command
- Add new CleanCommand for cleaning up module directories
- Supports cleaning notebooks (*.ipynb) and cache files (__pycache__, *.pyc)
- Can clean specific modules or all modules
- Provides preview of files to be cleaned with confirmation
- Includes --force flag to skip confirmation
- Integrates with module command group as 'tito module clean'
- Preserves Python source files (*_dev.py) and other important files
- Fixes issue with duplicate file removal from __pycache__ directories
2025-07-11 23:48:26 -04:00
Vijay Janapa Reddi
b2794273f6 Remove redundant py_to_notebook tool in favor of Jupytext
- Delete bin/py_to_notebook.py and tito/tools/py_to_notebook.py
- Update notebooks command to use Jupytext directly
- Jupytext is already configured in all *_dev.py files
- Simpler, more standard workflow using established tools
- Better integration with NBDev ecosystem

Benefits:
- Eliminates duplicate conversion tools
- Uses industry-standard Jupytext instead of custom tool
- Reduces maintenance burden
- Better error handling and compatibility
2025-07-11 23:31:55 -04:00
Vijay Janapa Reddi
3198100eb9 Fix doctor command environment validation
- Skip environment validation for 'tito system doctor' command
- Fix dependency detection in doctor command for packages without __version__
- Doctor command now works correctly and shows comprehensive system diagnosis
2025-07-11 23:28:41 -04:00
Vijay Janapa Reddi
0307662fbc Remove version field from module metadata
- Remove version field from all module.yaml files
- Update template generator to exclude version field
- Further simplify metadata to focus on system information only
- Status remains dynamically determined by test results
2025-07-11 23:23:10 -04:00
Vijay Janapa Reddi
c62515a920 Simplify module metadata to focus on essential system information
- Reduce module.yaml files from 100+ lines to ~25 lines focused on system needs
- Remove pedagogical details (learning objectives, difficulty, time estimates)
- Keep only essential fields: name, title, description, status, dependencies, exports, files, components
- Update status command to work with simplified metadata format
- Update metadata generation script to create simplified templates
- Focus on system metadata for CLI tools and build systems, not educational content

Before: Verbose pedagogical metadata with 20+ fields
After: Concise system metadata with 8 core fields

This aligns with the principle that module.yaml should be for systems, not pedagogy.
2025-07-11 23:02:10 -04:00
Vijay Janapa Reddi
69a51dfe11 Fix doctor command to check for correct CLI script path
- Change doctor command check from 'bin/tito.py' to 'bin/tito'
- The actual CLI script is 'bin/tito' (without .py extension)
- Doctor command now correctly shows CLI script as found instead of missing
- Resolves false positive error in environment diagnosis
2025-07-11 22:57:10 -04:00
Vijay Janapa Reddi
3ba0873979 Clean up CLI by removing legacy flat commands
- Remove legacy flat commands (info, test, sync, etc.) from main parser
- Keep only hierarchical command groups (system, module, package)
- Eliminate confusing positional arguments showing both flat and hierarchical commands
- Update help text to remove references to deprecated commands
- CLI now shows clean 3-command structure: system, module, package
- Old flat commands like 'tito info' now properly error with helpful message
- Maintains all functionality through hierarchical structure:
  - tito info → tito system info
  - tito status → tito module status
  - tito sync → tito package sync

Result: Clean, focused CLI with clear command organization
2025-07-11 22:54:39 -04:00
Vijay Janapa Reddi
19bb551004 feat: Reorganize CLI into hierarchical command structure
- Add system, module, and package command groups for clear subsystem separation
- Create SystemCommand, ModuleCommand, and PackageCommand classes
- Maintain backward compatibility with existing flat commands
- Enhanced help system with contextual guidance at each level
- Updated main CLI to show organized command groups
- Added comprehensive documentation for CLI reorganization

New structure:
- tito system (info, doctor, jupyter)
- tito module (status, test, notebooks)
- tito package (sync, reset, nbdev)

Benefits:
- Clear subsystem separation
- Intuitive command discovery
- Better extensibility for future commands
- Reduced cognitive load for users
2025-07-11 22:37:35 -04:00
Vijay Janapa Reddi
341b10969c feat: Add comprehensive module metadata system
- Add module.yaml files for setup, tensor, activations, layers, and autograd modules
- Enhanced tito status command with --metadata flag for rich information display
- Created metadata schema with learning objectives, dependencies, components, and more
- Added metadata generation script (bin/generate_module_metadata.py)
- Comprehensive documentation in docs/development/module-metadata-system.md
- Status command now shows module status, difficulty, time estimates, and detailed metadata
- Supports dependency tracking, component-level status, and educational information
- Enables rich CLI experience with structured module information
2025-07-11 22:33:24 -04:00
Vijay Janapa Reddi
de03be4f70 refactor: Reorganize CLI commands for clear separation of concerns
- Rename 'modules' command to 'status' for intuitive module status checking
- Consolidate all testing functionality into 'test' command:
  - 'tito test --module X' for individual module testing with detailed output
  - 'tito test --all' for all modules with progress bar
  - Remove confusing redirection from test to modules
- Simplify 'info' command to focus on system information and course navigation:
  - Remove module implementation status table (moved to status command)
  - Add quick command reference panel
  - Clean separation between system info and module status
- Update all imports and registrations for renamed command

Result: Clean, intuitive CLI with no duplication:
- 'tito status' → Module development status
- 'tito test' → All testing functionality
- 'tito info' → System info and navigation

No more confusing overlaps or redirections between commands.
2025-07-11 22:25:19 -04:00
Vijay Janapa Reddi
39a04bbe65 feat: Add modules command and clean up CLI duplication
- Add new 'tito modules' command for comprehensive module status checking
  - Scans all modules in modules/ directory automatically
  - Shows file structure (dev file, tests, README)
  - Runs tests with --test flag
  - Provides detailed breakdown with --details flag

- Remove duplicate/stub commands:
  - Remove 'tito status' (unimplemented stub)
  - Remove 'tito submit' (unimplemented stub)

- Update 'tito test' command:
  - Focus on individual module testing with detailed output
  - Redirect 'tito test --all' to 'tito modules --test' with recommendation
  - Better error handling with available modules list

- Add comprehensive documentation:
  - docs/development/testing-separation.md - explains module vs package checking
  - docs/development/command-cleanup-summary.md - documents CLI cleanup

Key benefit: Clear separation between module development status (tito modules)
and TinyTorch package functionality (tito info) with no confusing overlaps.
2025-07-11 22:14:53 -04:00
Vijay Janapa Reddi
a3f8487357 fix: update status checks to focus on functionality over module organization
- Fix Networks and MLP status checks to use actual available components
- Networks: test Sequential composition with layers
- MLP: test multi-layer perceptron using Sequential + Dense + ReLU
- CNN: simplified test for convolution concepts
- Focus on functional capabilities rather than specific package organization

This addresses the fundamental issue that status checks were trying to match
pedagogical module organization with production package structure.
2025-07-11 22:02:17 -04:00
Vijay Janapa Reddi
10a4969abd fix: correct DataLoader status check in CLI
- Fix CLI test to use Tensor objects instead of raw integers
- DataLoader now correctly shows as  Implemented in status
- Test creates proper Tensor data for DataLoader compatibility
2025-07-11 21:56:19 -04:00
Vijay Janapa Reddi
c7a82b400c feat: update CLI tools for dataloader module
- Update valid modules list in test command: data → dataloader
- Update module display name in info command: Data → DataLoader
- Update CLI references to use new module name
- All CLI commands now recognize 'dataloader' instead of 'data'

Ensures CLI tools work seamlessly with the renamed module.
2025-07-11 18:59:19 -04:00
Vijay Janapa Reddi
a1a3e0f9e4 Add test timeouts and local test data for data module
- Added pytest-timeout configuration with 5-minute timeout for all tests
- Added timeout handling to test command with proper error messages
- Created small local test dataset (50 train + 20 test samples) that mimics CIFAR-10 structure
- Updated data module tests to use local test data instead of downloading CIFAR-10
- Tests now run much faster (~0.1s vs ~30s) and don't require internet connection
- Added TestCIFAR10Dataset class that loads from local pickle files
- All test functionality preserved but using local data for speed and reliability
2025-07-11 18:50:05 -04:00
Vijay Janapa Reddi
b155dec4fc feat: add Networks module with forward-pass and visualizations
- Add modules/networks/networks_dev.py and networks_dev.ipynb (Jupytext/nbdev educational pattern)
- Add comprehensive visualizations: architecture, data flow, layer analysis, network comparison
- Add modules/networks/README.md with learning goals, usage, and visualization docs
- Add modules/networks/tests/test_networks.py with thorough tests for composition, MLPs, and visualizations
- Register 'networks' in CLI info and test commands
- Update CLI info command to check layers/networks status
- This module focuses on forward pass only (no training yet)
2025-07-10 23:16:12 -04:00
Vijay Janapa Reddi
15f5a84863 RESTORE: Complete CLI functionality in new architecture
- Ported all commands from bin/tito.py to new tito/ CLI architecture
- Added InfoCommand with system info and module status
- Added TestCommand with pytest integration
- Added DoctorCommand with environment diagnosis
- Added SyncCommand for nbdev export functionality
- Added ResetCommand for package cleanup
- Added JupyterCommand for notebook server
- Added NbdevCommand for nbdev development tools
- Added SubmitCommand and StatusCommand (placeholders)
- Fixed missing imports in tinytorch/core/tensor.py
- All commands now work with 'tito' command in shell
- Maintains professional architecture while restoring full functionality

Commands restored:
 info - System information and module status
 test - Run module tests with pytest
 doctor - Environment diagnosis
 sync - Export notebooks to package
 reset - Clean tinytorch package
 nbdev - nbdev development commands
 jupyter - Start Jupyter server
 submit - Module submission
 status - Module status
 notebooks - Build notebooks from Python files

The CLI now has both the professional architecture and all original functionality.
2025-07-10 22:39:23 -04:00
Vijay Janapa Reddi
a92a5530ef MAJOR: Separate CLI from framework - proper architectural separation
BREAKING CHANGE: CLI moved from tinytorch/cli/ to tito/

Perfect Senior Engineer Architecture:
- tinytorch/ = Pure ML framework (production)
- tito/ = Development/management CLI tool
- modules/ = Educational content

Benefits:
 Clean separation of concerns
 Framework stays lightweight (no CLI dependencies)
 Clear mental model for users
 Professional project organization
 Proper dependency management

Structure:
tinytorch/          # 🧠 Core ML Framework
├── core/          # Tensors, layers, operations
├── training/      # Training loops, optimizers
├── models/        # Model architectures
└── ...           # Pure ML functionality

tito/              # 🔧 Development CLI Tool
├── main.py        # CLI entry point
├── core/          # CLI configuration & console
├── commands/      # Command implementations
└── tools/         # CLI utilities

Key Changes:
- Moved all CLI code from tinytorch/cli/ to tito/
- Updated imports and entry points
- Separated dependencies (Rich only for dev tools)
- Updated documentation to reflect proper separation
- Maintained backward compatibility with bin/tito wrapper

This demonstrates how senior engineers separate:
- Production code (framework) from development tools (CLI)
- Core functionality from management utilities
- User-facing APIs from internal tooling

Educational Value:
- Shows proper software architecture
- Teaches separation of concerns
- Demonstrates dependency management
- Models real-world project organization
2025-07-10 22:08:56 -04:00