Repository navigation
Load Qwen2.5-Omni checkpoints that name Qwen2_5OmniModel - #13087
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@codex review |
1 similar comment
|
@codex review |
|
Codex Review: Didn't find any major issues. Swish! 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". |
|
@codex review |
1 similar comment
|
@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". |
…uting merges (#13173) * Fix the two Backend CI test failures on main after the branch-restore and Omni routing merges test_new_chat_context_recount: #13109 made the history restore estimate the selected branch (estimateContextUsage(branch)) instead of every stored row. The product change is right; the harness that replays the sliced restore did not bind the loader's new `branch` local, so every history-hydration case threw "branch is not defined", and the binding guard's self-check still pinned `msgs`. Bind `branch` with the real orderBySelectedBranch and resolveSavedBranchHead from message-order.ts, the way the loader computes it without a saved head, and make the guard's self-check require only the destructured remoteId plus one plain local, not a specific input of the block. test_omni_text_only_load: #13087's _route tests call FastModel.from_pretrained, which repoints transformers' LOSS_MAPPING at Unsloth's Triton loss for the whole process before the route is captured, and never undo it. Any Omni forward with labels later in that xdist worker then ran Triton on the CPU runner ("0 active drivers"), so 0 to 4 of these tests failed depending on scheduling. Stub patch_loss_functions in _route, which routing does not need, and have the Omni tests use transformers' own causal-LM loss on a CPU host so another leaker cannot break them; on a GPU host they keep Unsloth's loss. * Restore the whole loss mapping after each Omni test, and sort the harness messages like the loader The Omni fixture now snapshots LOSS_MAPPING, installs transformers' own loss for the test body on CPU, and puts the full snapshot back afterwards, so a load inside the test (_capture_fast_base_kwargs) cannot leave the Triton loss behind for the next test in the worker. The recount harness sorts the stored messages by createdAt, role and id before taking msgs.at(-1) as the fallback head, as runtime-provider.tsx does, so an unsorted fixture cannot price a branch the loader would not select.
Fixes #2325
Every official Qwen2.5-Omni checkpoint (
Qwen/Qwen2.5-Omni-3B,Qwen/Qwen2.5-Omni-7Band theunsloth/Qwen2.5-Omni-*mirrors) names its architectureQwen2_5OmniModelinconfig.json, a name from the pre-release transformers branch, and keeps its vision config underthinker_config.FastModeldecides "is this a VLM" from an architecture ending inForConditionalGenerationor a top-levelvision_config, so these checkpoints were treated as text models and sent toAutoModelForCausalLM, which has no mapping forQwen2_5OmniConfig:This affects
FastModel,FastLanguageModelandFastVisionModelalike. A checkpoint that namesQwen2_5OmniForConditionalGeneration(for examplehf-internal-testing/tiny-random-Qwen2_5OmniForConditionalGeneration) already loaded and trained, so the rest of the Omni path (thinker hand-off, processor, LoRA on the text core) is already in place; only the routing missed.Change
_has_vision_configalso looks one level down atthinker_config.vision_config, and both VLM checks inFastModel.from_pretraineduse it. Configs without athinker_configevaluate exactly as before.Evidence
unsloth/Qwen2.5-Omni-3B, LoRA r=8 on the 7 text projections, 10 SFT steps of a small text dataset, then greedy text generation (return_audio=False), on a B200, transformers 5.17.0, torch 2.13, TRL 0.25.1, PEFT 0.21.2:FastModel(load_in_4bit=True)(the issue's call)FastLanguageModel16 bitFastVisionModel(load_in_4bit=True)FastLanguageModel(fast_inference=True)AttributeError: 'Qwen2_5OmniConfig' object has no attribute 'vocab_size'Parity against plain transformers + PEFT on the thinker (same data, seed, LoRA targets, 14,966,784 trainable parameters on both sides):
padding_free=True)FastLanguageModel16 bitForward loss on two fixed sequences, no training: transformers 3.7117 / 3.4589, Unsloth 3.7150 / 3.4600.
Tests: the new
test_qwen2_5_omni_routes_to_a_multimodal_class[Qwen2_5OmniModel]fails on main and passes here; theForConditionalGenerationcase and a plainQwen2ForCausalLMcheckpoint route as before. The 33 loader / vision / omni / processor test files give 444 passed on main and 447 passed here (the 3 new tests), with no failures on either side.