Skip to content

feat(tests): add 29 model tests for forward pass, LTI stability, generation, RMSNorm, causal mask, LoRA and loop-index embedding#22

Open
miheer-smk wants to merge 3 commits intokyegomez:mainfrom
miheer-smk:main
Open

feat(tests): add 29 model tests for forward pass, LTI stability, generation, RMSNorm, causal mask, LoRA and loop-index embedding#22
miheer-smk wants to merge 3 commits intokyegomez:mainfrom
miheer-smk:main

Conversation

@miheer-smk
Copy link
Copy Markdown

What this PR adds

Adds tests/test_model.py — 29 tests covering the core OpenMythos model.
The existing test suite only covered RoPE and the tokenizer.
This PR fills the gap by testing the model itself.

Tests added (9 categories)

  • Model loading — GQA and MLA configs instantiate correctly
  • Forward pass shape — logits are (B, T, vocab_size) for both attention types
  • Batch sizes — parametrized over batch size 1, 2, 4
  • LTI stability — spectral radius of A is in [0,1] at init and after extreme weight perturbation (core Parcae guarantee)
  • Depth extrapolation — model works for n_loops=1,2,4,8 including beyond max_loop_iters
  • Generation — output shape, prompt preservation, tokens within vocab
  • RMSNorm — shape, unit RMS, learned weight scaling
  • Causal mask — shape, upper triangle is -inf, lower triangle is 0
  • Loop-index embedding — shape, differs per iteration, deterministic at t=0
  • LoRA adapter — shape, valid across all loop indices

Related to #5

…ration, RMSNorm, causal mask, LoRA, and loop-index embedding
Copy link
Copy Markdown

@Borda Borda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe you shall add minimal CI to run these and so prove they are correct... 🐰

@miheer-smk
Copy link
Copy Markdown
Author

@Borda — done! Added .github/workflows/tests.yml which runs all 29 tests on Python 3.10 and 3.11 via GitHub Actions CI. Both passed successfully...

@miheer-smk
Copy link
Copy Markdown
Author

@Borda @kyegomez — here's the CI proof. Both Python 3.10 and 3.11 pass all 29 tests on a clean machine:
✅ Python 3.10 — 29 passed
✅ Python 3.11 — 29 passed
Actions run: https://github.com/miheer-smk/OpenMythos/actions/runs/24804510337
Once merged, the workflow will run automatically on future PRs to the main repo too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants