fix(bridge): restore native stop_at_layer and input_to_embed - #1633
Merged
jlarson4 merged 1 commit intoAug 10, 2026
Merged
Conversation
Collaborator
|
Thanks for filing and resolving this issue @emerardd, looks great, merging as is. |
3 tasks
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
Fixes #1632.
Native
TransformerBridgeblocks are namedlayers.N, but the block layer-index parser only recognizedlayers.Nwhen it had a preceding dot. As a result, directforward(..., stop_at_layer=...)calls never stopped andinput_to_embed()returned final vocabulary logits instead of the residual stream entering block 0.This change:
blocks.N,h.N, andlayers.N, including top-level native names;stop_at_layerindices before passing the stop point to blocks;inputs_embeds, which is required to resume a residual withstart_at_layer;input_to_embed()round-trip regression coverage for an offlineboot_native()model.No new dependencies are required.
Type of change
Screenshots
Not applicable.
Verification
d_vocabdimension, and residual re-entry raised because the native model requiredinput_ids.uv run pytest tests/unit/model_bridge/test_boot_native.py— 35 passeduv run pytest tests/integration/model_bridge/test_bridge_input_to_embed.py tests/integration/model_bridge/test_bridge_stop_at_layer.py::test_manual_hooks_stop_at_layer_compat_with_processing— 5 passeduv run mypy .— success, 424 source filespycln,isort, andblackchecks on the four changed files — passedgit diff --check— passedThe complete unit-test suite was not rerun; only the affected unit and integration surface was run locally.
Checklist: