Skip to content

Add UnlimitedOcrTextModel to the fused-MoE conversion snapshot - #13867

Merged
danielhanchen merged 1 commit into
mainfrom
ci-moe-snapshot-unlimited-ocr
Oct 15, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
ci-moe-snapshot-unlimited-ocr

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

pinned-symbol matrix (vLLM, TRL, PEFT, ST, bitsandbytes, transformers) fails on any PR that runs it (seen on #13851, on main e1cdbf4):

FAILED tests/version_compat/test_peft_conversion_symbol_backfill.py::test_the_fused_snapshot_matches_upstream
AssertionError: fused MoE types missing from the snapshot: ['UnlimitedOcrTextModel']

That test is the canary against transformers main's conversion_mapping._MODEL_TO_CONVERSION_PATTERN, which now carries "UnlimitedOcrTextModel": "qwen2_moe" (the unlimited_ocr text model, a fused qwen2_moe-family MoE). The canary is right; this is the same kind of upkeep as #12018 (longcat_flash_lsa).

Two changes in unsloth/import_fixes.py:

  1. The entry goes into _PEFT_MOE_CONVERSION_PATTERNS.
  2. Unlike every existing entry it is keyed by class name, not by a lowercase model type, and _UnavailableConversionPatternMap._is_moe lowercased the key before the snapshot lookup. So the snapshot entry alone would not have helped: with the map gone, get("UnlimitedOcrTextModel") would still lowercase to unlimitedocrtextmodel, miss the snapshot, find no moe/mixtral hint in the name, and return a silent None, which is the mis-conversion the stand-in exists to refuse. _is_moe now checks the key as given as well as lowercased.

New test test_a_fused_class_name_alias_is_refused_in_its_own_case pins both halves.

Verification (tests/version_compat/test_peft_conversion_symbol_backfill.py, transformers 5.18.0 installed, upstream map fetched live):

  • main: the upstream canary fails as above.
  • With this change: 68 passed.
  • Sabotage, entry removed: the canary and the new test fail.
  • Sabotage, entry kept but _is_moe back to the lowercase-only lookup: the new test fails (the stand-in returns None for the class name).
  • Formatted with scripts/run_ruff_format.py.

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-15T15:27:18.092543Z 98f0a55 Manual request
🔒 Security Review ⚠️ Failed 2026-10-15T15:23:51.029589Z 98f0a55 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🚀

Reviewed commit: 98f0a55ceb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

@danielhanchen
danielhanchen merged commit cc483b3 into main Oct 15, 2026
@danielhanchen
danielhanchen deleted the ci-moe-snapshot-unlimited-ocr branch October 15, 2026 15:30
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