Commit Graph

9128 Commits

Author SHA1 Message Date
Vijay Janapa Reddi
b6d8a8eb64 feat(contributors): add fun emojis, legend, and sorting
- Custom emoji set: 🪲 Bug Hunter, 🧑‍💻 Code Contributor, ✍️ Documentation Hero, etc.
- Add legend to all README contributor sections
- Sort contributors by contribution count (most active first)
- Remove old emoji key links, use inline legend instead
- Sync emoji mappings across both generator scripts
2026-01-22 10:23:30 -05:00
Vijay Janapa Reddi
65ba7ed64b feat: sync emoji mapping with official all-contributors spec
Complete list from https://allcontributors.org/docs/en/emoji-key:
- a11y, audio, blog, bug, business, code, content, data, design, doc
- eventOrganizing, example, financial, fundingFinding, ideas, infra
- maintenance, mentoring, platform, plugin, projectManagement, promotion
- question, research, review, security, talk, test, tool, translation
- tutorial, userTesting, video
2026-01-22 10:01:01 -05:00
Vijay Janapa Reddi
65525380ff docs: use standard all-contributors emoji key
- Complete emoji mapping in generate_readme_tables.py
- Simplify docs to reference official emoji key
- Link: https://allcontributors.org/docs/en/emoji-key
2026-01-22 10:00:01 -05:00
Vijay Janapa Reddi
b12b71ef78 feat: support explicit project syntax in all-contributors command
Now supports:
- @all-contributors please add @user for bug in tinytorch
- @all-contributors please add @user for code in book
- @all-contributors please add @user for doc in kits
- @all-contributors please add @user for test in labs

Falls back to auto-detection from labels/title if no project specified.
2026-01-22 09:56:15 -05:00
Vijay Janapa Reddi
94ddc8dccc fix: resolve YAML syntax error in all-contributors workflow 2026-01-22 09:49:13 -05:00
Vijay Janapa Reddi
a9a6c7e09e feat: add automatic @all-contributors comment workflow
- Add all-contributors-add.yml workflow that triggers on issue comments
- When someone comments @all-contributors please add @user for bug, code,
  the workflow automatically:
  - Parses username and contribution types
  - Detects project from labels/title (tinytorch, kits, labs, or book)
  - Updates the project's .all-contributorsrc
  - Regenerates README tables
  - Commits directly (no PR needed)
  - Replies with confirmation

- Add avikde and Takosaga as TinyTorch contributors (bug, test)
- Update contributor documentation with new workflow details
2026-01-22 09:44:51 -05:00
Vijay Janapa Reddi
7fe85bd912 refactor(tinytorch): use pyproject.toml as single source of truth for version
- Update pyproject.toml version to 0.1.4
- Set put_version_in_init = False in settings.ini to prevent nbdev overwrite
- Update tito/main.py to read version from pyproject.toml
- Update tito/__init__.py to read version from pyproject.toml
- Sync settings.ini version to 0.1.4

This ensures tito dev validate doesn't reset the version number.
2026-01-22 08:23:16 -05:00
Vijay Janapa Reddi
83d11f1f50 Add 'ure' to codespell ignore list for regex pattern 2026-01-22 07:54:59 -05:00
Vijay Janapa Reddi
61cbd39344 Fix workflow reference: book-update-contributors.yml → update-contributors.yml 2026-01-21 19:34:14 -05:00
github-actions[bot]
e36fae4a81 Update contributors list [skip ci] 2026-01-22 00:30:47 +00:00
Vijay Janapa Reddi
30884da41c Merge feature/all-contributors-setup: Add per-project contributor tracking system 2026-01-21 19:27:56 -05:00
Vijay Janapa Reddi
930b7371c3 Add comprehensive documentation for contributor system 2026-01-21 19:27:37 -05:00
Vijay Janapa Reddi
d4b87a6b4e Add automatic trigger when contributor configs change 2026-01-21 19:25:58 -05:00
Vijay Janapa Reddi
87160dfc17 Fix generate_readme_tables.py to use repo root from script location 2026-01-21 19:22:53 -05:00
Vijay Janapa Reddi
a59a169a7f Add sectioned contributor system with per-project tracking
- Rename workflow to update-contributors.yml (more generic name)
- Add generate_main_readme.py to create sectioned contributor table
- Update main README with sections: Book, TinyTorch, Kits, Labs
- Add contribution type badges (emojis) to contributor entries
- Add Marcelo Rovai to kits contributors
- Update workflow to handle all project contributor files
2026-01-21 19:21:47 -05:00
Vijay Janapa Reddi
8f740b8222 Add all book contributors from main config
Migrated 99 contributors from the main .all-contributorsrc to the
book-specific config. These are all the people who contributed to
the ML Systems Book project.

Total book contributors: 103
2026-01-20 13:53:54 -05:00
Vijay Janapa Reddi
0430c85639 Populate contributors from git history
- Scanned git history for each project folder
- Added historical contributors to .all-contributorsrc files
- Generated README contributor tables with emoji badges
- Added generate_readme_tables.py script for future updates

Contributors added:
- Book: profvjreddi, Mjrovai, GabrielAmazonas, hzeljko
- Kits: profvjreddi
- Labs: profvjreddi
- TinyTorch: AmirAlasady, profvjreddi, kai4avaya, minhdang26403,
             didier-durand, karthikdani, jettythek
2026-01-20 13:48:55 -05:00
Vijay Janapa Reddi
b8ee62da44 Add contributor scanning script
Script to analyze git history and identify contributors per project:
- Scans book/, kits/, labs/, tinytorch/ folders
- Detects contribution types from commit messages and files
- Maps git emails to GitHub usernames
- Filters out bots and AI tools (github-actions, claude, cursor, etc.)
- Deduplicates by GitHub username
- Can output as table, JSON, or all-contributorsrc format
- Supports dry-run and direct update of config files

Usage:
  python scan_contributors.py                    # Show all as table
  python scan_contributors.py --project tinytorch
  python scan_contributors.py --output rc        # Show RC format
  python scan_contributors.py --dry-run          # Preview updates
  python scan_contributors.py --update           # Apply updates
2026-01-20 13:47:46 -05:00
Vijay Janapa Reddi
149d945a51 Add per-project All Contributors setup
Set up separate contributor tracking for each sub-project:
- book/.all-contributorsrc - Book content contributors
- kits/.all-contributorsrc - Hardware kit contributors
- labs/.all-contributorsrc - Lab exercise contributors
- tinytorch/.all-contributorsrc - Framework contributors

Each project now has:
- Its own .all-contributorsrc config file
- Contributors section in README with All Contributors format
- Project-specific contribution types in the recognition guide
- Cheatsheet in CONTRIBUTING.md (where applicable)

Added @AmirAlasady as first TinyTorch contributor for bug report #1122.

Usage: Comment on any issue/PR with:
@all-contributors please add @username for bug, code, doc, or ideas
2026-01-20 13:35:00 -05:00
Vijay Janapa Reddi
d6cee86a95 Remove unused next_functions from Function class (#1123)
The next_functions attribute was declared and populated but never
used anywhere in the autograd system. The backward() method uses
saved_tensors directly to propagate gradients through the computation
graph, making next_functions dead code.

This simplifies the codebase and removes confusion for students
trying to understand how the computation graph is traversed.

Closes #1122
2026-01-20 10:05:53 -05:00
Vijay Janapa Reddi
2bc166e280 test: add test for matmul scalar rejection
Verifies that matmul correctly raises ValueError when given 0D tensors
(scalars), ensuring behavior aligns with PyTorch/NumPy semantics.

Follow-up to PR #1120.
2026-01-20 08:17:55 -05:00
Dang Truong
3c9ea8d8af fix: matmul should not allow 0D tensors (#1120)
Fixes matmul to correctly reject 0D tensors (scalars), aligning with PyTorch/NumPy behavior. Also cleans up unnecessary f-strings.
2026-01-20 08:17:17 -05:00
Dang Truong
b450b74aff fix: fix memory calculation result (#1118) 2026-01-20 08:07:26 -05:00
kai
6c53aafb8c updating cloud.js to fix spacing 2026-01-20 07:46:18 -05:00
kai
9e3bf82327 setup better auth flow and messaging 2026-01-19 20:11:52 -05:00
kai
92d2f580a9 updated the profile to have educator, industry, student 2026-01-19 18:11:53 -05:00
Vijay Janapa Reddi
a6fff2c277 feat(workflow): automate README badge version updates
- Add automatic README.md badge update to publish workflow
- Update workflow to handle 6 files instead of 5
- Sync README badge to match current version (0.1.4)

This ensures version badges stay in sync across all releases
without manual intervention.
2026-01-19 11:09:35 -05:00
Dang Truong
1d658fa5d7 fix: miscellaneous fix for Tokenizer (#1115) 2026-01-19 10:43:00 -05:00
Dang Truong
baef923943 fix: fix module import in Transformers module test (#1117)
* fix: fix GPT model to use Embedding Layer created in module 11 instead of re-defining token embedding and positional embedding

* fix: fix module import in Transformers module test
2026-01-19 10:42:52 -05:00
Dang Truong
6a387d0c26 fix: correct RandomHorizontalFlip axis for HWC inputs (#1113) 2026-01-19 10:42:42 -05:00
Dang Truong
164faf4dc1 fix: initialize parameter's gradient after creating Optimizer object (#1114) 2026-01-19 10:42:31 -05:00
Vijay Janapa Reddi
871d1f473a docs: complete Perceptron 1958 standardization and add tito dev CLI docs
- Update remaining 1957→1958 references across all documentation
- Add tito dev commands (preflight, export, validate) to CLI reference
- Update CLI validation script to recognize new dev subcommands
- Fix milestone year references in tests and workflow code
- Update timeline visualization JavaScript

This completes the Perceptron year standardization to align with
the publication year and academic citation format (rosenblatt1958perceptron).

Cherry-picked from: ebf3fb17b (feature/tito-dev-validate)
2026-01-17 12:18:23 -05:00
Vijay Janapa Reddi
dbad2637e3 fix(docs): standardize Perceptron year to 1958
- Rename milestone directory from 01_1957_perceptron to 01_1958_perceptron
- Update all references to use 1958 (publication year) for consistency
  with academic citation format (rosenblatt1958perceptron)
- Changes affect: READMEs, docs, tests, milestone tracker

Rationale: Using 1958 aligns with the publication year and standard
academic citations, while 1957 was the development year.

Cherry-picked from: 28ca41582 (feature/tito-dev-validate)
2026-01-17 12:15:49 -05:00
Vijay Janapa Reddi
4b45ba326d Merge branch 'issue-1112-tito-module-05' into dev
This merge brings critical student work preservation features:

Key Changes:
- Rewrote 'tito system update' to preserve student work
  - Uses git sparse checkout for selective updates
  - Preserves: modules/, tinytorch/core/, .tito/, .venv/
  - Updates: src/, tito/, tests/, milestones/, datasets/

- Added consistent Panel warnings for destructive actions
- Removed unused TestCommand and ExportCommand (replaced by module/dev commands)
- Fixed integration tests and training module tests
- Improved optimizer and training module error handling

This addresses issue #1112 and ensures students can safely update
TinyTorch without losing their work in progress.

Commits merged:
- e7051671d chore(tito): remove unused TestCommand and ExportCommand
- abc033d8d fix(tito): rewrite update command to preserve student work
- f9fd2c8fe style(tito): use Panel warnings consistently for destructive actions
- 2ed310d6f fix(tinytorch): fix integration tests and improve update command
2026-01-17 12:14:39 -05:00
Vijay Janapa Reddi
48498d1589 feat(tito): Add 'tito dev validate' command for release validation
- Cherry-picked ValidateCommand from feature/tito-dev-validate branch
- Simulates complete student journey through curriculum
- Runs export + complete cycle for all modules (01-20)
- Executes all milestones after module validation
- Supports --ci mode for CI/CD integration
- Options: --module, --skip-milestones, --stop-on-fail
- Provides detailed pass/fail reporting with timing

This enables release validation without full branch merge conflicts.
2026-01-17 12:06:27 -05:00
Vijay Janapa Reddi
cb5da69349 fix(tinytorch): update CLI validation script with system update and logo commands
The validation script had an outdated list of system subcommands, missing 'update' and 'logo' which were recently added to the CLI.
2026-01-17 10:41:36 -05:00
Vijay Janapa Reddi
8a259e4a42 docs(tinytorch): reorganize site navigation and add update documentation
- Reorganize TOC: move datasets from TITO CLI to new Reference section
- Add complete TITO CLI Reference section to PDF build (was missing)
- Add System Updates section to troubleshooting guide with code safety info
- Fix datasets.md styling for consistency (add border-radius to all boxes)
- Improve logical flow: TITO CLI → Reference → Community

Changes:
- HTML TOC: Create Reference section, move datasets + resources
- PDF TOC: Add full TITO CLI section (overview, modules, milestones, data, troubleshooting)
- troubleshooting.md: Add 4 new sections on updating TinyTorch safely
- datasets.md: Standardize styling with rounded corners

Result: Clean separation between workflow docs (TITO CLI) and reference materials
2026-01-17 10:39:49 -05:00
Vijay Janapa Reddi
c420fe7858 chore(tinytorch): bump version to v0.1.4
TinyTorch v0.1.4: Educational improvements and module path fixes

Breaking Changes:
- fix: correct module path from core.transformer to core.transformers (14 files)

Educational Enhancements:
- refactor: remove premature backward() methods for cleaner progressive learning
- feat: add educational scaffolding with TODO/hints in Module 20 Capstone
- docs: remove forward references to Module 06 in early modules

Bug Fixes:
- fix: TransformerBlock now supports ff_dim parameter for flexibility
- fix: wrap module print statements in if __name__ guards

Code Quality:
- refactor: reorganize Quantizer class export location
- refactor: improve module integration in tinytorch.__init__.py
- chore: remove outdated TINYTORCH_FORMATTING_STANDARDS.md (415 lines)

Stats: 29 files changed, 357 insertions(+), 711 deletions(-)
2026-01-17 10:25:59 -05:00
Vijay Janapa Reddi
be13cb552a Merge remote-tracking branch 'origin/dev' into dev 2026-01-16 17:08:07 -05:00
Vijay Janapa Reddi
b70bc755ce Merge remote-tracking branch 'origin/dev' into dev 2026-01-16 17:07:49 -05:00
Vijay Janapa Reddi
e6090688c4 fix: align ASCII diagrams and tables in TinyTorch modules
Improve visual consistency of documentation by fixing alignment in:
- Tensor reshape operations table
- Reduction patterns diagram
- Training loop flowchart
- Convolution feature hierarchy
- Transformer memory scaling visualization
2026-01-16 17:06:34 -05:00
Vijay Janapa Reddi
021f75d8bf chore: remove unused scripts and documentation
Remove 19 unused scripts that were not referenced in any workflows or configuration files:
- 13 validation scripts in .github/tinytorch-scripts/ (never integrated into CI/CD)
- TINYTORCH_RELEASE_PROCESS.md documentation
- Duplicate gs_compress_pdf.py script
- Unused book scripts (footnotes, reorganize_scripts)
- Unused check_no_emojis.py script
2026-01-15 14:52:52 -05:00
Vijay Janapa Reddi
a1863e80a7 fix(tests): complete progressive disclosure audit and fix all modules
Comprehensive audit and fix of all module integration tests:

MOVED (wrong location):
- test_attention_pipeline_integration.py: 09_convolutions → 12_attention
- test_tensor_attention_integration.py: 09_convolutions → 12_attention

REWRITTEN (violated progressive disclosure):
- Module 11: Was testing compression (16) and attention (12) from embeddings
- Module 12: Was testing kernels (17) instead of attention
- Module 13: Was testing benchmarking (19) instead of transformers
- Module 14: Was testing mlops and benchmarking from profiling
- Module 18: Was importing modules 19+

All 20 modules now follow progressive disclosure:
- Each module only imports from modules 01 to itself
- No future module dependencies
- Proper regression tests for prior modules

Validation: 20/20 modules pass
2026-01-15 14:45:14 -05:00
Vijay Janapa Reddi
d8475a0b59 fix(tests): enforce progressive disclosure in integration tests
Fixed module integration tests to only use modules up to and including
the current module (progressive disclosure). Tests were importing from
future modules which caused validation failures.

Changes:
- Module 05: Remove seed parameter (DataLoader does not support it)
- Module 06: Remove spatial/attention imports (modules 09, 12)
- Module 07: Make gradient tests lenient for partial autograd
- Module 08: Remove spatial imports (module 09)
- Module 09: Remove attention imports (module 12)

Validation result: All 20 modules now pass
2026-01-15 14:45:14 -05:00
kai
9da06f2131 Merge branch 'dev' of github.com:harvard-edge/cs249r_book into dev 2026-01-15 14:25:29 -05:00
kai
f5c5f804a5 updating the manual email flow 2026-01-15 14:25:10 -05:00
Vijay Janapa Reddi
e7051671dc chore(tito): remove unused TestCommand and ExportCommand
These commands were never registered in main.py and have been replaced by:
- TestCommand → tito module test (ModuleTestCommand)
- ExportCommand → tito module export / tito dev export

Also removed unused import and variable in milestone.py.
2026-01-15 10:46:39 -05:00
Vijay Janapa Reddi
abc033d8d2 fix(tito): rewrite update command to preserve student work
The previous update command tried to re-run the install script, which
would fail on existing installations and could wipe student work.

New implementation:
- Downloads latest via git sparse checkout to temp directory
- Selectively updates: src/, tito/, tests/, milestones/, datasets/
- Preserves: modules/, tinytorch/core/*.py, .tito/, .venv/
- Reinstalls pip package to update CLI entry points

This allows students to safely run `tito system update` without
losing their work in progress.

Addresses #1112
2026-01-15 10:36:36 -05:00
Vijay Janapa Reddi
f9fd2c8fe1 style(tito): use Panel warnings consistently for destructive actions
Standardize warning dialogs across all tito commands that perform
destructive operations (reset, delete, overwrite). All confirmation
prompts now use Rich Panel with yellow/red borders for visibility.

Updated commands:
- module reset
- package reset (all variants)
- login (force re-login)
- setup (recreate venv)
2026-01-15 09:52:40 -05:00
Vijay Janapa Reddi
2ed310d6f2 fix(tinytorch): fix integration tests and improve update command
- Fix gradient accumulation scaling in Trainer (divide gradient, not just loss)
- Fix evaluation loop to count batches correctly instead of using len(dataloader)
- Ensure optimizer params have requires_grad=True and grad initialized
- Add pytest -o addopts= to prevent config pollution in integration tests
- Improve update command messaging with Panel warning

Fixes #1112
2026-01-15 09:52:28 -05:00