Repository navigation
Conversation
VaultGemma had no adapter tests. Covers the bits that differ from Gemma 2: only pre-norms in the block, hook_attn_out/hook_mlp_out aliases not pointing at the dropped post-norms, block mapping names matching the HF decoder layer, and compat mode being gated off.
jlarson4
left a comment
There was a problem hiding this comment.
Just one note about duplicate tests due to the original VaultGemma tests being placed in the wrong location. Take a look and let me know if you have any questions
| return VaultGemmaArchitectureAdapter(make_bridge_cfg("VaultGemmaForCausalLM", d_mlp=128)) | ||
|
|
||
|
|
||
| def test_factory_resolves_vaultgemma_arch_string() -> None: |
There was a problem hiding this comment.
VaultGemma has a couple unit tests in test_thin_subclass_adapters.py (test_vaultgemma_drops_post_norms and a line in test_factory_registrations). This test and test_block_has_only_pre_norms are repeated there. Could you remove them from that file to eliminate the duplication?
There was a problem hiding this comment.
Thanks, missed that file. Removed test_vaultgemma_drops_post_norms and the VaultGemma line from test_factory_registrations in test_thin_subclass_adapters.py, so everything VaultGemma is in the new file now.
…rs.py They now live in test_vaultgemma_adapter.py.
Description
VaultGemma is one of the few adapters in
supported_architectures/with no unit test file. This addstest_vaultgemma_adapter.py.The adapter is Gemma 2 with
post_attention_layernormandpost_feedforward_layernormremoved, so the tests cover what the subclass changes:ln1/ln2, mapped toinput_layernorm/pre_feedforward_layernormhook_attn_out/hook_mlp_outresolve toattn.hook_out/mlp.hook_out, and no alias targets anln*_postthat no longer existsVaultGemmaDecoderLayer. It's built from a tiny config, so nothing is downloaded (google/vaultgemma-1bis gated, so a hub-backed test wouldn't run in CI without a token)supports_compatibility_mode=False, phase 3 not applicable), while Gemma 2 still has it onTo check the tests actually catch regressions, I broke the adapter two ways. Removing the
_block_normsoverride, so the post-norms come back, fails 3 of the 5 tests. Pointingln2atpost_feedforward_layernormfails 2. Both changes were reverted.Tests only, no library changes.
Type of change
Checklist: