Add Apertus adapter tests and fix nested key translation#1503
Open
abhinav-bellapu wants to merge 1 commit into
Open
Add Apertus adapter tests and fix nested key translation#1503abhinav-bellapu wants to merge 1 commit into
abhinav-bellapu wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #1302.
Summary
ApertusArchitectureAdapterconfig routing, registration, component paths, GQA weight conversions, key translation, rotary/eager test setup, and the XiELU meta-device compatibility patch.Why
Apertus was the remaining unclaimed architecture in #1302 without a dedicated supported-architecture test suite.
The new key-translation cases also exposed a shared bug:
self_attnormlpmatched before nested paths such asself_attn.q_projandmlp.up_proj. This emitted keys such asblocks.0.attn.q_proj.weightinstead of the canonicalblocks.0.attn.q.weight, so the result was not the inverse of the existing TL-to-HF mapping and did not line up with adapter weight-conversion keys. Checking the more specific nested path first fixes that while preserving parent-component fallback behavior.Validation
uv run --locked --python 3.11 pytest tests/unit/model_bridge/supported_architectures/test_apertus_adapter.py -q(31 passed)pytest tests/unit/model_bridge -q(2404 passed, 6 skipped, 9 xfailed)pytest tests/unit -m "not slow" --reruns 2 --reruns-delay 5 -q(3260 passed, 33 skipped, 42 deselected, 9 xfailed)mypy .(Success: no issues found in 308 source files)pycln --check --all . --exclude __init__.pyisort --check-only .black --check .