Skip to content

Bug/bridge hook gating followups - #1724

Merged
jlarson4 merged 4 commits into
dev-4.xfrom
bug/bridge-hook-gating-followups
Aug 26, 2026
Merged

Bug/bridge hook gating followups#1724
jlarson4 merged 4 commits into
dev-4.xfrom
bug/bridge-hook-gating-followups

Conversation

@jlarson4

Copy link
Copy Markdown
Collaborator

Description

  • Callable hook filters – add_hook now skips gated-off hook points and warns naming them, instead of silently attaching hooks that never fire.
  • MoE routing observables – MoERouterBridge fires hook_expert_weights and hook_expert_indices in HookedTransformer's [tokens, num_experts] layout, scattering top-k weights in and gathering them back so edits still reach HuggingFace.
  • MoE router wiring – GPT-OSS gains the router submodule it lacked, Granite declares its reordered tuple positions, and JetMoe opts out because its 5-tuple has no top-k pair.
  • MoE hook aliases – blocks.N.mlp.hook_expert_* resolves onto the router submodule, so code migrated from HookedTransformer finds the hooks under the legacy names.
  • Benchmark allowlist – the mlp.hook_expert_indices and mlp.hook_expert_weights exemptions are removed now that both hooks exist.
  • Encoder-decoder weight stacking – the stacking helpers walk encoder_blocks and decoder_blocks as one index space and resolve the decoder's self_attn, so all eight stacked properties work on T5 instead of raising AttributeError.
  • Encoder-decoder head labels – all_head_labels emits the EL/DL scheme derived from real block counts, replacing a list that named only half the heads.
    -BERT pooler – the adapter wraps the pooler module rather than its inner Linear, so hook_out carries the post-tanh pooled [CLS] that HookedEncoder exposes as hook_pooler_out.
  • Pooler component – a new BertPoolerBridge aliases hook_pooler_out onto hook_out for migrated code.
  • Next-sentence prediction – to_sentence_pair_tokens and predict_next_sentence pair-tokenize two strings and own the token_type_ids plumbing that callers otherwise forget.
  • Audio frame entry – encoder_output runs the audio encoder from precomputed frames, bypassing the convolutional front end while leaving the start_at_layer guard intact.
  • Tautological tests removed – four adapter tests asserting n_key_value_heads against their own fixture's input are deleted.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Checklist:

  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have not rewritten tests relating to key interfaces which would affect backward compatibility

@jlarson4
jlarson4 merged commit 6a221d9 into dev-4.x Aug 26, 2026
49 of 50 checks passed
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