Skip to content

Add Neo architecture adapter tests (closes #1302)#1381

Open
chandrudp29 wants to merge 4 commits into
TransformerLensOrg:devfrom
chandrudp29:add-neo-adapter-tests
Open

Add Neo architecture adapter tests (closes #1302)#1381
chandrudp29 wants to merge 4 commits into
TransformerLensOrg:devfrom
chandrudp29:add-neo-adapter-tests

Conversation

@chandrudp29

Copy link
Copy Markdown

Adds unit tests for NeoArchitectureAdapter as requested in #1302.

Covers config attributes, component mapping bridge types and HF module names, all 9 weight conversion keys, and NeoLinearTransposeConversion numerical correctness transpose roundtrip, shape, rearrange patterns for Q/K/V and O weights.

All 49 tests pass locally.

Type of change
I have added tests that prove my fix is effective or that my feature works
New and existing unit tests pass locally with my changes

@chandrudp29

Copy link
Copy Markdown
Author

The failing check (Notebook Checks / Bridge_Evals_Demo) is unrelated to this PR - I only added tests/unit/model_bridge/supported_architectures/test_neo_adapter.py and demos/Direct_Path_Patching_Demo.ipynb. The Bridge_Evals_Demo notebook was not modified. All unit tests, type checks, format checks, compatibility checks (3.10/3.11/3.12), docstring tests, and coverage tests pass.

@TensorCruncher

Copy link
Copy Markdown

If you refer to the recently created guide on writing unit test files for adapters, some of those config tests are not needed.

Also, instead of checking membership of keys and checking count for the weight conversion section, it is better to use a set based check since it does both.

Also refer to similar adapter test files for reference. Some may still have old patterns so the guide takes precedence.

See: https://github.com/TransformerLensOrg/TransformerLens/blob/main/docs/source/content/adapter_development/adapter-unit-test-guide.md

@chandrudp29 chandrudp29 force-pushed the add-neo-adapter-tests branch from 9b87a11 to 62b221f Compare June 13, 2026 12:27
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