Skip to content

Restore ordered model loader selection - #1126

Merged
0xShug0 merged 1 commit into
mainfrom
fix/ordered-model-loader-selection
Oct 28, 2026
Merged

0xShug0 merged 1 commit into
mainfrom
fix/ordered-model-loader-selection

Conversation

@0xShug0

@0xShug0 0xShug0 commented Oct 28, 2026 •

Copy link
Copy Markdown
Owner

Problem on current main

#1119 added a priority pass that tries LFM3 before the normal loader-selection loop. When a directory contains both LFM3 and another supported model, LFM3 wins even if the other model's loader is registered first. This can select the wrong model or reject a request that previously worked.

Before versus after

For the shared-directory cases below, the original model's loader is registered before LFM3. No --family is supplied unless shown.

Input Main, with #1119's priority pass This PR
Shared LFM2.5 + LFM3 directory Selects LFM3, overriding loader order Selects LFM2.5, respecting loader order
Shared YuE2 + LFM3 directory, gen request Selects LFM3; session fails because LFM3 does not support gen Selects YuE2; the tested score-generation request completes
Shared AuK + LFM3 directory Selects LFM3, overriding loader order Selects AuK, respecting loader order
Explicit --family lfm3_audio Selects LFM3 Selects LFM3
Explicit LFM2.5 backbone GGUF Selects LFM2.5 Selects LFM2.5
Ordinary YuE2 or AuK directory without LFM3 Selects YuE2 or AuK, respectively Selects YuE2 or AuK, respectively

Fix

Remove the priority pass and its shared loader hooks, restoring the three shared loader files exactly to their pre-#1119 versions. Keep LFM3's identity checks inside its own loader. Update its documentation and session test to use --family lfm3_audio, and remove the test added specifically for the priority mechanism.

Automatic detection follows normal registration order again. LFM3 no longer jumps ahead of generic layout-based loaders; callers should use --family lfm3_audio to select it reliably. Inference math and session lifecycle are not changed.

Validation

  • Debug C++17 build passed; affected loader implementations were rebuilt against the restored interface, with unchanged Debug dependencies reused.
  • model_spec_system_test and lfm3_audio_session_test passed.
  • Tested the loader selections shown above and completed the previously failing YuE2 session.
  • CUDA ASR completed for both LFM2.5 and LFM3 from the shared directory. Each transcript matched its corresponding ordinary-package control.
  • Explicit LFM3 CUDA ASR also passed with upstream BF16 safetensors and the published Q8 GGUF, without a spec override.

Loader selection and component selection are separate: LFM2.5 ASR in the shared directory still needs its existing backbone-selection option when multiple backbone candidates are present. The original ordered-selection code reports the same ambiguity; this PR does not change that behavior.

@0xShug0
0xShug0 merged commit cd77007 into main Oct 28, 2026
7 checks passed
@0xShug0
0xShug0 deleted the fix/ordered-model-loader-selection branch October 28, 2026 20:12
@0xShug0

0xShug0 commented Oct 28, 2026

Copy link
Copy Markdown
Owner Author

@ykhrustalev I've removed the loader-priority changes introduced in #1119. Using --family lfm3_audio is sufficient to load LFM3 correctly. The CLI documentation actually lists --family as required, and specifying it resolves ambiguous model selection and other weird issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant