Skip to content

Test/falcon bert adapter tests#1414

Open
chandrudp29 wants to merge 5 commits into
TransformerLensOrg:devfrom
chandrudp29:test/falcon-bert-adapter-tests
Open

Test/falcon bert adapter tests#1414
chandrudp29 wants to merge 5 commits into
TransformerLensOrg:devfrom
chandrudp29:test/falcon-bert-adapter-tests

Conversation

@chandrudp29

Copy link
Copy Markdown

Adds unit tests for two architecture adapters:

FalconArchitectureAdapter (test_falcon_adapter.py, 42 tests):

  • RoPE + parallel (default), ALiBi, and sequential variants
  • New-arch (Falcon 40B+) ln_attn path
  • Weight conversions: QKVO patterns, GQA/multi-query propagation

BertArchitectureAdapter (test_bert_adapter.py, 23 tests):

  • Learned positional embeddings (pos_embed present, no rotary_emb)
  • Post-LN architecture: supports_fold_ln=False guard
  • supports_generation=False class attribute
  • Weight conversions: QKV weights + biases, O weight

All 65 tests pass locally.

chandrudp29 and others added 5 commits June 16, 2026 15:10
25 tests across 4 classes covering component mapping, config flags,
weight conversions, and GQA head-count propagation.

- TestMistralComponentMapping (12 tests): top-level keys, bridge types,
  HF module paths, block submodules, attn flags, QKVO paths, MLP paths.
  Includes explicit guard that attn uses AttentionBridge, not
  PositionEmbeddingsAttentionBridge.
- TestMistralAdapterConfig (4 tests): final_rms=False, uses_rms_norm,
  gated_mlp, attn_only — anti-drift flags.
- TestMistralWeightConversions (5 tests): exactly 4 QKVO weight keys,
  split-heads and merge-heads rearrange patterns, no bias/norm entries.
- TestMistralGQASupport (4 tests): K/V use n_key_value_heads, Q/O
  unchanged, fallback to n_heads when n_key_value_heads is unset.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

1 participant