bridge.models.minimax_m3.transformers_compat#

Targeted corrections for released Transformers MiniMax implementations.

Module Contents#

Functions#

patch_minimax_m3_vision_rope

Restore partial 3D vision RoPE on Transformers 5.17.0 only.

API#

bridge.models.minimax_m3.transformers_compat.patch_minimax_m3_vision_rope() → bool#

Restore partial 3D vision RoPE on Transformers 5.17.0 only.

Transformers PR #48105 changed the frequency ladder to 2D and dropped the width coordinate from the T/H/W position IDs. Keep the released checkpoint’s partial 3D rotation on 5.17.0. Transformers PR #49164 restores the geometry in 5.18+. Leave those releases unpatched: their native buffer-based frequency calculation can differ after model.half()/bfloat16() from the FP32-per-forward calculation used here. That precision difference is accepted; it is not the missing-axis/incorrect-geometry bug this compatibility patch addresses. Replacing the class affects new MiniMax models only. Import Bridge before constructing HF MiniMax models; existing instances retain their old numerical behavior and should be reconstructed before serialization.