Repository navigation
Studio: route lfm2_moe (LFM2-8B-A1B) to transformers 5.3.0 - #7040
Conversation
LFM2-8B-A1B and any other lfm2_moe checkpoint were missing from the transformers tier tables, so they fell through to the default 4.57.x sidecar, which does not register lfm2_moe and errors with "not supported yet in transformers==4.57.6". Only lfm2_vl was listed. Add Lfm2MoeForCausalLM / lfm2_moe to the 5.3.0 tier (lfm2_moe is registered in transformers 5.3.0). get_transformers_tier now returns 530 for LFM2-8B-A1B and the model loads and trains as expected.
There was a problem hiding this comment.
Code Review
This pull request adds support for the 'Lfm2MoeForCausalLM' model type and its corresponding 'lfm2_moe' identifier to the transformers version utility. There are no review comments, and I have no feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
Superseded by #7043, which routes lfm2_moe (and any new architecture) by reading CONFIG_MAPPING_NAMES instead of a table edit. This can be closed once that lands. |
|
@codex review |
|
Codex Review: Didn't find any major issues. 🚀 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Problem
Training or loading
LiquidAI/LFM2-8B-A1B(or anylfm2_moecheckpoint) in Studio fails at model load with:Root cause
studio/backend/utils/transformers_version.pymaps a model to the transformers sidecar it needs. Thelfm2_moemodel type and itsLfm2MoeForCausalLMarchitecture were not listed in any tier, so the resolver fell through to the default 4.57.x sidecar. The MoE variant was simply never added; onlylfm2_vlwas present.lfm2_moeis registered in transformers 5.3.0, which we already ship as the.venv_t5_530sidecar.Fix
Add
Lfm2MoeForCausalLMto_TRANSFORMERS_530_ARCHITECTURESandlfm2_moeto_TRANSFORMERS_530_MODEL_TYPES, so LFM2 MoE checkpoints route to the 5.3.0 sidecar like the other MoE families already do.Verification
get_transformers_tiernow returns530for the model:With the 5.3.0 sidecar active, the full QLoRA path works end to end: 4-bit load with the experts quantized (about 4.5 GB resident), LoRA attaches to the MoE expert projections, a short train run produces a finite loss, and merge to 16-bit reloads in stock transformers and generates coherent text.
No behavior change for any other model: this only adds two entries to the 5.3.0 tier sets.