Skip to content

MLX inference stub: answer zoo's new _MarkovTreeDrafter import (red since unsloth-zoo #2910) - #20024

Merged
danielhanchen merged 1 commit into
mainfrom
fix-mlx-stub-markov-drafter
Nov 27, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
fix-mlx-stub-markov-drafter

Conversation

@danielhanchen

@danielhanchen danielhanchen commented Nov 27, 2026 •

Copy link
Copy Markdown
Member

Problem

MLX CI on Mac M1 fails two stub parity tests in studio/backend/tests/test_mlx_inference_backend.py, for example on #19615's run:

test_the_stub_answers_every_helper_zoo_imports_from_inference:
  AssertionError: zoo imports ['_MarkovTreeDrafter'] from mlx.inference and the stub cannot answer them
test_the_stub_accepts_every_call_zoo_makes_to_an_inference_helper:
  AttributeError: _MarkovTreeDrafter

unsloth-zoo #2910 (DSpark trees over the Markov lattice under Fast Verify) made unsloth_zoo/mlx/speculative.py import _MarkovTreeDrafter from .inference, and check isinstance(drafter._draft, _MarkovTreeDrafter). The test's stand-in for unsloth_zoo.mlx.inference reads the names zoo imports from zoo's own source, and it fails until each one has an answer. That is its job, and it caught the new import as intended.

Fix

Add _MarkovTreeDrafter to the stub's private helpers, as a plain class like _SparseDrafter next to it. The isinstance check then has a type to test against.

Verification

tests/test_mlx_inference_backend.py -k stub:

unsloth-zoo this branch main's stub
main (2fc45a4, includes #2910) 11 passed, 1 skipped 2 failed (the two above)
released 2026.11.11 11 passed, 1 skipped not run

The skip is the mlx_lm case, which needs Apple Silicon.

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-27T19:46:08.834840Z 98e6d7a Manual request
ℹ️ 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: 98e6d7aff3

ℹ️ 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 8cf8390 into main Nov 27, 2026
1 of 20 checks passed
@danielhanchen
danielhanchen deleted the fix-mlx-stub-markov-drafter branch November 27, 2026 19:53
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