Skip to content

Support untied-head attention-sink LlamaSimpleMLP targets - #1002

Open
claude-spd1 wants to merge 3 commits into
mainfrom
bridge/task-1423-external-loader
Open

claude-spd1 wants to merge 3 commits into
mainfrom
bridge/task-1423-external-loader

Conversation

@claude-spd1

Copy link
Copy Markdown
Collaborator

Description

Add the untied-output-head and learned attention-sink variant of the 4-layer LlamaSimpleMLP target to the public loader and pretrainer. Clean and decomposed forwards share the same sink-aware attention implementation, and the cache contract records both new model facts.

Related Issue

Bridge task #1423.

Motivation and Context

The completed #1423 decomposition and base-model bundles need a public consumer that reconstructs their exact architecture. Without this change, public param-decomp assumes a tied output head and plain causal attention and cannot load those artifacts faithfully.

How Has This Been Tested?

  • pytest -q param_decomp/tests/core/test_pretrain.py param_decomp/tests/targets/test_llama_simple_mlp.py (21 passed, 1 skipped)
  • pytest -q param_decomp/tests/core/test_config.py param_decomp/tests/targets/simple_mlp_equivalence/test_torch_equivalence.py (22 passed, 1 skipped)
  • The cache round-trip test now covers both the legacy tied/plain variant and the untied/sink variant.

Does this PR introduce a breaking change?

No. Existing configs default to tied embeddings and no attention sinks.

Diff breakdown

  • pretrain: +98 -25
  • target loader and attention primitive: +151 -20
  • tests: +24 -2
  • docs: +3 -2

Crew-Address: agent/i9y2
Bridge-Task: 1423

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