114 Commits

Author SHA1 Message Date
jettythek
8ba2fec9fd test(community): add CLI tests for progress syncing
Adds unit tests for the community submission flow: payload schema
(assemble_payload), the 200 success path, and the 401 token-refresh path,
plus an opt-in live end-to-end test that self-skips without credentials.

Corrects two assertions to match the current handler: sync_progress returns
a SyncResult (check .ok, not identity against True), and the success message
is "Sync successful!" (lowercase). The three unit tests pass locally.

From #1886, test files only; the bundled guard.js/auth.js auth change is left
for a separate, reviewable PR.
2026-06-21 22:26:57 -04:00
Vijay Janapa Reddi
f0de9f970e fix(tito): reliably sync CLI progress to the community dashboard (#1849)
The dashboard did not reflect CLI progress for users across Windows and
Ubuntu. Three independent client defects, now fixed:

1. Automatic sync was silently skipped on any non-TTY shell. _trigger_submission
   gated on `not sys.stdin.isatty()`, which is False on Windows Git Bash/MinTTY
   and many IDE terminals even when interactive, so `tito module complete`
   updated local progress.json but never uploaded, with no message. Decouple
   "should we sync" (logged-in and not CI) from "should we prompt" (needs a
   TTY): non-interactive real users now sync without a prompt instead of being
   skipped.

2. A 2xx response with synced_modules null/0 was reported as success using the
   local count, hiding backend failures. sync_progress now returns a SyncResult
   and reports an honest accepted-but-unconfirmed warning when the server does
   not confirm persistence.

3. No standalone resync path and login did not sync, so modules completed before
   logging in never reached the dashboard. Add `tito community sync` and an
   offer to sync existing progress after login.

The sync trigger decision now lives in one shared helper
(auto_sync_after_completion) used by the module, milestone, and login paths,
plus a small core/runtime.py that owns is_ci()/is_interactive(). Adds
tests/cli/test_progress_sync.py (15 tests) covering the non-TTY regression, the
CI/not-logged-in branches, honest 2xx interpretation, and the new command.
2026-06-15 13:57:06 -04:00
Vijay Janapa Reddi
5be9f3671a fix(tito): add hidden nbgrader release tiers 2026-06-02 14:45:35 -04:00
Vijay Janapa Reddi
28931b087d fix(tito): harden nbgrader release staging 2026-06-02 14:00:02 -04:00
Vijay Janapa Reddi
ccbc069426 fix(tito): restore nbgrader workflow 2026-06-02 13:40:42 -04:00
Vijay Janapa Reddi
57a665dfe0 fix(tito): align release workflows 2026-06-02 13:40:26 -04:00
Vijay Janapa Reddi
fd9fea0e90 fix(tinytorch): repair release regressions 2026-06-02 13:40:09 -04:00
Vijay Janapa Reddi
bcd5483813 docs(tinytorch): refresh release narrative 2026-06-02 13:39:45 -04:00
Vijay Janapa Reddi
cfd1f66349 docs(tinytorch/tests): update user-journey duration to match measured CI
The docstring stated full_journey takes ~10min; the most recent CI
run that reached the JSON output reported 451.63 seconds = 7.5 min
for 20 modules + 6 milestones. Update to ~7-8min and note the
20-module + 6-milestone shape so the comment reflects what the test
actually exercises.

Also serves as the path-touching change that retriggers
tinytorch-validate-dev on a push event (the prior push-event run
was cancelled by an inadvertent manual workflow_dispatch — the
concurrency group's cancel-in-progress flag superseded the
in-progress push run, leaving the badge red despite a healthy
workflow).
2026-05-12 09:42:01 -04:00
Rocky
c19109f9a2 fix(tinytorch): LayerNorm gamma/beta missing requires_grad=True
gamma and beta were created as Tensor(np.ones/zeros(n)) with no
requires_grad flag, defaulting to False after enable_autograd() patches
Tensor.__init__. The _LayerNormBackward.apply() guards on
beta.requires_grad and gamma.requires_grad, so gradients were silently
never computed for either parameter -- LayerNorm could not learn its
scale and shift during training.

Fix: pass requires_grad=True at construction so the backward pass
computes grad_gamma and grad_beta correctly.

Also remove the manual param.requires_grad = True workaround from
test_layernorm_gradient_flow() which was masking the bug.
2026-04-23 23:19:22 +05:30
Vijay Janapa Reddi
b9ee88ca70 docs(readmes): stretch HTML tables to full width
Add `width="100%"` to every HTML content and contributor table across all
project READMEs so they render full-width on GitHub instead of collapsing
to natural content width. Cell-level `width="X%"` percentages were already
in place but only take effect once the table itself has an explicit width.

Also update the contributor-sync scripts so the auto-generated tables stay
consistent on the next bot run:
  - .github/workflows/contributors/generate_main_readme.py
  - .github/workflows/contributors/generate_readme_tables.py

Scope: 27 files, 85 tables. Sub-project READMEs that already use the
"card" pattern (labs/, kits/ content sections with <table width="98%">
wrappers) are intentionally untouched.
2026-04-22 16:01:54 -04:00
Vijay Janapa Reddi
0a9a2e9028 Merge pull request #1392 from Shashank-Tripathi-07/feat/tensor-pytorch-compat-api
test(tinytorch): PyTorch-compat test coverage for Tensor API additions
2026-04-20 19:58:07 -04:00
Vijay Janapa Reddi
96f70ec4b5 fix(tinytorch): fix GELU gradient mismatch and float32 test precision
Two root causes for the 20 failing gradient correctness tests:

1. GELU forward/backward approximation mismatch: forward used
   sigmoid(1.702*x) but backward computed derivative of the tanh
   approximation. Now both use the sigmoid form consistently.

2. Finite-difference tests used float64 arithmetic but Tensor stores
   float32, causing precision loss in numerical gradients. Tests now
   use float32 throughout with appropriate tolerances.

Also fixed BCE and composed gradient tests that created disconnected
Tensors from .data copies, breaking the autograd graph.
2026-04-18 15:26:44 -04:00
Rocky
3b0fd02b0f test(tinytorch): add PyTorch-compat coverage for ndim, numel, view, contiguous, masked_fill
Closes #1298 (test coverage for the API additions landed in #1391 plus
the deferred view/masked_fill that arrived in the same merge window).

Ten focused tests in TestTensorPyTorchCompat verify the methods students
are most likely to call when porting PyTorch training loops to TinyTorch:

- ndim matches len(shape) for rank 0-3 tensors
- numel() equals .size
- view() is a reshape alias, including -1 inference
- contiguous() returns correct data and guarantees C-order layout
- masked_fill basic replacement and the -inf attention-mask pattern
- masked_fill does not mutate the original tensor
- Tensor([t1, t2]) stacking constructor

Each test targets one specific behavioral contract so failures pinpoint
exactly which method regressed.
2026-04-18 04:48:22 +05:30
Vijay Janapa Reddi
6c27f08787 fix(tinytorch): restore gradient correctness tests with per-op tolerances (#1342)
Reintroduce finite-difference gradient tests that were removed in
df40f696a to unblock CI. The backward math is correct (confirmed in
issue audit); failures were caused by uniform tolerances that are too
tight for nonlinear ops.

Key fixes:
- EPS 1e-4 -> 1e-5 for better truncation/cancellation tradeoff at float64
- GELU: rtol=5e-3, atol=1e-4 and moderate test points (nested
  tanh-of-cubic amplifies finite-diff error at extreme values)
- BCE: rtol=2e-3, atol=1e-4 (clip boundaries create derivative jumps)
- Two-layer chain: rtol=2e-3, atol=1e-4 (error accumulates through layers)
- Replace em-dash box-drawing chars with ASCII to avoid encoding issues
2026-04-17 18:55:17 -04:00
Vijay Janapa Reddi
242093e407 fix(tinytorch): wire Tanh into enable_autograd()
Tanh was the only activation not patched by enable_autograd(). calling Tanh()(x).backward() silently left x.grad as None because the forward never attached a computation graph.

changes mirror the existing tracked_sigmoid_forward pattern:
- new TanhBackward(Function) class using saved output, since d/dx tanh(x) = 1 - tanh(x)^2 can be computed from the forward result
- new tracked_tanh_forward in enable_autograd() that attaches TanhBackward when input requires_grad
- Tanh added to the activations import and patch install lines
- regression test in test_06_autograd_progressive.py asserts tanh grad values at known points

closes #1341
2026-04-16 13:41:32 -04:00
Vijay Janapa Reddi
df40f696aa fix(tests): drop stray gradient test file from #1338
the file tinytorch/tests/06_autograd/test_gradient_correctness.py was accidentally included in #1338 along with the intended tokenization DummyModel fix. the same file is the subject of #1336 where its failing 17 tests are being worked through. removing it here to get dev CI green again.
2026-04-16 12:51:51 -04:00
Vijay Janapa Reddi
ce394f5757 Merge pull request #1338 from Shashank-Tripathi-07/fix/tokenization-dummy-model-numpy-params
fix(tests/10_tokenization): replace raw numpy array params with Tensor in DummyModel
2026-04-16 12:50:41 -04:00
Rocky
13972d6807 fix(tests/08_training): correct scheduler lr assertion to use epoch 0 not epoch 1
train_epoch applies scheduler.get_lr(self.epoch) at the start of the
epoch when self.epoch == 0, then increments epoch to 1 at the end.
The test was asserting against get_lr(1) which is off by one.
2026-04-16 18:27:15 +05:30
Rocky
96e672bc7f fix(tests/10_tokenization): replace raw numpy array params with Tensor in DummyModel
DummyModel.parameters() was returning [np.array([1.0])], a raw numpy
array. Trainer.__init__ iterates model.parameters() and checks
param.requires_grad, which crashes with AttributeError on numpy arrays.

Fix: give DummyModel a proper Tensor parameter with requires_grad=True,
consistent with how every other test stub in this file constructs params.
2026-04-16 18:19:20 +05:30
Rocky
2b7ff801ee fix(tests/06_autograd): rewrite gradient correctness tests to pass CI
- Move enable_autograd() call to after all module imports so activation
  and loss forward methods are patched correctly
- Move constant Tensors inside fn() closures to avoid stale autograd state
- Use w.data.copy() in linear layer tests instead of raw Tensor assignment
- Remove em dashes and Unicode box-drawing characters
- Use .format() instead of f-strings for consistency
2026-04-16 18:15:01 +05:30
Rocky
19c7e69ea5 test(tinytorch): add finite-difference gradient correctness tests for Module 06
No backward pass in TinyTorch was previously verified numerically — tests
only checked that gradients were non-None or non-zero.

This file adds finite-difference (central differences, ε=1e-4) checks for:

- Arithmetic: add, sub, mul, div, matmul (both operands), broadcast add, chained ops
- Activations: ReLU (incl. zero boundary), Sigmoid, Tanh, GELU
- Losses: MSELoss, MSELoss batch, BinaryCrossEntropyLoss, CrossEntropyLoss
- Composed graphs: Linear weight gradient, Linear bias gradient, two-layer chain, MSE-through-Linear end-to-end
- Gradient accumulation across two backward calls
- no_grad() context: disables tracking inside, does not affect outside
2026-04-16 17:34:12 +05:30
Rocky
6b42b75b55 test(tinytorch): add coverage tests for Module 08 training infrastructure
Covers six areas that were implemented but had zero test coverage:

- CosineSchedule: start/mid/end values, monotonic decrease, past-end edge case
- clip_grad_norm: clipping, no-clip, multi-param global norm, direction preservation, zero-grad safety
- save/load_checkpoint: file creation, all keys present, epoch/step/history/weights restored, resumes training, creates parent dirs
- Trainer.evaluate: finite loss, float return types, eval mode set, weights unchanged, history recorded, classification accuracy (correct and wrong)
- Scheduler integration in train_epoch: LR recorded in history, optimizer.lr updated, decreases over epochs
- Gradient clipping integration in train_epoch: training completes, weights update, tight clip limits update size
- Train/eval mode switching: model.training flag correct after train_epoch, evaluate, and train→eval→train
2026-04-16 17:34:01 +05:30
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
Vijay Janapa Reddi
d30257577c refactor(tinytorch): migrate from legacy np.random to default_rng(7)
Replace np.random.randn/rand/seed with np.random.default_rng(7) across
all 93 source modules, tests, and milestones for reproducible, isolated
random state.
2026-04-03 17:57:51 -04:00
Vijay Janapa Reddi
a66f2c66a6 fix(tinytorch): fix MaxPool2d API mismatch in milestone 04 CIFAR script (#1278)
- Fix pool_size=(2,2) → kernel_size=2, stride=2 in 02_lecun_cifar10.py
- Normalize all Conv2D/MaxPool2D/BatchNorm2D references to lowercase d
  (Conv2d, MaxPool2d, BatchNorm2d) across comments, strings, and ASCII art
- Fix Conv2d error string in 09_convolutions.py source module
- Delete milestones/extras/ directory (drifted copies, 2 placeholders,
  1 broken script — maintenance liability that caused the duplicate bug)
- Add test_milestones_smoke.py: 19 lightweight tests that import every
  milestone script and construct every model class in 0.07s, catching
  API drift without data downloads
2026-03-24 17:24:14 -04:00
Vijay Janapa Reddi
dc3267027a fix(tinytorch): fix remaining test failures (847/847 passing)
- Fix x.T -> x.transpose() in profiling progressive test
- Fix KVCache constructor calls in memoization progressive test
  (3-arg -> 5-arg: batch_size, max_seq_len, num_layers, num_heads, head_dim)
2026-03-24 08:49:47 -04:00
Vijay Janapa Reddi
d3919434ab fix(tinytorch): batch 7 test infrastructure cleanup
Module numbering fixes (4 progressive test files):
- M01: TestModule02TensorCore -> TestModule01TensorCore, remove
  nonexistent 01_setup references
- M02: TestModule03ActivationsCore -> TestModule02ActivationsCore
- M03: TestModule04LayersCore -> TestModule03LayersCore,
  test_module_04_complete -> test_module_03_complete
- M07: TestModule06OptimizersCore -> TestModule07OptimizersCore

DataLoader core tests:
- Replace raw Python list with TensorDataset in 3 tests
- Add meaningful assertions to test_shuffling (was vacuous)

Other test fixes:
- M18: test_tinygpt_integration module_name 16_tinygpt -> 18_memoization
- M06: Add NOTE to test_autograd_core.py explaining Variable
  tests are placeholders (class not implemented)
2026-03-24 08:49:47 -04:00
Vijay Janapa Reddi
6fdfe203cb fix(tinytorch): batch 2 critical fixes from module audit
M06 Autograd:
- SumBackward now stores axis/keepdims and expands grad_output
  correctly for axis-reduced sums (was producing wrong gradients
  for bias accumulation and axis-specific reductions)

M13 Transformers:
- Convert 8 TransformerBlock calls from positional to keyword args
  (ff_dim=) across test files for M13, M14, M18 — prevents silent
  mlp_ratio interpretation creating 64x larger hidden layers
- Fix parameter count: 4*embed_dim^2 -> 12*embed_dim^2, 11.4M -> 29.7M

M18 Memoization:
- Add missing 2x factor in KV cache formula (K and V are two tensors)
- Fix GPT-2 37MB -> 72MB, GPT-3 4.7GB -> 18GB
- Fix speedup formula: sum(i^2) -> sum(i), 170x -> ~50x

M01 Tensor:
- Fix analyze_memory_layout transpose text (was still saying
  "changes memory layout" contradicting the earlier fix)
2026-03-24 08:49:46 -04:00
Vijay Janapa Reddi
03f58ad021 fix(tinytorch): first batch of critical fixes from module audit
Test infrastructure:
- Fix wrong import paths in test files for losses, profiling,
  memoization, KV cache integration, and capstone modules
- Remove broken backward() test from losses core (stub in M04)
- Fix module labels in test docstrings

Correctness bugs:
- M01: Transpose is a view not a copy; dtype float32 not int64
- M04: MSELoss docstring 0.1467 -> 0.1800
- M08: Move scheduler before batch loop (was one-epoch late)
- M10: encode("abc") returns [1,2,3] not [0,1,2]
- M19: Remove *1000 from demo (values already in ms)
- M20: Import BenchmarkSuite from perf.benchmarking
2026-03-24 08:49:46 -04:00
Vijay Janapa Reddi
fa7813cbae fix(tito): register --tinytorch pytest flag in conftest
tito module test passes --tinytorch to pytest but the flag was never
registered via pytest_addoption (the pytest_tinytorch plugin was removed
during test cleanup). Adds the registration to conftest.py so tito
module test works again. Addresses discussion #1257.
2026-03-24 08:49:45 -04:00
Vijay Janapa Reddi
aadaf5b13a docs: convert all README markdown tables to HTML format
Standardize table formatting across 25 README files to use
HTML tables with consistent styling (thead/tbody, column widths,
bold labels) matching the main README's presentation.
2026-03-17 08:57:21 -04:00
Vijay Janapa Reddi
09de699545 fix(exports): add missing #| export directives across 10 modules
Systematic audit of all 20 modules against module-developer agent rules
found 9 standalone helper functions missing #| export — these are called
by exported code at runtime but were excluded from the generated package,
causing NameError/AttributeError in CI.

Modules fixed:
- 05_dataloader: _pad_image, _random_crop_region (used by RandomCrop)
- 06_autograd: _stable_softmax, _one_hot_encode (prior session)
- 07_optimizers: 5 mixin classes + monkey-patches (prior session)
- 08_training: 7 monkey-patched Trainer methods (prior session)
- 10_tokenization: _count_byte_pairs, _merge_pair (used by BPETokenizer)
- 11_embeddings: _compute_sinusoidal_table (prior session)
- 12_attention: _compute_attention_scores, _scale_scores, _apply_mask (prior)
- 15_quantization: _collect_layer_inputs, _quantize_single_layer (used by quantize_model)
- 18_memoization: _cached_generation_step, _create_cache_storage, _cached_attention_forward (used by enable_kv_cache)
- 19_benchmarking: rename TinyMLPerf→MLPerf, fix monkey-patch naming (prior)

Also includes: vscode-ext icon refactor (ThemeIcon migration).

All 789 tests pass (unit, integration, e2e, CLI).
2026-02-15 17:38:03 -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
796bedbec1 fix: update memoization test assertions for new error message format
Updated test assertions to use case-insensitive matching for the
new 3-part educational error messages.
2026-01-25 11:44:20 -05:00
Vijay Janapa Reddi
6f8efe8a94 fix: update test assertion for new error message format
The reshape error message was updated to the 3-part educational
pattern, but the integration test was still checking for the old
message text. Updated to use case-insensitive matching.
2026-01-25 11:35:32 -05:00
Vijay Janapa Reddi
f96dc24788 test(milestones): add full milestone run tests
Add comprehensive tests that run each milestone script fully:
- Tests all 6 milestones (01-06) with actual training
- Verifies correct outputs and accuracy thresholds
- Marked as @pytest.mark.slow for release validation
- Suitable for e2e testing, not regular CI

These tests validate the complete educational experience works end-to-end.
2026-01-24 19:04:39 -05:00
Vijay Janapa Reddi
2c9b0dccbf fix: restore Conv2dBackward and MaxPool2dBackward for CNN gradient flow
- Restore Conv2dBackward class removed in commit 23c5eb2b5
- Restore MaxPool2dBackward class for pooling gradient routing
- Update Conv2d/MaxPool2d forward() to attach _grad_fn
- Set requires_grad=True on Conv2d weights and bias
- Add enable_autograd() to Module 11 (Embeddings) for progressive disclosure
- Remove skip markers from convolution gradient tests

CNN training now works correctly - conv weights receive gradients and update
during training. All 40 convolution tests pass.
2026-01-24 17:39:11 -05:00
Vijay Janapa Reddi
b217f7c552 test: skip Conv2d/MaxPool2d gradient tests (known limitation)
Conv2d and MaxPool2d use raw numpy operations internally rather than
Tensor operations, so they don't participate in the autograd computation
graph. The forward pass works correctly and requires_grad propagates,
but backward() doesn't compute gradients through these operations.

This is a known architectural limitation of the educational implementation.
Proper autograd support would require either:
1. Rewriting conv/pool to use Tensor ops throughout, OR
2. Manually implementing backward functions

Skip these tests with clear documentation of why.
2026-01-24 14:42:18 -05:00
Vijay Janapa Reddi
ea6a638431 refactor(tests): remove tests for unimplemented attention components
Remove test_attention_pipeline_integration.py and test_tensor_attention_integration.py
which test SelfAttention, create_causal_mask, and other components that do not exist
in the attention module. These were always skipped and provided no test value.

The existing attention tests (test_attention_core.py) properly test the actual
implemented components: scaled_dot_product_attention and MultiHeadAttention.
2026-01-24 14:07:48 -05:00
Vijay Janapa Reddi
e233814a63 refactor(tests): remove performance benchmark tests
Performance benchmark tests are inherently timing-sensitive and flaky
in CI environments. They were already skipped by default. Removing them
entirely as they provide no CI value - performance testing should be
done locally or in dedicated performance regression infrastructure.
2026-01-24 13:57:26 -05:00
Vijay Janapa Reddi
e409d5a94b refactor(tests): remove redundant milestone tests
Remove test_milestones_run.py and test_learning_verification.py as they
duplicate functionality already covered by module and integration tests.
The milestone demo scripts remain for student use, but running them as
tests adds no value beyond the existing test coverage.
2026-01-24 13:57:06 -05:00
Vijay Janapa Reddi
d53722eb81 fix(tests): skip flaky performance and transformer training tests in CI
- Skip test_performance.py by default (timing-sensitive benchmarks)
- Skip test_attention_runs (non-deterministic transformer training)

Both can be run manually when needed. This ensures CI passes reliably.

Test results: 845 passed, 36 skipped in ~4 minutes
2026-01-24 13:42:32 -05:00
Vijay Janapa Reddi
999fd13447 refactor(tests): reorganize test folders and fix misplaced files
Folder consolidation:
- Merge system/ into integration/ (removed duplicate folder)
- Remove performance/ (only had framework, no tests)

File relocations:
- Move test_dense_layer.py, test_dense_integration.py from 04_losses/ to 03_layers/
- Move test_network_capability.py from 04_losses/ to integration/
- Move test_kv_cache_integration.py from 14_profiling/ to 18_memoization/
- Move system/ tests (forward_passes, gradients, shapes, etc.) to integration/

Removed duplicates:
- system/test_gradient_flow_overall.py (duplicate of integration version)
- system/test_integration.py (redundant with integration/ folder)
- system/test_milestones.py (duplicate of milestones/ tests)

Final structure: 26 folders, 100 test files
2026-01-24 12:44:40 -05:00
Vijay Janapa Reddi
389989ece7 refactor(tests): clean up test folder and fix gradient flow issues
Test Cleanup (113 files, -22,000 lines):
- Remove 21 redundant run_all_tests.py files
- Remove checkpoints/ folder (22 obsolete checkpoint files)
- Remove progressive/, debugging/, diagnostic/ folders
- Remove duplicate integration tests and examples
- Remove orphaned dev artifacts and generated outputs
- Consolidate test_gradient_flow_overall.py into system/

Documentation Cleanup (4 files removed):
- Remove duplicate HOW_TO_USE.md, WORKFLOW.md, SYSTEM_DESIGN.md
- Trim environment/README.md from 334 to 86 lines
- Update capstone/README.md removing outdated bug references

Test Fixes:
- Add requires_grad=True to layer parameters in gradient tests
- Fix PositionalEncoding argument order in test_shapes.py
- Adjust performance thresholds for realistic expectations
- Fix gradient clipping to handle memoryview correctly
- Update zero_grad assertions to accept None or zeros
2026-01-24 12:22:37 -05:00
Vijay Janapa Reddi
1dab26b16c fix(tests): add optimizer creation to enable gradient flow in tests
The progressive disclosure design means layer parameters have
requires_grad=False until an optimizer is created. The optimizer
__init__ sets requires_grad=True on all parameters it receives.

Tests were checking gradient flow without creating an optimizer,
which does not reflect real usage. Students always create an optimizer
before training. Fixed tests to create optimizers first.

Remaining failures are real autograd limitations:
- Conv2d backward does not compute weight gradients
- Embedding backward does not compute weight gradients
- LayerNorm backward does not compute weight gradients

These are honest test failures that expose real bugs.
2026-01-24 08:35:56 -05:00
Vijay Janapa Reddi
770dac3469 fix(tests): correct API calls in system milestone tests
- Fix Tensor() call to not use dtype kwarg (use float literals instead)
- Fix PositionalEncoding to use max_seq_len param
- Fix TransformerBlock to use ff_dim instead of hidden_dim
2026-01-24 07:47:32 -05:00
Vijay Janapa Reddi
f524506d19 fix(tests): resolve API mismatches and fix test infrastructure
- Fix BenchmarkSuite instantiation (requires models, datasets params)
- Delete test_checkpoint_integration.py (tests non-existent APIs)
- Limit environment tests to main requirements.txt only
- Fix variable name bug in integration_simple_test.py
- Fix PositionalEncoding, TransformerBlock, LayerNorm API calls
- Fix milestone CLI tests to use 'tito milestone' not 'milestones'
- Add TITO_ALLOW_SYSTEM env var for CLI tests
2026-01-24 00:26:41 -05:00
Vijay Janapa Reddi
ed709c95a5 fix(tests): resolve import errors for honest test execution
- Fix test_capstone_core.py: use BenchmarkSuite instead of non-existent BenchmarkReport
- Remove test_integration_01_setup.py: references non-existent setup_dev module

These fixes allow the test suite to run without collection errors.
Gradient tests now correctly fail, exposing real autograd integration issues.
2026-01-23 23:27:30 -05:00
Vijay Janapa Reddi
9b3e9cb8dd cleanup(tests): remove redundant performance tests and aliases
- Delete test_module_15/16/17/19/20 files (duplicates of module-specific tests)
- Remove backward-compat aliases from performance_test_framework.py
- Update run_all_performance_tests.py to use pytest on module directories
- Replace PerformanceTestSuite alias with PerformanceTester

Tests now run from their proper locations in tests/{module}/ directories.
2026-01-23 23:13:54 -05:00