Commit Graph

615 Commits

Author SHA1 Message Date
Vijay Janapa Reddi
2de66f1c0f refactor: complete Gold Standard audit for core foundation chapters; unify Volume 1 and Volume 2 math; verify physical realism of hardware constants 2026-02-25 08:31:21 -05:00
Vijay Janapa Reddi
9d840fc1a0 Merge branch 'dev' into feature/book-volumes 2026-02-10 13:12:34 -05:00
kai
f05bb12cb2 updated the iframe login issues 2026-02-10 10:25:11 -05:00
kai
1178d21600 flow with particles as new timeline opening 2026-02-09 17:46:03 -05:00
kai
e95c9d96c7 updating antialiasing ant crawl issue...arxiv 2026-02-09 08:15:18 -05:00
github-actions[bot]
2ac790601e chore(tinytorch): bump version to tinytorch-v0.1.8 2026-02-07 20:55:09 +00:00
github-actions[bot]
b01b83506b docs: add @Takosaga as tinytorch contributor for doc, bug 2026-02-06 12:10:07 +00:00
Dang Truong
af23c13999 fix small typo (#1163) 2026-02-06 02:09:30 -05:00
Vijay Janapa Reddi
956e7277c8 feat(site): auto-generate team page from .all-contributorsrc
Add generate_team.py script that reads .all-contributorsrc and generates
the team.md page automatically. This keeps the website team page in sync
with the README contributors.

- Add tinytorch/site/scripts/generate_team.py
- Update both deploy workflows to run the script before building
- Contributors added via @all-contributors now appear on the website

The script runs during site build, so team.md stays fresh with each deploy.
2026-02-05 20:25:02 -05:00
github-actions[bot]
6c33a3e3ab docs: add @oscarf189 as tinytorch contributor for doc 2026-02-06 01:20:45 +00:00
Vijay Janapa Reddi
c1c8c11eec fix(layers): correct Xavier/Glorot initialization terminology
The formula sqrt(1/fan_in) is actually LeCun initialization (1998),
not Xavier/Glorot. True Xavier uses sqrt(2/(fan_in+fan_out)).

- Rename XAVIER_SCALE_FACTOR → INIT_SCALE_FACTOR
- Update all comments to say "LeCun-style initialization"
- Add note explaining difference between LeCun, Xavier, and He init
- Keep the simpler formula for pedagogical clarity

Fixes #1161
2026-02-05 20:11:50 -05:00
kai
0cfebb6f42 index.html comm site with arxiv 2026-02-04 22:23:11 -05:00
github-actions[bot]
1c0fac8aae Update contributors list [skip ci] 2026-02-04 16:42:46 +00:00
Vijay Janapa Reddi
ddca8652ce fix(contributors): merge duplicate Andrea entries in TinyTorch
AndreaMattiaGaravagn (truncated) and AndreaMattiaGaravagno were listed
as separate contributors. Merged into a single entry with the correct
username, avatar, and combined contributions (code + doc).
2026-02-04 11:29:34 -05:00
Vijay Janapa Reddi
299fcc14e1 style(paper): tidy references.bib for pre-commit compliance
Fix line wrapping and add trailing newline to pass bibtex-tidy
pre-commit hook.
2026-02-04 10:44:02 -05:00
Vijay Janapa Reddi
25fc9e4848 fix(tito): resolve Jupyter kernel mismatch causing ModuleNotFoundError (#1147)
Students hit "No module named 'tinytorch.core.tensor'" in notebooks because
the Jupyter kernel used a different Python than where tinytorch was installed.

- setup: install ipykernel + nbdev, register named kernel during tito setup
- health: add Notebook Readiness checks (import, kernel, Python match)
- export: verify exported file exists and has content (fail loudly)
- Windows: add get_venv_bin_dir() helper for cross-platform venv paths
2026-02-04 10:24:37 -05:00
Vijay Janapa Reddi
3a2b1bf482 fix(ci): use head_ref for PR branch in fresh install test
On PR events, github.ref_name resolves to the merge ref (e.g.
"1159/merge") which doesn't exist on raw.githubusercontent.com,
causing a 404. Use github.head_ref (the actual source branch)
for PRs, falling back to ref_name for push events.

Also adds -f flag to curl so HTTP errors fail immediately with
a clear message instead of silently saving the 404 HTML page.
2026-02-04 10:06:25 -05:00
Vijay Janapa Reddi
24ab7599c6 fix(paper): escape special LaTeX characters breaking PDF build
Escape unescaped & characters in references.bib (Taylor & Francis,
AI & Machine-Learning) and replace Unicode em-dashes (U+2014) with
LaTeX --- ligatures in paper.tex for T1 font compatibility.
2026-02-04 10:05:32 -05:00
Vijay Janapa Reddi
19093cec1b fix(ci): use pipe delimiter in sed to handle branch names with slashes
The fresh install test script used / as the sed delimiter when
substituting the branch name, which breaks on any branch containing /
(e.g. feature/foo, fix/bar, or GitHub merge refs like 1156/merge).
2026-02-04 09:00:20 -05:00
Vijay Janapa Reddi
4fb5173503 docs(activations): expand GELU explanation with both approximation forms
Show the exact definition, tanh approximation, and sigmoid approximation
side by side so students understand where 1.702 comes from and why we
chose the sigmoid form. Avoids erf notation in favor of plain-language
description of Φ(x) appropriate for Module 2 students.

Related to harvard-edge/cs249r_book#1154
2026-02-04 08:49:41 -05:00
Vijay Janapa Reddi
c3a9230ea8 fix(activations): correct misleading GELU hint about 1.702 constant
The hint claimed 1.702 comes from √(2/π) ≈ 0.798, which is incorrect.
The 1.702 constant is empirically fitted so that sigmoid(1.702x) ≈ Φ(x),
the Gaussian CDF. The √(2/π) constant appears in the separate tanh-based
GELU approximation, not the sigmoid approximation used here.

Fixes harvard-edge/cs249r_book#1154
2026-02-04 08:42:58 -05:00
Vijay Janapa Reddi
20a4ba2379 fix(attention): correct O(n²) complexity explanation and memory table bug
- Clarify that attention time complexity is O(n²×d), not O(n²), since each
  of the n² query-key pairs requires a d-dimensional dot product
- Fix Total Memory column in analyze_attention_memory_overhead() which was
  duplicating the Optimizer column instead of summing all components
- Update KEY INSIGHT multiplier from 4x to 7x to match corrected total

Fixes harvard-edge/cs249r_book#1150
2026-02-04 08:37:32 -05:00
Vijay Janapa Reddi
819ed75bc1 Merge pull request #1151 from AndreaMattiaGaravagno/feature/step-by-step-milestone-visualization
feat: add step-by-step visualization to milestones
2026-02-03 22:21:46 -05:00
github-actions[bot]
a33d600fbd docs: add @AndreaMattiaGaravagno as tinytorch contributor for code 2026-02-04 03:20:48 +00:00
Vijay Janapa Reddi
3e3a635a70 Merge pull request #1152 from AndreaMattiaGaravagno/fix/milestone-frame-alignment
fix(tito-milestone): align bold cyan frame
2026-02-03 22:17:26 -05:00
AndreaMattiaGaravagno
668a50af87 feat: add step-by-step visualization to milestones 2026-02-03 19:42:21 +01:00
Vijay Janapa Reddi
30a267a793 feat(site): add Team page and reorganize Community section
- Add new Team page featuring core staff and contributors
- Vijay Janapa Reddi (Nerdy Professor), Andrea Garavagno (Tech Lead),
  Kari Janapareddi (Chief of Staff), Kai Kleinbard (Web Wizard)
- Display community staff side-by-side with fun role titles
- Move Acknowledgments to separate page for MiniTorch/micrograd credits
- Add contributor generator script for future automation
- Update navigation: Team → Ecosystem → Acknowledgments
2026-02-03 13:41:10 -05:00
Vijay Janapa Reddi
0c7509ff35 feat(site): add embedded PDF slide viewer to all module pages
Replace the slide download card with an inline PDF viewer using PDF.js:
- Change grid layout from 4 cards (2x2) to 3 cards in a row
- Add embedded slide viewer with navigation, zoom, and fullscreen
- Load slides from local _static/slides/ for reliable CORS handling
- Add "· AI-generated" subtitle to match audio card pattern
- Use 🔥 icon consistently across all viewers

Affected: 20 module ABOUT.md files + big-picture.md
2026-02-03 12:06:52 -05:00
Vijay Janapa Reddi
e8ffd090e3 fix(paper): normalize BibTeX escaping in references.bib
Standardize LaTeX accent escaping and ampersand formatting for
consistency across bibliography entries.
2026-02-03 10:23:51 -05:00
AndreaMattiaGaravagno
5f6a8468f3 fix(tito-milestone): align bold cyan frame and correct "Press Enter" color 2026-02-03 12:24:18 +01:00
github-actions[bot]
cb564234a4 docs: add @AndreaMattiaGaravagn as tinytorch contributor for doc 2026-02-01 15:03:42 +00:00
AndreaMattiaGaravagno
ad94870ed2 docs(slides): specify genai usage (#1149) 2026-02-01 10:01:47 -05:00
kai
9d8e54776a restoring init file that was accidently changed 2026-01-30 15:28:19 -05:00
kai
3409e91322 updated the bundle remove auto o 2026-01-30 15:23:23 -05:00
kai
6cbdbe56ea bundle for socratiq button on 2026-01-30 15:09:00 -05:00
github-actions[bot]
8154612fca chore(tinytorch): bump version to tinytorch-v0.1.7 2026-01-29 21:50:01 +00:00
Vijay Janapa Reddi
17d64580d7 fix(site): use external link icon for arXiv Paper link
Changed Paper link from local PDF download to arXiv external link:
- URL: _static/downloads/TinyTorch-Paper.pdf → arxiv.org/abs/2601.19107
- Icon: ↓ (download) → ↗ (external link)
- Added target=_blank to open in new tab
2026-01-29 15:03:43 -05:00
Vijay Janapa Reddi
bb5dd7a9f6 fix(export): use nbdev Python API instead of CLI for reliable export
The nbdev_export CLI was not reading settings.ini correctly in CI,
causing exports to silently fail. Using nbdev.export.nb_export()
Python API directly with explicit lib_path ensures exports work
reliably regardless of environment.
2026-01-29 14:28:40 -05:00
Vijay Janapa Reddi
2ec60a6f5c fix(export): use python -m nbdev.export instead of nbdev_export command
The nbdev_export command wasn't in PATH in CI. Using sys.executable
with -m nbdev.export ensures we use the same Python environment that's
running tito, which is more reliable across different environments.

Fixed in:
- tito/commands/dev/export.py (both _export_all_modules and _run_nbdev_export)
- tito/commands/module/workflow.py (_export_notebook)
2026-01-29 14:19:26 -05:00
Vijay Janapa Reddi
2546b54bba fix(export): handle running from tinytorch directory
The directory check was looking for tinytorch/tinytorch/__init__.py
when running from the tinytorch directory (as CI does). Fixed to check
for either repo root or tinytorch project directory structure.
2026-01-29 13:53:22 -05:00
Vijay Janapa Reddi
46d633d3cd fix(ci): show full export error output for debugging
Increased error output from 100 to 500 chars and show both stdout
and stderr to help diagnose CI export failures.
2026-01-29 13:51:58 -05:00
Vijay Janapa Reddi
2007029aa2 fix(milestone): pass Tensor class to step functions that need it
Fixed NameError in step_1_profile and step_5_accelerate by adding
Tensor as a parameter. These functions create sample tensors for
profiling/testing but the Tensor class is imported in main(), so
they need it passed as an argument.
2026-01-28 19:14:28 -05:00
Vijay Janapa Reddi
0b119bf666 refactor(milestone): extract MLPerf steps into separate functions
Break the 600-line main() into clean, documented step functions:
- CONFIG dict for shared settings
- step_1_profile() - Measure baseline with Profiler
- step_2_quantize() - FP32→INT8 with Quantizer
- step_3_prune() - Magnitude pruning with Compressor
- step_4_kv_cache() - Transformer generation speedup
- step_5_accelerate() - Vectorized operations demo
- step_6_benchmark() - Scientific benchmarking
- print_final_results() - Summary table

Each function has detailed docstrings with ASCII diagrams
explaining what the optimization technique does.
2026-01-28 18:57:31 -05:00
Vijay Janapa Reddi
a3b3c77f1a docs(milestone): add ASCII attention pattern diagrams to docstrings
Each challenge function now has visual documentation showing:
- The task input/output example
- The ideal attention weight matrix pattern
- Why the pattern is required for the task

Challenge 3 also explains why a fresh model is needed
(sequential training causes "catastrophic forgetting").
2026-01-28 18:41:33 -05:00
Vijay Janapa Reddi
b8f68510fd refactor(milestone): extract challenges into separate functions
Break the monolithic main() into clean, documented functions:
- CONFIG dict for shared hyperparameters
- build_model() for creating fresh model/optimizer/loss
- challenge_1_reversal() - anti-diagonal attention patterns
- challenge_2_copying() - diagonal attention patterns
- challenge_3_mixed() - prefix-conditioned behavior (fresh model)
- print_final_results() - summary table and messages

This makes the code much easier for students to understand
and clearly shows why challenge 3 needs a fresh model.
2026-01-28 18:38:35 -05:00
Vijay Janapa Reddi
bcbcbf7f3d fix(milestone): reset model before mixed task challenge
The transformer was being trained sequentially on reversal then copying,
which caused it to "forget" reversal before the mixed task. Now we
reinitialize the model before challenge 3 so it learns both tasks
together with proper prefix conditioning.
2026-01-28 18:36:16 -05:00
Vijay Janapa Reddi
8f9481b508 fix(test): update assertion to match actual error message
The test checked for "invalid" or "error" but the actual message
says "Command Not Found" and "not a valid command".
2026-01-28 17:36:20 -05:00
Vijay Janapa Reddi
eb84df491e docs(paper): clarify Adam memory overhead + fix LaTeX labels
- Clarify "3× memory" → "3× optimizer-related memory (gradients plus
  two state buffers)" for accuracy
- Fix lstlisting label syntax: label=lst:... → label={lst:...}
- Remove stale figure reference, use prose instead
- Fix convolutions comment: 6 → 7 nested loops (matches actual code)
- Remove unused benchmark_table3.py
2026-01-28 17:19:55 -05:00
Vijay Janapa Reddi
dc7ff1dfc9 feat(site): link Paper to arXiv instead of local PDF
The paper is now published at arXiv:2601.19107, so link directly
to the abstract page for better discoverability and citation info.
2026-01-28 15:51:36 -05:00
Vijay Janapa Reddi
316bdae031 Merge dev: user journey test + export bug fix 2026-01-28 12:42:30 -05:00