Add Falcon-H1 parallel hybrid architecture adapter (FalconH1ForCausalLM)#1480
Merged
jlarson4 merged 6 commits intoJul 3, 2026
Merged
Conversation
…Falcon-H1 adapter
Collaborator
|
This looks great! I had to do a conflict resolution for the supported models file, so once this CI run passes, I will get this merged. Thanks for your hard work @udapy |
1 task
Author
|
@jlarson4 |
Collaborator
|
@udapy No problem! Merging now |
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.
Description
Adds TransformerBridge support for
FalconH1ForCausalLM(TII Falcon-H1 family).Fixes # (issue)
// summary
BlockBridge—input_layernorm+pre_ff_layernorm, realhook_resid_midattn(GQA) +mamba(SSM2MixerBridge) on every blockrotary_emb+setup_component_testingmamba_rms_norm=falseon released checkpoints)is_statefulnot setweight_processing_conversions = {}(HF applies multipliers in passthrough forward)verify_modelsapplicable_phases = []— hybrid SSM precedent; parity gated by integration testsKey design decision: no
is_statefulis_stateful=True, greedy generation diverges from HF after the first decode step,cache_paramsconvention, but Falcon-H1 (transformers ≥5.x) carries attention KV and Mamba state in one unifiedpast_key_values/DynamicCache.Files changed (10 files)
transformer_lens/model_bridge/supported_architectures/falcon_h1.pytests/unit/.../test_falcon_h1_adapter.pytests/integration/.../test_falcon_h1_adapter.pysupported_architectures/__init__.pyfactories/architecture_adapter_factory.pytools/model_registry/__init__.pyHF_SUPPORTED_ARCHITECTURES,CANONICAL_AUTHORS_BY_ARCH)tools/model_registry/generate_report.pysources/transformers.py+sources/_bridge_builder.py_HF_PASSTHROUGH_ATTRSliststools/model_registry/data/supported_models.jsontiiuae/Falcon-H1-*entries (status 0)Verification (local)
tiiuae/Falcon-H1-Tiny-90M-Instructmax_diff == 0.0tiiuae/Falcon-H1-0.5B-Basemax_diff == 0.0attn+mambain the same block), attention and Mamba branch ablation, and SSM config propagation.CI gating
pytest.mark.slowonly (same astest_nemotron_h_adapter.py).make integration-testdeselect them via-m "not slow".skipif(CI)— redundant given current makefile/CI wiring.Unit tests +
TestRegistrySyncedWithFactoryrun in normal CI.Tokenizer policy
Falcon-H1-0.5B-Base:bos_token_id=None, no BOS prepended →default_prepend_boscorrectly left unset.Not in scope
preprocess_weights()/ compatibility-mode multiplier foldingverify_modelsregistry score updates (applicable_phases=[])Type of change
Please delete options that are not relevant.
Checklist:
Related