Fix direct TransformerBridge config flag assignment - #1709
Conversation
koriyoshi2041
left a comment
There was a problem hiding this comment.
Verified at f10b46ea41. Direct assignments for all four managed flags take the same setter path without recursion, and deepcopy leaves standalone configs unbound while rebinding copied bridges. The focused regression passes locally (10/10 on Python 3.13); the CI-only left-padding failure also passes twice at this head and is outside the changed surface.
jlarson4
left a comment
There was a problem hiding this comment.
Thanks for putting this together, @emerardd, routing assignment through the setters via a weakref, and keeping copies unbound with __getstate__/__setstate__ is a clean way to solve this issue. A couple small comments, let me know if you have any questions.
|
Thanks for the quick turn around @emerardd! Assuming CI passes, this is approved and will be merged! |
Description
Fixes #1689.
Direct assignment to
bridge.cfg.use_attn_result,use_attn_in,use_hook_mlp_in, oruse_split_qkv_inputpreviously updated only the top-level config and silently left the constructed block components unchanged.This change:
TransformerBridgeConfigto its bridge through a weak reference;Type of change
Checklist:
Testing
uv run mypy .pass.