Add Mixtral architecture adapter tests#1329
Merged
jlarson4 merged 2 commits intoMay 26, 2026
Merged
Conversation
Download-free unit suite for MixtralArchitectureAdapter (49 tests, no real checkpoints), following the existing adapter-test pattern. Covers config defaults, QKVO and Q/K/V bias conversions with GQA head counts, component mapping (including the MoE bridge), factory dispatch, numerical conversion round-trips, GQA forward hook shapes, setup_component_testing, and architecture guards.
Collaborator
|
Excellent work on this @RecreationalMath! Merging |
sunny1401
pushed a commit
to sunny1401/TransformerLens
that referenced
this pull request
May 26, 2026
* Add Mixtral architecture adapter tests Download-free unit suite for MixtralArchitectureAdapter (49 tests, no real checkpoints), following the existing adapter-test pattern. Covers config defaults, QKVO and Q/K/V bias conversions with GQA head counts, component mapping (including the MoE bridge), factory dispatch, numerical conversion round-trips, GQA forward hook shapes, setup_component_testing, and architecture guards. * Minor docstring change
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
MixtralArchitectureAdapterundertests/unit/model_bridge/supported_architectures/, following the existing adapter-test pattern (modelled on the qwen3_moe and qwen2 suites). It needs no model downloads or real checkpoints, it uses tiny programmaticTransformerBridgeConfigobjects, plus small synthetic tensors and a fake attention module for the behavioural tests, so it runs on CPU in seconds.The suite (49 tests) covers:
final_rms=False).n_key_value_headsfallback.block_sparse_moeMoE bridge with itsgaterouter and the absence of Q/K-norm.select_architecture_adapter.n_headswhile K/V surfacen_key_value_heads.setup_component_testingrotary-embedding wiring, eager-attention forcing, and robustness on a minimal HF model.Contributes to #1302 (Mixtral checkbox).
Type of change
Checklist: