feat(rosetta): Architecture::FalconClassic variant + falcon family (closes #1587)#1673
Merged
Conversation
…loses #1587) Falcon classic (TII; FalconForCausalLM, 7B/40B/11B/RW variants) is distinct from FalconH1 (hybrid Transformer+SSM) and from BLOOM: - HF prefix is `transformer.h.N.*` (BLOOM uses `h.N.*`; LLaMA uses `model.layers.N.*`) - RoPE position encoding (not ALiBi like BLOOM) - Fused QKV (`self_attention.query_key_value`) with MQA/MGQA layout - Falcon-7B uses single per-block layernorm - Falcon-40B uses separate `ln_attn` + `ln_mlp` (parallel attn+mlp residuals) Adds `Architecture::FalconClassic` variant + `falcon_classic_map_name` (95 LOC) that translates both 7B and 40B layernorm variants: transformer.word_embeddings.weight → model.embed_tokens.weight transformer.h.N.input_layernorm.* → model.layers.N.input_layernorm.* (7B) transformer.h.N.ln_attn.* → model.layers.N.input_layernorm.* (40B) transformer.h.N.ln_mlp.* → model.layers.N.post_attention_layernorm.* (40B) transformer.h.N.self_attention.query_key_value.* → model.layers.N.self_attn.qkv_proj.* (fused) transformer.h.N.self_attention.dense.* → model.layers.N.self_attn.o_proj.* transformer.h.N.mlp.dense_h_to_4h.* → model.layers.N.mlp.up_proj.* transformer.h.N.mlp.dense_4h_to_h.* → model.layers.N.mlp.down_proj.* transformer.ln_f.* → model.norm.* YAML at contracts/model-families/falcon.yaml covers 7B (MQA), 11B (MGQA, RoPE θ=500000), and 40B (MGQA, RoPE θ=10000) sizes. Coverage test updated: `test_from_model_type_unknown_gh219` previously asserted `from_model_type("falcon") == None`. Updated to expect `Some(FalconClassic)` post-#1587. Verified: - pv validate clean - FALSIFY-PARITY-002, FALSIFY-MF-006, FALSIFY-MF-011 pass - All 13764 aprender-core --lib tests pass Out of scope (separate tickets): - Parallel attn+mlp residual runtime support - MQA/MGQA-aware QKV splitter at conversion layer
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.
Summary
Closes #1587. Adds `Architecture::FalconClassic` variant + Falcon-specific tensor mapper + `contracts/model-families/falcon.yaml`.
Why FalconClassic needs its own variant
Falcon (TII; `FalconForCausalLM`) is distinct from both:
Falcon-specific traits:
Engine changes
YAML
`contracts/model-families/falcon.yaml` covers 7B (MQA, RoPE θ=10000), 11B (MGQA, RoPE θ=500000), 40B (MGQA, RoPE θ=10000). All share 65024-token vocab.
Test plan
Out of scope
🤖 Generated with Claude Code