Add Olmo2 architecture adapter tests#1387
Open
RecreationalMath wants to merge 2 commits into
Open
Conversation
Contributor
Author
|
Heads up. I omitted |
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.
Description
Adds a unit test suite for
Olmo2ArchitectureAdapterundertests/unit/model_bridge/supported_architectures/, following the unit-test guide and modeling structure on the post-#1365 olmoe suite. It needs no model downloads or real checkpoints. The suite uses tiny programmaticTransformerBridgeConfigobjects plus small synthetic tensors and a fake attention module for the behavioral tests, so it runs on CPU in seconds.The suite (32 tests) covers:
supports_fold_ln=False. Post-norm prevents the LN fold. Folding a norm that runs after attention or MLP would corrupt the weights._qkvo_weight_conversions()helper, so per-key rearrange patterns are left to base-class tests per the guide's anti-pattern 4.ln1maps topost_attention_layernormandln2maps topost_feedforward_layernorm. Central architecture-specific decision. Catches porting regressions from the pre-norm Llama family.hook_alias_overrides:hook_resid_midpoints atmlp.hook_in(the true post-attn pre-mlp residual under post-norm), overridingBlockBridge's defaultln2.hook_in. A load-bearing assertion is included (test asserts the override differs from the default).setup_component_testingrotary wiring on template and bridge-model attentions, plus the observable eager-forcing effect on the HF model and per-layer self_attn configs.Contributes to #1302 (Olmo2 checkbox).
Type of change
Checklist: